@antv/g2plot 2.4.3 → 2.4.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +42 -9
- package/dist/g2plot.min.js +4 -4
- package/dist/g2plot.min.js.map +1 -1
- package/esm/index.d.ts +1 -9
- package/esm/index.js +1 -9
- package/esm/index.js.map +1 -1
- package/esm/plots/area/adaptor.js +22 -22
- package/esm/plots/area/adaptor.js.map +1 -1
- package/esm/plots/area/constants.d.ts +0 -2
- package/esm/plots/area/constants.js +1 -2
- package/esm/plots/area/constants.js.map +1 -1
- package/esm/plots/area/index.js +4 -11
- package/esm/plots/area/index.js.map +1 -1
- package/esm/plots/area/types.d.ts +1 -1
- package/esm/plots/area/types.js.map +1 -1
- package/esm/plots/bar/constants.js +3 -0
- package/esm/plots/bar/constants.js.map +1 -1
- package/esm/plots/column/constants.js +3 -0
- package/esm/plots/column/constants.js.map +1 -1
- package/esm/plots/dual-axes/util/render-sider.js +1 -1
- package/esm/plots/dual-axes/util/render-sider.js.map +1 -1
- package/esm/plots/gauge/adaptor.js +1 -0
- package/esm/plots/gauge/adaptor.js.map +1 -1
- package/esm/plots/line/adaptor.js +19 -33
- package/esm/plots/line/adaptor.js.map +1 -1
- package/esm/plots/line/constants.d.ts +0 -2
- package/esm/plots/line/constants.js +1 -3
- package/esm/plots/line/constants.js.map +1 -1
- package/esm/plots/line/index.js +1 -8
- package/esm/plots/line/index.js.map +1 -1
- package/esm/plots/line/interactions/marker-active.js +6 -7
- package/esm/plots/line/interactions/marker-active.js.map +1 -1
- package/esm/plots/line/types.d.ts +1 -1
- package/esm/plots/line/types.js.map +1 -1
- package/esm/plots/liquid/adaptor.js +2 -1
- package/esm/plots/liquid/adaptor.js.map +1 -1
- package/esm/plots/liquid/shapes/liquid.js +5 -3
- package/esm/plots/liquid/shapes/liquid.js.map +1 -1
- package/esm/plots/liquid/types.d.ts +1 -0
- package/esm/plots/liquid/types.js.map +1 -1
- package/esm/plots/pie/adaptor.js +2 -0
- package/esm/plots/pie/adaptor.js.map +1 -1
- package/esm/plots/pie/contants.js +1 -0
- package/esm/plots/pie/contants.js.map +1 -1
- package/esm/plots/progress/adaptor.js +1 -0
- package/esm/plots/progress/adaptor.js.map +1 -1
- package/esm/plots/rose/constant.js +1 -0
- package/esm/plots/rose/constant.js.map +1 -1
- package/esm/plots/sankey/adaptor.js +31 -2
- package/esm/plots/sankey/adaptor.js.map +1 -1
- package/esm/plots/sankey/types.d.ts +8 -0
- package/esm/plots/sankey/types.js.map +1 -1
- package/esm/plots/scatter/adaptor.d.ts +1 -1
- package/esm/plots/scatter/adaptor.js +2 -2
- package/esm/plots/scatter/adaptor.js.map +1 -1
- package/esm/utils/geometry.js +1 -2
- package/esm/utils/geometry.js.map +1 -1
- package/esm/utils/transform/percent.js +2 -2
- package/esm/utils/transform/percent.js.map +1 -1
- package/lib/index.d.ts +1 -9
- package/lib/index.js +5 -13
- package/lib/index.js.map +1 -1
- package/lib/plots/area/adaptor.js +20 -20
- package/lib/plots/area/adaptor.js.map +1 -1
- package/lib/plots/area/constants.d.ts +0 -2
- package/lib/plots/area/constants.js +2 -3
- package/lib/plots/area/constants.js.map +1 -1
- package/lib/plots/area/index.js +3 -10
- package/lib/plots/area/index.js.map +1 -1
- package/lib/plots/area/types.d.ts +1 -1
- package/lib/plots/area/types.js.map +1 -1
- package/lib/plots/bar/constants.js +3 -0
- package/lib/plots/bar/constants.js.map +1 -1
- package/lib/plots/column/constants.js +3 -0
- package/lib/plots/column/constants.js.map +1 -1
- package/lib/plots/dual-axes/util/render-sider.js +1 -1
- package/lib/plots/dual-axes/util/render-sider.js.map +1 -1
- package/lib/plots/gauge/adaptor.js +1 -0
- package/lib/plots/gauge/adaptor.js.map +1 -1
- package/lib/plots/line/adaptor.js +16 -30
- package/lib/plots/line/adaptor.js.map +1 -1
- package/lib/plots/line/constants.d.ts +0 -2
- package/lib/plots/line/constants.js +2 -4
- package/lib/plots/line/constants.js.map +1 -1
- package/lib/plots/line/index.js +0 -7
- package/lib/plots/line/index.js.map +1 -1
- package/lib/plots/line/interactions/marker-active.js +6 -7
- package/lib/plots/line/interactions/marker-active.js.map +1 -1
- package/lib/plots/line/types.d.ts +1 -1
- package/lib/plots/line/types.js.map +1 -1
- package/lib/plots/liquid/adaptor.js +2 -1
- package/lib/plots/liquid/adaptor.js.map +1 -1
- package/lib/plots/liquid/shapes/liquid.js +5 -3
- package/lib/plots/liquid/shapes/liquid.js.map +1 -1
- package/lib/plots/liquid/types.d.ts +1 -0
- package/lib/plots/liquid/types.js.map +1 -1
- package/lib/plots/pie/adaptor.js +2 -0
- package/lib/plots/pie/adaptor.js.map +1 -1
- package/lib/plots/pie/contants.js +1 -0
- package/lib/plots/pie/contants.js.map +1 -1
- package/lib/plots/progress/adaptor.js +1 -0
- package/lib/plots/progress/adaptor.js.map +1 -1
- package/lib/plots/rose/constant.js +1 -0
- package/lib/plots/rose/constant.js.map +1 -1
- package/lib/plots/sankey/adaptor.js +30 -1
- package/lib/plots/sankey/adaptor.js.map +1 -1
- package/lib/plots/sankey/types.d.ts +8 -0
- package/lib/plots/sankey/types.js.map +1 -1
- package/lib/plots/scatter/adaptor.d.ts +1 -1
- package/lib/plots/scatter/adaptor.js +1 -1
- package/lib/plots/scatter/adaptor.js.map +1 -1
- package/lib/utils/geometry.js +1 -2
- package/lib/utils/geometry.js.map +1 -1
- package/lib/utils/transform/percent.js +2 -2
- package/lib/utils/transform/percent.js.map +1 -1
- package/package.json +2 -2
- package/src/index.ts +1 -9
- package/src/plots/area/adaptor.ts +25 -26
- package/src/plots/area/constants.ts +1 -3
- package/src/plots/area/index.ts +3 -10
- package/src/plots/area/types.ts +1 -1
- package/src/plots/bar/constants.ts +3 -0
- package/src/plots/column/constants.ts +3 -0
- package/src/plots/dual-axes/util/render-sider.ts +1 -1
- package/src/plots/gauge/adaptor.ts +1 -0
- package/src/plots/line/adaptor.ts +28 -37
- package/src/plots/line/constants.ts +1 -4
- package/src/plots/line/index.ts +1 -8
- package/src/plots/line/interactions/marker-active.ts +7 -8
- package/src/plots/line/types.ts +1 -1
- package/src/plots/liquid/adaptor.ts +2 -1
- package/src/plots/liquid/shapes/liquid.ts +6 -3
- package/src/plots/liquid/types.ts +1 -0
- package/src/plots/pie/adaptor.ts +2 -0
- package/src/plots/pie/contants.ts +1 -0
- package/src/plots/progress/adaptor.ts +1 -0
- package/src/plots/rose/constant.ts +1 -0
- package/src/plots/sankey/adaptor.ts +35 -2
- package/src/plots/sankey/types.ts +8 -0
- package/src/plots/scatter/adaptor.ts +3 -1
- package/src/utils/geometry.ts +1 -2
- package/src/utils/transform/percent.ts +2 -2
package/esm/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const version = "2.4.
|
|
1
|
+
export declare const version = "2.4.8";
|
|
2
2
|
import * as G2 from '@antv/g2';
|
|
3
3
|
export { G2 };
|
|
4
4
|
import { registerLocale } from './core/locale';
|
|
@@ -88,14 +88,6 @@ export { Mix as Mix } from './plots/mix';
|
|
|
88
88
|
export type { MixOptions } from './plots/mix';
|
|
89
89
|
export { Facet } from './plots/facet';
|
|
90
90
|
export type { FacetOptions } from './plots/facet';
|
|
91
|
-
/** 提供一些工具方法 */
|
|
92
|
-
import { findGeometry, getAllGeometriesRecursively, findViewById } from './utils';
|
|
93
|
-
declare const Util: {
|
|
94
|
-
findGeometry: typeof findGeometry;
|
|
95
|
-
findViewById: typeof findViewById;
|
|
96
|
-
getAllGeometriesRecursively: typeof getAllGeometriesRecursively;
|
|
97
|
-
};
|
|
98
|
-
export { Util };
|
|
99
91
|
/** 开发 adaptor 可能会用到的方法或一些工具方法,不强制使用 */
|
|
100
92
|
export { flow, measureTextWidth } from './utils';
|
|
101
93
|
/** 各个 geometry 的 adaptor,可以让开发者更快的构造图形 */
|
package/esm/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export var version = '2.4.
|
|
1
|
+
export var version = '2.4.8';
|
|
2
2
|
// G2 自定义能力透出
|
|
3
3
|
import * as G2 from '@antv/g2';
|
|
4
4
|
export { G2 };
|
|
@@ -94,14 +94,6 @@ export { Mix as MultiView } from './plots/mix';
|
|
|
94
94
|
export { Mix as Mix } from './plots/mix';
|
|
95
95
|
// 分面图及类型定义 | author by [visiky](https://github.com/visiky)
|
|
96
96
|
export { Facet } from './plots/facet';
|
|
97
|
-
/** 提供一些工具方法 */
|
|
98
|
-
import { findGeometry, getAllGeometriesRecursively, findViewById } from './utils';
|
|
99
|
-
var Util = {
|
|
100
|
-
findGeometry: findGeometry,
|
|
101
|
-
findViewById: findViewById,
|
|
102
|
-
getAllGeometriesRecursively: getAllGeometriesRecursively,
|
|
103
|
-
};
|
|
104
|
-
export { Util };
|
|
105
97
|
/** 开发 adaptor 可能会用到的方法或一些工具方法,不强制使用 */
|
|
106
98
|
export { flow, measureTextWidth } from './utils';
|
|
107
99
|
/** 各个 geometry 的 adaptor,可以让开发者更快的构造图形 */
|
package/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,IAAM,OAAO,GAAG,OAAO,CAAC;AAE/B,aAAa;AACb,OAAO,KAAK,EAAE,MAAM,UAAU,CAAC;AAC/B,OAAO,EAAE,EAAE,EAAE,CAAC;AAEd,QAAQ;AACR,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,8BAA8B;AAC9B,cAAc,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC;AACtC,cAAc,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC;AACtC,uBAAuB;AACvB,OAAO,EAAE,cAAc,EAAE,CAAC;AAE1B,WAAW;AACX,OAAO,EAAE,SAAS,EAAE,MA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eAAe;AACf,OAAO,EAAE,GAAG,IAAI,SAAS,EAAE,MAAM,aAAa,CAAC;AAE/C,oBAAoB;AACpB,OAAO,EAAE,GAAG,IAAI,GAAG,EAAE,MAAM,aAAa,CAAC;AAGzC,2DAA2D;AAC3D,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAGtC,eAAe;AACf,OAAO,EAAE,YAAY,EAAE,2BAA2B,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAClF,IAAM,IAAI,GAAG;IACX,YAAY,cAAA;IACZ,YAAY,cAAA;IACZ,2BAA2B,6BAAA;CAC5B,CAAC;AACF,OAAO,EAAE,IAAI,EAAE,CAAC;AAChB,uCAAuC;AACvC,OAAO,EAAE,IAAI,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAEjD,0CAA0C;AAC1C,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AASpF,uCAAuC;AACvC,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACrG,MAAM,CAAC,IAAM,QAAQ,GAAG,EAAE,KAAK,OAAA,EAAE,MAAM,QAAA,EAAE,OAAO,SAAA,EAAE,UAAU,YAAA,EAAE,WAAW,aAAA,EAAE,KAAK,OAAA,EAAE,SAAS,WAAA,EAAE,CAAC;AAE9F,oDAAoD;AACpD,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC","sourcesContent":["export const version = '2.4.3';\n\n// G2 自定义能力透出\nimport * as G2 from '@antv/g2';\nexport { G2 };\n\n// 国际化处理\nimport { registerLocale } from './core/locale';\nimport { EN_US_LOCALE } from './locales/en_US';\nimport { ZH_CN_LOCALE } from './locales/zh_CN';\n/** default locale register */\nregisterLocale('en-US', EN_US_LOCALE);\nregisterLocale('zh-CN', ZH_CN_LOCALE);\n/** 透出 国际化 工具函数,便于使用 */\nexport { registerLocale };\n\n/** 全局变量 */\nexport { setGlobal } from './core/global';\n\n/** G2Plot 的 Plot 基类 */\nexport { Plot } from './core/plot';\n\n/** Adaptor 及其参数的类型定义 */\nexport type { Adaptor, Params } from './core/adaptor';\n\n// 类型定义导出\nexport * from './types';\n\n// 折线图及类型定义 | author by [hustcc](https://github.com/hustcc)\nexport { Line } from './plots/line';\nexport type { LineOptions } from './plots/line';\n\n// 面积图及类型定义 | author by [hustcc](https://github.com/hustcc)\nexport { Area } from './plots/area';\nexport type { AreaOptions } from './plots/area';\n\n// 柱形图及类型定义 | author by [zqlu](https://github.com/zqlu)\nexport { Column } from './plots/column';\nexport type { ColumnOptions } from './plots/column';\n\n// 条形图及类型定义 | author by [BBSQQ](https://github.com/BBSQQ)\nexport { Bar } from './plots/bar';\nexport type { BarOptions } from './plots/bar';\n\n// 饼图及类型定义 | author by [visiky](https://github.com/visiky)\nexport { Pie } from './plots/pie';\nexport type { PieOptions } from './plots/pie';\n\n// 玫瑰图及类型定义 | author by [zhangzhonghe](https://github.com/zhangzhonghe)\nexport { Rose } from './plots/rose';\nexport type { RoseOptions } from './plots/rose';\n\n// 词云图及类型定义 | author by [zhangzhonghe](https://github.com/zhangzhonghe)\nexport { WordCloud } from './plots/word-cloud';\nexport type { WordCloudOptions } from './plots/word-cloud';\n\n// 散点图及类型定义 | author by [lxfu1](https://github.com/lxfu1)\nexport { Scatter } from './plots/scatter';\nexport type { ScatterOptions } from './plots/scatter';\n\n// 雷达图及类型定义 | author by [visiky](https://github.com/visiky)\nexport { Radar } from './plots/radar';\nexport type { RadarOptions } from './plots/radar';\n\n// 混合图形 | author by [liuzhenying](https://github.com/liuzhenying)\nexport { DualAxes } from './plots/dual-axes';\nexport type { DualAxesOptions } from './plots/dual-axes';\n\n// 迷你折线图及类型定义 | author by [connono](https://github.com/connono)\nexport { TinyLine } from './plots/tiny-line';\nexport type { TinyLineOptions } from './plots/tiny-line';\n\n// 迷你柱形图及类型定义 | author by [connono](https://github.com/connono)\nexport { TinyColumn } from './plots/tiny-column';\nexport type { TinyColumnOptions } from './plots/tiny-column';\n\n// 迷你面积图及类型定义 | author by [connono](https://github.com/connono)\nexport { TinyArea } from './plots/tiny-area';\nexport type { TinyAreaOptions } from './plots/tiny-area';\n\n// 直方图及类型定义 | author by [arcsin1](https://github.com/arcsin1), [visiky](https://github.com/visiky)\nexport { Histogram } from './plots/histogram';\nexport type { HistogramOptions } from './plots/histogram';\n\n// 进度图及类型定义 | author by [connono](https://github.com/connono)\nexport { Progress } from './plots/progress';\nexport type { ProgressOptions } from './plots/progress';\n\n// 环形进度图及类型定义 | author by [connono](https://github.com/connono)\nexport { RingProgress } from './plots/ring-progress';\nexport type { RingProgressOptions } from './plots/ring-progress';\n\n// 热力图及类型定义 | author by [jiazhewang](https://github.com/jiazhewang)\nexport { Heatmap } from './plots/heatmap';\nexport type { HeatmapOptions } from './plots/heatmap';\n\n// 箱线图及类型定义 | author by [BBSQQ](https://github.com/BBSQQ), [visiky](https://github.com/visiky)\nexport { Box } from './plots/box';\nexport type { BoxOptions } from './plots/box';\n\n// 小提琴图及类型定义 | author by [YiSiWang](https://github.com/YiSiWang), [visiky](https://github.com/visiky)\nexport { Violin } from './plots/violin';\nexport type { ViolinOptions } from './plots/violin';\n\n// 韦恩图及类型定义 | author by [visiky](https://github.com/visiky)\nexport { Venn } from './plots/venn';\nexport type { VennOptions } from './plots/venn';\n\n// K线图及类型定义 | author by [jhwong](https://github.com/jinhuiWong), [visiky](https://github.com/visiky)\nexport { Stock } from './plots/stock';\nexport type { StockOptions } from './plots/stock';\n\n// 漏斗图及类型定义\nexport { Funnel, FUNNEL_CONVERSATION_FIELD } from './plots/funnel';\nexport type { FunnelOptions } from './plots/funnel';\n\n// 水波图及类型定义 | author by [CarisL](https://github.com/CarisL), [hustcc](https://github.com/hustcc), [pearmini](https://github.com/pearmini)\nexport { Liquid } from './plots/liquid';\nexport type { LiquidOptions } from './plots/liquid';\n\n// 子弹图及类型定义 | author by [arcsin1](https://github.com/arcsin1)\nexport { Bullet } from './plots/bullet';\nexport type { BulletOptions } from './plots/bullet';\n\n// 旭日图及类型定义 | author by [lxfu1](https://github.com/lxfu1), [visiky](https://github.com/visiky)\nexport { Sunburst } from './plots/sunburst';\nexport type { SunburstOptions } from './plots/sunburst';\n\n// 仪表盘及类型定义 | author by [hustcc](https://github.com/hustcc)\nexport { Gauge } from './plots/gauge';\nexport type { GaugeOptions } from './plots/gauge';\n\n// 瀑布图 | author by [visiky](https://github.com/visiky)\nexport { Waterfall } from './plots/waterfall';\nexport type { WaterfallOptions } from './plots/waterfall';\n\n// 玉珏图 | author by [yujs](https://github.com/yujs) | updated by [visiky](https://github.com/visiky)\nexport { RadialBar } from './plots/radial-bar';\nexport type { RadialBarOptions } from './plots/radial-bar';\n\n// 对称条形图及类型定义 | author by [arcsin1](https://github.com/arcsin1)\nexport { BidirectionalBar } from './plots/bidirectional-bar';\nexport type { BidirectionalBarOptions } from './plots/bidirectional-bar';\n\n// 矩形树图\nexport { Treemap } from './plots/treemap';\nexport type { TreemapOptions } from './plots/treemap';\n\n// 桑基图及类型定义 | author by [hustcc](https://github.com/hustcc)\nexport { Sankey } from './plots/sankey';\nexport type { SankeyOptions } from './plots/sankey';\n\n// 弦图及类型定义 | author by [MrSmallLiu](https://github.com/MrSmallLiu), [visiky](https://github.com/visiky)\nexport { Chord } from './plots/chord';\nexport type { ChordOptions } from './plots/chord';\n\n// circle-packing 及类型定义 | author by [visiky](https://github.com/visiky), [Angeli](https://github.com/Angelii)\nexport { CirclePacking } from './plots/circle-packing';\nexport type { CirclePackingOptions } from './plots/circle-packing';\n\n// 以下开放自定义图表开发的能力(目前仅仅是孵化中)\n/** 所有开放图表都使用 G2Plot.P 作为入口开发,理论上官方的所有图表都可以走 G2Plot.P 的入口(暂时不处理) */\nexport { P } from './plugin';\n\n/** 开放 getCanvasPatterng 方法 */\nexport { getCanvasPattern } from './utils/pattern';\n\n// 已经废弃,更名为 Mix\nexport { Mix as MultiView } from './plots/mix';\nexport type { MixOptions as MultiViewOptions } from './plots/mix';\n/** 开放多图层图表 (mix) */\nexport { Mix as Mix } from './plots/mix';\nexport type { MixOptions } from './plots/mix';\n\n// 分面图及类型定义 | author by [visiky](https://github.com/visiky)\nexport { Facet } from './plots/facet';\nexport type { FacetOptions } from './plots/facet';\n\n/** 提供一些工具方法 */\nimport { findGeometry, getAllGeometriesRecursively, findViewById } from './utils';\nconst Util = {\n findGeometry,\n findViewById,\n getAllGeometriesRecursively,\n};\nexport { Util };\n/** 开发 adaptor 可能会用到的方法或一些工具方法,不强制使用 */\nexport { flow, measureTextWidth } from './utils';\n\n/** 各个 geometry 的 adaptor,可以让开发者更快的构造图形 */\nexport { line, interval, area, point, polygon, schema } from './adaptor/geometries';\nexport type {\n LineGeometryOptions,\n IntervalGeometryOptions,\n AreaGeometryOptions,\n PointGeometryOptions,\n PolygonGeometryOptions,\n SchemaGeometryOptions,\n} from './adaptor/geometries';\n/** 开放一些通用的 adaptor 通道方法,实验阶段:不保证稳定性 */\nimport { scale, legend, tooltip, annotation, interaction, theme, animation } from './adaptor/common';\nexport const adaptors = { scale, legend, tooltip, annotation, interaction, theme, animation };\n\n/** 对于没有开发完成的图表,可以暂时先放到 Lab 下面,先做体验,稳定后放到根 export */\nexport { Lab } from './lab';\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,IAAM,OAAO,GAAG,OAAO,CAAC;AAE/B,aAAa;AACb,OAAO,KAAK,EAAE,MAAM,UAAU,CAAC;AAC/B,OAAO,EAAE,EAAE,EAAE,CAAC;AAEd,QAAQ;AACR,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC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;AAC7G,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAGvD,2BAA2B;AAC3B,mEAAmE;AACnE,OAAO,EAAE,CAAC,EAAE,MAAM,UAAU,CAAC;AAE7B,8BAA8B;AAC9B,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAEnD,eAAe;AACf,OAAO,EAAE,GAAG,IAAI,SAAS,EAAE,MAAM,aAAa,CAAC;AAE/C,oBAAoB;AACpB,OAAO,EAAE,GAAG,IAAI,GAAG,EAAE,MAAM,aAAa,CAAC;AAGzC,2DAA2D;AAC3D,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAGtC,uCAAuC;AACvC,OAAO,EAAE,IAAI,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAEjD,0CAA0C;AAC1C,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AASpF,uCAAuC;AACvC,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACrG,MAAM,CAAC,IAAM,QAAQ,GAAG,EAAE,KAAK,OAAA,EAAE,MAAM,QAAA,EAAE,OAAO,SAAA,EAAE,UAAU,YAAA,EAAE,WAAW,aAAA,EAAE,KAAK,OAAA,EAAE,SAAS,WAAA,EAAE,CAAC;AAE9F,oDAAoD;AACpD,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC","sourcesContent":["export const version = '2.4.8';\n\n// G2 自定义能力透出\nimport * as G2 from '@antv/g2';\nexport { G2 };\n\n// 国际化处理\nimport { registerLocale } from './core/locale';\nimport { EN_US_LOCALE } from './locales/en_US';\nimport { ZH_CN_LOCALE } from './locales/zh_CN';\n/** default locale register */\nregisterLocale('en-US', EN_US_LOCALE);\nregisterLocale('zh-CN', ZH_CN_LOCALE);\n/** 透出 国际化 工具函数,便于使用 */\nexport { registerLocale };\n\n/** 全局变量 */\nexport { setGlobal } from './core/global';\n\n/** G2Plot 的 Plot 基类 */\nexport { Plot } from './core/plot';\n\n/** Adaptor 及其参数的类型定义 */\nexport type { Adaptor, Params } from './core/adaptor';\n\n// 类型定义导出\nexport * from './types';\n\n// 折线图及类型定义 | author by [hustcc](https://github.com/hustcc)\nexport { Line } from './plots/line';\nexport type { LineOptions } from './plots/line';\n\n// 面积图及类型定义 | author by [hustcc](https://github.com/hustcc)\nexport { Area } from './plots/area';\nexport type { AreaOptions } from './plots/area';\n\n// 柱形图及类型定义 | author by [zqlu](https://github.com/zqlu)\nexport { Column } from './plots/column';\nexport type { ColumnOptions } from './plots/column';\n\n// 条形图及类型定义 | author by [BBSQQ](https://github.com/BBSQQ)\nexport { Bar } from './plots/bar';\nexport type { BarOptions } from './plots/bar';\n\n// 饼图及类型定义 | author by [visiky](https://github.com/visiky)\nexport { Pie } from './plots/pie';\nexport type { PieOptions } from './plots/pie';\n\n// 玫瑰图及类型定义 | author by [zhangzhonghe](https://github.com/zhangzhonghe)\nexport { Rose } from './plots/rose';\nexport type { RoseOptions } from './plots/rose';\n\n// 词云图及类型定义 | author by [zhangzhonghe](https://github.com/zhangzhonghe)\nexport { WordCloud } from './plots/word-cloud';\nexport type { WordCloudOptions } from './plots/word-cloud';\n\n// 散点图及类型定义 | author by [lxfu1](https://github.com/lxfu1)\nexport { Scatter } from './plots/scatter';\nexport type { ScatterOptions } from './plots/scatter';\n\n// 雷达图及类型定义 | author by [visiky](https://github.com/visiky)\nexport { Radar } from './plots/radar';\nexport type { RadarOptions } from './plots/radar';\n\n// 混合图形 | author by [liuzhenying](https://github.com/liuzhenying)\nexport { DualAxes } from './plots/dual-axes';\nexport type { DualAxesOptions } from './plots/dual-axes';\n\n// 迷你折线图及类型定义 | author by [connono](https://github.com/connono)\nexport { TinyLine } from './plots/tiny-line';\nexport type { TinyLineOptions } from './plots/tiny-line';\n\n// 迷你柱形图及类型定义 | author by [connono](https://github.com/connono)\nexport { TinyColumn } from './plots/tiny-column';\nexport type { TinyColumnOptions } from './plots/tiny-column';\n\n// 迷你面积图及类型定义 | author by [connono](https://github.com/connono)\nexport { TinyArea } from './plots/tiny-area';\nexport type { TinyAreaOptions } from './plots/tiny-area';\n\n// 直方图及类型定义 | author by [arcsin1](https://github.com/arcsin1), [visiky](https://github.com/visiky)\nexport { Histogram } from './plots/histogram';\nexport type { HistogramOptions } from './plots/histogram';\n\n// 进度图及类型定义 | author by [connono](https://github.com/connono)\nexport { Progress } from './plots/progress';\nexport type { ProgressOptions } from './plots/progress';\n\n// 环形进度图及类型定义 | author by [connono](https://github.com/connono)\nexport { RingProgress } from './plots/ring-progress';\nexport type { RingProgressOptions } from './plots/ring-progress';\n\n// 热力图及类型定义 | author by [jiazhewang](https://github.com/jiazhewang)\nexport { Heatmap } from './plots/heatmap';\nexport type { HeatmapOptions } from './plots/heatmap';\n\n// 箱线图及类型定义 | author by [BBSQQ](https://github.com/BBSQQ), [visiky](https://github.com/visiky)\nexport { Box } from './plots/box';\nexport type { BoxOptions } from './plots/box';\n\n// 小提琴图及类型定义 | author by [YiSiWang](https://github.com/YiSiWang), [visiky](https://github.com/visiky)\nexport { Violin } from './plots/violin';\nexport type { ViolinOptions } from './plots/violin';\n\n// 韦恩图及类型定义 | author by [visiky](https://github.com/visiky)\nexport { Venn } from './plots/venn';\nexport type { VennOptions } from './plots/venn';\n\n// K线图及类型定义 | author by [jhwong](https://github.com/jinhuiWong), [visiky](https://github.com/visiky)\nexport { Stock } from './plots/stock';\nexport type { StockOptions } from './plots/stock';\n\n// 漏斗图及类型定义\nexport { Funnel, FUNNEL_CONVERSATION_FIELD } from './plots/funnel';\nexport type { FunnelOptions } from './plots/funnel';\n\n// 水波图及类型定义 | author by [CarisL](https://github.com/CarisL), [hustcc](https://github.com/hustcc), [pearmini](https://github.com/pearmini)\nexport { Liquid } from './plots/liquid';\nexport type { LiquidOptions } from './plots/liquid';\n\n// 子弹图及类型定义 | author by [arcsin1](https://github.com/arcsin1)\nexport { Bullet } from './plots/bullet';\nexport type { BulletOptions } from './plots/bullet';\n\n// 旭日图及类型定义 | author by [lxfu1](https://github.com/lxfu1), [visiky](https://github.com/visiky)\nexport { Sunburst } from './plots/sunburst';\nexport type { SunburstOptions } from './plots/sunburst';\n\n// 仪表盘及类型定义 | author by [hustcc](https://github.com/hustcc)\nexport { Gauge } from './plots/gauge';\nexport type { GaugeOptions } from './plots/gauge';\n\n// 瀑布图 | author by [visiky](https://github.com/visiky)\nexport { Waterfall } from './plots/waterfall';\nexport type { WaterfallOptions } from './plots/waterfall';\n\n// 玉珏图 | author by [yujs](https://github.com/yujs) | updated by [visiky](https://github.com/visiky)\nexport { RadialBar } from './plots/radial-bar';\nexport type { RadialBarOptions } from './plots/radial-bar';\n\n// 对称条形图及类型定义 | author by [arcsin1](https://github.com/arcsin1)\nexport { BidirectionalBar } from './plots/bidirectional-bar';\nexport type { BidirectionalBarOptions } from './plots/bidirectional-bar';\n\n// 矩形树图\nexport { Treemap } from './plots/treemap';\nexport type { TreemapOptions } from './plots/treemap';\n\n// 桑基图及类型定义 | author by [hustcc](https://github.com/hustcc)\nexport { Sankey } from './plots/sankey';\nexport type { SankeyOptions } from './plots/sankey';\n\n// 弦图及类型定义 | author by [MrSmallLiu](https://github.com/MrSmallLiu), [visiky](https://github.com/visiky)\nexport { Chord } from './plots/chord';\nexport type { ChordOptions } from './plots/chord';\n\n// circle-packing 及类型定义 | author by [visiky](https://github.com/visiky), [Angeli](https://github.com/Angelii)\nexport { CirclePacking } from './plots/circle-packing';\nexport type { CirclePackingOptions } from './plots/circle-packing';\n\n// 以下开放自定义图表开发的能力(目前仅仅是孵化中)\n/** 所有开放图表都使用 G2Plot.P 作为入口开发,理论上官方的所有图表都可以走 G2Plot.P 的入口(暂时不处理) */\nexport { P } from './plugin';\n\n/** 开放 getCanvasPatterng 方法 */\nexport { getCanvasPattern } from './utils/pattern';\n\n// 已经废弃,更名为 Mix\nexport { Mix as MultiView } from './plots/mix';\nexport type { MixOptions as MultiViewOptions } from './plots/mix';\n/** 开放多图层图表 (mix) */\nexport { Mix as Mix } from './plots/mix';\nexport type { MixOptions } from './plots/mix';\n\n// 分面图及类型定义 | author by [visiky](https://github.com/visiky)\nexport { Facet } from './plots/facet';\nexport type { FacetOptions } from './plots/facet';\n\n/** 开发 adaptor 可能会用到的方法或一些工具方法,不强制使用 */\nexport { flow, measureTextWidth } from './utils';\n\n/** 各个 geometry 的 adaptor,可以让开发者更快的构造图形 */\nexport { line, interval, area, point, polygon, schema } from './adaptor/geometries';\nexport type {\n LineGeometryOptions,\n IntervalGeometryOptions,\n AreaGeometryOptions,\n PointGeometryOptions,\n PolygonGeometryOptions,\n SchemaGeometryOptions,\n} from './adaptor/geometries';\n/** 开放一些通用的 adaptor 通道方法,实验阶段:不保证稳定性 */\nimport { scale, legend, tooltip, annotation, interaction, theme, animation } from './adaptor/common';\nexport const adaptors = { scale, legend, tooltip, annotation, interaction, theme, animation };\n\n/** 对于没有开发完成的图表,可以暂时先放到 Lab 下面,先做体验,稳定后放到根 export */\nexport { Lab } from './lab';\n"]}
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { __assign, __rest } from "tslib";
|
|
2
|
-
import { each,
|
|
2
|
+
import { each, omit } from '@antv/util';
|
|
3
3
|
import { tooltip, slider, interaction, animation, theme, annotation, limitInPlot, pattern } from '../../adaptor/common';
|
|
4
|
-
import { findGeometry
|
|
4
|
+
import { findGeometry } from '../../utils';
|
|
5
5
|
import { area, point, line } from '../../adaptor/geometries';
|
|
6
6
|
import { flow, transformLabel, deepAssign } from '../../utils';
|
|
7
7
|
import { getDataWhetherPecentage } from '../../utils/transform/percent';
|
|
8
8
|
import { meta, legend, axis } from '../line/adaptor';
|
|
9
|
-
import { POINT_VIEW_ID } from './constants';
|
|
10
9
|
export { meta };
|
|
11
10
|
/**
|
|
12
11
|
* geometry 处理
|
|
@@ -27,9 +26,6 @@ function geometry(params) {
|
|
|
27
26
|
var primary = deepAssign({}, params, {
|
|
28
27
|
options: {
|
|
29
28
|
area: { color: color, style: areaStyle },
|
|
30
|
-
// 颜色保持一致,因为如果颜色不一致,会导致 tooltip 中元素重复。
|
|
31
|
-
// 如果存在,才设置,否则为空
|
|
32
|
-
line: lineMapping && __assign({ color: color }, lineMapping),
|
|
33
29
|
point: pointMapping && __assign({ color: color }, pointMapping),
|
|
34
30
|
tooltip: tooltipOptions,
|
|
35
31
|
// label 不传递给各个 geometry adaptor,由 label adaptor 处理
|
|
@@ -39,23 +35,28 @@ function geometry(params) {
|
|
|
39
35
|
},
|
|
40
36
|
},
|
|
41
37
|
});
|
|
42
|
-
// 线默认 2px
|
|
43
|
-
var lineParams =
|
|
44
|
-
|
|
45
|
-
|
|
38
|
+
// 线默认 2px (折线不能复用面积图的 state,因为 fill 和 stroke 不匹配)
|
|
39
|
+
var lineParams = {
|
|
40
|
+
chart: chart,
|
|
41
|
+
options: deepAssign({ line: { size: 2 } }, omit(options, ['state']), {
|
|
42
|
+
// 颜色保持一致,因为如果颜色不一致,会导致 tooltip 中元素重复。
|
|
43
|
+
// 如果存在,才设置,否则为空
|
|
44
|
+
line: lineMapping && __assign({ color: color }, lineMapping),
|
|
45
|
+
sizeField: seriesField,
|
|
46
|
+
state: lineMapping === null || lineMapping === void 0 ? void 0 : lineMapping.state,
|
|
47
|
+
tooltip: false,
|
|
48
|
+
// label 不传递给各个 geometry adaptor,由 label adaptor 处理
|
|
49
|
+
label: undefined,
|
|
50
|
+
args: {
|
|
51
|
+
startOnZero: startOnZero,
|
|
52
|
+
},
|
|
53
|
+
}),
|
|
54
|
+
};
|
|
55
|
+
var pointParams = deepAssign({}, primary, { options: { tooltip: false, state: pointState } });
|
|
46
56
|
// area geometry 处理
|
|
47
57
|
area(primary);
|
|
48
58
|
line(lineParams);
|
|
49
|
-
|
|
50
|
-
if (pointMapping) {
|
|
51
|
-
var pointView = chart.createView({ id: POINT_VIEW_ID });
|
|
52
|
-
pointView.axis(false);
|
|
53
|
-
pointView.tooltip(false);
|
|
54
|
-
pointView.legend(false);
|
|
55
|
-
// [PERFORMANCE] 🚀 数据为空的 point 标注点都不渲染(不包括:数据为 0)
|
|
56
|
-
pointView.data(data.filter(function (d) { return !isNil(d[yField]); }));
|
|
57
|
-
point(__assign(__assign({}, pointParams), { chart: pointView }));
|
|
58
|
-
}
|
|
59
|
+
point(pointParams);
|
|
59
60
|
return params;
|
|
60
61
|
}
|
|
61
62
|
/**
|
|
@@ -93,8 +94,7 @@ function adjust(params) {
|
|
|
93
94
|
var chart = params.chart, options = params.options;
|
|
94
95
|
var isStack = options.isStack, isPercent = options.isPercent, seriesField = options.seriesField;
|
|
95
96
|
if ((isPercent || isStack) && seriesField) {
|
|
96
|
-
|
|
97
|
-
each(geometries, function (g) {
|
|
97
|
+
each(chart.geometries, function (g) {
|
|
98
98
|
g.adjust('stack');
|
|
99
99
|
});
|
|
100
100
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"adaptor.js","sourceRoot":"","sources":["../../../src/plots/area/adaptor.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,IAAI,EAAE,
|
|
1
|
+
{"version":3,"file":"adaptor.js","sourceRoot":"","sources":["../../../src/plots/area/adaptor.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AACxC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,SAAS,EAAE,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AACxH,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE3C,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAAE,IAAI,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAC/D,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O,CAAC,MAA2B;IACjD,0BAA0B;IAC1B,OAAO,IAAI,CACT,KAAK,EACL,OAAO,CAAC,WAAW,CAAC,EACpB,QAAQ,EACR,IAAI,EACJ,MAAM,EACN,IAAI,EACJ,MAAM,EACN,OAAO,EACP,KAAK,EACL,MAAM,EACN,UAAU,EAAE,EACZ,WAAW,EACX,SAAS,EACT,WAAW,CACZ,CAAC,MAAM,CAAC,CAAC;AACZ,CAAC","sourcesContent":["import { Geometry } from '@antv/g2';\nimport { each, omit } from '@antv/util';\nimport { tooltip, slider, interaction, animation, theme, annotation, limitInPlot, pattern } from '../../adaptor/common';\nimport { findGeometry } from '../../utils';\nimport { Params } from '../../core/adaptor';\nimport { area, point, line } from '../../adaptor/geometries';\nimport { flow, transformLabel, deepAssign } from '../../utils';\nimport { getDataWhetherPecentage } from '../../utils/transform/percent';\nimport { Datum } from '../../types';\nimport { meta, legend, axis } from '../line/adaptor';\nimport { AreaOptions } from './types';\n\nexport { meta };\n\n/**\n * geometry 处理\n * @param params\n */\nfunction geometry(params: Params<AreaOptions>): Params<AreaOptions> {\n const { chart, options } = params;\n const {\n data,\n areaStyle,\n color,\n point: pointMapping,\n line: lineMapping,\n isPercent,\n xField,\n yField,\n tooltip,\n seriesField,\n startOnZero,\n } = options;\n const pointState = pointMapping?.state;\n\n const chartData = getDataWhetherPecentage(data, yField, xField, yField, isPercent);\n chart.data(chartData);\n // 百分比堆积图,默认会给一个 % 格式化逻辑, 用户可自定义\n const tooltipOptions = isPercent\n ? {\n formatter: (datum: Datum) => ({\n name: datum[seriesField] || datum[xField],\n value: (Number(datum[yField]) * 100).toFixed(2) + '%',\n }),\n ...tooltip,\n }\n : tooltip;\n const primary = deepAssign({}, params, {\n options: {\n area: { color, style: areaStyle },\n point: pointMapping && {\n color,\n ...pointMapping,\n },\n tooltip: tooltipOptions,\n // label 不传递给各个 geometry adaptor,由 label adaptor 处理\n label: undefined,\n args: {\n startOnZero,\n },\n },\n });\n // 线默认 2px (折线不能复用面积图的 state,因为 fill 和 stroke 不匹配)\n const lineParams = {\n chart,\n options: deepAssign({ line: { size: 2 } }, omit(options as any, ['state']), {\n // 颜色保持一致,因为如果颜色不一致,会导致 tooltip 中元素重复。\n // 如果存在,才设置,否则为空\n line: lineMapping && {\n color,\n ...lineMapping,\n },\n sizeField: seriesField,\n state: lineMapping?.state,\n tooltip: false,\n // label 不传递给各个 geometry adaptor,由 label adaptor 处理\n label: undefined,\n args: {\n startOnZero,\n },\n }),\n };\n const pointParams = deepAssign({}, primary, { options: { tooltip: false, state: pointState } });\n\n // area geometry 处理\n area(primary);\n line(lineParams);\n point(pointParams);\n\n return params;\n}\n\n/**\n * 数据标签\n * @param params\n */\nfunction label(params: Params<AreaOptions>): Params<AreaOptions> {\n const { chart, options } = params;\n const { label, yField } = options;\n\n const areaGeometry = findGeometry(chart, 'area');\n\n // label 为 false, 空 则不显示 label\n if (!label) {\n areaGeometry.label(false);\n } else {\n const { callback, ...cfg } = label;\n areaGeometry.label({\n fields: [yField],\n callback,\n cfg: {\n layout: [\n { type: 'limit-in-plot' },\n { type: 'path-adjust-position' },\n { type: 'point-adjust-position' },\n { type: 'limit-in-plot', cfg: { action: 'hide' } },\n ],\n ...transformLabel(cfg),\n },\n });\n }\n\n return params;\n}\n\n/**\n * 处理 adjust\n * @param params\n */\nfunction adjust(params: Params<AreaOptions>): Params<AreaOptions> {\n const { chart, options } = params;\n const { isStack, isPercent, seriesField } = options;\n if ((isPercent || isStack) && seriesField) {\n each(chart.geometries, (g: Geometry) => {\n g.adjust('stack');\n });\n }\n\n return params;\n}\n\n/**\n * 折线图适配器\n * @param chart\n * @param options\n */\nexport function adaptor(params: Params<AreaOptions>) {\n // flow 的方式处理所有的配置到 G2 API\n return flow(\n theme,\n pattern('areaStyle'),\n geometry,\n meta,\n adjust,\n axis,\n legend,\n tooltip,\n label,\n slider,\n annotation(),\n interaction,\n animation,\n limitInPlot\n )(params);\n}\n"]}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { Plot } from '../../core/plot';
|
|
2
2
|
import { deepAssign } from '../../utils';
|
|
3
|
-
/** point 标注点视图 */
|
|
4
|
-
export var POINT_VIEW_ID = 'point-view';
|
|
5
3
|
/**
|
|
6
4
|
* 面积图默认配置项
|
|
7
5
|
*/
|
|
@@ -19,6 +17,7 @@ export var DEFAULT_OPTIONS = deepAssign({}, Plot.getDefaultOptions(), {
|
|
|
19
17
|
line: {},
|
|
20
18
|
legend: {
|
|
21
19
|
position: 'top-left',
|
|
20
|
+
radio: {},
|
|
22
21
|
},
|
|
23
22
|
});
|
|
24
23
|
//# sourceMappingURL=constants.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/plots/area/constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AACvC,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/plots/area/constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AACvC,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC;;GAEG;AACH,MAAM,CAAC,IAAM,eAAe,GAAG,UAAU,CAAC,EAAE,EAAE,IAAI,CAAC,iBAAiB,EAAE,EAAE;IACtE,OAAO,EAAE;QACP,MAAM,EAAE,IAAI;QACZ,WAAW,EAAE,IAAI;QACjB,cAAc,EAAE,IAAI;QACpB,UAAU,EAAE;YACV,IAAI,EAAE,GAAG;SACV;KACF;IACD,OAAO,EAAE,IAAI;IACb,OAAO;IACP,IAAI,EAAE,EAAE;IACR,MAAM,EAAE;QACN,QAAQ,EAAE,UAAU;QACpB,KAAK,EAAE,EAAE;KACV;CACF,CAAC,CAAC","sourcesContent":["import { Plot } from '../../core/plot';\nimport { deepAssign } from '../../utils';\n\n/**\n * 面积图默认配置项\n */\nexport const DEFAULT_OPTIONS = deepAssign({}, Plot.getDefaultOptions(), {\n tooltip: {\n shared: true,\n showMarkers: true,\n showCrosshairs: true,\n crosshairs: {\n type: 'x',\n },\n },\n isStack: true,\n // 默认开启\n line: {},\n legend: {\n position: 'top-left',\n radio: {},\n },\n});\n"]}
|
package/esm/plots/area/index.js
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import { __extends } from "tslib";
|
|
2
|
-
import { isNil } from '@antv/util';
|
|
3
2
|
import { Plot } from '../../core/plot';
|
|
4
3
|
import { getDataWhetherPecentage } from '../../utils/transform/percent';
|
|
5
|
-
import { findViewById } from '../../utils';
|
|
6
4
|
import { adaptor, meta } from './adaptor';
|
|
7
|
-
import { DEFAULT_OPTIONS
|
|
5
|
+
import { DEFAULT_OPTIONS } from './constants';
|
|
8
6
|
var Area = /** @class */ (function (_super) {
|
|
9
7
|
__extends(Area, _super);
|
|
10
8
|
function Area() {
|
|
@@ -32,15 +30,10 @@ var Area = /** @class */ (function (_super) {
|
|
|
32
30
|
*/
|
|
33
31
|
Area.prototype.changeData = function (data) {
|
|
34
32
|
this.updateOption({ data: data });
|
|
35
|
-
var _a = this,
|
|
36
|
-
var
|
|
33
|
+
var _a = this.options, isPercent = _a.isPercent, xField = _a.xField, yField = _a.yField;
|
|
34
|
+
var _b = this, chart = _b.chart, options = _b.options;
|
|
37
35
|
meta({ chart: chart, options: options });
|
|
38
|
-
|
|
39
|
-
this.chart.changeData(chartdata);
|
|
40
|
-
var pointView = findViewById(this.chart, POINT_VIEW_ID);
|
|
41
|
-
if (pointView) {
|
|
42
|
-
pointView.changeData(data.filter(function (d) { return !isNil(d[yField]); }));
|
|
43
|
-
}
|
|
36
|
+
this.chart.changeData(getDataWhetherPecentage(data, yField, xField, yField, isPercent));
|
|
44
37
|
};
|
|
45
38
|
/**
|
|
46
39
|
* 获取 面积图 的适配器
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/plots/area/index.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/plots/area/index.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAEvC,OAAO,EAAE,uBAAuB,EAAE,MAAM,+BAA+B,CAAC;AAExE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAI9C;IAA0B,wBAAiB;IAA3C;QAAA,qEAqCC;QA5BC,WAAW;QACJ,UAAI,GAAW,MAAM,CAAC;;IA2B/B,CAAC;IApCC;;;OAGG;IACI,sBAAiB,GAAxB;QACE,OAAO,eAAe,CAAC;IACzB,CAAC;IAKD;;OAEG;IACO,gCAAiB,GAA3B;QACE,OAAO,IAAI,CAAC,iBAAiB,EAAE,CAAC;IAClC,CAAC;IAED;;;OAGG;IACI,yBAAU,GAAjB,UAAkB,IAAyB;QACzC,IAAI,CAAC,YAAY,CAAC,EAAE,IAAI,MAAA,EAAE,CAAC,CAAC;QACtB,IAAA,KAAgC,IAAI,CAAC,OAAO,EAA1C,SAAS,eAAA,EAAE,MAAM,YAAA,EAAE,MAAM,YAAiB,CAAC;QAC7C,IAAA,KAAqB,IAAI,EAAvB,KAAK,WAAA,EAAE,OAAO,aAAS,CAAC;QAChC,IAAI,CAAC,EAAE,KAAK,OAAA,EAAE,OAAO,SAAA,EAAE,CAAC,CAAC;QACzB,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,uBAAuB,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,CAAC,CAAC,CAAC;IAC1F,CAAC;IAED;;OAEG;IACO,+BAAgB,GAA1B;QACE,OAAO,OAAO,CAAC;IACjB,CAAC;IACH,WAAC;AAAD,CAAC,AArCD,CAA0B,IAAI,GAqC7B","sourcesContent":["import { Plot } from '../../core/plot';\nimport { Adaptor } from '../../core/adaptor';\nimport { getDataWhetherPecentage } from '../../utils/transform/percent';\nimport { AreaOptions } from './types';\nimport { adaptor, meta } from './adaptor';\nimport { DEFAULT_OPTIONS } from './constants';\n\nexport type { AreaOptions };\n\nexport class Area extends Plot<AreaOptions> {\n /**\n * 获取 面积图 默认配置项\n * 供外部使用\n */\n static getDefaultOptions(): Partial<AreaOptions> {\n return DEFAULT_OPTIONS;\n }\n\n /** 图表类型 */\n public type: string = 'area';\n\n /**\n * 获取 面积图 默认配置\n */\n protected getDefaultOptions() {\n return Area.getDefaultOptions();\n }\n\n /**\n * @override\n * @param data\n */\n public changeData(data: AreaOptions['data']) {\n this.updateOption({ data });\n const { isPercent, xField, yField } = this.options;\n const { chart, options } = this;\n meta({ chart, options });\n this.chart.changeData(getDataWhetherPecentage(data, yField, xField, yField, isPercent));\n }\n\n /**\n * 获取 面积图 的适配器\n */\n protected getSchemaAdaptor(): Adaptor<AreaOptions> {\n return adaptor;\n }\n}\n"]}
|
|
@@ -17,7 +17,7 @@ export interface AreaOptions extends Options, Pick<GeometryOptions, 'customInfo'
|
|
|
17
17
|
/** 面积图形样式 */
|
|
18
18
|
readonly areaStyle?: StyleAttr;
|
|
19
19
|
/** 面积中折线的样式 */
|
|
20
|
-
readonly line?: LineGeometryOptions['line']
|
|
20
|
+
readonly line?: LineGeometryOptions['line'] & Pick<PointGeometryOptions, 'state'>;
|
|
21
21
|
/** 面积图数据点图形样式 */
|
|
22
22
|
readonly point?: PointGeometryOptions['point'] & Pick<PointGeometryOptions, 'state'>;
|
|
23
23
|
/** 积图是否从 0 基准线开始填充 */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/plots/area/types.ts"],"names":[],"mappings":"","sourcesContent":["import { GeometryOptions, LineGeometryOptions, PointGeometryOptions } from '../../adaptor/geometries';\nimport { Options, StyleAttr } from '../../types';\n\n/** 面积图的配置类型定义 */\nexport interface AreaOptions extends Options, Pick<GeometryOptions, 'customInfo'> {\n /** x 轴字段 */\n readonly xField?: string;\n /** y 轴字段 */\n readonly yField?: string;\n /** 分组字段 */\n readonly seriesField?: string;\n /** 是否堆积 */\n readonly isStack?: boolean;\n /** 是否百分比 */\n readonly isPercent?: boolean;\n /** 是否平滑 */\n readonly smooth?: boolean;\n /** 面积图形样式 */\n readonly areaStyle?: StyleAttr;\n /** 面积中折线的样式 */\n readonly line?: LineGeometryOptions['line']
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/plots/area/types.ts"],"names":[],"mappings":"","sourcesContent":["import { GeometryOptions, LineGeometryOptions, PointGeometryOptions } from '../../adaptor/geometries';\nimport { Options, StyleAttr } from '../../types';\n\n/** 面积图的配置类型定义 */\nexport interface AreaOptions extends Options, Pick<GeometryOptions, 'customInfo'> {\n /** x 轴字段 */\n readonly xField?: string;\n /** y 轴字段 */\n readonly yField?: string;\n /** 分组字段 */\n readonly seriesField?: string;\n /** 是否堆积 */\n readonly isStack?: boolean;\n /** 是否百分比 */\n readonly isPercent?: boolean;\n /** 是否平滑 */\n readonly smooth?: boolean;\n /** 面积图形样式 */\n readonly areaStyle?: StyleAttr;\n /** 面积中折线的样式 */\n readonly line?: LineGeometryOptions['line'] & Pick<PointGeometryOptions, 'state'>;\n /** 面积图数据点图形样式 */\n readonly point?: PointGeometryOptions['point'] & Pick<PointGeometryOptions, 'state'>;\n /** 积图是否从 0 基准线开始填充 */\n readonly startOnZero?: boolean;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/plots/bar/constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AACvC,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC;;GAEG;AACH,MAAM,CAAC,IAAM,eAAe,GAAG,UAAU,CAAC,EAAE,EAAE,IAAI,CAAC,iBAAiB,EAAE,EAAE;IACtE,aAAa,EAAE,GAAG;IAClB,WAAW,EAAE,CAAC,GAAG,EAAE;IACnB,OAAO,EAAE;QACP,MAAM,EAAE,IAAI;QACZ,WAAW,EAAE,KAAK;QAClB,MAAM,EAAE,EAAE;KACX;IACD,YAAY,EAAE,CAAC,EAAE,IAAI,EAAE,eAAe,EAAE,CAAC;CAC1C,CAAC,CAAC","sourcesContent":["import { Plot } from '../../core/plot';\nimport { deepAssign } from '../../utils';\n\n/**\n * 条形图默认配置项\n */\nexport const DEFAULT_OPTIONS = deepAssign({}, Plot.getDefaultOptions(), {\n barWidthRatio: 0.6,\n marginRatio: 1 / 32,\n tooltip: {\n shared: true,\n showMarkers: false,\n offset: 20,\n },\n interactions: [{ type: 'active-region' }],\n});\n"]}
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/plots/bar/constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AACvC,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC;;GAEG;AACH,MAAM,CAAC,IAAM,eAAe,GAAG,UAAU,CAAC,EAAE,EAAE,IAAI,CAAC,iBAAiB,EAAE,EAAE;IACtE,aAAa,EAAE,GAAG;IAClB,WAAW,EAAE,CAAC,GAAG,EAAE;IACnB,OAAO,EAAE;QACP,MAAM,EAAE,IAAI;QACZ,WAAW,EAAE,KAAK;QAClB,MAAM,EAAE,EAAE;KACX;IACD,MAAM,EAAE;QACN,KAAK,EAAE,EAAE;KACV;IACD,YAAY,EAAE,CAAC,EAAE,IAAI,EAAE,eAAe,EAAE,CAAC;CAC1C,CAAC,CAAC","sourcesContent":["import { Plot } from '../../core/plot';\nimport { deepAssign } from '../../utils';\n\n/**\n * 条形图默认配置项\n */\nexport const DEFAULT_OPTIONS = deepAssign({}, Plot.getDefaultOptions(), {\n barWidthRatio: 0.6,\n marginRatio: 1 / 32,\n tooltip: {\n shared: true,\n showMarkers: false,\n offset: 20,\n },\n legend: {\n radio: {},\n },\n interactions: [{ type: 'active-region' }],\n});\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/plots/column/constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AACvC,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC;;GAEG;AACH,MAAM,CAAC,IAAM,eAAe,GAAG,UAAU,CAAC,EAAE,EAAE,IAAI,CAAC,iBAAiB,EAAE,EAAE;IACtE,gBAAgB,EAAE,GAAG;IACrB,WAAW,EAAE,CAAC,GAAG,EAAE;IACnB,OAAO,EAAE;QACP,MAAM,EAAE,IAAI;QACZ,WAAW,EAAE,KAAK;QAClB,MAAM,EAAE,EAAE;KACX;IACD,YAAY,EAAE,CAAC,EAAE,IAAI,EAAE,eAAe,EAAE,CAAC;CAC1C,CAAC,CAAC","sourcesContent":["import { Plot } from '../../core/plot';\nimport { deepAssign } from '../../utils';\n\n/**\n * 柱形图默认配置项\n */\nexport const DEFAULT_OPTIONS = deepAssign({}, Plot.getDefaultOptions(), {\n columnWidthRatio: 0.6,\n marginRatio: 1 / 32,\n tooltip: {\n shared: true,\n showMarkers: false,\n offset: 20,\n },\n interactions: [{ type: 'active-region' }],\n});\n"]}
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/plots/column/constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AACvC,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC;;GAEG;AACH,MAAM,CAAC,IAAM,eAAe,GAAG,UAAU,CAAC,EAAE,EAAE,IAAI,CAAC,iBAAiB,EAAE,EAAE;IACtE,gBAAgB,EAAE,GAAG;IACrB,WAAW,EAAE,CAAC,GAAG,EAAE;IACnB,OAAO,EAAE;QACP,MAAM,EAAE,IAAI;QACZ,WAAW,EAAE,KAAK;QAClB,MAAM,EAAE,EAAE;KACX;IACD,MAAM,EAAE;QACN,KAAK,EAAE,EAAE;KACV;IACD,YAAY,EAAE,CAAC,EAAE,IAAI,EAAE,eAAe,EAAE,CAAC;CAC1C,CAAC,CAAC","sourcesContent":["import { Plot } from '../../core/plot';\nimport { deepAssign } from '../../utils';\n\n/**\n * 柱形图默认配置项\n */\nexport const DEFAULT_OPTIONS = deepAssign({}, Plot.getDefaultOptions(), {\n columnWidthRatio: 0.6,\n marginRatio: 1 / 32,\n tooltip: {\n shared: true,\n showMarkers: false,\n offset: 20,\n },\n legend: {\n radio: {},\n },\n interactions: [{ type: 'active-region' }],\n});\n"]}
|
|
@@ -26,6 +26,6 @@ export var doSliderFilter = function (view, sliderValue) {
|
|
|
26
26
|
var idx = xValues.indexOf(value);
|
|
27
27
|
return idx > -1 ? isBetween(idx, minIndex, maxIndex) : true;
|
|
28
28
|
});
|
|
29
|
-
view.render(true);
|
|
29
|
+
view.getRootView().render(true);
|
|
30
30
|
};
|
|
31
31
|
//# sourceMappingURL=render-sider.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"render-sider.js","sourceRoot":"","sources":["../../../../src/plots/dual-axes/util/render-sider.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE3C;;;;;;GAMG;AACH,MAAM,CAAC,IAAM,cAAc,GAAG,UAAC,IAAU,EAAE,WAA6B;IAC/D,IAAA,GAAG,GAAS,WAAW,GAApB,EAAE,GAAG,GAAI,WAAW,GAAf,CAAgB;IAC/B,IAAM,IAAI,GAAG,IAAI,CAAC,UAAU,EAAE,CAAC,IAAI,CAAC;IACpC,IAAM,MAAM,GAAG,IAAI,CAAC,SAAS,EAAE,CAAC;IAChC,IAAM,QAAQ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port { isBetween } from '../../../utils';\n\n/**\n * 右侧 View 进行 slider 过滤\n * 由于双轴图是多 View , 需要监听左侧 Slider 的 change 事件来同步右侧 View\n * @param { View } view 右侧视图\n * @param { number[] } sliderValue 滑块当前值\n * @returns void\n */\nexport const doSliderFilter = (view: View, sliderValue: [number, number]) => {\n const [min, max] = sliderValue;\n const data = view.getOptions().data;\n const xScale = view.getXScale();\n const dataSize = size(data);\n if (!xScale || !dataSize) {\n return;\n }\n const isHorizontal = true;\n const values = valuesOfKey(data, xScale.field);\n const xValues = isHorizontal ? values : values.reverse();\n const xTickCount = size(xValues);\n const minIndex = Math.floor(min * (xTickCount - 1));\n const maxIndex = Math.floor(max * (xTickCount - 1));\n\n // 增加 x 轴的过滤器\n view.filter(xScale.field, (value: any) => {\n const idx: number = xValues.indexOf(value);\n return idx > -1 ? isBetween(idx, minIndex, maxIndex) : true;\n });\n view.getRootView().render(true);\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"adaptor.js","sourceRoot":"","sources":["../../../src/plots/gauge/adaptor.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,KAAK,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AACxF,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACpD,OAAO,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AAEvD,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,IAAI,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAC3E,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAEjH,OAAO,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAEzD;;;GAGG;AACH,SAAS,QAAQ,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AAC;oBACb,SAAS,EAAE,QAAQ;oBACnB,KAAK,EAAE,qBAAqB;iBAC7B;aACF,EACD,aAAa,CACd,CAAC;SACH;QACD,oBAAoB,CAAC,KAAK,EAAE,EAAE,SAAS,wBAAO,SAAS,KAAE,OAAO,EAAE,gBAAgB,GAAE,EAAE,EAAE,EAAE,OAAO,SAAA,EAAE,CAAC,CAAC;KACtG;IAED,IAAI,OAAO,EAAE;QACX,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;KACpB;IAED,OAAO,MAAM,CAAC;AAChB,CAAC;AAED;;;GAGG;AACH,SAAS,KAAK,CAAC,MAA4B;IACjC,IAAA,KAAK,GAAK,MAAM,MAAX,CAAY;IAEzB,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IACpB,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IAErB,OAAO,MAAM,CAAC;AAChB,CAAC;AAED;;GAEG;AACH,OAAO,EAAE,SAAS,EAAE,CAAC;AAErB;;;;GAIG;AACH,MAAM,UAAU,OAAO,CAAC,MAA4B;IAClD,0BAA0B;IAC1B,OAAO,IAAI,CACT,KAAK;IACL,+CAA+C;IAC/C,SAAS,EACT,QAAQ,EACR,IAAI,EACJ,SAAS,EACT,WAAW,EACX,UAAU,EAAE,EACZ,KAAK;IACL,uBAAuB;KACxB,CAAC,MAAM,CAAC,CAAC;AACZ,CAAC","sourcesContent":["import { Geometry } from '@antv/g2';\nimport { isString } from '@antv/util';\nimport { interaction, animation, theme, scale, annotation } from '../../adaptor/common';\nimport { interval } from '../../adaptor/geometries';\nimport { AXIS_META_CONFIG_KEYS } from '../../constant';\nimport { Params } from '../../core/adaptor';\nimport { deepAssign, flow, pick, renderGaugeStatistic } from '../../utils';\nimport { RANGE_TYPE, RANGE_VALUE, PERCENT, DEFAULT_COLOR, INDICATEOR_VIEW_ID, RANGE_VIEW_ID } from './constants';\nimport { GaugeOptions } from './types';\nimport { getIndicatorData, getRangeData } from './utils';\n\n/**\n * geometry 处理\n * @param params\n */\nfunction geometry(params: Params<GaugeOptions>): Params<GaugeOptions> {\n const { chart, options } = params;\n const { percent, range, radius, innerRadius, startAngle, endAngle, axis, indicator, gaugeStyle, type, meter } =\n options;\n const { color, width: rangeWidth } = range;\n\n // 指标 & 指针\n // 如果开启在应用\n if (indicator) {\n const indicatorData = getIndicatorData(percent);\n\n const v1 = chart.createView({ id: INDICATEOR_VIEW_ID });\n v1.data(indicatorData);\n\n v1.point()\n .position(`${PERCENT}*1`)\n .shape(indicator.shape || 'gauge-indicator')\n // 传入指针的样式到自定义 shape 中\n .customInfo({\n defaultColor: chart.getTheme().defaultColor,\n indicator,\n });\n\n v1.coordinate('polar', {\n startAngle,\n endAngle,\n radius: innerRadius * radius, // 外部的 innerRadius * radius = 这里的 radius\n });\n\n v1.axis(PERCENT, axis);\n // 一部分应用到 scale 中\n v1.scale(PERCENT, pick(axis, AXIS_META_CONFIG_KEYS));\n }\n\n // 辅助 range\n // [{ range: 1, type: '0', percent: 原始进度百分比 }]\n const rangeData = getRangeData(percent, options.range);\n const v2 = chart.createView({ id: RANGE_VIEW_ID });\n v2.data(rangeData);\n\n const rangeColor = isString(color) ? [color, DEFAULT_COLOR] : color;\n\n const { ext } = interval({\n chart: v2,\n options: {\n xField: '1',\n yField: RANGE_VALUE,\n seriesField: RANGE_TYPE,\n rawFields: [PERCENT],\n isStack: true,\n interval: {\n color: rangeColor,\n style: gaugeStyle,\n shape: type === 'meter' ? 'meter-gauge' : null,\n },\n args: {\n zIndexReversed: true,\n sortZIndex: true,\n },\n minColumnWidth: rangeWidth,\n maxColumnWidth: rangeWidth,\n },\n });\n\n const geometry = ext.geometry as Geometry;\n // 传入到自定义 shape 中\n geometry.customInfo({ meter });\n\n v2.coordinate('polar', {\n innerRadius,\n radius,\n startAngle,\n endAngle,\n }).transpose();\n\n return params;\n}\n\n/**\n * meta 配置\n * @param params\n */\nfunction meta(params: Params<GaugeOptions>): Params<GaugeOptions> {\n return flow(\n scale({\n range: {\n min: 0,\n max: 1,\n maxLimit: 1,\n minLimit: 0,\n },\n [PERCENT]: {},\n })\n )(params);\n}\n\n/**\n * 统计指标文档\n * @param params\n */\nfunction statistic(params: Params<GaugeOptions>, updated?: boolean): Params<GaugeOptions> {\n const { chart, options } = params;\n const { statistic, percent } = options;\n\n // 先清空标注,再重新渲染\n chart.getController('annotation').clear(true);\n if (statistic) {\n const { content: contentOption } = statistic;\n let transformContent;\n // 当设置 content 的时候,设置默认样式\n if (contentOption) {\n transformContent = deepAssign(\n {},\n {\n content: `${(percent * 100).toFixed(2)}%`,\n style: {\n opacity: 0.75,\n fontSize: '30px',\n lineHeight: 1,\n textAlign: 'center',\n color: 'rgba(44,53,66,0.85)',\n },\n },\n contentOption\n );\n }\n renderGaugeStatistic(chart, { statistic: { ...statistic, content: transformContent } }, { percent });\n }\n\n if (updated) {\n chart.render(true);\n }\n\n return params;\n}\n\n/**\n * other 配置\n * @param params\n */\nfunction other(params: Params<GaugeOptions>): Params<GaugeOptions> {\n const { chart } = params;\n\n chart.legend(false);\n chart.tooltip(false);\n\n return params;\n}\n\n/**\n * 对外暴露的 adaptor\n */\nexport { statistic };\n\n/**\n * 图适配器\n * @param chart\n * @param options\n */\nexport function adaptor(params: Params<GaugeOptions>) {\n // flow 的方式处理所有的配置到 G2 API\n return flow(\n theme,\n // animation 配置必须在 createView 之前,不然无法让子 View 生效\n animation,\n geometry,\n meta,\n statistic,\n interaction,\n annotation(),\n other\n // ... 其他的 adaptor flow\n )(params);\n}\n"]}
|
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
import { __assign, __rest } from "tslib";
|
|
2
|
-
import { each, isArray
|
|
3
|
-
import { tooltip, slider, interaction, animation, theme, scale, annotation, limitInPlot } from '../../adaptor/common';
|
|
4
|
-
import {
|
|
2
|
+
import { each, isArray } from '@antv/util';
|
|
3
|
+
import { tooltip, slider, interaction, animation, theme, scale, annotation, limitInPlot, scrollbar, } from '../../adaptor/common';
|
|
4
|
+
import { findGeometry, transformLabel, deepAssign } from '../../utils';
|
|
5
5
|
import { point, line, area } from '../../adaptor/geometries';
|
|
6
|
+
import { flow } from '../../utils';
|
|
6
7
|
import { adjustYMetaByZero } from '../../utils/data';
|
|
7
|
-
import { POINT_VIEW_ID } from './constants';
|
|
8
8
|
/**
|
|
9
9
|
* geometry 配置处理
|
|
10
10
|
* @param params
|
|
11
11
|
*/
|
|
12
12
|
function geometry(params) {
|
|
13
13
|
var chart = params.chart, options = params.options;
|
|
14
|
-
var data = options.data, color = options.color, lineStyle = options.lineStyle, lineShape = options.lineShape, pointMapping = options.point, areaMapping = options.area,
|
|
14
|
+
var data = options.data, color = options.color, lineStyle = options.lineStyle, lineShape = options.lineShape, pointMapping = options.point, areaMapping = options.area, seriesField = options.seriesField;
|
|
15
15
|
var pointState = pointMapping === null || pointMapping === void 0 ? void 0 : pointMapping.state;
|
|
16
|
+
var areaState = areaMapping === null || areaMapping === void 0 ? void 0 : areaMapping.state;
|
|
16
17
|
chart.data(data);
|
|
17
18
|
// line geometry 处理
|
|
18
19
|
var primary = deepAssign({}, params, {
|
|
@@ -32,19 +33,11 @@ function geometry(params) {
|
|
|
32
33
|
label: undefined,
|
|
33
34
|
},
|
|
34
35
|
});
|
|
35
|
-
var
|
|
36
|
+
var second = deepAssign({}, primary, { options: { tooltip: false, state: pointState } });
|
|
37
|
+
var areaParams = deepAssign({}, primary, { options: { tooltip: false, state: areaState } });
|
|
36
38
|
line(primary);
|
|
39
|
+
point(second);
|
|
37
40
|
area(areaParams);
|
|
38
|
-
var pointParams = deepAssign({}, primary, { options: { tooltip: false, state: pointState } });
|
|
39
|
-
if (pointMapping) {
|
|
40
|
-
var pointView = chart.createView({ id: POINT_VIEW_ID });
|
|
41
|
-
pointView.axis(false);
|
|
42
|
-
pointView.tooltip(false);
|
|
43
|
-
pointView.legend(false);
|
|
44
|
-
// [PERFORMANCE] 🚀 数据为空的 point 标注点都不渲染(不包括:数据为 0)
|
|
45
|
-
pointView.data(data.filter(function (d) { return !isNil(d[yField]); }));
|
|
46
|
-
point(__assign(__assign({}, pointParams), { chart: pointView }));
|
|
47
|
-
}
|
|
48
41
|
return params;
|
|
49
42
|
}
|
|
50
43
|
/**
|
|
@@ -54,22 +47,16 @@ function geometry(params) {
|
|
|
54
47
|
export function meta(params) {
|
|
55
48
|
var _a, _b;
|
|
56
49
|
var options = params.options;
|
|
57
|
-
var xAxis = options.xAxis, yAxis = options.yAxis, xField = options.xField, yField = options.yField, data = options.data
|
|
58
|
-
|
|
59
|
-
_a[xField] =
|
|
50
|
+
var xAxis = options.xAxis, yAxis = options.yAxis, xField = options.xField, yField = options.yField, data = options.data;
|
|
51
|
+
return flow(scale((_a = {},
|
|
52
|
+
_a[xField] = xAxis,
|
|
53
|
+
_a[yField] = yAxis,
|
|
54
|
+
_a), (_b = {},
|
|
55
|
+
_b[xField] = {
|
|
60
56
|
type: 'cat',
|
|
61
|
-
sync: true,
|
|
62
|
-
values: uniq(data.map(function (d) { return d[xField]; })),
|
|
63
57
|
},
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
if (seriesField) {
|
|
67
|
-
defaultMeta[seriesField] = { sync: true };
|
|
68
|
-
}
|
|
69
|
-
return flow(scale((_b = {},
|
|
70
|
-
_b[xField] = xAxis,
|
|
71
|
-
_b[yField] = yAxis,
|
|
72
|
-
_b), defaultMeta))(params);
|
|
58
|
+
_b[yField] = adjustYMetaByZero(data, yField),
|
|
59
|
+
_b)))(params);
|
|
73
60
|
}
|
|
74
61
|
/**
|
|
75
62
|
* 坐标系配置. 支持 reflect 镜像处理
|
|
@@ -159,9 +146,8 @@ function label(params) {
|
|
|
159
146
|
export function adjust(params) {
|
|
160
147
|
var chart = params.chart, options = params.options;
|
|
161
148
|
var isStack = options.isStack;
|
|
162
|
-
var geometries = getAllGeometriesRecursively(chart);
|
|
163
149
|
if (isStack) {
|
|
164
|
-
each(geometries, function (g) {
|
|
150
|
+
each(chart.geometries, function (g) {
|
|
165
151
|
g.adjust('stack');
|
|
166
152
|
});
|
|
167
153
|
}
|
|
@@ -174,6 +160,6 @@ export function adjust(params) {
|
|
|
174
160
|
*/
|
|
175
161
|
export function adaptor(params) {
|
|
176
162
|
// flow 的方式处理所有的配置到 G2 API
|
|
177
|
-
return flow(geometry, meta, adjust, theme, coordinate, axis, legend, tooltip, label, slider, interaction, animation, annotation(), limitInPlot)(params);
|
|
163
|
+
return flow(geometry, meta, adjust, theme, coordinate, axis, legend, tooltip, label, slider, scrollbar, interaction, animation, annotation(), limitInPlot)(params);
|
|
178
164
|
}
|
|
179
165
|
//# sourceMappingURL=adaptor.js.map
|