8000 Fix/react vchart types by xile611 · Pull Request #3078 · VisActor/VChart · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Fix/react vchart types #3078

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"changes": [
{
"comment": "fix: fix type error of react vchart, fix #3065\n\n",
"type": "none",
"packageName": "@visactor/vchart"
}
],
"packageName": "@visactor/vchart",
"email": "dingling112@gmail.com"
}
9 changes: 5 additions & 4 deletions packages/react-vchart/src/charts/AreaChart.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
import React from 'react';
import type React from 'react';
import type { IAreaChartSpec, IVChartConstructor } from '@visactor/vchart';
import { VChart, registerAreaChart, registerLabel } from '@visactor/vchart';
import { BaseChartProps, createChart } from './BaseChart';
import type { BaseChartProps } from './BaseChart';
import { createChart } from './BaseChart';
import { cartesianComponentsRegisters } from './register';

export interface AreaChartProps
extends Omit<BaseChartProps, 'spec' | 'container' | 'type' | 'data'>,
Omit<IAreaChartSpec, 'type'> {}
Omit<Partial<IAreaChartSpec>, 'type'> {}

export const AreaChart = createChart<React.PropsWithChildren<AreaChartProps> & { type: 'area' }>(
export const AreaChart = createChart<React.PropsWithChildren<AreaChartProps> & { type?: 'area' }>(
'AreaChart',
{
type: 'area',
Expand Down
9 changes: 5 additions & 4 deletions packages/react-vchart/src/charts/Bar3dChart.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
import React from 'react';
import type React from 'react';
import type { IBar3dChartSpec, IVChartConstructor } from '@visactor/vchart';
import { VChart, registerBar3dChart, registerLabel, registerTotalLabel } from '@visactor/vchart';
import { BaseChartProps, createChart } from './BaseChart';
import type { BaseChartProps } from './BaseChart';
import { createChart } from './BaseChart';
import { cartesianComponentsRegisters } from './register';

export interface Bar3dChartProps
extends Omit<BaseChartProps, 'spec' | 'container' | 'type' | 'data'>,
Omit<IBar3dChartSpec, 'type'> {
Omit<Partial<IBar3dChartSpec>, 'type'> {
//
}

export const Bar3dChart = createChart<React.PropsWithChildren<Bar3dChartProps> & { type: 'bar3d' }>(
export const Bar3dChart = createChart<React.PropsWithChildren<Bar3dChartProps> & { type?: 'bar3d' }>(
'Bar3dChart',
{
type: 'bar3d',
Expand Down
9 changes: 5 additions & 4 deletions packages/react-vchart/src/charts/BarChart.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
import React from 'react';
import type React from 'react';
import type { IBarChartSpec, IVChartConstructor } from '@visactor/vchart';
import { VChart, registerBarChart, registerLabel, registerTotalLabel } from '@visactor/vchart';
import { BaseChartProps, createChart } from './BaseChart';
import type { BaseChartProps } from './BaseChart';
import { createChart } from './BaseChart';
import { cartesianComponentsRegisters } from './register';

export interface BarChartProps
extends Omit<BaseChartProps, 'spec' | 'container' | 'type' | 'data'>,
Omit<IBarChartSpec, 'type'> {
Omit<Partial<IBarChartSpec>, 'type'> {
//
}

export const BarChart = createChart<React.PropsWithChildren<BarChartProps> & { type: 'bar' }>(
export const BarChart = createChart<React.PropsWithChildren<BarChartProps> & { type?: 'bar' }>(
'BarChart',
{
type: 'bar',
Expand Down
11 changes: 6 additions & 5 deletions packages/react-vchart/src/charts/BoxPlotChart.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
import React from 'react';
import { IBoxPlotChartSpec, IVChartConstructor } from '@visactor/vchart';
import type React from 'react';
import type { IBoxPlotChartSpec, IVChartConstructor } from '@visactor/vchart';
import { VChart, registerBoxplotChart, registerLabel } from '@visactor/vchart';
import { BaseChartProps, createChart } from './BaseChart';
import type { BaseChartProps } from './BaseChart';
import { createChart } from './BaseChart';
import { cartesianComponentsRegisters } from './register';

export interface BoxPlotChartProps
extends Omit<BaseChartProps, 'spec' | 'container' | 'type' | 'data'>,
Omit<IBoxPlotChartSpec, 'type'> {}
Omit<Partial<IBoxPlotChartSpec>, 'type'> {}

export const BoxPlotChart = createChart<React.PropsWithChildren<BoxPlotChartProps> & { type: 'boxPlot' }>(
export const BoxPlotChart = createChart<React.PropsWithChildren<BoxPlotChartProps> & { type?: 'boxPlot' }>(
'BoxPlotChart',
{
type: 'boxPlot',
Expand Down
11 changes: 6 additions & 5 deletions packages/react-vchart/src/charts/CirclePackingChart.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
import React from 'react';
import { ICirclePackingChartSpec, IVChartConstructor } from '@visactor/vchart';
import type React from 'react';
import type { ICirclePackingChartSpec, IVChartConstructor } from '@visactor/vchart';
import { VChart, registerCirclePackingChart } from '@visactor/vchart';
import { BaseChartProps, createChart } from './BaseChart';
import type { BaseChartProps } from './BaseChart';
import { createChart } from './BaseChart';
import { simpleComponentsRegisters } from './register';

export interface CirclePackingChartProps
extends Omit<BaseChartProps, 'spec' | 'container' | 'type' | 'data'>,
Omit<ICirclePackingChartSpec, 'type'> {}
Omit<Partial<ICirclePackingChartSpec>, 'type'> {}

export const CirclePackingChart = createChart<
React.PropsWithChildren<CirclePackingChartProps> & { type: 'circlePacking' }
React.PropsWithChildren<CirclePackingChartProps> & { type?: 'circlePacking' }
>(
'CirclePackingChart',
{
Expand Down
11 changes: 6 additions & 5 deletions packages/react-vchart/src/charts/CircularProgressChart.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
import React from 'react';
import { ICircularProgressChartSpec, IVChartConstructor } from '@visactor/vchart';
import type React from 'react';
import type { ICircularProgressChartSpec, IVChartConstructor } from '@visactor/vchart';
import { VChart, registerCircularProgressChart, registerLabel } from '@visactor/vchart';
import { BaseChartProps, createChart } from './BaseChart';
import type { BaseChartProps } from './BaseChart';
import { createChart } from './BaseChart';
import { polarComponentsRegisters } from './register';

export interface CircularProgressChartProps
extends Omit<BaseChartProps, 'spec' | 'container' | 'type' | 'data'>,
Omit<ICircularProgressChartSpec, 'type'> {}
Omit<Partial<ICircularProgressChartSpec>, 'type'> {}

export const CircularProgressChart = createChart<
React.PropsWithChildren<CircularProgressChartProps> & { type: 'circularProgress' }
React.PropsWithChildren<CircularProgressChartProps> & { type?: 'circularProgress' }
>(
'CircularProgressChart',
{
Expand Down
11 changes: 6 additions & 5 deletions packages/react-vchart/src/charts/CommonChart.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import { ICommonChartSpec, IVChartConstructor } from '@visactor/vchart';
import type React from 'react';
import type { ICommonChartSpec, IVChartConstructor } from '@visactor/vchart';
import {
VChart,
registerCommonChart,
Expand All @@ -16,13 +16,14 @@ import {
registerScatterSeries,
registerPieSeries
} from '@visactor/vchart';
import { BaseChartProps, createChart } from './BaseChart';
import type { BaseChartProps } from './BaseChart';
import { createChart } from './BaseChart';

export interface CommonChartProps
extends Omit<BaseChartProps, 'spec' | 'container' | 'type' | 'data'>,
Omit<ICommonChartSpec, 'type'> {}
Omit<Partial<ICommonChartSpec>, 'type'> {}

export const CommonChart = createChart<React.PropsWithChildren<CommonChartProps> & { type: 'common' }>(
export const CommonChart = createChart<React.PropsWithChildren<CommonChartProps> & { type?: 'common' }>(
'CommonChart',
{
type: 'common',
Expand Down
11 changes: 6 additions & 5 deletions packages/react-vchart/src/charts/CorrelationChart.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
import React from 'react';
import { ICorrelationChartSpec, IVChartConstructor } from '@visactor/vchart';
import type React from 'react';
import type { ICorrelationChartSpec, IVChartConstructor } from '@visactor/vchart';
import { VChart, registerCorrelationChart } from '@visactor/vchart';
import { BaseChartProps, createChart } from './BaseChart';
import type { BaseChartProps } from './BaseChart';
import { createChart } from './BaseChart';
import { simpleComponentsRegisters } from './register';

export interface CorrelationChartProps
extends Omit<BaseChartProps, 'spec' | 'container' | 'type' | 'data'>,
Omit<ICorrelationChartSpec, 'type'> {}
Omit<Partial<ICorrelationChartSpec>, 'type'> {}

export const CorrelationChart = createChart<React.PropsWithChildren<CorrelationChartProps> & { type: 'correlation' }>(
export const CorrelationChart = createChart<React.PropsWithChildren<CorrelationChartProps> & { type?: 'correlation' }>(
'CorrelationChart',
{
type: 'correlation',
Expand Down
11 changes: 6 additions & 5 deletions packages/react-vchart/src/charts/Funnel3dChart.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
import React from 'react';
import { IFunnel3dChartSpec, IVChartConstructor } from '@visactor/vchart';
import type React from 'react';
import type { IFunnel3dChartSpec, IVChartConstructor } from '@visactor/vchart';
import { VChart, registerFunnel3dChart, registerLabel } from '@visactor/vchart';
import { BaseChartProps, createChart } from './BaseChart';
import type { BaseChartProps } from './BaseChart';
import { createChart } from './BaseChart';
import { simpleComponentsRegisters } from './register';

export interface Funnel3dChartProps
extends Omit<BaseChartProps, 'spec' | 'container' | 'type' | 'data'>,
Omit<IFunnel3dChartSpec, 'type'> {}
Omit<Partial<IFunnel3dChartSpec>, 'type'> {}

export const Funnel3dChart = createChart<React.PropsWithChildren<Funnel3dChartProps> & { type: 'funnel3d' }>(
export const Funnel3dChart = createChart<React.PropsWithChildren<Funnel3dChartProps> & { type?: 'funnel3d' }>(
'Funnel3dChart',
{
type: 'funnel3d',
Expand Down
11 changes: 6 additions & 5 deletions packages/react-vchart/src/charts/FunnelChart.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
import React from 'react';
import { IFunnelChartSpec, IVChartConstructor } from '@visactor/vchart';
import type React from 'react';
import type { IFunnelChartSpec, IVChartConstructor } from '@visactor/vchart';
import { VChart, registerFunnelChart, registerLabel } from '@visactor/vchart';
import { BaseChartProps, createChart } from './BaseChart';
import type { BaseChartProps } from './BaseChart';
import { createChart } from './BaseChart';
import { simpleComponentsRegisters } from './register';

export interface FunnelChartProps
extends Omit<BaseChartProps, 'spec' | 'container' | 'type' | 'data'>,
Omit<IFunnelChartSpec, 'type'> {}
Omit<Partial<IFunnelChartSpec>, 'type'> {}

export const FunnelChart = createChart<React.PropsWithChildren<FunnelChartProps> & { type: 'funnel' }>(
export const FunnelChart = createChart<React.PropsWithChildren<FunnelChartProps> & { type?: 'funnel' }>(
'FunnelChart',
{
type: 'funnel',
Expand Down
9 changes: 5 additions & 4 deletions packages/react-vchart/src/charts/GaugeChart.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
import React from 'react';
import type React from 'react';
import type { IGaugeChartSpec, IVChartConstructor } from '@visactor/vchart';
import { VChart, registerGaugeChart } from '@visactor/vchart';
import { BaseChartProps, createChart } from './BaseChart';
import type { BaseChartProps } from './BaseChart';
import { createChart } from './BaseChart';
import { simpleComponentsRegisters } from './register';

export interface GaugeChartProps
extends Omit<BaseChartProps, 'spec' | 'container' | 'type' | 'data'>,
Omit<IGaugeChartSpec, 'type'> {}
Omit<Partial<IGaugeChartSpec>, 'type'> {}

export const GaugeChart = createChart<React.PropsWithChildren<GaugeChartProps> & { type: 'gauge' }>(
export const GaugeChart = createChart<React.PropsWithChildren<GaugeChartProps> & { type?: 'gauge' }>(
'GaugeChart',
{
type: 'gauge',
Expand Down
9 changes: 5 additions & 4 deletions packages/react-vchart/src/charts/HeatmapChart.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react';
import type React from 'react';
import type { IHeatmapChartSpec, IVChartConstructor } from '@visactor/vchart';
import {
VChart,
Expand All @@ -7,16 +7,17 @@ import {
registerCartesianCrossHair,
registerLabel
} from '@visactor/vchart';
import { BaseChartProps, createChart } from './BaseChart';
import type { BaseChartProps } from './BaseChart';
import { createChart } from './BaseChart';
import { cartesianComponentsRegisters } from './register';

export interface HeatmapChartProps
extends Omit<BaseChartProps, 'spec' | 'container' | 'type' | 'data'>,
Omit<IHeatmapChartSpec, 'type'> {
Omit<Partial<IHeatmapChartSpec>, 'type'> {
//
}

export const HeatmapChart = createChart<React.PropsWithChildren<HeatmapChartProps> & { type: 'heatmap' }>(
export const HeatmapChart = createChart<React.PropsWithChildren<HeatmapChartProps> & { type?: 'heatmap' }>(
'HeatmapChart',
{
type: 'heatmap',
Expand Down
11 changes: 6 additions & 5 deletions packages/react-vchart/src/charts/Histogram3dChart.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
import React from 'react';
import { IHistogram3dChartSpec, IVChartConstructor } from '@visactor/vchart';
import type React from 'react';
import type { IHistogram3dChartSpec, IVChartConstructor } from '@visactor/vchart';
import { VChart, registerHistogram3dChart, registerLabel } from '@visactor/vchart';
import { BaseChartProps, createChart } from './BaseChart';
import type { BaseChartProps } from './BaseChart';
import { createChart } from './BaseChart';
import { cartesianComponentsRegisters } from './register';

export interface Histogram3dChartProps
extends Omit<BaseChartProps, 'spec' | 'container' | 'type' | 'data'>,
Omit<IHistogram3dChartSpec, 'type'> {}
Omit<Partial<IHistogram3dChartSpec>, 'type'> {}

export const Histogram3dChart = createChart<React.PropsWithChildren<Histogram3dChartProps> & { type: 'histogram3d' }>(
export const Histogram3dChart = createChart<React.PropsWithChildren<Histogram3dChartProps> & { type?: 'histogram3d' }>(
'Histogram3dChart',
{
type: 'histogram3d',
Expand Down
11 changes: 6 additions & 5 deletions packages/react-vchart/src/charts/HistogramChart.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
import React from 'react';
import { IHistogramChartSpec, IVChartConstructor } from '@visactor/vchart';
import type React from 'react';
import type { IHistogramChartSpec, IVChartConstructor } from '@visactor/vchart';
import { VChart, registerHistogramChart, registerLabel } from '@visactor/vchart';
import { BaseChartProps, createChart } from './BaseChart';
import type { BaseChartProps } from './BaseChart';
import { createChart } from './BaseChart';
import { cartesianComponentsRegisters } from './register';

export interface HistogramChartProps
extends Omit<BaseChartProps, 'spec' | 'container' | 'type' | 'data'>,
Omit<IHistogramChartSpec, 'type'> {}
Omit<Partial<IHistogramChartSpec>, 'type'> {}

export const HistogramChart = createChart<React.PropsWithChildren<HistogramChartProps> & { type: 'histogram' }>(
export const HistogramChart = createChart<React.PropsWithChildren<HistogramChartProps> & { type?: 'histogram' }>(
'HistogramChart',
{
type: 'histogram',
Expand Down
9 changes: 5 additions & 4 deletions packages/react-vchart/src/charts/LineChart.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
import React from 'react';
import type React from 'react';
import type { ILineChartSpec, IVChartConstructor } from '@visactor/vchart';
import { VChart, registerLineChart, registerLabel, registerTotalLabel } from '@visactor/vchart';
import { BaseChartProps, createChart } from './BaseChart';
import type { BaseChartProps } from './BaseChart';
import { createChart } from './BaseChart';
import { cartesianComponentsRegisters } from './register';

export interface LineChartProps
extends Omit<BaseChartProps, 'spec' | 'container' | 'type' | 'data'>,
Omit<ILineChartSpec, 'type'> {}
Omit<Partial<ILineChartSpec>, 'type'> {}

export const LineChart = createChart<React.PropsWithChildren<LineChartProps> & { type: 'line' }>(
export const LineChart = createChart<React.PropsWithChildren<LineChartProps> & { type?: 'line' }>(
'LineChart',
{
type: 'line',
Expand Down
11 changes: 6 additions & 5 deletions packages/react-vchart/src/charts/LinearProgressChart.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
import React from 'react';
import { ILinearProgressChartSpec, IVChartConstructor } from '@visactor/vchart';
import type React from 'react';
import type { ILinearProgressChartSpec, IVChartConstructor } from '@visactor/vchart';
import { VChart, registerLinearProgressChart, registerLabel } from '@visactor/vchart';
import { BaseChartProps, createChart } from './BaseChart';
import type { BaseChartProps } from './BaseChart';
import { createChart } from './BaseChart';
import { cartesianComponentsRegisters } from './register';

export interface LinearProgressChartProps
extends Omit<BaseChartProps, 'spec' | 'container' | 'type' | 'data'>,
Omit<ILinearProgressChartSpec, 'type'> {}
Omit<Partial<ILinearProgressChartSpec>, 'type'> {}

export const LinearProgressChart = createChart<
React.PropsWithChildren<LinearProgressChartProps> & { type: 'linearProgress' }
React.PropsWithChildren<LinearProgressChartProps> & { type?: 'linearProgress' }
>(
'LinearProgressChart',
{
Expand Down
9 changes: 5 additions & 4 deletions packages/react-vchart/src/charts/LiquidChart.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
import React from 'react';
import type React from 'react';
import type { ILiquidChartSpec, IVChartConstructor } from '@visactor/vchart';
import { VChart, registerLiquidChart } from '@visactor/vchart';
import { BaseChartProps, createChart } from './BaseChart';
import type { BaseChartProps } from './BaseChart';
import { createChart } from './BaseChart';
import { simpleComponentsRegisters } from './register';

export interface LiquidChartProps
extends Omit<BaseChartProps, 'spec' | 'container' | 'type' | 'data' | 'data'>,
Omit<ILiquidChartSpec, 'type'> {}
Omit<Partial<ILiquidChartSpec>, 'type'> {}

export const LiquidChart = createChart<React.PropsWithChildren<LiquidChartProps> & { type: 'liquid' }>(
export const LiquidChart = createChart<React.PropsWithChildren<LiquidChartProps> & { type?: 'liquid' }>(
'LiquidChart',
{
type: 'liquid',
Expand Down
Loading
Loading
0