It seems weird to pair D3 with React, since D3 is just another abstraction over the DOM, just like React. Why not just render the graphics with React?
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 dashboa…
Bivariate Maps with React and D3
11–17 of 17 posts
Re: Bivariate Maps with React and D3
#12Re: Bivariate Maps with React and D3
#13Earlier quoted context omitted.
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 dashboa…
There 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
Subjectively, I didn’t find the API all that great either.
Re: Bivariate Maps with React and D3
#14I love the idea of bivariate color scales, but is it just me or they are hard to read?
Re: Bivariate Maps with React and D3
#15It seems weird to pair D3 with React, since D3 is just another abstraction over the DOM, just like React. Why not just render the graphics with React?
I couldn't see a reason for React to be used in this visualization either. It's been awhile since I've used D3 but I thought it could do this kind of rendering on its own? {geoJson.features.map(feature => )} I was thinking maybe React was also used with this visualization in production (e.g. adding interactive elements for a published story), and so maybe the author found it easy to use React for the rendering too?
Fast and easy to start and expand as needed.
Re: Bivariate Maps with React and D3
#16It seems weird to pair D3 with React, since D3 is just another abstraction over the DOM, just like React. Why not just render the graphics with React?
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 dashboa…
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.
Re: Bivariate Maps with React and D3
#17Earlier quoted context omitted.
There 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
I 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.