Skip to content

Commit 063d91b

Browse files
committed
fix: fix ts type error
1 parent 949f682 commit 063d91b

File tree

38 files changed

+84
-92
lines changed

38 files changed

+84
-92
lines changed

scripts/sync.js

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,7 @@ const eslint = new ESLint({
1616
fix: true,
1717
})
1818

19-
const g2PlotDir = path.resolve(
20-
process.cwd(),
21-
'node_modules/@antv/g2plot/src/plots'
22-
)
19+
const g2PlotDir = path.resolve(process.cwd(), 'node_modules/@antv/g2plot/src/plots')
2320
const plotDir = path.resolve(process.cwd(), 'src/plots')
2421
const testDir = path.resolve(process.cwd(), '__tests__/plots')
2522
const exportPath = path.resolve(process.cwd(), 'src/index.ts')
@@ -33,9 +30,7 @@ const newCharts = []
3330

3431
plotNames.forEach((chartName) => {
3532
try {
36-
if (
37-
!fs.existsSync(path.resolve(plotDir, `${kebabCase(chartName)}/index.tsx`))
38-
) {
33+
if (!fs.existsSync(path.resolve(plotDir, `${kebabCase(chartName)}/index.tsx`))) {
3934
newCharts.push(chartName)
4035
}
4136
} catch (error) {}
@@ -72,14 +67,14 @@ export type ${chart}ChartProps = Writeable<Omit<BaseChartProps<${chart}Options>,
7267
7368
const ${chart}Chart = defineComponent<${chart}ChartProps>({
7469
name: '${chart}Chart',
75-
setup(props, ctx) {
70+
setup: (props, ctx) => {
7671
return () => <BaseChart chart={${chart}} {...mergeAttrs(props, ctx.attrs)} />
7772
},
7873
})
7974
8075
/* istanbul ignore next */
8176
${chart}Chart.install = (app: App) => {
82-
app.component(${chart}Chart.name, ${chart}Chart)
77+
app.component('${chart}Chart', ${chart}Chart)
8378
}
8479
8580
export default ${chart}Chart
@@ -118,10 +113,7 @@ const addExport = async () => {
118113
exportFileContent += content
119114
})
120115

121-
const fixedContent = await lintAndFixFileContent(
122-
exportFileContent,
123-
exportPath
124-
)
116+
const fixedContent = await lintAndFixFileContent(exportFileContent, exportPath)
125117

126118
writeFile(exportPath, fixedContent, {
127119
encoding: 'utf8',

src/index.ts

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ import { PieChartProps as _PieChartProps } from './plots/pie'
1313
import { RadarChartProps as _RadarChartProps } from './plots/radar'
1414
import { RoseChartProps as _RoseChartProps } from './plots/rose'
1515
import { ScatterChartProps as _ScatterChartProps } from './plots/scatter'
16-
import { WordCloudChartProps as _WordCloudChartProps } from './plots/word-cloud'
1716
import { WaterfallChartProps as _WaterfallChartProps } from './plots/waterfall'
17+
import { WordCloudChartProps as _WordCloudChartProps } from './plots/word-cloud'
1818

1919
// mini plots
2020
import { ProgressChartProps as _ProgressChartProps } from './plots/progress'
@@ -95,9 +95,9 @@ export type RoseChartProps = _RoseChartProps
9595
export { default as ScatterChart } from './plots/scatter'
9696
export type ScatterChartProps = _ScatterChartProps
9797

98+
export { default as WaterfallChart } from './plots/waterfall'
9899
export { default as WordCloudChart } from './plots/word-cloud'
99100
export type WordCloudChartProps = _WordCloudChartProps
100-
export { default as WaterfallChart } from './plots/waterfall'
101101
export type WaterfallChartProps = _WaterfallChartProps
102102

103103
// mini plots
@@ -113,35 +113,35 @@ export type TinyAreaChartProps = _TinyAreaChartProps
113113
export { default as TinyColumnChart } from './plots/tiny-column'
114114
export type TinyColumnChartProps = _TinyColumnChartProps
115115

116+
export { default as BidirectionalBarChart } from './plots/bidirectional-bar'
117+
export { default as BoxChart } from './plots/box'
118+
export { default as ChordChart } from './plots/chord'
119+
export { default as CirclePackingChart } from './plots/circle-packing'
120+
export { default as DualAxesChart } from './plots/dual-axes'
121+
export { default as FacetChart } from './plots/facet'
122+
export { default as MixChart } from './plots/mix'
123+
export { default as MultiViewChart } from './plots/multi-view'
124+
export { default as RadialBarChart } from './plots/radial-bar'
125+
export { default as SankeyChart } from './plots/sankey'
126+
export { default as StockChart } from './plots/stock'
127+
export { default as SunburstChart } from './plots/sunburst'
116128
export { default as TinyLineChart } from './plots/tiny-line'
129+
export { default as TreemapChart } from './plots/treemap'
130+
export { default as VennChart } from './plots/venn'
131+
export { default as ViolinChart } from './plots/violin'
117132
export type TinyLineChartProps = _TinyLineChartProps
118-
export { default as DualAxesChart } from './plots/dual-axes'
119133
export type DualAxesChartProps = _DualAxesChartProps
120-
export { default as BoxChart } from './plots/box'
121134
export type BoxChartProps = _BoxChartProps
122-
export { default as StockChart } from './plots/stock'
123135
export type StockChartProps = _StockChartProps
124-
export { default as SunburstChart } from './plots/sunburst'
125136
export type SunburstChartProps = _SunburstChartProps
126-
export { default as RadialBarChart } from './plots/radial-bar'
127137
export type RadialBarChartProps = _RadialBarChartProps
128-
export { default as BidirectionalBarChart } from './plots/bidirectional-bar'
129138
export type BidirectionalBarChartProps = _BidirectionalBarChartProps
130-
export { default as TreemapChart } from './plots/treemap'
131139
export type TreemapChartProps = _TreemapChartProps
132-
export { default as SankeyChart } from './plots/sankey'
133140
export type SankeyChartProps = _SankeyChartProps
134-
export { default as ChordChart } from './plots/chord'
135141
export type ChordChartProps = _ChordChartProps
136-
export { default as MultiViewChart } from './plots/multi-view'
137142
export type MultiViewChartProps = _MultiViewChartProps
138-
export { default as MixChart } from './plots/mix'
139143
export type MixChartProps = _MixChartProps
140-
export { default as ViolinChart } from './plots/violin'
141144
export type ViolinChartProps = _ViolinChartProps
142-
export { default as FacetChart } from './plots/facet'
143145
export type FacetChartProps = _FacetChartProps
144-
export { default as CirclePackingChart } from './plots/circle-packing'
145146
export type CirclePackingChartProps = _CirclePackingChartProps
146-
export { default as VennChart } from './plots/venn'
147147
export type VennChartProps = _VennChartProps

src/plots/area/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const AreaChart = defineComponent<AreaChartProps>({
1515

1616
/* istanbul ignore next */
1717
AreaChart.install = (app: App) => {
18-
app.component(AreaChart.name, AreaChart)
18+
app.component('AreaChart', AreaChart)
1919
}
2020

2121
export default AreaChart

src/plots/bar/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const BarChart = defineComponent<BarChartProps>({
1515

1616
/* istanbul ignore next */
1717
BarChart.install = (app: App) => {
18-
app.component(BarChart.name, BarChart)
18+
app.component('BarChart', BarChart)
1919
}
2020

2121
export default BarChart

src/plots/bidirectional-bar/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ const BidirectionalBarChart = defineComponent<BidirectionalBarChartProps>({
1717

1818
/* istanbul ignore next */
1919
BidirectionalBarChart.install = (app: App) => {
20-
app.component(BidirectionalBarChart.name, BidirectionalBarChart)
20+
app.component('BidirectionalBarChart', BidirectionalBarChart)
2121
}
2222

2323
export default BidirectionalBarChart

src/plots/box/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const BoxChart = defineComponent<BoxChartProps>({
1515

1616
/* istanbul ignore next */
1717
BoxChart.install = (app: App) => {
18-
app.component(BoxChart.name, BoxChart)
18+
app.component('BoxChart', BoxChart)
1919
}
2020

2121
export default BoxChart

src/plots/bullet/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const BulletChart = defineComponent<BulletChartProps>({
1515

1616
/* istanbul ignore next */
1717
BulletChart.install = (app: App) => {
18-
app.component(BulletChart.name, BulletChart)
18+
app.component('BulletChart', BulletChart)
1919
}
2020

2121
export default BulletChart

src/plots/chord/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const ChordChart = defineComponent<ChordChartProps>({
1515

1616
/* istanbul ignore next */
1717
ChordChart.install = (app: App) => {
18-
app.component(ChordChart.name, ChordChart)
18+
app.component('ChordChart', ChordChart)
1919
}
2020

2121
export default ChordChart

src/plots/circle-packing/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@ export type CirclePackingChartProps = Writeable<
1010

1111
const CirclePackingChart = defineComponent<CirclePackingChartProps>({
1212
name: 'CirclePackingChart',
13-
setup(props, ctx) {
13+
setup: (props, ctx) => {
1414
return () => <BaseChart chart={CirclePacking} {...mergeAttrs(props, ctx.attrs)} />
1515
},
1616
})
1717

1818
/* istanbul ignore next */
1919
CirclePackingChart.install = (app: App) => {
20-
app.component(CirclePackingChart.name, CirclePackingChart)
20+
app.component('CirclePackingChart', CirclePackingChart)
2121
}
2222

2323
export default CirclePackingChart

src/plots/column/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { defineComponent, App } from 'vue-demi'
1+
import { App, defineComponent } from 'vue-demi'
22
import { Column, ColumnOptions } from '@antv/g2plot'
33
import BaseChart, { BaseChartProps } from '../../components/base'
44
import { Writeable } from '../../types'
@@ -15,7 +15,7 @@ const ColumnChart = defineComponent<ColumnChartProps>({
1515

1616
/* istanbul ignore next */
1717
ColumnChart.install = (app: App) => {
18-
app.component(ColumnChart.name, ColumnChart)
18+
app.component('ColumnChart', ColumnChart)
1919
}
2020

2121
export default ColumnChart

0 commit comments

Comments
 (0)