Skip to content

feat(frontend): add option to unstack downloads per version #1101

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

tylersayshi
Copy link
Contributor

@tylersayshi tylersayshi commented May 7, 2025

adds option to view stacked and unstacked downloads (keeping current defaults). Replicating the downloads chart for crates.io

stacked:
image

unstacked:
image

options on small screens:
image

Copy link

@KnorpelSenf KnorpelSenf left a comment

Choose a reason for hiding this comment

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

Thank you for fixing this, it was really confusing

@crowlKats
Copy link
Collaborator

crowlKats commented May 8, 2025

this is intentional behaviour, and is common across other systems already (ie crates.io). a stacked graph makes sense for an aggregation set of data across different points, so this seems the right usecase

@KnorpelSenf
Copy link

ah dangit

@tylersayshi tylersayshi marked this pull request as draft May 8, 2025 16:43
@tylersayshi
Copy link
Contributor Author

this is intentional behaviour, and is common across other systems already (ie crates.io). a stacked graph makes sense for an aggregation set of data across different points, so this seems the right usecase

There's an option on crates.io to unstack the graph. Would you be ok with me changing this to add the dropdown option for stacked/unstacked here as well?

image

@crowlKats
Copy link
Collaborator

@tylersayshi yes that sounds good

@tylersayshi tylersayshi changed the title fix(frontend): unstack download charts feat(frontend): add option to unstack downloads per version May 9, 2025
@tylersayshi tylersayshi marked this pull request as ready for review May 9, 2025 05:59
Comment on lines -200 to +220
out = new Date(Date.UTC(
date.getUTCFullYear(),
date.getUTCMonth(),
date.getUTCDate() - date.getUTCDay(),
));
out = new Date(
Date.UTC(
date.getUTCFullYear(),
date.getUTCMonth(),
date.getUTCDate() - date.getUTCDay(),
),
);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Why might this change? I ran deno fmt, is the style not guarenteed to stay the same?

Comment on lines -147 to -151
const isDarkMode = document.documentElement.classList.contains(
"dark",
);
const newAggregationPeriod = e.currentTarget
.value as AggregationPeriod;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

took the chance to simplify this logic while I was reading it and adding the other select.

only updateSeries is needed for this

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