Skip to content

Commit

Permalink
fix: TinyColumnChart TinyLineChart interface优化
Browse files Browse the repository at this point in the history
  • Loading branch information
wb-tyz279201 committed Jan 13, 2021
1 parent 4c88ea4 commit b5a694d
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 15 deletions.
19 changes: 11 additions & 8 deletions src/plots/TinyColumnChart.tsx
Original file line number Diff line number Diff line change
@@ -1,23 +1,26 @@
import 'react'
import { TinyColumn, TinyColumnOptions as options } from '@antv/g2plot/lib/plots/tiny-column';
import { TinyColumn, TinyColumnOptions as Options } from '@antv/g2plot/lib/plots/tiny-column';
import set from '@antv/util/lib/set';
import createPlot, { BasePlotOptions } from '../createPlot';
import { polyfillOptions } from './core/polyfill';
import { isNil } from '@antv/util';
interface TinyColumnOptions extends options, BasePlotOptions {
/** colorField在4.2.0即将废弃 */

type Opt = Omit<Options, 'data'>;

interface TinyColumnOptions extends Opt, BasePlotOptions {
/** colorField 旧版g2Plot api,即将废弃请查看最新文档 */
colorField?: string,

data: any[],
data: number[] | Record<string, any>[],

/** xField在4.2.0即将废弃 */
/** xField 旧版g2Plot api,即将废弃请查看最新文档 */
xField?: string,

/** yField在4.2.0即将废弃 */
/** yField 旧版g2Plot api,即将废弃请查看最新文档 */
yField?: string,

/** guideLine 在4.2.0即将废弃 */
guideLine?: Array<object> // TODO
/** guideLine 旧版g2Plot api,即将废弃请查看最新文档 */
guideLine?: Array<object>
}

const polyfill = (opt: TinyColumnOptions): TinyColumnOptions => {
Expand Down
17 changes: 10 additions & 7 deletions src/plots/TinyLineChart.tsx
Original file line number Diff line number Diff line change
@@ -1,24 +1,27 @@
import 'react'
import { TinyLine, TinyLineOptions as options } from '@antv/g2plot/lib/plots/tiny-line';
import { TinyLine, TinyLineOptions as Options } from '@antv/g2plot/lib/plots/tiny-line';
import get from '@antv/util/lib/get';
import set from '@antv/util/lib/set';
import createPlot, { BasePlotOptions } from '../createPlot';
import { polyfillOptions } from './core/polyfill';
import { isNil } from '@antv/util';
interface TinyLineOptions extends options, BasePlotOptions {

type Opt = Omit<Options, 'data'>;

interface TinyLineOptions extends Opt, BasePlotOptions {
/** size在4.2.0即将废弃 */
size?: number,

data: any[],
data: number[] | Record<string, any>[],

/** xField在4.2.0即将废弃 */
/** xField 旧版g2Plot api,即将废弃请查看最新文档 */
xField?: string,

/** yField在4.2.0即将废弃 */
/** yField 旧版g2Plot api,即将废弃请查看最新文档 */
yField?: string,

/** guideLine 在4.2.0即将废弃 */
guideLine?: Array<object> // TODO
/** guideLine 旧版g2Plot api,即将废弃请查看最新文档 */
guideLine?: Array<object>
}

const polyfill = (opt: TinyLineOptions): TinyLineOptions => {
Expand Down

0 comments on commit b5a694d

Please sign in to comment.