File tree Expand file tree Collapse file tree 5 files changed +42
-0
lines changed Expand file tree Collapse file tree 5 files changed +42
-0
lines changed Original file line number Diff line number Diff line change 1+ // Jest Snapshot v1, https://goo.gl/fbAQLP
2+
3+ exports [` VennChart should render without crashed 1` ] = ` <div />` ;
Original file line number Diff line number Diff line change 1+ import React from 'react'
2+ import { create } from 'react-test-renderer'
3+ import VennChart from '../../src/plots/venn'
4+
5+ describe ( 'VennChart' , ( ) => {
6+ test ( 'should render without crashed' , ( ) => {
7+ const renderer = create ( < VennChart data = { [ ] } /> )
8+
9+ expect ( renderer . toJSON ( ) ) . toMatchSnapshot ( )
10+ } )
11+ } )
Original file line number Diff line number Diff line change 1+ # VennChart
2+
3+ ## Usage
4+
5+ ``` tsx | pure
6+ import { VennChart } from ' @opd/g2plot-react'
7+ ```
8+
9+ <API src =" ../../src/plots/venn/index.tsx " />
Original file line number Diff line number Diff line change @@ -52,6 +52,8 @@ import { FacetChartProps as _FacetChartProps } from './plots/facet'
5252
5353import { CirclePackingChartProps as _CirclePackingChartProps } from './plots/circle-packing'
5454
55+ import { VennChartProps as _VennChartProps } from './plots/venn'
56+
5557export { default as BaseChart } from './components/base'
5658export type BaseChartProps < T = any > = _BaseChartProps < T >
5759
@@ -160,3 +162,6 @@ export type FacetChartProps = _FacetChartProps
160162
161163export { default as CirclePackingChart } from './plots/circle-packing'
162164export type CirclePackingChartProps = _CirclePackingChartProps
165+
166+ export { default as VennChart } from './plots/venn'
167+ export type VennChartProps = _VennChartProps
Original file line number Diff line number Diff line change 1+ import React , { forwardRef } from 'react'
2+ import { Venn , VennOptions } from '@antv/g2plot'
3+ import BaseChart , { BaseChartProps } from '../../components/base'
4+
5+ export type VennChartProps = Omit < BaseChartProps < VennOptions > , 'chart' > &
6+ VennOptions
7+
8+ const VennChart = forwardRef < HTMLDivElement | null , VennChartProps > (
9+ ( props , ref ) => {
10+ return < BaseChart chart = { Venn } ref = { ref } { ...props } />
11+ }
12+ )
13+
14+ export default VennChart
You can’t perform that action at this time.
0 commit comments