GithubHelp home page GithubHelp logo

Comments (6)

kevinwarne avatar kevinwarne commented on September 17, 2024

Hey,

There are some current capabilities with d2b to add sunburst labels and disable click zooming. Here is a fiddle that uses that functionality. https://jsfiddle.net/3cyeddyp/

Right now the annotations are limited to the axis chart components (e.g. bar, line, area, scatter, ..). I would like to add built in annotation hooks to the other charts, but I'm still considering how this should be done. The main issue is that the annotations are rendered in SVG, so a large chart padding would need to be added around the sunburst to allow room for the annotations. This might make it a bit unusable for mobile devices, so an extra configuration would need to be added to disable annotations and padding given some mobile threshold.

This is definitely something I'd like to add in the near future though so stay tuned. Thanks for checking out d2b 👍.

from d2b.

Seraf avatar Seraf commented on September 17, 2024

Ohh, that's awesome, thanks for the quick answer ! I agree, the annotations may lead to weird behavior on mobile/small screens.
But without the annotations, the label are really hard to read IMHO. Let me know if you need some tests/ideas ;-)

Also, I have another question : is it possible to not have the root displayed ? I mean not having a root node displayed, but directly few nodes on the same level ?

from d2b.

Seraf avatar Seraf commented on September 17, 2024

About the label/zoom, I already tried to modify these config, but I didn't succeed.
I'm using the vue integration, and set this in my data

chartConfig: function (chart) {
        chart.show_labels(true),
        chart.zoomable(false)
      },

But it looks like I'm not able to access these attributes (if I set them with chart.zoomable = false I haven't errors, but it doesn't work)

from d2b.

kevinwarne avatar kevinwarne commented on September 17, 2024

Ah, you are using Vue. Here is the updated fiddle with Vue integration: https://jsfiddle.net/3cyeddyp/3/

There is extra configuration in there for doing other things with the sunburst (like hiding the root node, and eliminating the donut). Go ahead and play around with it to see what you need.

The main thing with your snippet is that you need to access chart.sunburst() which returns the internal d2b.svgSunburst rather than d2b.chartSunburst. This has the showLabels and zoomable configurations.

chartConfig: function (chart) {
  chart.sunburst()
    .showLabels(true),
    .zoomable(false)
},

from d2b.

kevinwarne avatar kevinwarne commented on September 17, 2024

One other thing, if you are looking to hide the breadcrumbs there is configuration for that in this fiddle: https://jsfiddle.net/3cyeddyp/4/

from d2b.

Seraf avatar Seraf commented on September 17, 2024

Thanks a lot for your quick and detailed answers ! :)

from d2b.

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.