This commit is contained in:
Garry Ing 2021-05-21 14:34:56 -04:00
parent aca844332a
commit 68840f9388
No known key found for this signature in database
GPG Key ID: 62E12D2F8C30C493
2 changed files with 12 additions and 13 deletions

View File

@ -90,8 +90,10 @@
fill: var(--background); fill: var(--background);
transition: all 0.15s ease-out; transition: all 0.15s ease-out;
&:hover { &.active {
stroke: var(--foreground-text); stroke: var(--foreground-text);
stroke-dasharray: 3;
animation: dash 80s linear;
} }
} }
@ -107,6 +109,10 @@
.nodes [active] { .nodes [active] {
cursor: pointer; cursor: pointer;
stroke: var(--active-note); stroke: var(--active-note);
&.active {
stroke: var(--active-note);
}
} }
.text [active] { .text [active] {

View File

@ -90,11 +90,11 @@ const showTooltip = (event) => {
} }
const setupListeners = (linkElement) => { const setupListeners = (linkElement) => {
linkElement.addEventListener('mouseleave', _event => { linkElement.addEventListener('mouseleave', () => {
hideTooltip() hideTooltip()
}) })
tooltipWrapper.addEventListener('mouseleave', _event => { tooltipWrapper.addEventListener('mouseleave', () => {
hideTooltip() hideTooltip()
}) })
@ -104,7 +104,7 @@ const setupListeners = (linkElement) => {
showTooltip(event) showTooltip(event)
}) })
tooltipWrapper.addEventListener('mouseenter', event => { tooltipWrapper.addEventListener('mouseenter', () => {
clearTimeout(opacityTimeout) clearTimeout(opacityTimeout)
clearTimeout(contentTimeout) clearTimeout(contentTimeout)
}) })
@ -194,7 +194,7 @@ if (typeof window.graphData !== 'undefined') {
if (nodeD.id !== destinationID && !relatedNodesSet.has(nodeD.id)) { if (nodeD.id !== destinationID && !relatedNodesSet.has(nodeD.id)) {
return 'inactive' return 'inactive'
} }
return '' return 'active'
}) })
link.attr('class', (linkD) => { link.attr('class', (linkD) => {
@ -203,18 +203,11 @@ if (typeof window.graphData !== 'undefined') {
} }
return 'active' return 'active'
}) })
link.attr('stroke-width', (linkD) => {
if (linkD.source.id === destinationID || linkD.target.id === destinationID) {
return STROKE * 1
}
return STROKE
})
text.attr('class', (textD) => { text.attr('class', (textD) => {
if (textD.id !== destinationID && !relatedNodesSet.has(textD.id)) { if (textD.id !== destinationID && !relatedNodesSet.has(textD.id)) {
return 'inactive' return 'inactive'
} }
return '' return 'active'
}) })
} }