-
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
feat: count plots #100
base: main
Are you sure you want to change the base?
feat: count plots #100
Conversation
Visit the preview URL for this PR (updated for commit 1cb857d): https://ccv-pubs--pr100-counts-barplot-p7o1nv21.web.app (expires Wed, 25 Dec 2024 18:42:56 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 Sign: f75c16b3bdd7d81b7a0b7f8d3eed826b541e7a2a |
@paulstey, Opinions on the plots? Want to see anything different? |
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.
Hmm... I wonder if there's a way to somehow note that the current-year numbers are incomplete? I know this is test data, but the "tiny current year bar" will still be true with real data.
Otherwise, looking good!
import React from 'react'; | ||
import { Vega } from 'react-vega'; | ||
|
||
const bar_color = '#00c398'; // ccv green |
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.
Maybe pull the colors to global styles?
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.
Because these are being used in Vega, they might not be able to be pulled into the global styles list...
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.
Oh that is really annoying
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.
✨ vega ✨
|
||
function generateBarPlot({ data = {}, xLabel = '', yLabel = '' }) { | ||
// Validate input JSON structure | ||
if (!Array.isArray(data) || data.some((item) => !('label' in item && 'count' in item))) { |
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.
What are users seeing if the plots throw errors?
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.
Looks really good George!! I'd love to include some screencaps in the PR if you have them handy, because I haven't run the code myself yet. It looks good though! How are you finding Vega so far?
Edit: I'm so sorry I just noticed that there's a preview link 🤦♀️ -- don't worry about those screencaps lol
import React from 'react'; | ||
import { Vega } from 'react-vega'; | ||
|
||
const bar_color = '#00c398'; // ccv green |
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.
Because these are being used in Vega, they might not be able to be pulled into the global styles list...
One option could be adding an |
…Plot with specification using a type property
That's good to me. For your next PR for the functions can you make it as a PR merging into this branch? |
Added functions to generate:
Notes: