
Bivariate Maps with React and D3 - danso
https://github.com/angelozehr/bivariate-maps-react-d3
======
cuchoi
I love _the idea_ of bivariate color scales, but is it just me or they are
hard to read?

~~~
hughes
It's especially confusing that the featured example uses the _lack_ of
something (equality) at the maximum of one scale.

------
airstrike
OK, now we just need a bivariate color palette generator

------
tenaciousDaniel
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?

~~~
danso
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?

    
    
        <svg
          width={width}
          height={height}
        >
          {geoJson.features.map(feature =>
            <path
              key={`path-${feature.properties.bfsId}`}
              stroke='white'
              strokeWidth={0.25}
              d={path(feature)}
              fill='steelblue'
            />
          )}
        </svg>
    
    

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?

~~~
sen_mendoza
D3 can do this type of rendering, but d3 data joins and selections are often
difficult for people to understand and master. The beauty of this approach is
that it bypasses all that and uses map to loop through the geoJSON features
creating each path element.

To me this is more readable and easy to understand, but you don't really need
react to do any of this. This can also be done with plan js.

