Closed bijwaard closed 2 months ago
As a work-around, I tried to drive marker refX and refY from formula, but this is not allowed, probably because they are in the SVG definition section.
markerArrowRed:
bespoke:
formulas:
- "ref = 1.5"
drives:
- elementName: "marker"
attribsSet:
refX: "ref"
refY: "ref"
attribute drive [ refX ] not allowed on element
<marker id="markerArrowRed" orient="auto">
module.js:2:766239
object:
<marker xmlns="http://www.w3.org/2000/svg" orient="auto" id="markerArrowRed" style="white-space: pre;">
<path style="fill: red; white-space: pre;" d="M1,0 L1,3 L2,1.5 L1,0" id="markerArrowRed@flowrpt0"/>
</marker>
attribute drive [ refY ] not allowed on element
<marker id="markerArrowRed" orient="auto">
module.js:2:766239
object:
<marker xmlns="http://www.w3.org/2000/svg" orient="auto" id="markerArrowRed" style="white-space: pre;">
<path style="fill: red; white-space: pre;" d="M1,0 L1,3 L2,1.5 L1,0" id="markerArrowRed@flowrpt0"/>
</marker>
This is an issue with the pass through dompurify which is the initial sanitization step. refX, refY, markerWidth, markerHeight, markerUnits get stripped off due to the camel-casing. I'll get that fixed. In the meantime if you change to lowercase it should all work for you now. i.e. change to: refx, refy, markerwidth, markerheight
FYI, to get the svg post-panel changes you can press the SVG button in the panel options and then copy/paste it out of the console.
Thanks for the workaround! lowcase attributes work fine I also implemented autoscaling in steps of 500 inspired by your formula.
All the camelCase marker element attributes now work in 1.16.4, just published.
When attributes are driven by measurements, the arrowhead is not correctly driven from measurements. When comparing original SVG and modified SVG, I noticed that the defined markers miss the attributes refX="1.5" refY="1.5". The refX and refY define the point of attachment of the marker to the line.
Here is the relevant part of the original SVG:
This is the SVG after modification (obtained through firefox inspect):
I can reproduce the wrong placement of the arrowhead with SVG editor inkscape.
Originally posted by @bijwaard in https://github.com/andymchugh/andrewbmchugh-flow-panel/issues/67#issuecomment-2288098041