Conversation
|
There still remain issues with the current design. For example it is not possible to create an #show: lq.show_(lq.legend-icon.with(kind: lq.scatter), it => {
lq.mark()
})and have it adapt to the color if the color is overridden explicitly through On the one hand, the current behavior in this PR is useful for overriding the color, size etc. of the default icon. On the other hand, it is not suitable for creating a differently shaped icon but with the styles inherited from the plot. I deem such behavior very desirable if one wants to draw a rectangle instead of a mark and so on. I am not yet sure whether there even is a good solution for this. However, a potential solution will likely depend on a set of special drawing primitives for lines, rectangles, ellipses etc. defined by Lilaq and most likely this will only make sense with user-defined types for Typst. |
To make it possible to modify the appearance of legend icons, a type
legend-icon(in the futurelegend.icon) is introduced.The type can be used
In this example, the mark size for all legend icons for scatter plots is set to
5pt. The patternshow mark: set markgrants priority to this rule over potential other rules that are invoked withinscatter, e.g., due to settinglq.scatter(.., size: 7pt)This closes #100 .