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

How to make sunburst reflect render deep reqursive struncture? #2493

Closed
R31N3 opened this issue Apr 8, 2021 · 1 comment
Closed

How to make sunburst reflect render deep reqursive struncture? #2493

R31N3 opened this issue Apr 8, 2021 · 1 comment
Assignees
Labels
feature 特性需求

Comments

@R31N3
Copy link

R31N3 commented Apr 8, 2021

  • G2Plot Version: v2
  • Platform: Linux

How to render sunburst reflect with deep structures with many parent-child links?
image

I found out that hierarchyConfig may help my and found examples in D3-Hierarchy references, like what I actually want.
There's the Link:
https://observablehq.com/@d3/zoomable-sunburst?collection=@d3/d3-hierarchy
https://observablehq.com/@d3/sunburst?collection=@d3/d3-hierarchy (zoomable feature is not necessary)

Here's the Input Data Example:
https://gist.github.com/R31N3/ec46aeb62f94bf23e1a43ddc6e31639e
https://gist.githubusercontent.com/R31N3/ec46aeb62f94bf23e1a43ddc6e31639e/raw/b620ce9de8bef3e02445b08eff7eb11fc163ae6c/test.json

@visiky visiky assigned visiky and unassigned lxfu1 May 15, 2021
@visiky visiky added the feature 特性需求 label May 15, 2021
@visiky
Copy link
Member

visiky commented Jun 13, 2021

Try this example: http://g2plot.antv.vision/en/examples/more-plots/sunburst#basic

import { Sunburst } from '@antv/g2plot';

fetch('https://gw.alipayobjects.com/os/antfincdn/XfLX8sX9z%26/sunburst.json')
  .then((data) => data.json())
  .then((data) => {
    const plot = new Sunburst('container', {
      data: { children: data },
      innerRadius: 0.3,
      interactions: [{ type: 'element-active' }],
    });
    plot.render();
  });

💡 Make sure the value of the parent node (which has children nodes), to be undefined.

😊 And we'll add a new configuration ignoreParentValue in the next version. #2637

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature 特性需求
Projects
None yet
Development

No branches or pull requests

3 participants