|
|
|
|
|
by marcusb
436 days ago
|
|
> SVG complexity is a good counterpoint to “why this instead of SVG”. But I don’t think we need to even address the claim that most tools for SVG generation use JS, if the concern is JS on the client. If you want to address the generation of charts on the client, then, yes, JS is something that needs to be addressed, because SVG (or Canvas) are not in and of themselves systems for generating charts. There isn't a <PieChart> primitive within the SVG spec, to my knowledge. The entire purpose of this library seems to be generating charts in pure markup without any scripting language dependencies. Trying to pretend that isn't relevant, or suggesting that "SVG" is, in and of itself, a viable substitute is just really weird. |
|
Sure, I have used JS (TS) for building these projects, but that’s immaterial because it never ships to clients.
As for pie chart “primitives”, I’m not asking you to take my word for it but I also can say with relatively high confidence that SVG as a technology is capable of the kinds of composition needed for that. It probably won’t match the ergonomics of a few CSS variables, but it could come close if you’re willing to overlook the verbosity of XML syntax.
Not that I’m saying you or anyone should do that! My original response wasn’t intended to persuade you or anyone that SVG is a better choice of technology for this purpose. Only to clarify that there is no inherent requirement to run client side JS to render SVG charts. That’s probably not super interesting in its own right, it’s only a clarifying statement of fact.