Skip to content

Commit b3dbfa9

Browse files
authored
Fix mouse interactions in node visualizations (#12127)
Fixes #11215 Fixes #11748 Slightly adjusted styles to show mouse hover state on elements with click interactions. <img width="168" alt="image" src="https://github.com/user-attachments/assets/452652f4-5e16-4899-a466-90095cdd4e4c" /> <img width="443" alt="image" src="https://github.com/user-attachments/assets/450559fd-6bd3-4429-b8e4-080c4afa838a" />
1 parent ec90e49 commit b3dbfa9

File tree

3 files changed

+17
-2
lines changed

3 files changed

+17
-2
lines changed

app/gui/src/project-view/components/GraphEditor/GraphNode.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -472,6 +472,7 @@ const showMenuAt = ref<{ x: number; y: number }>()
472472
:style="nodeStyle"
473473
:class="nodeClass"
474474
:data-node-id="nodeId"
475+
@pointerdown.stop
475476
@pointerenter="((nodeHovered = true), updateNodeHover($event))"
476477
@pointerleave="((nodeHovered = false), updateNodeHover(undefined))"
477478
@pointermove="updateNodeHover"

app/gui/src/project-view/components/visualizations/JSONVisualization/JsonObjectWidget.vue

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,10 @@ function entryTitle(key: string) {
7373
}
7474
.key {
7575
color: blue;
76-
text-decoration: underline;
76+
77+
&:hover {
78+
text-decoration: underline;
79+
}
7780
}
7881
.viewonly .key {
7982
color: darkred;

app/gui/src/project-view/components/visualizations/ScatterplotVisualization.vue

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -727,11 +727,12 @@ watchPostEffect(() => {
727727
})
728728
.transition()
729729
.duration(animationDuration.value)
730+
.attr('class', 'scatterPoint')
730731
.attr(
731732
'd',
732733
symbol.type(matchShape).size((d) => (d.size ?? 0.15) * SIZE_SCALE_MULTIPLER),
733734
)
734-
.style('fill', (d) => colorScale(d))
735+
.style('--color', (d) => colorScale(d))
735736
.attr('transform', (d) => `translate(${xScale_(Number(d.x))}, ${yScale_(d.y)})`)
736737
if (data.value.points.labels === VISIBLE_POINTS) {
737738
d3Points.value
@@ -950,6 +951,16 @@ config.setToolbar(useScatterplotVizToolbar())
950951
user-select: none;
951952
display: flex;
952953
flex-direction: column;
954+
955+
&:deep(path.scatterPoint) {
956+
fill: var(--color);
957+
stroke: transparent;
958+
stroke-width: 5px;
959+
transition: stroke 200ms;
960+
&:hover {
961+
stroke: color-mix(in srgb, var(--color) 50%, transparent 50%);
962+
}
963+
}
953964
}
954965
955966
.WarningsScatterplotVisualization {

0 commit comments

Comments
 (0)