@@ -162,7 +162,7 @@ limitations under the License. -->
162
162
anchor .value = graph .value .append (" g" ).selectAll (" .topo-line-anchor" );
163
163
arrow .value = graph .value .append (" g" ).selectAll (" .topo-line-arrow" );
164
164
svg .value .call (zoom (d3 , graph .value , [- 100 , - 100 ]));
165
- svg .value .on (" click" , (event : any ) => {
165
+ svg .value .on (" click" , (event : PointerEvent ) => {
166
166
event .stopPropagation ();
167
167
event .preventDefault ();
168
168
topologyStore .setNode (null );
@@ -218,11 +218,11 @@ limitations under the License. -->
218
218
simulation .value .alphaTarget (0 );
219
219
}
220
220
}
221
- function handleNodeClick(d : Node & { x: number ; y: number }) {
221
+ function handleNodeClick(event : PointerEvent , d : Node & { x: number ; y: number }) {
222
222
topologyStore .setNode (d );
223
223
topologyStore .setLink (null );
224
- operationsPos .x = d . x - 100 ;
225
- operationsPos .y = d . y - 70 ;
224
+ operationsPos .x = event . offsetX ;
225
+ operationsPos .y = event . offsetY ;
226
226
if (d .layer === String (dashboardStore .layerId )) {
227
227
return ;
228
228
}
@@ -231,7 +231,7 @@ limitations under the License. -->
231
231
{ id: " alarm" , title: " Alarm" , func: handleGoAlarm },
232
232
];
233
233
}
234
- function handleLinkClick(event : any , d : Call ) {
234
+ function handleLinkClick(event : PointerEvent , d : Call ) {
235
235
if (d .source .layer !== dashboardStore .layerId || d .target .layer !== dashboardStore .layerId ) {
236
236
return ;
237
237
}
0 commit comments