-
Notifications
You must be signed in to change notification settings - Fork 1
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
Client report graphs #18
Conversation
thomassth
commented
Oct 20, 2024
- Fixed beeswarm graph
- Added participants graph
Thanks @thomassth! Still reviewing, but first thought was that there's already some test data and helper functions in .storybook/utils.js that other stories are using. Could we stick with using those functions, and add more if any from your testData file are missing? See: https://github.com/CivicTechTO/polis-storybook/blob/main/.storybook/utils.js polis-storybook/stories/compdem/client-participation/TidCarousel.stories.js Lines 6 to 10 in 3e5000f
Also, I spawned #19, because added more data sources is a really nice idea, and lets us actually start using storybook to look at past snapshots of data using the visualizations hosted here (which is its own killer feature) |
Maybe in scope of this PR, you could version control your new data files alongside the originals? (for now, if we could stick with the current sample data, as I'm pretty sure some stories would break if other data was swapped in, and generalizing them seems out-of-scope for this issue. But if you added the data to the repo, viewing it for now would be as simple as changing the conversation_id in the imports when working locally) polis-storybook/.storybook/utils.js Lines 2 to 3 in 3e5000f
So versioning in your data into these files:
(participation init endpoint is a composite of enough data to init the visualization on first load, and is at: https://pol.is/api/v3/participationInit?conversation_id=5esrbenwxs ) |
Lemme know what you think! Thanks again 🙌 |
And unless there's a reason to change the submodule, would love to keep it pointed to the "storybook-prep" branch, which is a bare minimal changeset from upstream, just to get storybook working If we're diverging too much, then we'll just add a new submodule in |
I've looked through the |
91b2cc1
to
4a58a6c
Compare
I have removed the excess test data for now; we can think about adding them in other commits. |
Hm, I'm not getting it building properly in storybook on local -- same for CI: Found the build error line (it doesn't fail out, and maybe that's something to improve in the build process): Did you have it working locally? Anything that maybe didn't get committed? I'll update if I sort it out myself :) Thanks @thomassth 🙌 🙌 |
K, gonna merge in mainline, where I've added a fix for ensuring failures show in CI when they happen in the build :) |
K, failure confirmed, and now I think I've got a fix. Needed to add some more packages to the storybook environment, and make sure they get added as a d3 global |
k yay! ParticipantsGraph working now 🎉 https://civictechto.github.io/polis-storybook/PR-18/?path=/story/compdem-client-report-participantsgraph--default
Now that you've got us going in the right direction, I think I know the fixes for this :) |
export const getComments = () => { | ||
return commentsData | ||
} | ||
|
||
// Simulates response data from /api/v3/reports?report_id=r3bpnywujybyru4rkx92i | ||
export const getReports = () => { | ||
return reportsData |
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.
Aligned this with the response from actual API endpoint (an array)
|
||
const comments = getComments(); | ||
|
||
// Logic from client-report/src/components/app.js#L274-291 |
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.
<3 THANK YOU SO MUCH. This was what I was missing 🙏 🙏 🙏 🙏
735b7b9
to
ad37363
Compare
Ah that's why, I didn't know the storybook needed another round of imports |
EDIT: Ok, feeling good that I've pushed the fix 🤞 |
ad37363
to
2b86d62
Compare
Ok, they're both working in the deployed storybook. Merge away if it looks good to you! Thanks for getting this in! |