I'm aware that I can add shapes to MxGraph by drawing them with stencils like:
<shape name="or" aspect="variable">
<background>
<path>
<move x="0" y="0"/>
<quad x1="100" y1="0" x2="100" y2="50"/>
<quad x1="100" y1="100" x2="0" y2="100"/>
<close/>
</path>
</background>
<foreground>
<fillstroke/>
</foreground>
</shape>
or draw with JavaScript as:
BoxShape.prototype.redrawPath = function(path, x, y, w, h, isForeground)
{
var dy = this.extrude * this.scale;
var dx = this.extrude * this.scale;
path.moveTo(0, dy);
path.lineTo(w - dx, dy);
path.lineTo(w, 0);
path.moveTo(w - dx, dy);
path.lineTo(w - dx, h);
};
I feel those two options are too primitive to create a complex shape. Draw.io uses fancy graphics like below and I feel that drawing them with the code as below would be an overkill and someone might have used some converter to do that directly from an SVG.
I inspected those elements those are drawings (Rendered as SVG) and not plain images which can be easily put on top of a vertex in MxGraph
Is there any easy way to create custom objects without writing code manually as below?