Skip to content

Commit

Permalink
Merge branch 'main' into clique_analysis
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-rind authored Dec 14, 2024
2 parents fe439a0 + 35550d8 commit fdb1f3c
Show file tree
Hide file tree
Showing 12 changed files with 113 additions and 37 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# easyNWK Web

This project aims to provide a modern web-based version of the easyNWK.
The easyNWK is an egocentric network visualization tool for social workers and
The easyNWK is an egocentered network visualization tool for social workers and
healthcare professionals based on the book
[Soziale Diagnostik](https://www.vandenhoeck-ruprecht-verlage.com/themen-entdecken/paedagogik-soziale-arbeit/soziale-arbeit/26908/soziale-diagnostik)
by Peter Pantuček-Eisenbacher.
Expand Down
13 changes: 10 additions & 3 deletions src/assets/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ $panel-shadow: none;
.panel-block,
.panel-heading,
.panel-tabs {
border-bottom: 1px solid #dbdbdb;
border-left: 1px solid #dbdbdb;
border-right: 1px solid #dbdbdb;
border-bottom: 1px solid #C6C6C6;
border-left: 1px solid #C6C6C6;
border-right: 1px solid #C6C6C6;
}

// equal height with or without large icon
Expand All @@ -54,3 +54,10 @@ $panel-shadow: none;
.clickAble {
cursor: pointer;
}

.textarea,
.input,
.select select,
.button {
border-color: #aaa;
}
2 changes: 1 addition & 1 deletion src/components/EgoHeader.vue
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export default defineComponent({
#ego {
display: flex;
align-items: center;
color: black
color: black;
}
#ego > :last-child {
Expand Down
54 changes: 35 additions & 19 deletions src/components/NetworkMap.vue
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@
/>
</symbol>
<radialGradient id="selected-gradient">
<stop offset="60%" stop-color="rgb(0, 80, 150)" stop-opacity="0.25" />
<stop offset="100%" stop-color="rgb(0, 80, 150)" stop-opacity="0" />
<stop offset="60%" stop-color="rgb(28, 135, 230)" stop-opacity="0.25" />
<stop offset="100%" stop-color="rgb(28, 135, 230)" stop-opacity="0" />
</radialGradient>
<filter id="dilate-and-xor">
<!-- h/t https://stackoverflow.com/a/63287731/1140589 -->
Expand Down Expand Up @@ -69,7 +69,7 @@
v-if="mark.selected"
:cx="mark.x"
:cy="mark.y"
r="4"
:r="iconSize * 1.5"
fill="url('#selected-gradient')"
/>
</g>
Expand All @@ -88,7 +88,7 @@

<g v-for="mark in alteriMarks" :key="mark.d.id">
<line
v-if="connections && mark.d.edgeType >= 1"
v-if="connectionsEgo && mark.d.edgeType >= 1"
:class="{ select: mark.selected }"
:x1="egoCoords[0]"
:y1="egoCoords[1]"
Expand All @@ -104,7 +104,7 @@
:x="mark.x"
:y="mark.y"
:text-anchor="mark.x < 0 ? 'end' : 'start'"
:dx="mark.x < 0 ? -3 : 3"
:dx="mark.x < 0 ? -0.7 * iconSize : 0.7 * iconSize"
:dy="mark.y < 0 ? -1 : 4"
>
{{ mark.label }}
Expand All @@ -117,7 +117,7 @@
:x="mark.x"
:y="mark.y"
:text-anchor="mark.x < 0 ? 'end' : 'start'"
:dx="mark.x < 0 ? -3 : 3"
:dx="mark.x < 0 ? -0.7 * iconSize : 0.7 * iconSize"
:dy="mark.y < 0 ? -1 : 4"
>
{{ mark.label }}
Expand All @@ -131,17 +131,18 @@
:x="egoCoords[0]"
:y="egoCoords[1]"
class="mark"
width="4"
height="4"
transform="translate(-2,-2)"
:width="iconSize"
:height="iconSize"
:transform="iconTranslate"
v-if="!emoji || !egoEmoji"
/>
<text
v-if="emoji && egoEmoji"
:x="egoCoords[0]"
:y="egoCoords[1] + 1"
:y="egoCoords[1] + iconSize / 4"
class="mark"
style="font-size: 4px; cursor: pointer; text-anchor: middle"
style="cursor: pointer"
:style="{ 'font-size': iconSize + 'px' }"
>
{{ egoEmoji }}
</text>
Expand All @@ -152,11 +153,11 @@
<template v-if="mark.d.emoji && emoji">
<text
:key="mark.d.id"
:x="mark.x - 3"
:y="mark.y + 1"
:x="mark.x"
:y="mark.y + iconSize / 4"
class="mark clickAble"
@click.stop="clickAlter(mark.d)"
style="font-size: 4px; cursor: pointer"
:style="{ 'font-size': iconSize + 'px' }"
>
{{ mark.d.emoji }}
</text>
Expand All @@ -168,9 +169,9 @@
:x="mark.x"
:y="mark.y"
class="mark clickAble"
width="4"
height="4"
transform="translate(-2,-2)"
:width="iconSize"
:height="iconSize"
:transform="iconTranslate"
@click.stop="clickAlter(mark.d)"
/>
</template>
Expand Down Expand Up @@ -687,6 +688,7 @@ export default defineComponent({
clearTimeout(clickTimeoutId);
clickTimeoutId = null;
console.log(alter.name + " dblclick");
console.log("Text here");
// open form
store.commit("openAlterFormById", { alterId: alter.id });
Expand Down Expand Up @@ -776,11 +778,19 @@ export default defineComponent({
alteriMarks,
connectionMarks,
labelSize: computed(() => store.state.view.labelSizeInNwk),
iconSize: computed(() => store.state.view.iconSizeInNwk),
iconTranslate: computed(
() =>
`translate(${store.state.view.iconSizeInNwk / -2},${
store.state.view.iconSizeInNwk / -2
})`
),
showAge: computed(() => store.state.view.ageInNwk),
showRole: computed(() => store.state.view.roleInNwk),
getRoleShort,
alteriNames: computed(() => store.state.view.alteriNames),
connections: computed(() => store.state.view.connections),
connectionsEgo: computed(() => store.state.view.connectionsEgo),
emoji: computed(() => store.state.view.emoji),
brushBtns,
isClusterConnectPossible,
Expand Down Expand Up @@ -841,7 +851,9 @@ line {
line.select {
// stroke: rgb(136, 159, 213);
// stroke: rgb($fhstpblue, 0.6);
stroke: rgb(102, 150, 192);
stroke: rgb(28, 135, 230);
stroke-dasharray: 5, 1;
//altes blau rgb(102, 150, 192);
}
#position {
Expand All @@ -854,12 +866,16 @@ line.select {
fill: $color-primary-0;
}
.mark {
use.mark {
fill: rgb(54, 54, 54);
stroke: white;
stroke-width: 0.2;
}
text.mark {
text-anchor: middle;
}
.edithint {
fill: rgba(lightgray, 0.5);
font-size: 1em;
Expand Down
50 changes: 44 additions & 6 deletions src/components/ViewOptionsPanel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
<input
type="range"
id="text-size"
min="2"
min="3"
max="13"
v-model="textSize"
:disabled="!alteriNames"
Expand All @@ -58,26 +58,48 @@
</div>
<div class="control">
<label class="checkbox">
<input type="checkbox" v-model="connections" />
<span>{{ t("connectionson") }}</span>
<input type="checkbox" v-model="connectionsEgo" />
<span>{{ t("connectionsego") }}</span>
</label>
</div>
<div class="control">
<label class="checkbox">
<input type="checkbox" v-model="emoji" />
<span>{{ t("emojion") }}</span>
<input type="checkbox" v-model="connections" />
<span>{{ t("connectionson") }}</span>
</label>
</div>
<div class="control">
<label for="text-size">{{ t("changesizeEmoji") }}</label>
&nbsp;
<input
type="range"
id="icon-size"
min="3"
max="8"
v-model="iconSize"
/>
</div>
</div>
<div>
<div class="control">
<button class="button" @click.stop="togglePseudonyms">
<button
class="button"
@click.stop="togglePseudonyms"
style="margin-right: 1vw"
>
<span class="icon">
<font-awesome-icon icon="user-secret" />
</span>
<span v-if="pseudonyms">{{ t("anonymiseoff") }}</span>
<span v-else>{{ t("anonymiseon") }}</span>
</button>
<button class="button" @click.stop="toggleEmoji">
<span class="icon">
<font-awesome-icon icon="icons" />
</span>
<span v-if="emoji">{{ t("emojioff") }}</span>
<span v-else>{{ t("emojion") }}</span>
</button>
</div>
</div>
</div>
Expand Down Expand Up @@ -126,6 +148,15 @@ export default defineComponent({
},
});
const iconSize = computed({
get(): number {
return store.state.view.iconSizeInNwk;
},
set(value: number) {
store.commit("view/setIconSizeInNwk", value);
},
});
// getter & setter for checkboxes
function accessFlag(flag: keyof ViewOptionsFlags) {
return computed({
Expand All @@ -142,14 +173,21 @@ export default defineComponent({
return {
pseudonyms: computed(() => store.state.pseudonym.active),
togglePseudonyms: () => store.commit("pseudonym/toggle"),
toggleEmoji: () =>
store.commit("view/updateFlag", {
flag: "emoji",
value: !store.state.view.emoji,
}),
horizons: accessFlag("horizons"),
connections: accessFlag("connections"),
connectionsEgo: accessFlag("connectionsEgo"),
emoji: accessFlag("emoji"),
alteriNames: accessFlag("alteriNames"),
isOpen,
showAge: accessFlag("ageInNwk"),
showRole: accessFlag("roleInNwk"),
textSize,
iconSize,
//markSize,
//changeMarkSize,
};
Expand Down
2 changes: 1 addition & 1 deletion src/data/AlterCategories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export const CATEGORY_TRANSLATIONS: Record<string, Record<string, string>> = {
// de: "Kreis 3 + 2 + 1",
// en: "Circle 3 + 2 + 1",
// },
"prof. Hilfe": {
"Prof. Hilfe": {
de: "Prof. Hilfe",
en: "Professional Help",
},
Expand Down
4 changes: 4 additions & 0 deletions src/data/ViewOptions.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
export interface ViewOptionsFlags {
horizons: boolean;
connections: boolean;
connectionsEgo: boolean;
emoji: boolean;
alteriNames: boolean;
ageInNwk: boolean;
Expand All @@ -9,18 +10,21 @@ export interface ViewOptionsFlags {

export interface ViewOptions extends ViewOptionsFlags {
labelSizeInNwk: number;
iconSizeInNwk: number;
}

export function initDefaultViewOptions(): ViewOptions {
return {
// pseudonyms: true,
horizons: false,
connections: true,
connectionsEgo: true,
emoji: false,
alteriNames: true,
ageInNwk: false,
roleInNwk: false,

labelSizeInNwk: 5,
iconSizeInNwk: 4,
};
}
7 changes: 5 additions & 2 deletions src/de.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,10 @@ export default {
changesize: "Textgröße:",
anonymiseon: "Anonymisieren",
horizonson: "Horizonte",
connectionson: "Verbindungen",
emojion: "Emojis",
connectionson: "Verbindungen zw. Kontakten",
connectionsego: "Verbindungen zu Ego",
emojion: "Emojis anzeigen",
emojioff: "Emojis ausblenden",
namesofcontactson: "Beschriftung der Kontakte",
ageofcontactson: "zusätzlich: Alter (Jahre)",
roleofcontactson: "zusätzlich: Rolle der Kontakte",
Expand Down Expand Up @@ -212,6 +214,7 @@ export default {
selectemoji: "Emoji auswählen",
removeemoji: "Emoji entfernen",
amountClique: "Anzahl Cliquen",
changesizeEmoji: "Icon Größe: ",
},
};
},
Expand Down
7 changes: 5 additions & 2 deletions src/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,10 @@ export default {
changesize: "Text size:",
anonymiseon: "Anonymise",
horizonson: "Horizons",
connectionson: "Connections",
emojion: "Emojis",
connectionson: "Connections between contacts",
connectionsego: "Connections to ego",
emojion: "Show emojis",
emojioff: "Hide emojis",
namesofcontactson: "Labels for contacts",
ageofcontactson: "Age of contacts",
roleofcontactson: "Role of contacts",
Expand Down Expand Up @@ -208,6 +210,7 @@ export default {
selectemoji: "Select emoji",
removeemoji: "Remove emoji",
amountClique: "Number of Cliques",
changesizeEmoji: "Icon size: ",
},
};
},
Expand Down
4 changes: 3 additions & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ import {
faUnlink,
faArrowsAlt,
faCopy,
faIcons,
} from "@fortawesome/free-solid-svg-icons";
library.add(
faBars,
Expand Down Expand Up @@ -96,7 +97,8 @@ library.add(
faInfo,
faLink,
faUnlink,
faArrowsAlt
faArrowsAlt,
faIcons
);

// Vue.component("font-awesome-icon", FontAwesomeIcon);
Expand Down
Loading

0 comments on commit fdb1f3c

Please sign in to comment.