-
Notifications
You must be signed in to change notification settings - Fork 3
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
added possible pattern for dynamic scrolly with Ai2Svelte #59
base: master
Are you sure you want to change the base?
Conversation
This looks good to me. And I'd be fine with moving the Would be good to check with @pkd2512 and @MinamiFunakoshiTR as well before we pull it in, if we're all happy with teaching this new pattern. |
Looks good to me. One thing I noticed about using the Ai2svelte component in this way is that the the default option, which hides the graphic if This got annoying in the 100 days Ukraine project because we did want to use So, a few suggestions:
|
And yes! Let's move |
Thanks @hobbes7878 & @MinamiFunakoshiTR |
Sorry for delay, @deaxmachina . Yeah, I'd do a PR in the kit, too, and we can coordinate merging both together. And actually, I'd replace makeScrollerSteps. I want to deprecate all our dynamic import patterns, tbh.. Officially declaring them an anti-pattern for regular use :) |
I opened a PR in the bluprint repo here: reuters-graphics/bluprint_graphics-kit#76 |
Since we talked about it, added the pattern that I've used with the Scroller component when multi-step Ai2Svelte files are involved and imported from Google Docs.
I suggest that we:
aiGraphics
where the key is the same as the id in the google doc (so no change to the Google Doc format)fetchComponent, makeScrollerSteps
and instead use a very simple function like so:in order to add the Svelte components in the
background
for thesteps
prop of the Scroller.Note that we'd need to move this function to
utils
of the Svelte Kit Bluprint.Then it's more or less the same as before. It also takes care of having multiple Scrollers on the page and not having to make separate look-up dictionaries for each of them.
I updated the example in the docs with this PR. Let me know if this makes any sense as an approach?