Giter VIP home page Giter VIP logo

Comments (13)

ignacio82 avatar ignacio82 commented on May 19, 2024

This case with 6 levels is more or less what I'm trying to do

1 School District -> 20 Schools -> 3 Grades -> many Teachers -> 4 Classroom -> many Students

This is what it looks like when you have so many levels

tree

from d3treer.

timelyportfolio avatar timelyportfolio commented on May 19, 2024

That definitely helps. The problem is the labelling. In this case, I think the Mike Bostock version works much better. I'm trying to think through I can provide access to both while minimizing function and parameter bloat. I'll try to work through it and will enjoy your input.

from d3treer.

timelyportfolio avatar timelyportfolio commented on May 19, 2024

@ignacio82 I spent a couple of hours implementing the example from Mike Bostock and the fork by Zan Armstrong. I think it will work much better with your example. Actually, thinking I might just go entirely with this version instead. Would you try it?

devtools::install_github("timelyportfolio/d3treeR@experiment/bostock")

Most everything on the R side should stay about the same.

Thanks.

from d3treer.

ignacio82 avatar ignacio82 commented on May 19, 2024

@timelyportfolio great step in the right direction. The one big thing missing are the colors. This is what I get:

tree

and this is what I get with googleVis:

untitled

Thanks!

from d3treer.

timelyportfolio avatar timelyportfolio commented on May 19, 2024

Are you using the treemap package? d3treeR is designed to leverage the multitude of color options provided within that package. Do the colors on hover/mouseover appear more correct?

image

If you are using the treemap package, can you get a treemap that looks like the one with googleVis? Within treemap, there is a nifty function called itreemap that might be helpful. However, the aggregates seem to not fit the scale as I would expect. I'll pose the question over on the treemap repo.

from d3treer.

ignacio82 avatar ignacio82 commented on May 19, 2024

I was able to get the colors like I want.Two more questions. Is it possible to add a legend for the color like in googleVis? is it possible to personalize what the tooltip is going to show?
Thanks

from d3treer.

timelyportfolio avatar timelyportfolio commented on May 19, 2024

Legends are very important, and I'm wondering how best to accomplish them, since treemap returns a range but not the full scale, so I'll need to recreate in d3.js. Guessing I'll try out the new d3-legend component from @susielu.

I do plan to have customizable tooltips also using one of the libraries such as d3-tip or kodama.

from d3treer.

timelyportfolio avatar timelyportfolio commented on May 19, 2024

also, see mtennekes/treemap#18

from d3treer.

ignacio82 avatar ignacio82 commented on May 19, 2024

Thanks for the great work!

from d3treer.

timelyportfolio avatar timelyportfolio commented on May 19, 2024

Another option would be to rip the legend off from treemap with gridSVG. Almost thinking this will be the quickest way to get something up and going, but that will mean I will not have an immediate solution for JSON data.

from d3treer.

timelyportfolio avatar timelyportfolio commented on May 19, 2024

@ignacio82 see mtennekes/treemap#18 for a new fun.aggregate argument in treemap that should achieve the coloring you expect. Please let me know how it works.

thanks again for working through this with me.

from d3treer.

ignacio82 avatar ignacio82 commented on May 19, 2024

@timelyportfolio thanks! fun.aggregate solves the problem!

from d3treer.

timelyportfolio avatar timelyportfolio commented on May 19, 2024

I'll close this for now, since it is partially resolved. I think the other standalone issues will pick up the remaining pieces. Thanks so much @ignacio82.

from d3treer.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.