plot icon indicating copy to clipboard operation
plot copied to clipboard

invalid markerEnd option for link/arrow

Open aboveyunhai opened this issue 1 year ago • 1 comments

the current markerEnd: "arrow-reverse" has no effect for both link and arrow. Not sure if it's the design choice or bug.

    Plot.link(data, {
      markerEnd: "arrow-reverse"
    })

if it's the choice then the following line should change to Exclude<Marker, "arrow-reverse"> for link | arrow https://github.com/observablehq/plot/blob/0032c11160e6340ce44307675d93bed382d10446/src/marker.d.ts#L93

aboveyunhai avatar Aug 29 '24 23:08 aboveyunhai

This is working as expected, but the spec can be confusing: arrow-reverse is exactly like arrow but reversed on the starting position, so you can draw something like <-----> with a single marker.

I think that your proposed solution (excluding it from the markerEnd and markerMid defs) makes total sense; it's not that it's "not working", but in these two cases it's by definition doing nothing.

Fil avatar Aug 30 '24 07:08 Fil