Closed lcahlander closed 6 years ago
I went ahead and published d3-flextree-v4
for D3 v4 because I needed it: https://github.com/neptunjs/d3-flextree-v4 / https://www.npmjs.com/package/d3-flextree-v4
I would be happy to move it back here if wanted.
Sorry for the long delay, guys. I spent some time on this, this past weekend, and made some progress.
I'm working in branch v4-plugin
. I used @neptunjs's repo for a reference, but I found that it broke some of the tests. Right now it is not quite working, but I think it is pretty close.
P.S. I'm definitely going to change the API somewhat. The separation()
function is only in this for backwards compatibility with d3.tree, but it is really a poor fit.
Also, I really don't like how the layout function mutates the tree, and I think it would be better if it returned the "shadow tree" -- the wrapper nodes, instead. Each of those has a pointer to the node it wraps, of course, so I don't think the impact would be too bad. Any objections?
Have you made any progress? Can you share a copy with me? I am working on an XML/JSON Schema viewer and this is needed.
Do you have an example of adding a child node to a leaf?
I worked on it a bit more -- my work is in the v4-plugin
branch. I'm working on simplifying the API, and a simple example can be found at https://github.com/Klortho/d3-flextree/blob/v4-plugin/demo/simple.html
Any updates here? I would love to help. What is broken? I have tried, and I cannot get it to work. Is this expected?
Hello,
I am also curious about the current state and progress. Is the V4 version usable in any way ? What is broken ? How can I help ?
Sorry, guys. I've been swamped lately. I was working in branch d4-plugin
, and it's kind of a pulled-apart mess right now; in the middle of putting it back together, getting the tests working again, and the build working with rollup ... so it's hard to answer the question "what's broken".
I will work on it today, I promise. Regarding help ... if I can't get it done today, I'll at least itemize a to-do list, and comment back here.
Thanks so much, I understand completely. Please let us know if we can help in any way, but asking for help sometimes takes more time than doing, so feel free to do whatever is best. d3-flextree
is so incredibly helpful, and I don't think it has attracted nearly the attention it deserves.
Thanks for saying so -- it should be done today.
Sorry, it's taking longer than I thought; I am working on it. I'm going to quit making specific estimates and just say, "very soon".
@Klortho Thank you for implementing this. Any update on progress of upgrading it to v4?
I'll be the latest asking for a v4 update. If there are some outstanding items, just let me know and I can take a look and maybe get a PR in.
This is basically done. I'll be pushing up a draft version today. It would be great if any of you could check it out and give me suggestions on packaging build issues, mostly. One goal I had was to make it d3-independent, so I'm creating several different bundles.
I pushed up the v4-plugin branch. The documentation is lagging behind the code. I made some API changes -- in the original implementation, I was concerned with making flextree completely compatible with tree
, which made a lot of things more complicated than they needed to be. I hope I haven't simpified too drastically. E.g. some of the methods I did away with are separation()
, size()
, sort()
, and setNodeSizes()
.
npm run build
builds four umd bundles: non-minified and minified versions of both d3-dependent and d3-independent modules. I haven't figured out how packaging for npm will work. Suggestions welcome.
This, I hope, is done -- I just released version 2.0.0. I changed the API somewhat, but they are mostly additions, and it should be very compatible with the existing D3 hierarchy. I wrote a lot of tests to ensure that. I did remove separation()
and size()
-- they are more applicable to fixed-node sized trees.
Please give it a try, and let me know if you have any problems or suggestions.
Hello,
I am working on implementing the d3 v4 tree in polymer. https://github.com/powerxhub/emh-d3-tree.git
The tree.nodeSize() takes a fixed array and not a function. https://github.com/d3/d3-hierarchy/blob/master/README.md#tree_nodeSize This seems ripe for your implementation of the flextree.
Thank you, Loren