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

How and why custom SVG shapes in charts #3

Open
shreshthmohan opened this issue Mar 2, 2022 · 0 comments
Open

How and why custom SVG shapes in charts #3

shreshthmohan opened this issue Mar 2, 2022 · 0 comments

Comments

@shreshthmohan
Copy link
Owner

For this chart I used a custom shape instead of just mashing together a <circle> and a <rect>

Why

  1. Interactions: I had a hover interaction to show a border. With the compound shape, a border shows up on both the rect and the circle, revealing the contained shapes. And it doesn't look that good.
  2. Opacity: If I give an opacity to the compound shapes, it looks weird because of the overlap between the contained shapes.

How

Explain the geometry and trigonometric calculations. Though done current with the help of D3, there's a better approach to do it without d3, with less code and with fewer points on the shape.

@shreshthmohan shreshthmohan added the draft A blog post that is a draft label Mar 2, 2022
@shreshthmohan shreshthmohan added status:published and removed draft A blog post that is a draft labels Nov 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant