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

Split treemaps? #71

Closed
mbostock opened this issue Dec 7, 2016 · 7 comments
Closed

Split treemaps? #71

mbostock opened this issue Dec 7, 2016 · 7 comments

Comments

@mbostock
Copy link
Member

mbostock commented Dec 7, 2016

As described in “Ordered and Unordered Treemap Algorithms and Their Applications on Handheld Devices” by Engdahl.

timelyportfolio added a commit to timelyportfolio/d3-hierarchy that referenced this issue Dec 9, 2016
@timelyportfolio
Copy link

timelyportfolio commented Dec 9, 2016

inspired by @thomasp85 ggforce implementation and the original paper, I have assembled an ugly mix of code from these two sources and other d3 treemap code https://github.com/timelyportfolio/d3-hierarchy/tree/feature/split-treemap. Before I submit pull with proper tests, I wanted to first make sure that this (with much revision of course) would be welcome.

@mbostock I forked your d3 source treemap (thanks so much for this!) and applied the new split algorithm http://bl.ocks.org/timelyportfolio/e480359ea953d96a38a4466187d3d62b.

d3_treemap_split

In just a little bit, I will also apply the d3v4 treemap with tile input to more closely inspect differences.

@mbostock
Copy link
Member Author

mbostock commented Dec 9, 2016

Fantastic! Implementation looks relatively straightforward which is always nice! Thank you for doing this and I look forward to the PR.

@timelyportfolio
Copy link

Just converted this to add treemapSplit http://bl.ocks.org/timelyportfolio/2bbd4cedf597eae6a5e90412d9df1c1f. (Had no idea d3.hierarchy had changed so much since this early iteration). I absolutely love all the convenience functions added in d3.hierarchy.

@timelyportfolio
Copy link

timelyportfolio commented Dec 12, 2016

started and it seems to work correctly on smaller test networks and the d3 source example with much better speed, but now on my test on a larger network I get

Uncaught RangeError: Maximum call stack size exceeded(…)

I'll research and debug (probably completely rewrite).

@timelyportfolio
Copy link

timelyportfolio commented Mar 2, 2017

Certainly no rush, but is this something you would like me to continue to push forward? Thanks for everything, and please, please, please let me know if ever in any strange little way whatsoever I can help you in any way.

mbostock added a commit that referenced this issue Mar 2, 2017
We were doing binary search, but we weren’t checking whether the previous pivot
is closer to the target value than the following pivot. Related #71.
mbostock added a commit that referenced this issue Mar 2, 2017
With a square layout, this tends to form an initial row across the top rather
than a column along the left. Related #71.
@mbostock
Copy link
Member Author

mbostock commented Mar 2, 2017

Turns out—with a bug fix and a small improvement—these are the same thing as binary treemaps which were implemented in d3-hierarchy@1.0 (d3@4.0)!

@timelyportfolio
Copy link

👍 good learning experience. Thanks!

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