Skip to content

Commit 8572bde

Browse files
committed
fix(Dashboard): improved graph interactions hints
Signed-off-by: Jean-Baptiste Bianchi <[email protected]>
1 parent 595d5ed commit 8572bde

File tree

4 files changed

+40
-2
lines changed

4 files changed

+40
-2
lines changed

src/dashboard/Synapse.Dashboard/Components/WorkflowDiagram/WorkflowDiagram.razor

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
</svg>
3535
</defs>
3636
</svg>
37-
<DagreGraph @ref="Store.DagreGraph" OnMouseUp="OnMouseUp" Options="options" Graph="graph">
37+
<DagreGraph @ref="Store.DagreGraph" OnMouseDown="HandleOnMouseDown" OnMouseUp="HandleOnMouseUp" Options="options" Graph="graph">
3838
<ExtraControls>
3939
<button class="btn" type="button" title="legend" @onclick="Store.ToggleLegendAsync">
4040
<svg>
@@ -116,4 +116,26 @@
116116
return true;
117117
}
118118

119+
protected void HandleOnMouseDown(GraphEventArgs<MouseEventArgs> e)
120+
{
121+
if (e.GraphElement == null && graph != null)
122+
{
123+
graph.CssClass = "grabbing";
124+
isDirty = true;
125+
}
126+
}
127+
128+
protected async Task HandleOnMouseUp(GraphEventArgs<MouseEventArgs> e)
129+
{
130+
if (e.GraphElement == null && graph != null)
131+
{
132+
graph.CssClass = "";
133+
isDirty = true;
134+
}
135+
if (OnMouseUp.HasDelegate)
136+
{
137+
await OnMouseUp.InvokeAsync(e);
138+
}
139+
}
140+
119141
}

src/dashboard/Synapse.Dashboard/wwwroot/css/app.css

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20809,6 +20809,13 @@ tr.row-placeholder td::after {
2080920809
height: 100px !important;
2081020810
}
2081120811

20812+
.graph-canvas {
20813+
cursor: grab;
20814+
}
20815+
.graph-canvas.grabbing {
20816+
cursor: grabbing;
20817+
}
20818+
2081220819
.graph-container, .graph-canvas {
2081320820
--stroke-color: #6c757d;
2081420821
--fill-color: #1a1d20;
@@ -20953,6 +20960,7 @@ tr.row-placeholder td::after {
2095320960
}
2095420961

2095520962
.node, .cluster {
20963+
cursor: pointer;
2095620964
--gradient-url: url(#default-node-gradient);
2095720965
}
2095820966
.node.default-task-node, .cluster.default-task-node {

src/dashboard/Synapse.Dashboard/wwwroot/css/app.min.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/dashboard/Synapse.Dashboard/wwwroot/css/graph.scss

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,13 @@ $viridisScale: // generated with 13 steps, using 12 to exclude the last yellow
4343
$nodeColors: map-merge($nodeColors, ($name: $color));
4444
}
4545

46+
.graph-canvas {
47+
cursor: grab;
48+
&.grabbing {
49+
cursor: grabbing;
50+
}
51+
}
52+
4653
.graph-container, .graph-canvas {
4754
--stroke-color: #{$mute};
4855
--fill-color: #{$dark-bg-subtle-dark};
@@ -85,6 +92,7 @@ $viridisScale: // generated with 13 steps, using 12 to exclude the last yellow
8592
}
8693

8794
.node, .cluster {
95+
cursor: pointer;
8896
--gradient-url: url(#default-node-gradient);
8997

9098
@each $name, $color in $nodeColors {

0 commit comments

Comments
 (0)