Skip to content

Commit f77333f

Browse files
xrendanclaude
andcommitted
Remove OWID and Our World in Data references from codebase
Rebrand the library by removing legacy OWID references: File renames: - OwidTable.ts → ChartsTable.ts - OwidTableUtil.ts → TableUtil.ts - OwidTableSynthesizers.ts → TableSynthesizers.ts - OwidVariable.ts → Variable.ts - OwidOrigin.ts → Origin.ts - OwidSource.ts → Source.ts - OwidTestData.ts → TestData.ts - LegacyToOwidTable.ts → LegacyToChartsTable.ts Type/function renames: - OwidTable → ChartsTable - OwidRow → DataRow - OwidColumnDef → ColumnDef - OwidVariableId → VariableId - OwidProcessingLevel → ProcessingLevel - checkIsOwidContinent → checkIsContinent - LogoOption.owid → LogoOption.legacy CSS class renames: - owid-btn → charts-btn - owid-checkbox → charts-checkbox Note: Entity codes in regions.json (OWID_WRL, OWID_LIC, etc.) are preserved for data compatibility. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 5dc9374 commit f77333f

File tree

157 files changed

+1743
-1742
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

157 files changed

+1743
-1742
lines changed

.storybook/docs/ChartTypes.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ const grapherState = new GrapherState({
9090
Best for showing relationships between two variables. Requires both X and Y dimensions.
9191

9292
```tsx
93-
import { createOwidTestDataset, legacyToOwidTableAndDimensionsWithMandatorySlug } from "@buildcanada/charts"
93+
import { createTestDataset, legacyToChartsTableAndDimensionsWithMandatorySlug } from "@buildcanada/charts"
9494

9595
// Define two variables
9696
const gdpData = [
@@ -108,12 +108,12 @@ const dimensions = [
108108
{ variableId: 2, property: DimensionProperty.y },
109109
]
110110

111-
const dataset = createOwidTestDataset([
111+
const dataset = createTestDataset([
112112
{ data: gdpData, metadata: { id: 1, display: { name: "GDP per capita" } } },
113113
{ data: lifeExpData, metadata: { id: 2, display: { name: "Life expectancy" } } },
114114
])
115115

116-
const table = legacyToOwidTableAndDimensionsWithMandatorySlug(dataset, dimensions, {})
116+
const table = legacyToChartsTableAndDimensionsWithMandatorySlug(dataset, dimensions, {})
117117

118118
const grapherState = new GrapherState({
119119
title: "GDP vs Life Expectancy",

.storybook/docs/DataLoading.mdx

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,14 @@ All charts require data with these mandatory columns:
1515

1616
## Method 1: Using TestData Format (Recommended)
1717

18-
The simplest approach uses the `createOwidTestDataset` helper with a structured array:
18+
The simplest approach uses the `createTestDataset` helper with a structured array:
1919

2020
```tsx
2121
import {
2222
Grapher,
2323
GrapherState,
24-
createOwidTestDataset,
25-
legacyToOwidTableAndDimensionsWithMandatorySlug,
24+
createTestDataset,
25+
legacyToChartsTableAndDimensionsWithMandatorySlug,
2626
GRAPHER_CHART_TYPES,
2727
DimensionProperty,
2828
} from "@buildcanada/charts"
@@ -53,11 +53,11 @@ const dimensions = [
5353
{ variableId, property: DimensionProperty.y },
5454
]
5555

56-
const dataset = createOwidTestDataset([
56+
const dataset = createTestDataset([
5757
{ data: myData, metadata: myMetadata },
5858
])
5959

60-
const table = legacyToOwidTableAndDimensionsWithMandatorySlug(
60+
const table = legacyToChartsTableAndDimensionsWithMandatorySlug(
6161
dataset,
6262
dimensions,
6363
{} // optional: color mapping for entities
@@ -80,8 +80,8 @@ If you have JSON data from an API or file:
8080
import {
8181
Grapher,
8282
GrapherState,
83-
createOwidTestDataset,
84-
legacyToOwidTableAndDimensionsWithMandatorySlug,
83+
createTestDataset,
84+
legacyToChartsTableAndDimensionsWithMandatorySlug,
8585
GRAPHER_CHART_TYPES,
8686
DimensionProperty,
8787
} from "@buildcanada/charts"
@@ -122,8 +122,8 @@ const metadata = {
122122

123123
// Build chart
124124
const dimensions = [{ variableId: 1, property: DimensionProperty.y }]
125-
const dataset = createOwidTestDataset([{ data: testData, metadata }])
126-
const table = legacyToOwidTableAndDimensionsWithMandatorySlug(dataset, dimensions, {})
125+
const dataset = createTestDataset([{ data: testData, metadata }])
126+
const table = legacyToChartsTableAndDimensionsWithMandatorySlug(dataset, dimensions, {})
127127

128128
const grapherState = new GrapherState({
129129
title: "GDP Growth Rate",
@@ -241,7 +241,7 @@ const entityColors = {
241241
"Germany": "#ffcc00",
242242
}
243243

244-
const table = legacyToOwidTableAndDimensionsWithMandatorySlug(
244+
const table = legacyToChartsTableAndDimensionsWithMandatorySlug(
245245
dataset,
246246
dimensions,
247247
entityColors // Pass colors here
@@ -288,7 +288,7 @@ type TestMetadata = {
288288
- Check that `dimensions` includes the correct `variableId`
289289
290290
### Colors not applying
291-
- Pass the color map to `legacyToOwidTableAndDimensionsWithMandatorySlug`
291+
- Pass the color map to `legacyToChartsTableAndDimensionsWithMandatorySlug`
292292
- Entity names in the color map must exactly match data entity names
293293
294294
## Next Steps

.storybook/docs/Introduction.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { Meta } from "@storybook/addon-docs/blocks"
44

55
# @buildcanada/charts
66

7-
A configurable data visualization library for creating interactive charts. Extracted from [Our World in Data's Grapher](https://github.com/owid/owid-grapher).
7+
A configurable data visualization library for creating interactive charts.
88

99
## Features
1010

@@ -61,4 +61,4 @@ This library requires the following peer dependencies:
6161

6262
## License
6363

64-
MIT License - Based on Our World in Data's Grapher (Apache 2.0)
64+
MIT License

.storybook/docs/MapCharts.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -203,8 +203,8 @@ import {
203203
ChartsProvider,
204204
Grapher,
205205
GrapherState,
206-
createOwidTestDataset,
207-
legacyToOwidTableAndDimensionsWithMandatorySlug,
206+
createTestDataset,
207+
legacyToChartsTableAndDimensionsWithMandatorySlug,
208208
fakeEntities,
209209
DimensionProperty,
210210
MapRegionName,
@@ -235,8 +235,8 @@ const metadata = {
235235
}
236236

237237
const dimensions = [{ variableId: 1, property: DimensionProperty.y }]
238-
const dataset = createOwidTestDataset([{ data: lifeExpData, metadata }])
239-
const table = legacyToOwidTableAndDimensionsWithMandatorySlug(dataset, dimensions, {})
238+
const dataset = createTestDataset([{ data: lifeExpData, metadata }])
239+
const table = legacyToChartsTableAndDimensionsWithMandatorySlug(dataset, dimensions, {})
240240

241241
const grapherState = new GrapherState({
242242
title: "Life Expectancy by Country (2020)",

.storybook/helpers/grapherStateFactory.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { GrapherState } from "../../packages/charts/src/grapher/core/GrapherStat
33
import {
44
LifeExpectancyGrapher,
55
CanadaProvinceGrapher,
6-
} from "../../packages/charts/src/grapher/testData/OwidTestData.sample.js"
6+
} from "../../packages/charts/src/grapher/testData/TestData.sample.js"
77
import type { GrapherProgrammaticInterface } from "../../packages/charts/src/grapher/core/Grapher.js"
88
import {
99
ColorSchemeName,
@@ -104,7 +104,7 @@ export function createScatterPlotState(
104104

105105
/**
106106
* Create a GrapherState for a WorldMap story
107-
* Uses Blues color scheme to match OWID production styling
107+
* Uses Blues color scheme for standard styling
108108
*/
109109
export function createMapChartState(
110110
overrides: Partial<GrapherProgrammaticInterface> = {}

CLAUDE.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
44

55
## Project: @buildcanada/charts
66

7-
A configurable data visualization library for creating interactive charts. Extracted from Our World in Data's Grapher.
7+
A configurable data visualization library for creating interactive charts.
88

99
## Commands
1010

@@ -31,7 +31,7 @@ bun run typecheck # TypeScript check
3131
src/
3232
├── components/ # Reusable UI components (TextWrap, MarkdownTextWrap, etc.)
3333
├── config/ # ChartsProvider context and configuration
34-
├── core-table/ # Data table handling (OwidTable, CoreTable)
34+
├── core-table/ # Data table handling (ChartsTable, CoreTable)
3535
├── explorer/ # Explorer component (data explorer UI)
3636
├── grapher/ # Main charting engine
3737
│ ├── axis/ # Axis rendering

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Part of the [Build Canada Design System](https://github.com/BuildCanada/bcds) monorepo.
44

5-
A configurable data visualization library for creating interactive charts. Extracted from [Our World in Data's](https://ourworldindata.org) Grapher.
5+
A configurable data visualization library for creating interactive charts.
66

77
## Installation
88

@@ -34,8 +34,8 @@ import {
3434
GrapherState,
3535
GRAPHER_CHART_TYPES,
3636
DimensionProperty,
37-
createOwidTestDataset,
38-
legacyToOwidTableAndDimensionsWithMandatorySlug,
37+
createTestDataset,
38+
legacyToChartsTableAndDimensionsWithMandatorySlug,
3939
} from "@buildcanada/charts"
4040
import "@buildcanada/charts/styles.css"
4141

@@ -48,8 +48,8 @@ const myData = [
4848
const metadata = { id: 1, display: { name: "My Metric" } }
4949
const dimensions = [{ variableId: 1, property: DimensionProperty.y }]
5050

51-
const dataset = createOwidTestDataset([{ data: myData, metadata }])
52-
const table = legacyToOwidTableAndDimensionsWithMandatorySlug(dataset, dimensions, {})
51+
const dataset = createTestDataset([{ data: myData, metadata }])
52+
const table = legacyToChartsTableAndDimensionsWithMandatorySlug(dataset, dimensions, {})
5353

5454
const grapherState = new GrapherState({
5555
title: "My Chart",

docs/DATA_LOADING_GUIDE.md

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -46,15 +46,15 @@ All charts require data with these mandatory columns:
4646

4747
## Method 1: Using TestData Format (Recommended)
4848

49-
The simplest approach uses the `createOwidTestDataset` helper with a structured array:
49+
The simplest approach uses the `createTestDataset` helper with a structured array:
5050

5151
```tsx
5252
import {
5353
Grapher,
5454
GrapherState,
55-
createOwidTestDataset,
55+
createTestDataset,
5656
fakeEntities,
57-
legacyToOwidTableAndDimensionsWithMandatorySlug,
57+
legacyToChartsTableAndDimensionsWithMandatorySlug,
5858
GRAPHER_CHART_TYPES,
5959
DimensionProperty,
6060
} from "@buildcanada/charts"
@@ -85,11 +85,11 @@ const dimensions = [
8585
{ variableId, property: DimensionProperty.y },
8686
]
8787

88-
const dataset = createOwidTestDataset([
88+
const dataset = createTestDataset([
8989
{ data: myData, metadata: myMetadata },
9090
])
9191

92-
const table = legacyToOwidTableAndDimensionsWithMandatorySlug(
92+
const table = legacyToChartsTableAndDimensionsWithMandatorySlug(
9393
dataset,
9494
dimensions,
9595
{} // optional: color mapping for entities
@@ -112,8 +112,8 @@ If you have JSON data from an API or file:
112112
import {
113113
Grapher,
114114
GrapherState,
115-
createOwidTestDataset,
116-
legacyToOwidTableAndDimensionsWithMandatorySlug,
115+
createTestDataset,
116+
legacyToChartsTableAndDimensionsWithMandatorySlug,
117117
GRAPHER_CHART_TYPES,
118118
DimensionProperty,
119119
} from "@buildcanada/charts"
@@ -154,8 +154,8 @@ const metadata = {
154154

155155
// Build chart
156156
const dimensions = [{ variableId: 1, property: DimensionProperty.y }]
157-
const dataset = createOwidTestDataset([{ data: testData, metadata }])
158-
const table = legacyToOwidTableAndDimensionsWithMandatorySlug(dataset, dimensions, {})
157+
const dataset = createTestDataset([{ data: testData, metadata }])
158+
const table = legacyToChartsTableAndDimensionsWithMandatorySlug(dataset, dimensions, {})
159159

160160
const grapherState = new GrapherState({
161161
title: "GDP Growth Rate",
@@ -302,12 +302,12 @@ const dimensions = [
302302
{ variableId: 2, property: DimensionProperty.y },
303303
]
304304

305-
const dataset = createOwidTestDataset([
305+
const dataset = createTestDataset([
306306
{ data: xData, metadata: xMetadata },
307307
{ data: yData, metadata: yMetadata },
308308
])
309309

310-
const table = legacyToOwidTableAndDimensionsWithMandatorySlug(dataset, dimensions, {})
310+
const table = legacyToChartsTableAndDimensionsWithMandatorySlug(dataset, dimensions, {})
311311

312312
const grapherState = new GrapherState({
313313
chartTypes: [GRAPHER_CHART_TYPES.ScatterPlot],
@@ -338,7 +338,7 @@ const entityColors = {
338338
"Germany": "#ffcc00",
339339
}
340340

341-
const table = legacyToOwidTableAndDimensionsWithMandatorySlug(
341+
const table = legacyToChartsTableAndDimensionsWithMandatorySlug(
342342
dataset,
343343
dimensions,
344344
entityColors // Pass colors here
@@ -352,8 +352,8 @@ import {
352352
ChartsProvider,
353353
Grapher,
354354
GrapherState,
355-
createOwidTestDataset,
356-
legacyToOwidTableAndDimensionsWithMandatorySlug,
355+
createTestDataset,
356+
legacyToChartsTableAndDimensionsWithMandatorySlug,
357357
parseDelimited,
358358
GRAPHER_CHART_TYPES,
359359
DimensionProperty,
@@ -389,15 +389,15 @@ function CSVChart({ csvData }: { csvData: string }) {
389389
const variableId = 1
390390
const dimensions = [{ variableId, property: DimensionProperty.y }]
391391

392-
const dataset = createOwidTestDataset([{
392+
const dataset = createTestDataset([{
393393
data: testData,
394394
metadata: {
395395
id: variableId,
396396
display: { name: "Value", numDecimalPlaces: 0 },
397397
},
398398
}])
399399

400-
const table = legacyToOwidTableAndDimensionsWithMandatorySlug(
400+
const table = legacyToChartsTableAndDimensionsWithMandatorySlug(
401401
dataset,
402402
dimensions,
403403
{}
@@ -525,5 +525,5 @@ type TestMetadata = {
525525
- For Canada maps, use full province names (e.g., "British Columbia", not "BC")
526526
527527
### Colors not applying
528-
- Pass the color map to `legacyToOwidTableAndDimensionsWithMandatorySlug`
528+
- Pass the color map to `legacyToChartsTableAndDimensionsWithMandatorySlug`
529529
- Entity names in the color map must exactly match data entity names

packages/charts/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@buildcanada/charts",
33
"version": "0.1.1",
4-
"description": "A configurable data visualization library for creating interactive charts. Extracted from Our World in Data's Grapher.",
4+
"description": "A configurable data visualization library for creating interactive charts.",
55
"type": "module",
66
"main": "src/index.ts",
77
"types": "src/index.ts",

0 commit comments

Comments
 (0)