Charts

Copy-paste chart examples for every Bklit UI component.

Choropleth Chart - Interactive

Visitor traffic by country

<ChoroplethChart aspectRatio="2 / 1" data={geojson} margin={{ top: 8, right: 8, bottom: 40, left: 8 }}>  <ChoroplethGraticule />  <ChoroplethFeatureComponent getFeatureColor={getVisitorColor} />  <ChoroplethTooltip getFeatureValue={getVisitorValue} valueLabel="Visitors" /></ChoroplethChart>

Trending up by 5.2% this month

Choropleth Chart

World map with single fill color and graticule

<ChoroplethChart aspectRatio="16 / 9" data={geojson} margin={{ top: 8, right: 8, bottom: 40, left: 8 }}>  <ChoroplethGraticule />  <ChoroplethFeatureComponent fill="var(--chart-3)" />  <ChoroplethTooltip /></ChoroplethChart>

Choropleth Chart - Analytics

Color scale based on visitor traffic by country

<ChoroplethChart aspectRatio="16 / 9" data={geojson} margin={{ top: 8, right: 8, bottom: 40, left: 8 }}>  <ChoroplethFeatureComponent getFeatureColor={getVisitorColor} />  <ChoroplethTooltip    getFeatureValue={getVisitorValue}    valueLabel="Visitors"  /></ChoroplethChart>

Choropleth Chart - Graticule

Visible latitude and longitude grid lines

<ChoroplethChart aspectRatio="16 / 9" data={geojson} margin={{ top: 8, right: 8, bottom: 40, left: 8 }}>  <ChoroplethGraticule stroke="rgba(255,255,255,0.15)" />  <ChoroplethFeatureComponent fill="var(--chart-1)" />  <ChoroplethTooltip /></ChoroplethChart>

Choropleth Chart - Patterns

Diagonal line patterns colored by region

<ChoroplethChart aspectRatio="16 / 9" data={geojson} margin={{ top: 8, right: 8, bottom: 40, left: 8 }}>  <ChoroplethFeatureComponent    patterns={<PatternPreset id="pattern-americas" preset="diagonal-up" color="var(--chart-1)" strokeWidth={1.5} />}    getFeaturePattern={(feat) => `pattern-${getRegion(feat)}`}  />  <ChoroplethTooltip /></ChoroplethChart>

Choropleth Chart - Click to Zoom

Click a country or marker to fly to it; the camera leans toward that side of the map

const cities = [  { label: "London", coordinates: [-0.13, 51.51] },  { label: "New York", coordinates: [-74.01, 40.71] },  { label: "Tokyo", coordinates: [139.69, 35.69] },  { label: "São Paulo", coordinates: [-46.63, -23.55] },  { label: "Sydney", coordinates: [151.21, -33.87] },];<ChoroplethChart  aspectRatio="16 / 9"  clickToZoom  data={geojson}  perspective={{ focus: { view: "auto", tilt: 24 } }}>  <ChoroplethGraticule stroke="var(--chart-grid)" />  <ChoroplethFeatureComponent getFeatureColor={getVisitorColor} />  {cities.map((city) => (    <ChoroplethMarker key={city.label} {...city} />  ))}  <ChoroplethTooltip getFeatureValue={getVisitorValue} valueLabel="Visitors" /></ChoroplethChart>

Choropleth Chart - Dot Grid

The whole map as one dot lattice, tilted back, fading out at the edges

const cities = [  { label: "London", coordinates: [-0.13, 51.51] },  { label: "New York", coordinates: [-74.01, 40.71] },  { label: "Tokyo", coordinates: [139.69, 35.69] },  { label: "São Paulo", coordinates: [-46.63, -23.55] },  { label: "Sydney", coordinates: [151.21, -33.87] },];<ChoroplethChart  aspectRatio="16 / 9"  clickToZoom  data={geojson}  focusMaxZoom={2}  perspective={{    overview: { tilt: 30 },    focus: { view: "auto", yaw: 10, tilt: 24 },  }}>  <ChoroplethDotGrid    edgeFade={20}    fadedOpacity={0.5}    getFeatureColor={getVisitorColor}    oceanOpacity={0.35}  />  {cities.map((city) => (    <ChoroplethMarker color="var(--chart-2)" key={city.label} size={12} {...city} />  ))}  <ChoroplethTooltip getFeatureValue={getVisitorValue} valueLabel="Visitors" /></ChoroplethChart>

Choropleth Chart - Pointer Camera

The map swings from west to east as the pointer crosses it, over a static dot background

const cities = [  { label: "London", coordinates: [-0.13, 51.51] },  { label: "New York", coordinates: [-74.01, 40.71] },  { label: "Tokyo", coordinates: [139.69, 35.69] },  { label: "São Paulo", coordinates: [-46.63, -23.55] },  { label: "Sydney", coordinates: [151.21, -33.87] },];<ChoroplethChart  aspectRatio="16 / 9"  clickToZoom  data={geojson}  perspective={{    overview: { view: "pointer", yaw: 14, tilt: 18 },    focus: { view: "auto", tilt: 28 },  }}>  <ChoroplethBackground hideOnFocus pattern="dots" />  <ChoroplethFeatureComponent fill="var(--chart-scale-02)" />  {cities.map((city) => (    <ChoroplethMarker      color="var(--chart-1)"      glow={6}      key={city.label}      pulse="always"      shape="pin"      size={10}      {...city}    />  ))}  <ChoroplethTooltip /></ChoroplethChart>