Skip to content

Commit

Permalink
feat: support SunburstChart
Browse files Browse the repository at this point in the history
  • Loading branch information
kagawagao committed Feb 28, 2020
1 parent d00b481 commit 805aa45
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 35 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ Extra Props:
- [x] [`AVAChart`](https://github.com/antvis/AVA)
- [x] [`BulletChart`](https://g2plot.antv.vision/zh/examples/bullet/basic)
- [x] [`TreemapChart`](https://g2plot.antv.vision/zh/examples/treemap/rect)
- [x] `SunburstChart`

## Develop

Expand Down
3 changes: 3 additions & 0 deletions __tests__/plots/__snapshots__/sunburst.spec.tsx.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`SunburstChart should render without crashed 1`] = `<div />`;
11 changes: 11 additions & 0 deletions __tests__/plots/sunburst.spec.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import React from 'react'
import { create } from 'react-test-renderer'
import SunburstChart from '../../src/plots/sunburst'

describe('SunburstChart', () => {
test('should render without crashed', () => {
const renderer = create(<SunburstChart data={[]} colorField="x" />)

expect(renderer.toJSON()).toMatchSnapshot()
})
})
51 changes: 17 additions & 34 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
"dependencies": {
"@antv/chart-advisor": "0.0.2-alpha.17",
"@antv/g": "^3.5.0-beta.3",
"@antv/g2plot": "^0.11.32"
"@antv/g2plot": "^0.11.33"
},
"husky": {
"hooks": {
Expand Down
11 changes: 11 additions & 0 deletions src/plots/sunburst.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import React, { FC } from 'react'
import { Sunburst, SunburstConfig } from '@antv/g2plot'
import BaseChart, { BaseChartProps } from './base'

export type SunburstChartProps = Omit<BaseChartProps, 'chart'> & SunburstConfig

const SunburstChart: FC<SunburstChartProps> = props => {
return <BaseChart chart={Sunburst} {...props} />
}

export default SunburstChart

0 comments on commit 805aa45

Please sign in to comment.