Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork21
add pages of examples translated from ObservablePlot docs#72
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:main
Are you sure you want to change the base?
Conversation
netlifybot commentedMay 28, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
✅ Deploy Preview forsvelteplot ready!
To edit notification comments on pull requests, go to yourNetlify project configuration. |
gka left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Hey, I really like this idea, thanks for working on it.
Actually, a proper "examples" section was on my todo list for a while now, too.
So I took your initiative as inspiration to get it working. The setup I came up with is a bit simpler, you can find it in the repo now under /src/routes/examples.
A couple of differences in my approach:
- each example plot must be in its own Svelte file, likethis one
- the title is exported via
<script module> - the category pages automatically generate an index of all example plots, seehttps://svelteplot.dev/examples/line, for instance
- the example code is automatically added below the plot, like herehttps://svelteplot.dev/examples/axis/datawrapper-ticks
- I added a script
pnpm run screenshotsthat generates screenshots of all example plots so the index pages can show them as little thumbnails
Given this new setup, I'd suggest the following procedure for adding more examples, including from the Observable Plot gallery:
- For examples that are already supported in SveltePlot we can open PRs that include multiple examples at once. It would be nice if you could run the screenshot script before opening the PR.
- For examples that are not yet supported in SveltePlot I would prefer having separate PRs for each example, so we can hold off on merging until the features are implemented in SveltePlot (or we properly document API differences)
What do you think?
jamesscottbrown commentedMay 29, 2025
That seems a good approach: my intention was mostly to quickly translate a lot of examples to get a good sense of how much was working. I'll open Issues for the broken examples. |
I added some pages of examples auto-translated from the Observable PlotPlot gallery using myhttps://github.com/jamesscottbrown/Sveltify-plot tool (which is still a WIP, but good enough for these examples).
Lots of thing sworked, but this also surfaced some issues.