david-desmaisons / vue.d3.sunburst Goto Github PK
View Code? Open in Web Editor NEWVue sunburst component based on D3.js
Home Page: https://david-desmaisons.github.io/Vue.D3.sunburst/
License: MIT License
Vue sunburst component based on D3.js
Home Page: https://david-desmaisons.github.io/Vue.D3.sunburst/
License: MIT License
As might be seen in the attached image I'm experiencing some scaling issues with your component.
I have tried to fix the issue with various css rules, but this has no effect on the size of the diagram only the element containing it.
How to I modify the width of the individual elements of the breadcrum and how do I scale up the diagram?
Hi,
Thanks for writing this very useful library.
I've noticed that in the plots I generate that the labels are often so long that they overlap each other on consecutive levels e.g.
I couldn't find it in the API, is there a way to rotate the labels 90 degrees? For instance, like in this krona diagram
If this is not part of the API, and you don't have time to implement that, I'm curious what strategy you would take to modify the code to enable that functionality? Specifically, is there a function that could be exposed?
Also how can we zoom out once a segment has been clicked? I couldn't work out how to do this on the example page.
And one small fix - I think the <sunburst :data="data">
in the Usage section should be <sunburst :data="tree">
.
Thanks in advance, ben
First off: Thanks for making this, using it has been a really smooth experience!
Setting any color scheme other than the default seems to mess up the coloring.
I first noticed it in the demo, works fine until you switch to any other scheme. Here's a screenshot:
I replicated it in the thing I'm building as well, would be nice to have it working (I might hunt it down myself, but don't hold your breath).
First of all, thank you for this great chart. I really appreciate your work!
Recently I encountered a small problem:
when a dataLabel is exactly 180 degrees, the dx is 5 and the dataLabel falls into the middle of the chart.
Probably this will fix the problem (textAngle < 180
instead of textAngle <= 180
):
function getDx({ textAngle, currentDx }) { if (textAngle < 180) { return 5; } return !!currentDx && currentDx < -5 ? currentDx : -5; }
What do you think?
Every time a section is zoomed in, all their children increase in area. Therefore, their angles also become bigger. Nevertheless, the "Minimal arc angle" information doesn't seem to be recomputed, as subsequent children, which became bigger than it, should be displayed and are not.
Hey, first, thanks for that wrapper!
I have currently an issue where due to items that can have multiple categories, the total count gets calculated wrongly. Not a big issue as I have the correct number, but at the moment, they get ignored, even as they are there. Is there a way to overwrite the calculated numbers by the real ones?
Hi there, great component! Is it possible to set the width of the breadcrumbs to accomodate longer text?
the component looks great, but I'm having a bit of trouble getting started. Not specific to your sunburst code, but just how to use this external component in a vue project, hope you don't mind me asking here.
I have added the component to package.json in client side of my app.
but i get this module not found
error
ERROR in ./src/pages/TreePage.vue?vue&type=script&lang=js& (./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./src/pages/TreePage.vue?vue&type=script&lang=js&)
Module not found: Error: Can't resolve 'vue-d3-sunburst' in '/Users/dc/dev/rikai/nap/web-app/client/src/pages'
@ ./src/pages/TreePage.vue?vue&type=script&lang=js& (./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./src/pages/TreePage.vue?vue&type=script&lang=js&) 53:0-110 57:21-36 58:22-38 59:23-40 60:14-22 61:17-28
I'm using a build script and babel to transofrm
Is there some other webpack or other configuration that I need to setup?
Hi, I set up a simple example on CodeSandbox.
The problem is that after zooming in a certain slice and reassigning the data the chart sometimes disappears completely:
But what's interesting is that not all slices will cause the bug:
Does anyone have any idea what might be the cause? I'm also trying to fix the issue myself, but unfortunately I'm quite new to the code in this repository.
Is there any plans to add support to the new version of Vue? It gives a few minors errors when trying to use it with the new version and the component does not compile. Such as:
vue-d3-sunburst.umd.js?6987:13880 Uncaught (in promise) TypeError: Cannot read properties of null (reading 'defaultSchemeColor')
Because of this prop:
colorScheme: { type: String, required: false, default: function _default() { return this.defaultSchemeColor; }, validator: function validator(value) { return Object.keys(colorSchemes).indexOf(value) !== -1; } }
I'm building ActivityWatch and we're using this lib for our sunburst visualization of time spent per category. (again, thanks!)
We've implemented the hover feature to show information about the represented data, but it's hard to get an overview at a glance, which makes me want to implement labeling of the arcs similar to what I've had in some of my Python visualizations:
I'm not super skilled at D3, but I'm just posting it here in case it piques someone's attention/interest, and to keep myself accountable in case I drop the ball.
Something akin to this: http://bl.ocks.org/metmajer/5480307
I found this for creating rounded text (might not be the best way to go, but still): https://www.visualcinnamon.com/2015/09/placing-text-on-arcs.html
Is it possible to use get-category-for-color
to apply a colour to each node that is passed in through the data object and if yes, how? For example when the data object looks like this:
data: {
name: 'base',
children: [
{
name: 'Fruity',
color: '#da1f24',
children: [
{
name: 'Berry',
color: '#de4b52',
children: [
{
name: 'Raspberry',
color: '#e52a68',
size: 1,
},
{
name: 'Blueberry',
color: '#6469af',
size: 1,
},
]
},
{
name: 'Dried fruit',
color: '#ca4a44',
children: [
{
name: 'Raisin',
color: '#b43b54',
size: 1,
},
]
},
{
name: 'Citrus fruit',
color: '#f7a129',
children: [
{
name: 'Grapefruit',
color: '#f26354',
size: 1,
},
{
name: 'Orange',
color: '#e1641f',
size: 1,
},
{
name: 'Lemon',
color: '#fde404',
size: 1,
},
]
},
]
},
{
name: 'Sour/Fermented',
color: '#ebb20f',
children: [
{
name: 'Sour',
color: '#e1c217',
children: [
{
name: 'Alcohol/Fermented',
color: '#9fa81a',
size: 1,
},
{
name: 'Citric acid',
color: '#f9ee01',
size: 1,
},
]
},
{
name: 'Alcohol/Fermented',
color: '#b09832',
children: [
{
name: 'Winey',
color: '#8f1a52',
size: 1,
},
{
name: 'Whiskey',
color: '#b34038',
size: 1,
},
]
}
]
},
]
},
Is there a way to pass down the same colour from parent data to children data so that children data is organised into colour blocks that relate directly to their parent?
This is possible with the D3 Zoomable Sunburst, as seen in this example:
Also, is it possible to create customised colour schemes? Thanks!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.