3 ms·
The creator admits this in the README: The use of react is hereby not sctrictly necessary and much of the code found in SwissMap.js is also valid for other p
by sen_mendoza 7y ago
The creator admits this in the README:
The use of react is hereby not sctrictly necessary and much of the code found in SwissMap.js is also valid for other programming environments.
The usefulness of combing react and d3 is that you can create reusable and composable components, instead of creating something news every time you need a specific chart/map. This makes it easier to create more complex things like dashboards or UIs.
- interlocutor 7y agoThere is a better way to create reusable and composable components: Web Components. Read about it here: https://developer.mozilla.org/en-US/docs/Web/Web_Components https://developer.mozilla.org/en-US/docs/Web/Web_Components
- jklm 7y agoI highly recommend against using web components. Polymer has failed to take off in the past 3/4 years, and there are performance issues across browsers. Subjectively, I didn’t find the API all that great either.
- interlocutor 7y agoPolymer is crap. Web Components are great. There is definitely no performance issues. Ditch polymer and other such bloated libs. Try this 200-line lib instead: https://github.com/wisercoder/uibuilder https://github.com/wisercoder/uibuilder
- tenaciousDaniel 7y agoThat answers the question of "why use React". But that wasn't my question. My question is "why use D3". I've been using D3 for a couple years now, and it's so low-level that I really don't feel like it abstracts very much for me. Using React, I can easily build an abstraction over an SVG path element that receives datapoints and produces a `d` attribute.