Replies: 2 comments
-
copying Mike's thoughts: Some possibilities…
|
Beta Was this translation helpful? Give feedback.
0 replies
-
A simpler method: function (_, scales, __, { width, height }) {
if (!this.done) return this.done = svg`<g><text x=${width / 2} y=${height / 2}>Hello`;
} |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
This example came up in #700 when using a function mark to add a
<defs>
element to a chart.When faceting, the defs will be added to each facet, which is redundant (and illegal if they contain ids). There a contrived way of adding them once only, by giving them an internal counter (state), but it would not be a good practice.
In the case of defs that set gradients and textures, we might argue that they are part of scales—unless they are constants… And sometimes what we want to do is to use the first facet to display some kind of annotation that's needed only once.
Beta Was this translation helpful? Give feedback.
All reactions