Tree canopy
Street trees by species fill a tree outline.
Open the chart without page chrome ↗
const options = {
chart: {
height: 420,
fontFamily: "Inter, Geist, \"IBM Plex Sans\", system-ui, sans-serif",
type: "unit",
toolbar: {
show: false
}
},
series: [96, 64, 42, 28],
labels: ["Plane", "Lime", "Oak", "Maple"],
colors: ["#166534", "#16a34a", "#65a30d", "#ca8a04"],
plotOptions: {
unit: {
positions: {
name: "tree",
category: "nature",
kind: "silhouette",
rings: [
[
[0.5, 0],
[0.85, 0.4],
[0.7, 0.4],
[0.95, 0.72],
[0.58, 0.72],
[0.58, 1],
[0.42, 1],
[0.42, 0.72],
[0.05, 0.72],
[0.3, 0.4],
[0.15, 0.4]
]
],
source: "original",
minUnits: 20,
aspect: 0.8,
order: "rowsUp",
cx: undefined,
cy: undefined,
shape: {
name: "tree",
category: "nature",
kind: "silhouette",
minUnits: 20,
order: "rowsUp",
source: "original"
},
with: e=>St({...t,...e||{}}),
outlined: function outlined(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:.16;const n=t.rings.map(t=>{const n=t.reduce((t,e)=>t+e[0],0)/t.length,a=t.reduce((t,e)=>t+e[1],0)/t.length;return t.map(t=>{let o=b(t,2);return[n+(o[0]-n)*(1-e),a+(o[1]-a)*(1-e)]})});return St({...t,name:t.name+"-outlined",kind:"stroke",rings:t.rings.concat(n)})},
fill: (t,n)=>wt(e,t,n),
isUnitShape: true
}
}
},
title: {
text: "Street trees by species (1 dot = 10)"
},
theme: {
mode: "light",
preset: "coastal"
}
}
const chart = new WestCoastCharts(document.querySelector('#chart'), options)
chart.render()import WestCoastCharts from 'west-coast-charts'
import types from 'west-coast-charts/types'
WestCoastCharts.use(types)
const options = {
chart: {
height: 420,
fontFamily: "Inter, Geist, \"IBM Plex Sans\", system-ui, sans-serif",
type: "unit",
toolbar: {
show: false
}
},
series: [96, 64, 42, 28],
labels: ["Plane", "Lime", "Oak", "Maple"],
colors: ["#166534", "#16a34a", "#65a30d", "#ca8a04"],
plotOptions: {
unit: {
positions: {
name: "tree",
category: "nature",
kind: "silhouette",
rings: [
[
[0.5, 0],
[0.85, 0.4],
[0.7, 0.4],
[0.95, 0.72],
[0.58, 0.72],
[0.58, 1],
[0.42, 1],
[0.42, 0.72],
[0.05, 0.72],
[0.3, 0.4],
[0.15, 0.4]
]
],
source: "original",
minUnits: 20,
aspect: 0.8,
order: "rowsUp",
cx: undefined,
cy: undefined,
shape: {
name: "tree",
category: "nature",
kind: "silhouette",
minUnits: 20,
order: "rowsUp",
source: "original"
},
with: e=>St({...t,...e||{}}),
outlined: function outlined(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:.16;const n=t.rings.map(t=>{const n=t.reduce((t,e)=>t+e[0],0)/t.length,a=t.reduce((t,e)=>t+e[1],0)/t.length;return t.map(t=>{let o=b(t,2);return[n+(o[0]-n)*(1-e),a+(o[1]-a)*(1-e)]})});return St({...t,name:t.name+"-outlined",kind:"stroke",rings:t.rings.concat(n)})},
fill: (t,n)=>wt(e,t,n),
isUnitShape: true
}
}
},
title: {
text: "Street trees by species (1 dot = 10)"
},
theme: {
mode: "light",
preset: "coastal"
}
}
const chart = new WestCoastCharts(document.querySelector('#chart'), options)
await chart.render() Waiting for the chart.
Open Data & agent view to read this chart through chart.describe().
Read from the running library through its optional agent/describe module. Text, table and JSON share the same snapshot. Demo data only.
$ wcc chart export unit-tree-canopy.json --out unit-tree-canopy.svg --with-table Public agent tools 0.2.3, tested with Library 1.1.5; available from the versioned GitHub release and npm. Save a JSON spec first and check the loaded runtime and supported modules before rendering. Command reference
Loading /gallery/unit/tree-canopy/index.md …