Skip to content

Instantly share code, notes, and snippets.

@nautilytics
Last active January 2, 2020 15:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nautilytics/406d6628033b26e552e3fb3a7ed3fb66 to your computer and use it in GitHub Desktop.
Save nautilytics/406d6628033b26e552e3fb3a7ed3fb66 to your computer and use it in GitHub Desktop.
Comparing transitions in D3, React, and Angular
// D3
d3.selectAll(‘.marker’)
.data(data, d => d.id)
.enter();
// Angular
<g app-marker *ngFor="let item of data; trackBy: trackByPoint"></g>
trackByPoint(item) {
return item.id;
};
// React
data.map(item => {
return (
<Marker key={`marker-for-${item.id}`} item={item}/>
)
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment