Skip to content

Add toDW, loadDW, toGeoDW, and loadGeoDW methods#1216

Merged
nshiab merged 1 commit into
mainfrom
datawrapper-methods
Jun 22, 2026
Merged

Add toDW, loadDW, toGeoDW, and loadGeoDW methods#1216
nshiab merged 1 commit into
mainfrom
datawrapper-methods

Conversation

@nshiab

@nshiab nshiab commented Jun 22, 2026

Copy link
Copy Markdown
Owner

Summary

  • Adds toDW and loadDW to push/pull CSV data between a SimpleTable and a Datawrapper chart or table
  • Adds toGeoDW and loadGeoDW to push/pull GeoJSON data between a SimpleTable and a Datawrapper map
  • All four methods support a custom apiKey env var name (defaults to DATAWRAPPER_KEY); toDW and toGeoDW also accept note and republish options
  • loadGeoDW temporarily writes the JSON to .sda-cache/<chartId>.json (Node-compatible) and removes it after loading

Closes #1215

Test plan

  • Tests in test/unit/methods/toDW.test.ts, loadDW.test.ts, toGeoDW.test.ts, loadGeoDW.test.ts run and pass when DATAWRAPPER_KEY is set in .env
  • Tests are skipped gracefully when the key is absent (matching the Google Sheets test pattern)

@nshiab
nshiab force-pushed the datawrapper-methods branch from af356e9 to 90976e3 Compare June 22, 2026 16:46
@nshiab
nshiab merged commit ee69b20 into main Jun 22, 2026
3 checks passed
@nshiab
nshiab deleted the datawrapper-methods branch June 22, 2026 16:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

New methods to work with datawrapper

1 participant