satori icon indicating copy to clipboard operation
satori copied to clipboard

A way to discover nodes (id's, classes, userData)

Open drcmda opened this issue 3 years ago • 2 comments

Feature Request

In order to identify nodes which later could become controlled. Even forwarding id's would probably be enough. Whatever renders the SVG now could inflate the layout with behaviour like events and such.

Description

<Satori>
  <div id="test">...

--->

<svg...>
  <g id="test">
    <path ...>

drcmda avatar Oct 17 '22 06:10 drcmda

Good call, I think it should preserve id, class and data-* attributes. There's some work to be done for this because it's not a 1:1 mapping between DOM/SVG elements, e.g. currently Satori will not render an empty and transparent <div>.

shuding avatar Oct 17 '22 18:10 shuding

How about passing an allowlist? It might be hard to guess what users will want to preserve so best to let the user configure it.

styfle avatar Oct 17 '22 20:10 styfle