Skip to content

Client diversity piechart update #15251

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 31 commits into
base: dev
Choose a base branch
from

Conversation

LifeofDan-EL
Copy link
Contributor

@LifeofDan-EL LifeofDan-EL commented Apr 7, 2025

Description

This PR is to create a new piechart that changes depending on the values, which is to be used to update the client diversity part of the website.

#15099

Preview: https://deploy-preview-15251--ethereumorg.netlify.app/en/developers/docs/nodes-and-clients/client-diversity/

@github-actions github-actions bot added the content 🖋️ This involves copy additions or edits label Apr 7, 2025
Copy link

netlify bot commented Apr 7, 2025

Deploy Preview for ethereumorg ready!

Name Link
🔨 Latest commit 003b4d0
🔍 Latest deploy log https://app.netlify.com/sites/ethereumorg/deploys/680036fca4e60000082d6745
😎 Deploy Preview https://deploy-preview-15251--ethereumorg.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
7 paths audited
Performance: 43 (🔴 down 12 from production)
Accessibility: 95 (🟢 up 1 from production)
Best Practices: 89 (🔴 down 9 from production)
SEO: 98 (no change from production)
PWA: 59 (no change from production)
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify site configuration.

@github-actions github-actions bot added the dependencies 📦 Changes related to project dependencies label Apr 7, 2025
@LifeofDan-EL
Copy link
Contributor Author

Deploy is failing, at first, I thought it was a lint error, so I fixed that with npx eslint ./src/components/MdComponents/index.tsx --fix but it is still failing.

Copy link
Member

@pettinarip pettinarip left a comment

Choose a reason for hiding this comment

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

@LifeofDan-EL left a comment about the issue we have.

On the other hand, there are a few files in this PR that shouldn't be modified/added/deleted like yarn.lock, .env.example, and some yarn related ones that are not necessary. Can help you clean them up once we have a working preview.

@@ -5,6 +5,27 @@ lang: en
sidebarDepth: 2
---

import { PieChart } from "@/components/PieChart"
Copy link
Member

Choose a reason for hiding this comment

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

This import is redundant now that we are injecting the component in the MdComponents file.

Also, next-mdx-remote (the mdx compiler that we use) doesn't support imports or exports, so we need to do something different to pass the below data to the component.

I think the easiest would be to pass the data array inline like this:

<PieChart data={[ { name: "Geth", value: 43 }, ... ]} title="Execution Clients" />

To clarify more, you can't use variables like executionData without exporting them in mdx. But since imports/exports are not supported, we can't use them either.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks @pettinarip for the clarification, it was an oversight pushing the yarn file. Thanks again.

Copy link
Member

@pettinarip pettinarip left a comment

Choose a reason for hiding this comment

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

@LifeofDan-EL good job. The implementation looks good and is functional. Left a comment about the styles to try to align it with our current design system.

* Color palette for blue shades, ordered from deep blue (largest share) to light blue (smallest share).
* Ensure your data is sorted from largest to smallest for this to work as intended.
*/
const COLORS = [
Copy link
Member

Choose a reason for hiding this comment

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

There are a few issues with these colors:

  • there is not enough contrast in dark mode
  • these are not part of our current color palette

This is the current colors that we have https://dev--63b7ea99632763723c7f4d6b.chromatic.com/?path=/story/design-system-colors--primitives

@konopkja what do you think?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, I looked at the preview after deployment and I agree there isn't enough contrast. Let me use values from the colour palette.

Copy link
Member

Choose a reason for hiding this comment

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

This file is not needed

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Resolved.

.yarnrc.yml Outdated
Copy link
Member

Choose a reason for hiding this comment

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

This file is not needed

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Resolved.

@konopkja
Copy link
Contributor

Screenshot 2025-04-11 at 17 08 25 Screenshot 2025-04-11 at 17 08 36

seems like dark mode / light mode have some contrast issues, on dark mode its the upper part , on light mode its the opposite part

@konopkja
Copy link
Contributor

lets use accent colors here

@pettinarip
Copy link
Member

lets use accent colors here

here is the list of accent colors in our tw config

@LifeofDan-EL
Copy link
Contributor Author

The latest build currently has the accent colour and I tweaked the legend a bit. What's left is to work on the responsiveness.

Once that is done, then I can update the content too, to reflect the new values.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
content 🖋️ This involves copy additions or edits dependencies 📦 Changes related to project dependencies
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants