D3 group doesn't group by date | Guillaume Levrier | Observable
ojs
ojs
ojs
ojs
ojs
Author
Guillaume Levrier
@guillaume-levrier
Political Scientist working on the challenges raised by biotechnology. Creator of PANDORÆ.
Comments (2)
Fil
Aug 28, 2020
It groups by "equality" and two JS Date objects are never equal
https://stackoverflow.com/questions/7244513/javascript-date-comparisons-dont-equal
use d3.group(dataTime, d => +d.date) instead see
https://observablehq.com/@d3/d3-group#key_equality
Guillaume Levrier
Aug 28, 2020
Cool thanks!
Reply
Add comment
Subscribe to notifications
© 2026 Observable, Inc.
Terms of service
Privacy policy
Product
About
Pricing
Documentation
Release notes
Contact us
Open source
Notebook Kit
Plot
D3
Community
Explore
Forum
Bluesky
YouTube
X
0
Follow
Follow
D3 group doesn't group by date | Guillaume Levrier | Observable