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

[Demo] Add sparkline to ViViVo #875

Merged
merged 9 commits into from
Nov 19, 2024
Merged

Conversation

huong-li-nguyen
Copy link
Contributor

@huong-li-nguyen huong-li-nguyen commented Nov 14, 2024

Description

Based on #793 - thank you again ataraexia! ⭐

  • Adds code for sparkline chart based on px.line

Screenshot

Screenshot 2024-11-19 at 09 57 18

Notice

  • I acknowledge and agree that, by checking this box and clicking "Submit Pull Request":

    • I submit this contribution under the Apache 2.0 license and represent that I am entitled to do so on behalf of myself, my employer, or relevant third parties, as applicable.
    • I certify that (a) this contribution is my original creation and / or (b) to the extent it is not my original creation, I am authorized to submit this contribution on behalf of the original creator(s) or their licensees.
    • I certify that the use of this contribution as authorized by the Apache 2.0 license does not violate the intellectual property rights of anyone else.
    • I have not referenced individuals, products or companies in any commits, directly or indirectly.
    • I have not added data or restricted code in any commits, directly or indirectly.

Copy link
Contributor

github-actions bot commented Nov 14, 2024

View the example dashboards of the current commit live on PyCafe ☕ 🚀

Updated on: 2024-11-19 09:06:25 UTC
Commit: a4584e0

Link: vizro-core/examples/dev/

Link: vizro-core/examples/scratch_dev

Link: vizro-core/examples/visual-vocabulary/

Link: vizro-ai/examples/dashboard_ui/

@huong-li-nguyen huong-li-nguyen self-assigned this Nov 14, 2024
Copy link
Contributor

@petar-qb petar-qb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks really good!

Copy link
Contributor

@antonymilne antonymilne left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks nice, although actually I found having three charts with facet_row kind of confusing:

  • are they the same y-axis scale?
  • are they on a shared y axis or separate? Like without any context I think from glancing at the graph you could easily misunderstand the plot to be showing that Google stock is always above Amazon which is above Apple

So tbh I'm not sure how "best practice" this is. Maybe we should just show one stock instead of comparing three? Or maybe separate the graphs horizontally with a thin grey line?

No strong feelings though, so if this is commonly how sparklines are done then that's ok.

@huong-li-nguyen
Copy link
Contributor Author

huong-li-nguyen commented Nov 19, 2024

Looks nice, although actually I found having three charts with facet_row kind of confusing:

  • are they the same y-axis scale?
  • are they on a shared y axis or separate? Like without any context I think from glancing at the graph you could easily misunderstand the plot to be showing that Google stock is always above Amazon which is above Apple

So tbh I'm not sure how "best practice" this is. Maybe we should just show one stock instead of comparing three? Or maybe separate the graphs horizontally with a thin grey line?

No strong feelings though, so if this is commonly how sparklines are done then that's ok.

Typically, sparklines display multiple traces, so having just a single trace wouldn't be effective in this context. It's not necessary for them to share the same y-axis scale, but they should use the same unit. The focus is less on comparing their magnitudes and more on observing the overall trend across all traces simultaneously.

I like your idea of adding more separation though, I've now added grey lines to better distinguish between them. 👍

Screenshot 2024-11-19 at 09 49 17

Screenshot 2024-11-19 at 09 57 18

@huong-li-nguyen huong-li-nguyen enabled auto-merge (squash) November 19, 2024 09:07
@huong-li-nguyen huong-li-nguyen merged commit ed15ddc into main Nov 19, 2024
36 checks passed
@huong-li-nguyen huong-li-nguyen deleted the demo/add-sparkline-chart branch November 19, 2024 09:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants