From 5b9be61e1b3fd6424cedbbba70a477d13ae0df04 Mon Sep 17 00:00:00 2001 From: julia221501 Date: Fri, 2 Sep 2022 18:26:55 +0200 Subject: [PATCH 01/10] Feature Tooltip angefangen --- src/components/NetworkMap.vue | 33 ++++++++++++++++++++++++++++++--- 1 file changed, 30 insertions(+), 3 deletions(-) diff --git a/src/components/NetworkMap.vue b/src/components/NetworkMap.vue index f03fc63..a069657 100644 --- a/src/components/NetworkMap.vue +++ b/src/components/NetworkMap.vue @@ -144,6 +144,21 @@ {{ showRole ? " / " + getRoleShort(mark.d.role) : "" }} + {{ mark.d.name }} +
{{ mark.d.role }} + +
+ { @@ -339,6 +358,10 @@ export default defineComponent({ return buffer.sort((a, b) => b.d.distance - a.d.distance); }); + function showTooltip(mark: any) { + console.log(mark); + } + const connectionMarks = computed((): Array => { return store.state.nwk.connections.map((conn) => { const coords1 = alteriCoords.value.get(conn.id1); @@ -357,7 +380,6 @@ export default defineComponent({ }; }); }); - return { egoShape: computed(() => shapeByGender(true, store.state.nwk.ego.currentGender) @@ -366,6 +388,7 @@ export default defineComponent({ isConnectMode, clickAlter, alteriMarks, + showTooltip, connectionMarks, showAge: computed(() => store.state.view.ageInNwk), showRole: computed(() => store.state.view.roleInNwk), @@ -401,6 +424,10 @@ text { user-select: none; } +.tooltip{ + +} + .textbg { stroke: white; stroke-width: 3; From b35010d263caec3f6ec6653494ab658c850d764f Mon Sep 17 00:00:00 2001 From: julia221501 Date: Sun, 4 Sep 2022 21:16:27 +0200 Subject: [PATCH 02/10] Feature Tooltip erweitert --- src/components/NetworkMap.vue | 82 +++++++++++++++++++++++++++++------ 1 file changed, 68 insertions(+), 14 deletions(-) diff --git a/src/components/NetworkMap.vue b/src/components/NetworkMap.vue index a069657..df1b6a0 100644 --- a/src/components/NetworkMap.vue +++ b/src/components/NetworkMap.vue @@ -143,20 +143,23 @@ {{ showAge && mark.d.age.length >= 1 ? "/ " + mark.d.age : "" }} {{ showRole ? " / " + getRoleShort(mark.d.role) : "" }} + - {{ mark.d.name }} -
{{ mark.d.role }} - + {{ mark.d.name }} + {{ mark.d.role }}
+ { + let div = document.createElement("div") + let p = document.createElement("p") + let p1 = document.createElement("p1") + let content = document.createTextNode(mark.d.name) + let content2 = document.createTextNode(mark.d.role) + p.appendChild(content) + p1.appendChild(content2) + div.appendChild(p) + div.appendChild(p1) + + const map = document.querySelector("#nwkmap") + var tooltop = 0 + var toolleft = 0 + if (map != undefined){ + const mapY = map.getBoundingClientRect().top + map.getBoundingClientRect().height/2 - 50 + const mapX = map.getBoundingClientRect().left + map.getBoundingClientRect().width/2 + tooltop = mapY + mark.y + toolleft = mapX + mark.x + console.log(mapY) + console.log(mapX) + console.log(mark.y) + console.log(mark.x) + } + div.style.position = "absolute" + div.style.left = toolleft + "px" + div.style.top = tooltop + "px" + + + document.body.appendChild(div) + }*/ + let clickTimeoutId: number | null = null; const clickAlter = (alter: Alter) => { if (isConnectMode.value && store.state.view.editIndex != null) { @@ -358,8 +388,18 @@ export default defineComponent({ return buffer.sort((a, b) => b.d.distance - a.d.distance); }); - function showTooltip(mark: any) { - console.log(mark); + function showTooltip(mark: any, active: boolean) { + //toolinfo(mark) + var element = document.querySelectorAll(".toolhover") + if (active){ + element = document.querySelectorAll(".toolhover-active") + } + for (var i = 0; i < element.length; i++) { + var e = element[i] + active ? e.classList.remove("toolhover-active") : e.classList.remove("toolhover") + active ? e.classList.add("toolhover") : e.classList.add("toolhover-active") + } + } const connectionMarks = computed((): Array => { @@ -388,6 +428,7 @@ export default defineComponent({ isConnectMode, clickAlter, alteriMarks, + //toolinfo, showTooltip, connectionMarks, showAge: computed(() => store.state.view.ageInNwk), @@ -424,8 +465,21 @@ text { user-select: none; } -.tooltip{ +.toolhover{ + display: none; +} + +.toolhover-active{ + display: block; +} +.tooltip { + overflow-wrap: break-word; + white-space: pre-line; + hyphens: none; + width: 10px; + display: flex; + background-color: red; } .textbg { From e99d2a17ad544c35f0b592713b4c5542f1415ac3 Mon Sep 17 00:00:00 2001 From: julia221501 Date: Tue, 6 Sep 2022 18:06:26 +0200 Subject: [PATCH 03/10] =?UTF-8?q?Feature=20Tooltip=20richtige=20Person=20a?= =?UTF-8?q?usgew=C3=A4hlt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/NetworkMap.vue | 100 +++++++++++++++++----------------- 1 file changed, 49 insertions(+), 51 deletions(-) diff --git a/src/components/NetworkMap.vue b/src/components/NetworkMap.vue index df1b6a0..c724da8 100644 --- a/src/components/NetworkMap.vue +++ b/src/components/NetworkMap.vue @@ -145,22 +145,50 @@ + - {{ mark.d.name }} - {{ mark.d.role }} + :dy="mark.y < 0 ? -15 : -10" + > + {{ mark.d.name }} + + + {{ mark.d.role }} + + + + {{ mark.d.age }} + { - let div = document.createElement("div") - let p = document.createElement("p") - let p1 = document.createElement("p1") - let content = document.createTextNode(mark.d.name) - let content2 = document.createTextNode(mark.d.role) - p.appendChild(content) - p1.appendChild(content2) - div.appendChild(p) - div.appendChild(p1) - - const map = document.querySelector("#nwkmap") - var tooltop = 0 - var toolleft = 0 - if (map != undefined){ - const mapY = map.getBoundingClientRect().top + map.getBoundingClientRect().height/2 - 50 - const mapX = map.getBoundingClientRect().left + map.getBoundingClientRect().width/2 - tooltop = mapY + mark.y - toolleft = mapX + mark.x - console.log(mapY) - console.log(mapX) - console.log(mark.y) - console.log(mark.x) - } - div.style.position = "absolute" - div.style.left = toolleft + "px" - div.style.top = tooltop + "px" - - - document.body.appendChild(div) - }*/ - let clickTimeoutId: number | null = null; const clickAlter = (alter: Alter) => { if (isConnectMode.value && store.state.view.editIndex != null) { @@ -389,17 +385,15 @@ export default defineComponent({ }); function showTooltip(mark: any, active: boolean) { - //toolinfo(mark) - var element = document.querySelectorAll(".toolhover") - if (active){ - element = document.querySelectorAll(".toolhover-active") - } + var element = document.querySelectorAll(`[markid="${mark.d.id}"]`); for (var i = 0; i < element.length; i++) { - var e = element[i] - active ? e.classList.remove("toolhover-active") : e.classList.remove("toolhover") - active ? e.classList.add("toolhover") : e.classList.add("toolhover-active") + active + ? element[i].classList.remove("toolhover") + : element[i].classList.remove("toolhover-active"); + active + ? element[i].classList.add("toolhover-active") + : element[i].classList.add("toolhover"); } - } const connectionMarks = computed((): Array => { @@ -465,11 +459,15 @@ text { user-select: none; } -.toolhover{ +.toolhover { display: none; } -.toolhover-active{ +.rect { + fill: #0c2c78; +} + +.toolhover-active { display: block; } From b46ecb1580dc202279d631f233ed561eb1646fff Mon Sep 17 00:00:00 2001 From: julia221501 Date: Wed, 21 Sep 2022 14:06:25 +0200 Subject: [PATCH 04/10] =?UTF-8?q?Rect=20zu=20Tooltip=20hinzugef=C3=BCgt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/NetworkMap.vue | 79 ++++++++++++++++++++--------------- 1 file changed, 46 insertions(+), 33 deletions(-) diff --git a/src/components/NetworkMap.vue b/src/components/NetworkMap.vue index c724da8..a8e3ac0 100644 --- a/src/components/NetworkMap.vue +++ b/src/components/NetworkMap.vue @@ -110,41 +110,20 @@ - - - - {{ mark.label }} - {{ showAge && mark.d.age.length >= 1 ? "/ " + mark.d.age : "" }} - {{ showRole ? " / " + getRoleShort(mark.d.role) : "" }} - - + :dy="mark.y < 0 ? -15 : -10" + width="40" + height="30" + > + + + + + + + {{ mark.label }} + Date: Fri, 30 Sep 2022 12:22:34 +0200 Subject: [PATCH 05/10] =?UTF-8?q?Ecken=20abgerundet=20und=20erste=20Anpass?= =?UTF-8?q?ungsschritte=20(gr=C3=B6=C3=9Fe=20von=20Rect)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/NetworkMap.vue | 71 ++++++++++-------- src/components/ToolTip.vue | 131 ++++++++++++++++++++++++++++++++++ 2 files changed, 171 insertions(+), 31 deletions(-) create mode 100644 src/components/ToolTip.vue diff --git a/src/components/NetworkMap.vue b/src/components/NetworkMap.vue index a8e3ac0..d80b483 100644 --- a/src/components/NetworkMap.vue +++ b/src/components/NetworkMap.vue @@ -87,40 +87,24 @@ - - - - - - - - {{ mark.d.name }} @@ -147,7 +131,7 @@ :markid="mark.d.id" :x="mark.x" :y="mark.y" - :dx="mark.x < 0 ? -3 : 3" + :dx="mark.x < 0 ? -4 : 4" :dy="mark.y < 0 ? -10 : -5" > {{ mark.d.role }} @@ -158,13 +142,34 @@ :markid="mark.d.id" :x="mark.x" :y="mark.y" - :dx="mark.x < 0 ? -3 : 3" + :dx="mark.x < 0 ? -4 : 4" :dy="mark.y < 0 ? -5 : 0" > {{ mark.d.age }} + + + + + + + { @@ -397,6 +403,7 @@ export default defineComponent({ return buffer.sort((a, b) => b.d.distance - a.d.distance); }); + // eslint-disable-next-line @typescript-eslint/no-explicit-any function showTooltip(mark: any, active: boolean) { var element = document.querySelectorAll(`[markid="${mark.d.id}"]`); for (var i = 0; i < element.length; i++) { @@ -482,6 +489,7 @@ text { .toolhover-active { display: block; + position: absolute; } .tooltip { @@ -491,6 +499,7 @@ text { width: 10px; display: flex; background-color: red; + position: absolute; } .textbg { diff --git a/src/components/ToolTip.vue b/src/components/ToolTip.vue new file mode 100644 index 0000000..590bcc3 --- /dev/null +++ b/src/components/ToolTip.vue @@ -0,0 +1,131 @@ + + + + + From 49e06ed33da1d8f91e78c72b81bdf10092c1bfec Mon Sep 17 00:00:00 2001 From: julia221501 Date: Fri, 30 Sep 2022 14:37:31 +0200 Subject: [PATCH 06/10] =?UTF-8?q?Alter=20Notiz=20wird=20ab=20bestimmter=20?= =?UTF-8?q?l=C3=A4nge=20abgek=C3=BCrzt=20und=20rect=20ist=20im=20Vordergru?= =?UTF-8?q?nd?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/NetworkMap.vue | 146 +++++++++++++++++++--------------- 1 file changed, 84 insertions(+), 62 deletions(-) diff --git a/src/components/NetworkMap.vue b/src/components/NetworkMap.vue index d80b483..cc677fc 100644 --- a/src/components/NetworkMap.vue +++ b/src/components/NetworkMap.vue @@ -87,68 +87,6 @@ - - - - - {{ mark.d.name }} - - - {{ mark.d.role }} - - - - {{ mark.d.age }} - - - + + + + + {{ mark.d.name }} + + + {{ mark.d.role }} + + + + {{ mark.d.age }} + + + + {{ + mark.d.note < 8 ? mark.d.note : mark.d.note.substring(0, 15) + "..." + }} + + + @@ -502,6 +516,14 @@ text { position: absolute; } +.text { + display: block; + width: 20px; + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; +} + .textbg { stroke: white; stroke-width: 3; From fdc2b36aad49102452f8f8473ceb62c37b7b5bda Mon Sep 17 00:00:00 2001 From: julia221501 Date: Mon, 3 Oct 2022 13:01:59 +0200 Subject: [PATCH 07/10] =?UTF-8?q?Tooltip=20in=20andere=20vue=20Datei=20geb?= =?UTF-8?q?racht,=20rect-Breite=20passt=20sich=20korrekt=20an,=20lange=20N?= =?UTF-8?q?amen=20&=20Rollen=20werden=20abgek=C3=BCrzt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/NetworkMap.vue | 80 +------------- src/components/ToolTip.vue | 189 +++++++++++++++++++--------------- 2 files changed, 108 insertions(+), 161 deletions(-) diff --git a/src/components/NetworkMap.vue b/src/components/NetworkMap.vue index cc677fc..6e975b8 100644 --- a/src/components/NetworkMap.vue +++ b/src/components/NetworkMap.vue @@ -180,82 +180,7 @@ width="220" height="220" /> - - - - - {{ mark.d.name }} - - - {{ mark.d.role }} - - - - {{ mark.d.age }} - - - - {{ - mark.d.note < 8 ? mark.d.note : mark.d.note.substring(0, 15) + "..." - }} - - - + @@ -271,6 +196,7 @@ import { shapeByGender } from "@/data/Gender"; import { TAB_BASE, TAB_CONNECTIONS } from "@/store/viewOptionsModule"; import { SYMBOL_DECEASED } from "@/assets/utils"; import { getRoleAbbrev } from "../data/Roles"; +import ToolTip from "@/components/ToolTip.vue"; interface AlterMark { d: Alter; @@ -294,7 +220,7 @@ interface ConnectionMark { // emit "map-click" (which is not currently used) export default defineComponent({ - components: {}, + components: { ToolTip }, setup: function (props, { emit }) { const store = useStore(); diff --git a/src/components/ToolTip.vue b/src/components/ToolTip.vue index 590bcc3..1aab39c 100644 --- a/src/components/ToolTip.vue +++ b/src/components/ToolTip.vue @@ -1,100 +1,111 @@ + + {{ mark.d.age }} + + + {{ + mark.d.note < maxWordLength + ? mark.d.note + : mark.d.note.substring(0, maxWordLength) + "..." + }} + + + + -