0.1.6 • Published 7 years ago

react-sunburst-d3-v4 v0.1.6

Weekly downloads
77
License
MIT
Repository
github
Last release
7 years ago

react-zoomable-sunburst-d3-v4

Sunburst component built with React. It is build upon D3 V4 and CRA

Installation

npm i react-sunburst-d3-v4

Demo

Watch the video

Example

import Sunburst from 'react-sunburst-d3-v4';

class App extends Component {
  onSelect(event){
    console.log(event);
  }
  render() {
    return (
      <div className="App">
        <Sunburst
          data={data}
          onSelect={this.onSelect}
          scale="linear"
          tooltipContent={ <div class="sunburstTooltip" style="position:absolute; color:'black'; z-index:10; background: #e2e2e2; padding: 5px; text-align: center;" /> }
          tooltip
          tooltipPosition="right"
          keyId="anagraph"
          width="480"
          height="400"
        />
      </div>
    );
  }
}
PropertyTypeDescriptionWorking
dataArrayTypically same for every Sunburst ChartYes
scaleStringOptions: linear / exponential - Linear renders each arc with same radii, Exponential reduces gradually by SquareRootYes
tooltipboolDisplay Tooltip or notYes
tooltipContentHTMLNodeCustomized Node for Tooltip renderingYes
keyIdstringUnique Id for Chart SVGYes
widthIntegerWidth of the Chart ContainerYes
heightIntegerHeight of the Chart ContainerYes

Methods

  • onSelect() - Function - Called on Arc Click for re-rendering the chart and passing back to User as props

TODO: 1. Add Label Content & Customized Label Content

Check out the Example folder for Customized Usage

0.1.6

7 years ago

0.1.5

7 years ago

0.1.4

7 years ago

0.1.3

7 years ago

0.1.2

7 years ago

0.1.1

7 years ago

0.1.0

7 years ago