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

Wrap rather than mutate input data? #13

Closed
mbostock opened this issue Nov 3, 2015 · 3 comments
Closed

Wrap rather than mutate input data? #13

mbostock opened this issue Nov 3, 2015 · 3 comments

Comments

@mbostock
Copy link
Member

mbostock commented Nov 3, 2015

Related d3/d3#1145 d3/d3#1929.

Also this was my “#1” regret on my AMA.

@mbostock mbostock changed the title Layouts should wrap rather than mutating input data? Wrap rather than mutate input data? Nov 3, 2015
@mbostock mbostock mentioned this issue Nov 3, 2015
16 tasks
@idibidiart
Copy link

@mbostock

Could you make use ImmutableJS or another implementation of persistent data structure so that we may leverage the efficiencies of structural sharing?

I went down the HTML5 Structured Cloning approach and it works well with D3 EXCEPT it is really slow to clone in general.

Persistent Data Structures like those implemented by ImmutableJS are extremely memory efficient and immutable by design. It also allows for rendering optimization with React due to mutation creating a a new reference identity and being able to use reference equality to determine if two deep tree structures are equal without comparing the actual tree data. Given React is being used more and more in general UI development, it may make a lot of sense to use ImmutableJS.

@leeb (on twitter) is the maintainer of that library.

Cheers

Marc

@idibidiart
Copy link

If not using ImmutableJS then maybe D3 will have its own implementation of HAMT...? I trust your choice will focus on performance...

http://blog.mattbierner.com/hash-array-mapped-tries-in-javascript/

@mbostock
Copy link
Member Author

Fixed in #14.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants