States with unemployment above 5%
Four of the seven states above 5% are in the West. Each state takes one of two colors, joined to the US atlas through encoding.key.
{
"type": "map",
"geo": {
"features": "\u0000demo-fold:0",
"projection": "albersUsa"
},
"data": "\u0000demo-fold:1",
"encoding": {
"key": {
"field": "id",
"type": "nominal"
},
"color": {
"field": "band",
"type": "nominal",
"scale": {
"domain": [
"Above 5%",
"5% or less"
],
"range": [
"#c2410c",
"#cdd3d9"
]
},
"title": "Unemployment rate"
}
},
"chrome": {
"title": "Four of the seven states with unemployment above 5% are in the West",
"subtitle": "Unemployment rate, seasonally adjusted, most recent month in the BLS release (%)"
}
}
{
"type": "map",
"geo": {
"features": {/* TopoJSON, 181 arcs; Copy includes it */},
"projection": "albersUsa"
},
"data": [
{
"id": "01",
"rate": 2.7,
"band": "5% or less"
},
{
"id": "02",
"rate": 4.8,
"band": "5% or less"
},
{
"id": "04",
"rate": 4.7,
"band": "5% or less"
},
{
"id": "05",
"rate": 4.2,
"band": "5% or less"
},
{
"id": "06",
"rate": 5.3,
"band": "Above 5%"
},
{
"id": "08",
"rate": 3.8,
"band": "5% or less"
},
// … 45 more rows; Copy includes them
],
"encoding": {
"key": {
"field": "id",
"type": "nominal"
},
"color": {
"field": "band",
"type": "nominal",
"scale": {
"domain": [
"Above 5%",
"5% or less"
],
"range": [
"#c2410c",
"#cdd3d9"
]
},
"title": "Unemployment rate"
}
},
"chrome": {
"title": "Four of the seven states with unemployment above 5% are in the West",
"subtitle": "Unemployment rate, seasonally adjusted, most recent month in the BLS release (%)"
}
}import { GeoMap } from "@opendata-ai/openchart-react";
import type { GeoMapSpec } from "@opendata-ai/openchart-core";
import "@opendata-ai/openchart-core/styles.css";
const data = "\u0000demo-fold:1";
const spec: GeoMapSpec = {
data,
"type": "map",
"geo": {
"features": "\u0000demo-fold:0",
"projection": "albersUsa"
},
"encoding": {
"key": {
"field": "id",
"type": "nominal"
},
"color": {
"field": "band",
"type": "nominal",
"scale": {
"domain": [
"Above 5%",
"5% or less"
],
"range": [
"#c2410c",
"#cdd3d9"
]
},
"title": "Unemployment rate"
}
},
"chrome": {
"title": "Four of the seven states with unemployment above 5% are in the West",
"subtitle": "Unemployment rate, seasonally adjusted, most recent month in the BLS release (%)"
}
};
export function Example() {
return <GeoMap spec={spec} />;
}
import { GeoMap } from "@opendata-ai/openchart-react";
import type { GeoMapSpec } from "@opendata-ai/openchart-core";
import "@opendata-ai/openchart-core/styles.css";
const data = [/* 51 rows; Copy includes them */];
const spec: GeoMapSpec = {
data,
"type": "map",
"geo": {
"features": {/* TopoJSON, 181 arcs; Copy includes it */},
"projection": "albersUsa"
},
"encoding": {
"key": {
"field": "id",
"type": "nominal"
},
"color": {
"field": "band",
"type": "nominal",
"scale": {
"domain": [
"Above 5%",
"5% or less"
],
"range": [
"#c2410c",
"#cdd3d9"
]
},
"title": "Unemployment rate"
}
},
"chrome": {
"title": "Four of the seven states with unemployment above 5% are in the West",
"subtitle": "Unemployment rate, seasonally adjusted, most recent month in the BLS release (%)"
}
};
export function Example() {
return <GeoMap spec={spec} />;
}
<script setup lang="ts">
import { GeoMap } from "@opendata-ai/openchart-vue";
import type { GeoMapSpec } from "@opendata-ai/openchart-core";
import "@opendata-ai/openchart-core/styles.css";
const data = "\u0000demo-fold:1";
const spec: GeoMapSpec = {
data,
"type": "map",
"geo": {
"features": "\u0000demo-fold:0",
"projection": "albersUsa"
},
"encoding": {
"key": {
"field": "id",
"type": "nominal"
},
"color": {
"field": "band",
"type": "nominal",
"scale": {
"domain": [
"Above 5%",
"5% or less"
],
"range": [
"#c2410c",
"#cdd3d9"
]
},
"title": "Unemployment rate"
}
},
"chrome": {
"title": "Four of the seven states with unemployment above 5% are in the West",
"subtitle": "Unemployment rate, seasonally adjusted, most recent month in the BLS release (%)"
}
};
</script>
<template>
<GeoMap :spec="spec" />
</template>
<script setup lang="ts">
import { GeoMap } from "@opendata-ai/openchart-vue";
import type { GeoMapSpec } from "@opendata-ai/openchart-core";
import "@opendata-ai/openchart-core/styles.css";
const data = [/* 51 rows; Copy includes them */];
const spec: GeoMapSpec = {
data,
"type": "map",
"geo": {
"features": {/* TopoJSON, 181 arcs; Copy includes it */},
"projection": "albersUsa"
},
"encoding": {
"key": {
"field": "id",
"type": "nominal"
},
"color": {
"field": "band",
"type": "nominal",
"scale": {
"domain": [
"Above 5%",
"5% or less"
],
"range": [
"#c2410c",
"#cdd3d9"
]
},
"title": "Unemployment rate"
}
},
"chrome": {
"title": "Four of the seven states with unemployment above 5% are in the West",
"subtitle": "Unemployment rate, seasonally adjusted, most recent month in the BLS release (%)"
}
};
</script>
<template>
<GeoMap :spec="spec" />
</template>
<script lang="ts">
import { GeoMap } from "@opendata-ai/openchart-svelte";
import type { GeoMapSpec } from "@opendata-ai/openchart-core";
import "@opendata-ai/openchart-core/styles.css";
const data = "\u0000demo-fold:1";
const spec: GeoMapSpec = {
data,
"type": "map",
"geo": {
"features": "\u0000demo-fold:0",
"projection": "albersUsa"
},
"encoding": {
"key": {
"field": "id",
"type": "nominal"
},
"color": {
"field": "band",
"type": "nominal",
"scale": {
"domain": [
"Above 5%",
"5% or less"
],
"range": [
"#c2410c",
"#cdd3d9"
]
},
"title": "Unemployment rate"
}
},
"chrome": {
"title": "Four of the seven states with unemployment above 5% are in the West",
"subtitle": "Unemployment rate, seasonally adjusted, most recent month in the BLS release (%)"
}
};
</script>
<GeoMap {spec} />
<script lang="ts">
import { GeoMap } from "@opendata-ai/openchart-svelte";
import type { GeoMapSpec } from "@opendata-ai/openchart-core";
import "@opendata-ai/openchart-core/styles.css";
const data = [/* 51 rows; Copy includes them */];
const spec: GeoMapSpec = {
data,
"type": "map",
"geo": {
"features": {/* TopoJSON, 181 arcs; Copy includes it */},
"projection": "albersUsa"
},
"encoding": {
"key": {
"field": "id",
"type": "nominal"
},
"color": {
"field": "band",
"type": "nominal",
"scale": {
"domain": [
"Above 5%",
"5% or less"
],
"range": [
"#c2410c",
"#cdd3d9"
]
},
"title": "Unemployment rate"
}
},
"chrome": {
"title": "Four of the seven states with unemployment above 5% are in the West",
"subtitle": "Unemployment rate, seasonally adjusted, most recent month in the BLS release (%)"
}
};
</script>
<GeoMap {spec} />
import { createGeoMap } from "@opendata-ai/openchart-vanilla";
import type { GeoMapSpec } from "@opendata-ai/openchart-core";
import "@opendata-ai/openchart-core/styles.css";
const data = "\u0000demo-fold:1";
const spec: GeoMapSpec = {
data,
"type": "map",
"geo": {
"features": "\u0000demo-fold:0",
"projection": "albersUsa"
},
"encoding": {
"key": {
"field": "id",
"type": "nominal"
},
"color": {
"field": "band",
"type": "nominal",
"scale": {
"domain": [
"Above 5%",
"5% or less"
],
"range": [
"#c2410c",
"#cdd3d9"
]
},
"title": "Unemployment rate"
}
},
"chrome": {
"title": "Four of the seven states with unemployment above 5% are in the West",
"subtitle": "Unemployment rate, seasonally adjusted, most recent month in the BLS release (%)"
}
};
const container = document.getElementById("chart");
if (!container) throw new Error('Add <div id="chart"></div> to the page first.');
createGeoMap(container, spec);
import { createGeoMap } from "@opendata-ai/openchart-vanilla";
import type { GeoMapSpec } from "@opendata-ai/openchart-core";
import "@opendata-ai/openchart-core/styles.css";
const data = [/* 51 rows; Copy includes them */];
const spec: GeoMapSpec = {
data,
"type": "map",
"geo": {
"features": {/* TopoJSON, 181 arcs; Copy includes it */},
"projection": "albersUsa"
},
"encoding": {
"key": {
"field": "id",
"type": "nominal"
},
"color": {
"field": "band",
"type": "nominal",
"scale": {
"domain": [
"Above 5%",
"5% or less"
],
"range": [
"#c2410c",
"#cdd3d9"
]
},
"title": "Unemployment rate"
}
},
"chrome": {
"title": "Four of the seven states with unemployment above 5% are in the West",
"subtitle": "Unemployment rate, seasonally adjusted, most recent month in the BLS release (%)"
}
};
const container = document.getElementById("chart");
if (!container) throw new Error('Add <div id="chart"></div> to the page first.');
createGeoMap(container, spec);