thi-ng / umbrella

⛱ Broadly scoped ecosystem & mono-repository of 199 TypeScript projects (and ~180 examples) for general purpose, functional, data driven development
https://thi.ng
Apache License 2.0
3.39k stars 150 forks source link

[@thi.ng/hiccup-svg] hdom can't render hiccup-svg created tree #351

Closed Nek closed 2 years ago

Nek commented 2 years ago

svg.convertTree on defs with gradients produces a piece of data that makes updateDOM from @thi.ng/transducers-hdom break. Minimal reproduction is available here: https://codesandbox.io/s/new-sunset-3tyefg?file=/src/index.ts Please check the console.

Nek commented 2 years ago

It's actually just hdom. Example incoming.

Nek commented 2 years ago

https://codesandbox.io/s/morning-fast-ixb9w1?file=/src/index.ts

Nek commented 2 years ago

And here I've added empty gradientTransform to the gradients and it made it work. https://codesandbox.io/s/loving-sun-xyn8xp?file=/src/index.ts

Nek commented 2 years ago

Also, convertTree doesn't convert numerical values into percentage strings. What am I doing wrong?

Nek commented 2 years ago

Well, I guess it's partially me. I've added gradientUnits: "objectBoundingBox" and it fixed the issue.