.size([width-2,height-2])// can I set a min circle size?
.padding(1)
// first, get data into hierarchical structure
hierarchy={
leth=d3.stratify()
.id(d=>d.id)
.parentId(d=>d.type)
(allNodes)// parse the nodes
// then use d3.hierarchy to calculate the size of each circle
returnd3.hierarchy(h).sum(d=>1)// added a value that represent the number of elements in each type
// in this case the number of signtures in the city
}
allNodes={
letaddedID=suffragist.map(d=>{// Appends the id and type to the dataset
d.id='child'
d.type=d.consistentCityRegion
returnd
})
return_.union(// @shierlys magic
[{id:'root',type:''}],
_.map(typeIDs,id=>newObject({id,type:'root'})),
addedID,
)
}
runonce=[false]
baseURL+suffragist[0].sheetURL// example of entry
Table(suffragist)
Table(allNodes)
import{Table,Search}from"@observablehq/inputs"
d3=require('d3@6')
_=require('lodash')
<style>
.katex-display,p,ul,h1,h2,h3,h4,li
{
font-family:sans-serif;
}
@media(hover:hover){
.katex-display,p,ul,h1,h2,h3,h4,li{
max-width: ${width-14}px;
min-width: ${800}px;}
}
</style>
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.