Skip to content

Commit 61b12cf

Browse files
committed
feat: use jsx-runtime
1 parent 248f18b commit 61b12cf

File tree

38 files changed

+56
-47
lines changed

38 files changed

+56
-47
lines changed

babel.config.js

+10-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,13 @@
11
module.exports = {
2-
presets: ['@opd/babel-preset-component'],
2+
presets: [
3+
'@opd/babel-preset-component',
4+
require.resolve('@babel/preset-typescript'),
5+
[
6+
require.resolve('@babel/preset-react'),
7+
{
8+
runtime: 'automatic',
9+
},
10+
],
11+
],
312
ignore: ['src/.umi/**/*.ts'],
413
}

src/components/base/index.tsx

+10-10
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
1-
import React, {
2-
HTMLAttributes,
1+
import { Plot as BasePlot } from '@antv/g2plot'
2+
import cloneDeep from 'lodash/cloneDeep'
3+
import isEmpty from 'lodash/isEmpty'
4+
import isEqual from 'lodash/isEqual'
5+
import {
36
forwardRef,
4-
useRef,
5-
useEffect,
6-
Ref,
7+
HTMLAttributes,
78
MutableRefObject,
89
ReactElement,
10+
Ref,
911
RefAttributes,
10-
useImperativeHandle,
1112
RefCallback,
13+
useEffect,
14+
useImperativeHandle,
15+
useRef,
1216
} from 'react'
13-
import isEqual from 'lodash/isEqual'
14-
import isEmpty from 'lodash/isEmpty'
15-
import cloneDeep from 'lodash/cloneDeep'
16-
import { Plot as BasePlot } from '@antv/g2plot'
1717

1818
interface Options {
1919
[x: string]: any

src/plots/area/index.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import React, { forwardRef } from 'react'
21
import { Area, AreaOptions } from '@antv/g2plot'
2+
import { forwardRef } from 'react'
33
import BaseChart, { BaseChartProps } from '../../components/base'
44

55
export type AreaChartProps = Omit<

src/plots/bar/index.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import React, { forwardRef } from 'react'
21
import { Bar, BarOptions } from '@antv/g2plot'
2+
import { forwardRef } from 'react'
33
import BaseChart, { BaseChartProps } from '../../components/base'
44

55
export type BarChartProps = Omit<BaseChartProps<BarOptions>, 'chart' | 'data'> &

src/plots/bidirectional-bar/index.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import React, { forwardRef } from 'react'
21
import { BidirectionalBar, BidirectionalBarOptions } from '@antv/g2plot'
2+
import { forwardRef } from 'react'
33
import BaseChart, { BaseChartProps } from '../../components/base'
44

55
export type BidirectionalBarChartProps = Omit<

src/plots/box/index.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import React, { forwardRef } from 'react'
21
import { Box, BoxOptions } from '@antv/g2plot'
2+
import { forwardRef } from 'react'
33
import BaseChart, { BaseChartProps } from '../../components/base'
44

55
export type BoxChartProps = Omit<BaseChartProps<BoxOptions>, 'chart' | 'data'> &

src/plots/bullet/index.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import React, { forwardRef } from 'react'
21
import { Bullet, BulletOptions } from '@antv/g2plot'
2+
import { forwardRef } from 'react'
33
import BaseChart, { BaseChartProps } from '../../components/base'
44

55
export type BulletChartProps = Omit<

src/plots/chord/index.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import React, { forwardRef } from 'react'
21
import { Chord, ChordOptions } from '@antv/g2plot'
2+
import { forwardRef } from 'react'
33
import BaseChart, { BaseChartProps } from '../../components/base'
44

55
export type ChordChartProps = Omit<

src/plots/circle-packing/index.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import React, { forwardRef } from 'react'
21
import { CirclePacking, CirclePackingOptions } from '@antv/g2plot'
2+
import { forwardRef } from 'react'
33
import BaseChart, { BaseChartProps } from '../../components/base'
44

55
export type CirclePackingChartProps = Omit<

src/plots/column/index.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import React, { forwardRef } from 'react'
21
import { Column, ColumnOptions } from '@antv/g2plot'
2+
import { forwardRef } from 'react'
33
import BaseChart, { BaseChartProps } from '../../components/base'
44

55
export type ColumnChartProps = Omit<

src/plots/dual-axes/index.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import React, { forwardRef } from 'react'
21
import { DualAxes, DualAxesOptions } from '@antv/g2plot'
2+
import { forwardRef } from 'react'
33
import BaseChart, { BaseChartProps } from '../../components/base'
44

55
export type DualAxesChartProps = Omit<

src/plots/facet/index.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import React, { forwardRef } from 'react'
21
import { Facet, FacetOptions } from '@antv/g2plot'
2+
import { forwardRef } from 'react'
33
import BaseChart, { BaseChartProps } from '../../components/base'
44

55
export type FacetChartProps = Omit<

src/plots/funnel/index.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import React, { forwardRef } from 'react'
21
import { Funnel, FunnelOptions } from '@antv/g2plot'
2+
import { forwardRef } from 'react'
33
import BaseChart, { BaseChartProps } from '../../components/base'
44

55
export type FunnelChartProps = Omit<

src/plots/gauge/index.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import React, { forwardRef } from 'react'
21
import { Gauge, GaugeOptions } from '@antv/g2plot'
2+
import { forwardRef } from 'react'
33
import BaseChart, { BaseChartProps } from '../../components/base'
44

55
export type GaugeChartProps = Omit<

src/plots/heatmap/index.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import React, { forwardRef } from 'react'
21
import { Heatmap, HeatmapOptions } from '@antv/g2plot'
2+
import { forwardRef } from 'react'
33
import BaseChart, { BaseChartProps } from '../../components/base'
44

55
export type HeatmapChartProps = Omit<

src/plots/histogram/index.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import React, { forwardRef } from 'react'
21
import { Histogram, HistogramOptions } from '@antv/g2plot'
2+
import { forwardRef } from 'react'
33
import BaseChart, { BaseChartProps } from '../../components/base'
44

55
export type HistogramChartProps = Omit<

src/plots/line/index.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import React, { forwardRef } from 'react'
21
import { Line, LineOptions } from '@antv/g2plot'
2+
import { forwardRef } from 'react'
33
import BaseChart, { BaseChartProps } from '../../components/base'
44

55
export type LineChartProps = Omit<

src/plots/liquid/index.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import React, { forwardRef } from 'react'
21
import { Liquid, LiquidOptions } from '@antv/g2plot'
2+
import { forwardRef } from 'react'
33
import BaseChart, { BaseChartProps } from '../../components/base'
44

55
export type LiquidChartProps = Omit<

src/plots/mix/index.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import React, { forwardRef } from 'react'
21
import { Mix, MixOptions } from '@antv/g2plot'
2+
import { forwardRef } from 'react'
33
import BaseChart, { BaseChartProps } from '../../components/base'
44

55
export type MixChartProps = Omit<BaseChartProps<MixOptions>, 'chart' | 'data'> &

src/plots/multi-view/index.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import React, { forwardRef } from 'react'
21
import { Mix, MixOptions } from '@antv/g2plot'
2+
import { forwardRef } from 'react'
33
import BaseChart, { BaseChartProps } from '../../components/base'
44

55
export type MultiViewChartProps = Omit<

src/plots/pie/index.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import React, { forwardRef } from 'react'
21
import { Pie, PieOptions } from '@antv/g2plot'
2+
import { forwardRef } from 'react'
33
import BaseChart, { BaseChartProps } from '../../components/base'
44

55
export type PieChartProps = Omit<BaseChartProps<PieOptions>, 'chart' | 'data'> &

src/plots/progress/index.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import React, { forwardRef } from 'react'
21
import { Progress, ProgressOptions } from '@antv/g2plot'
2+
import { forwardRef } from 'react'
33
import BaseChart, { BaseChartProps } from '../../components/base'
44

55
export type ProgressChartProps = Omit<

src/plots/radar/index.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import React, { forwardRef } from 'react'
21
import { Radar, RadarOptions } from '@antv/g2plot'
2+
import { forwardRef } from 'react'
33
import BaseChart, { BaseChartProps } from '../../components/base'
44

55
export type RadarChartProps = Omit<

src/plots/radial-bar/index.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import React, { forwardRef } from 'react'
21
import { RadialBar, RadialBarOptions } from '@antv/g2plot'
2+
import { forwardRef } from 'react'
33
import BaseChart, { BaseChartProps } from '../../components/base'
44

55
export type RadialBarChartProps = Omit<

src/plots/ring-progress/index.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import React, { forwardRef } from 'react'
21
import { RingProgress, RingProgressOptions } from '@antv/g2plot'
2+
import { forwardRef } from 'react'
33
import BaseChart, { BaseChartProps } from '../../components/base'
44

55
export type RingProgressChartProps = Omit<

src/plots/rose/index.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import React, { forwardRef } from 'react'
21
import { Rose, RoseOptions } from '@antv/g2plot'
2+
import { forwardRef } from 'react'
33
import BaseChart, { BaseChartProps } from '../../components/base'
44

55
export type RoseChartProps = Omit<

src/plots/sankey/index.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import React, { forwardRef } from 'react'
21
import { Sankey, SankeyOptions } from '@antv/g2plot'
2+
import { forwardRef } from 'react'
33
import BaseChart, { BaseChartProps } from '../../components/base'
44

55
export type SankeyChartProps = Omit<

src/plots/scatter/index.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import React, { forwardRef } from 'react'
21
import { Scatter, ScatterOptions } from '@antv/g2plot'
2+
import { forwardRef } from 'react'
33
import BaseChart, { BaseChartProps } from '../../components/base'
44

55
export type ScatterChartProps = Omit<

src/plots/stock/index.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import React, { forwardRef } from 'react'
21
import { Stock, StockOptions } from '@antv/g2plot'
2+
import { forwardRef } from 'react'
33
import BaseChart, { BaseChartProps } from '../../components/base'
44

55
export type StockChartProps = Omit<

src/plots/sunburst/index.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import React, { forwardRef } from 'react'
21
import { Sunburst, SunburstOptions } from '@antv/g2plot'
2+
import { forwardRef } from 'react'
33
import BaseChart, { BaseChartProps } from '../../components/base'
44

55
export type SunburstChartProps = Omit<

src/plots/tiny-area/index.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import React, { forwardRef } from 'react'
21
import { TinyArea, TinyAreaOptions } from '@antv/g2plot'
2+
import { forwardRef } from 'react'
33
import BaseChart, { BaseChartProps } from '../../components/base'
44

55
export type TinyAreaChartProps = Omit<

src/plots/tiny-column/index.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import React, { forwardRef } from 'react'
21
import { TinyColumn, TinyColumnOptions } from '@antv/g2plot'
2+
import { forwardRef } from 'react'
33
import BaseChart, { BaseChartProps } from '../../components/base'
44

55
export type TinyColumnChartProps = Omit<

src/plots/tiny-line/index.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import React, { forwardRef } from 'react'
21
import { TinyLine, TinyLineOptions } from '@antv/g2plot'
2+
import { forwardRef } from 'react'
33
import BaseChart, { BaseChartProps } from '../../components/base'
44

55
export type TinyLineChartProps = Omit<

src/plots/treemap/index.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import React, { forwardRef } from 'react'
21
import { Treemap, TreemapOptions } from '@antv/g2plot'
2+
import { forwardRef } from 'react'
33
import BaseChart, { BaseChartProps } from '../../components/base'
44

55
export type TreemapChartProps = Omit<

src/plots/venn/index.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import React, { forwardRef } from 'react'
21
import { Venn, VennOptions } from '@antv/g2plot'
2+
import { forwardRef } from 'react'
33
import BaseChart, { BaseChartProps } from '../../components/base'
44

55
export type VennChartProps = Omit<BaseChartProps<VennOptions>, 'chart'> &

src/plots/violin/index.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import React, { forwardRef } from 'react'
21
import { Violin, ViolinOptions } from '@antv/g2plot'
2+
import { forwardRef } from 'react'
33
import BaseChart, { BaseChartProps } from '../../components/base'
44

55
export type ViolinChartProps = Omit<

src/plots/waterfall/index.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import React, { forwardRef } from 'react'
21
import { Waterfall, WaterfallOptions } from '@antv/g2plot'
2+
import { forwardRef } from 'react'
33
import BaseChart, { BaseChartProps } from '../../components/base'
44

55
export type WaterfallChartProps = Omit<

src/plots/word-cloud/index.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import React, { forwardRef } from 'react'
21
import { WordCloud, WordCloudOptions } from '@antv/g2plot'
2+
import { forwardRef } from 'react'
33
import BaseChart, { BaseChartProps } from '../../components/base'
44

55
export type WordCloudChartProps = Omit<

0 commit comments

Comments
 (0)