diff --git a/package.json b/package.json index 23f89c46..10e51b68 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "bizcharts", - "version": "4.1.12-beta.1", + "version": "4.1.12", "description": "bizcharts", "keywords": [ "bizcharts", diff --git a/src/core.ts b/src/core.ts index 1239fe09..67bf6a7a 100644 --- a/src/core.ts +++ b/src/core.ts @@ -4,7 +4,7 @@ import * as SVGEngine from '@antv/g-svg/lib'; import { registerEngine } from '@antv/g2/lib/core'; // 导出自定义比例尺的能力 export { registerScale, getScale, registerTickMethod } from '@antv/scale'; - +export { setGlobal, GLOBAL } from '@antv/g2Plot/lib/core/global'; import './extend/scale/scale'; // 动画 @@ -17,7 +17,7 @@ registerEngine('svg', SVGEngine); // @ts-ignore export * from '@antv/g2/lib/core'; -export const VERSION = '4.1.12-beta.1'; +export const VERSION = '4.1.12'; diff --git a/src/createPlot.tsx b/src/createPlot.tsx index 2a37e727..d642767a 100644 --- a/src/createPlot.tsx +++ b/src/createPlot.tsx @@ -23,6 +23,14 @@ import { import { debounce, isArray, isFunction, isNil } from '@antv/util'; import warn from 'warning'; +// 国际化处理 +import { registerLocale } from '@antv/g2Plot/lib/core/locale'; +import { EN_US_LOCALE } from '@antv/g2Plot/lib/locales/en_US'; +import { ZH_CN_LOCALE } from '@antv/g2Plot/lib/locales/zh_CN'; +/** default locale register */ +registerLocale('en-US', EN_US_LOCALE); +registerLocale('zh-CN', ZH_CN_LOCALE); + const DEFAULT_PLACEHOLDER = (
(Waterfall, 'WaterfallChart'); diff --git a/src/plots/core/dependents.ts b/src/plots/core/dependents.ts index e0fbf0a2..a59e756d 100644 --- a/src/plots/core/dependents.ts +++ b/src/plots/core/dependents.ts @@ -22,6 +22,7 @@ type CategoryLegend = typeof Legend.Category; type ContinuousLegend = typeof Legend.Continuous; export { CategoryLegend, ContinuousLegend }; type HtmlTooltip = typeof Tooltip.Html; + export { HtmlTooltip }; export { Slider }; export { Scrollbar }; diff --git a/unittest/plots/WaterfallChart-spec.tsx b/unittest/plots/WaterfallChart-spec.tsx new file mode 100644 index 00000000..f36bc215 --- /dev/null +++ b/unittest/plots/WaterfallChart-spec.tsx @@ -0,0 +1,44 @@ +import React from 'react'; +import WaterfallChart from '../../src/plots/WaterfallChart'; +import { render, cleanup } from '@testing-library/react'; + +// 数据源 +const data = [ + { type: '日用品', money: 120 }, + { type: '伙食费', money: 900 }, + { type: '交通费', money: 200 }, + { type: '水电费', money: 300 }, + { type: '房租', money: 1200 }, + { type: '商场消费', money: 1000 }, + { type: '应酬红包', money: -2000 }, +]; + +describe('Plots-WaterfallChart', () => { + test('基础WaterfallChart', () => { + let chart = null; + render( { + chart = c; + }} + />); + cleanup(); + }); +});