cetz-plot icon indicating copy to clipboard operation
cetz-plot copied to clipboard

More powerful custom legend entries

Open SolidTux opened this issue 1 year ago • 2 comments

Currently, add-legend only supports a custom preview function. It would be nice to be able to use the available marks more easily. I got around it by adding this manually, but it seems a bit verbose:

(
  (
    type: "legend-item",
    label: name,
    style: (stroke: none),
    mark: mark,
    mark-size: 0.2,
    mark-style: (fill: black.lighten(75%), stroke: black),
    axes: ("x", "y"),
    data: (),
    preview: auto,
  ),
)

SolidTux avatar Oct 31 '24 14:10 SolidTux

So you want to be able to give all the styling keys you can give to add(...) to add-legend(...)?

johannes-wolf avatar Oct 31 '24 19:10 johannes-wolf

That would be ideal, yes.

SolidTux avatar Nov 02 '24 14:11 SolidTux