Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Charts: pass config and annotations to the macro as json #105

Merged
merged 5 commits into from
Feb 20, 2025

Conversation

helenb
Copy link
Contributor

@helenb helenb commented Feb 18, 2025

What is the context of this PR?

After a discussion with the design system team, they don't want to encode json themselves in the macro - they'd rather receive the config directly as json.

This updates both the annotations and the config to be encoded as json before they are passed to the template.
Instead of using a script tag, the macro passes a json encoded string as a data attribute.

How to review

Test that creating charts in an information page all still works as expected.

Follow-up Actions

Update the macro parameters documentation in the charts spec
Potentially remove the custom version of json_script from the repo, although TBC as this could still be a useful addition.

@helenb helenb requested a review from a team as a code owner February 18, 2025 13:02
@helenb helenb added the DataVis Charts and Visualisations label Feb 18, 2025
@helenb helenb merged commit e812ff1 into feature/datavis Feb 20, 2025
@helenb helenb deleted the feature/update-macro-args branch February 20, 2025 13:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
DataVis Charts and Visualisations
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants