feat: inline clip-path instead of id ref
Author: pluswaveCreated Nov 14, 2024Updated Apr 29, 2026
Labelsbug
Enhancement Description
I have a hexo blog with hexo-filter-kroki filter, which in turn, can render MULTIPLE vega-lite diagrams in ONE markdown file. the problem is that, when I set
{
"mark": { "clip": true }
}the result svg will have two parts to do this, part one is something like
<g ... clip-path="url(#clip1)" ... >
part two is something like
<defs>
<clipPath id="clip1">
...
</clipPath>
</defs>however, for multiple diagrams inlined in one html document, the id of clipPath conflicts and the renderer in browser is not correct except the first graph. To resolve this issue, I suggest make the clip-path attribute inline for part one , and completely discards part two.
Checklist
- I checked for duplicate issues.
Source: vega/vega