Hi i would like to make a simple
draw.io plugin. Something like showing a text message when a triangle object is placed.
I've coded in C# and WinForms but i've not much expirience in web stuff.
My current setup is:
- Ubuntu Virtual Machine
- Node.js and npm installed
Example script:
// Wait for Draw.io to be ready
mxEvent.addListener(window, 'load', function() {
// Add a listener for the shapeAdded event
editor.addListener(mxEvent.SHAPE_ADDED, function(sender, evt) {
// Get the added shape
var shape = evt.getProperty('cell');
// Check if the shape is a circle
if (shape && shape.isVertex() && shape.style && shape.style[mxConstants.STYLE_SHAPE] === mxConstants.SHAPE_ELLIPSE) {
// Show a text message
alert('A circle has been added');
}
});
});
(this following ChatGPT indications)
But now i'm confused and i'm not sure where i have to put the code, how to compile it, how to test it, etc.
Thx for your help.