Skip to content

static Datawrapper embed code#1611

Merged
Fil merged 3 commits into
mainfrom
mbostock/datawrapper-script
Aug 27, 2024
Merged

static Datawrapper embed code#1611
Fil merged 3 commits into
mainfrom
mbostock/datawrapper-script

Conversation

@mbostock
Copy link
Copy Markdown
Member

This…

  • Adopts Datawrapper’s recommended embed script code for simplicity
  • Favors static rendering of the embed script for better performance
  • Uses data-dark="auto" likewise for performance and simplicity

@mbostock mbostock requested a review from Fil August 27, 2024 14:49
@Fil
Copy link
Copy Markdown
Contributor

Fil commented Aug 27, 2024

@Fil Fil merged commit 52453ed into main Aug 27, 2024
@Fil Fil deleted the mbostock/datawrapper-script branch August 27, 2024 15:59
</div>

The above data loader lives in `data/chart.txt.py`, and creates the `data/chart.txt` file attachment, which contains the identifier. We read this file’s contents and pass it to the helper:
The above data loader lives in `data/chart.txt.py`, and creates the `data/chart.txt` file attachment, which contains the identifier. Since the identifier is dynamically constructed by the data loader, we can’t hard-code the identifier in HTML; instead, we’ll use a JavaScript helper function to create the embed script.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this will be possible with page loaders 👍

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, great point! Nice.

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.

2 participants