bartbutenaers / node-red-contrib-ui-svg

A Node-RED widget node to show interactive SVG (vector graphics) in the dashboard
Apache License 2.0
94 stars 27 forks source link

Put coordinates in output message #10

Closed bartbutenaers closed 5 years ago

bartbutenaers commented 5 years ago

When a shape is being clicked, an output message is being send. The mouse coordinates (of the clicked position) should be added to the output message.

This way the output message could be routed to another node that generates a popup context menu at that position (i.e. on top of the drawing).

In which message field should I put those x and y coordinate? For example:

payload: "mycircle",
topic: "clicked",
screen_location: {x : 50, y : 60}

Or perhaps better:

payload: {
   "elementId": mycircle",
   "positionX": 50,
   "positionY": 60,
}
topic: "clicked"
Steve-Mcl commented 5 years ago

Bart, as you are aware this is now implemented however, I suspect the coordinates generated are not correct.

I have used the msg.coordinates to show our contextmenu node however placement is not as expected.

Will feedback when I know more

Steve-Mcl commented 5 years ago

Sorted in jquery branch & handed off nicely to contextmenu :)

2019-08-27_13-17-24