Public
Edited
Apr 9
1 fork
1 star
Insert cell
Insert cell
<svg id="base" width="1000" height="500">
<g id="layer1"></g>
</svg>
Insert cell
import {powerplants_2019} from "@emfielduva/dvlib_sampledata"
Insert cell
sorteddata = d3.sort(powerplants_2019,(a,b)=>d3.ascending(a["Plant primary fuel generation category"],b["Plant primary fuel generation category"]));
Insert cell
colors=({"COAL":"#000000", "BIOMASS":"#00ff00", "HYDRO":"#0000ff", "OIL":"#777700", "GAS":"#E8BD0C", "NUCLEAR":"#00ffff", "GEOTHERMAL":"#A6A277", "WIND":"#FF66FF", "SOLAR":"#ffff00", "OFSL":"#888888", "OTHF":"#aa0000", "OTHRFOSL":"#888888", "WSTHTOTPUR":"#aa0000"})
Insert cell
import {dvPixelMatrix} from "@emfielduva/dvlib_layout"
Insert cell
pmElem1 = d3.select(svgContainer).select("#layer1")
Insert cell
pm = dvPixelMatrix(pmElem1,sorteddata,70,5,colors,"Plant primary fuel generation category");
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more