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

Remove d3-selection dependency #4

Open
4 of 9 tasks
thomaswilburn opened this issue Feb 28, 2023 · 0 comments
Open
4 of 9 tasks

Remove d3-selection dependency #4

thomaswilburn opened this issue Feb 28, 2023 · 0 comments
Assignees
Labels
good first issue Good for newcomers

Comments

@thomaswilburn
Copy link
Member

thomaswilburn commented Feb 28, 2023

d3-selection is confusing and difficult to use, and it's also a large dependency that gets added to almost every bundle. Our goal here is to rewrite these templates and eventually remove it completely. We can also take advantage of this to rewrite some of the templates to use newer HTML/CSS/JS features, such as flexbox or grid when that would simplify bar/column charts.

The current plan is to use Lit for rendering, but I'm open to other possibilities over time.

  • line chart - proof of concept rewrite in 53feff0
  • state grid map - fixed in d918a5b
  • bar chart - fixed in 485e912
  • table - updated in 3ca37ae
  • ai2html graphic - do we need this anymore? Possibly remove.
  • annotated line chart - base this on the line chart
  • block histogram - possible drop?
  • column chart - possible conversion to HTML flex/grid, and roll in the stacked variant
  • portrait pullquotes - possible drop?
@thomaswilburn thomaswilburn added the good first issue Good for newcomers label Feb 28, 2023
thomaswilburn added a commit that referenced this issue Mar 7, 2023
Related to #4

- Use a template element instead of a hidden div for the map SVG
- Fix some syntax errors.
- Remove d3-selection in favor of querySelector
- convert to our sans-serif font from the hard-coded Knockout from NPR
-
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants