nprapps / ice-melt

https://apps.npr.org/arctic-ice-melting-climate-change/
Other
0 stars 0 forks source link

Greenland map: get the lines to sort correctly, based on "order" attribute. #134

Open DanielJWood opened 1 year ago

DanielJWood commented 1 year ago

for some reason, the sort isn't working in.

        lines = linebox.selectAll(".lines")
          .data(linesRaw.features.sort((a,b)=> b.properties.order > a.properties.order))
            .join("path")
            .attr("class",d => `lines ${d.properties.styleClass} order-${d.properties.order}`);

We walk cold things to be below the others

image

DanielJWood commented 1 year ago

Should have been this:

lines = linebox.selectAll(".lines")
          .data(linesRaw.features.sort((a,b)=> b.properties.order - a.properties.order))
            .join("path")
            .attr("class",d => `lines ${d.properties.styleClass} order-${d.properties.order}`);