@antv/g2plot 2.4.11 → 2.4.12

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/esm/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export declare const version = "2.4.11";
1
+ export declare const version = "2.4.12";
2
2
  import * as G2 from '@antv/g2';
3
3
  export { G2 };
4
4
  import { registerLocale } from './core/locale';
package/esm/index.js CHANGED
@@ -1,4 +1,4 @@
1
- export var version = '2.4.11';
1
+ export var version = '2.4.12';
2
2
  // G2 自定义能力透出
3
3
  import * as G2 from '@antv/g2';
4
4
  export { G2 };
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,QAAQ,CAAC;AAEhC,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,MAAM,eAAe,CAAC;AAE1C,uBAAuB;AACvB,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAKnC,SAAS;AACT,cAAc,SAAS,CAAC;AAExB,2DAA2D;AAC3D,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAGpC,2DAA2D;AAC3D,OAAO,EAAE,IAAI,EAAE,MAAM,cA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ACvC,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.11';\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, addWaterWave } 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
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,IAAM,OAAO,GAAG,QAAQ,CAAC;AAEhC,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,MAAM,eAAe,CAAC;AAE1C,uBAAuB;AACvB,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAKnC,SAAS;AACT,cAAc,SAAS,CAAC;AAExB,2DAA2D;AAC3D,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAGpC,2DAA2D;AAC3D,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAGpC,uDAAuD;AACvD,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAGxC,yDAAyD;AACzD,OAAO,EAAE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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.12';\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, addWaterWave } 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"]}
@@ -217,6 +217,7 @@ export function theme(params) {
217
217
  var chart = params.chart;
218
218
  commonTheme(deepAssign({}, params, { chart: findViewById(chart, FIRST_AXES_VIEW) }));
219
219
  commonTheme(deepAssign({}, params, { chart: findViewById(chart, SECOND_AXES_VIEW) }));
220
+ commonTheme(params);
220
221
  return params;
221
222
  }
222
223
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"adaptor.js","sourceRoot":"","sources":["../../../src/plots/bidirectional-bar/adaptor.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAEvC,OAAO,EACL,OAAO,EACP,WAAW,IAAI,iBAAiB,EAChC,SAAS,IAAI,eAAe,EAC5B,KAAK,IAAI,WAAW,EACpB,WAAW,IAAI,iBAAiB,EAChC,KAAK,GACN,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACpD,OAAO,EAAE,IAAI,EAAE,YAAY,EAAE,YAAY,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAE3F,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AACjF,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAEtD;;;GAGG;AACH,SAAS,QAAQ,CAAC,MAAuC;IAC/C,IAAA,KAAK,GAAc,MAAM,MAApB,EAAE,OAAO,GAAK,MAAM,QAAX,CAAY;IAC1B,IAAA,IAAI,GAAkE,OAAO,KAAzE,EAAE,MAAM,GAA0D,OAAO,OAAjE,EAAE,MAAM,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AAC","sourcesContent":["import { View } from '@antv/g2';\nimport { get, keys } from '@antv/util';\nimport { Params } from '../../core/adaptor';\nimport {\n tooltip,\n interaction as commonInteraction,\n animation as commonAnimation,\n theme as commonTheme,\n limitInPlot as commonLimitInPlot,\n scale,\n} from '../../adaptor/common';\nimport { interval } from '../../adaptor/geometries';\nimport { flow, findViewById, findGeometry, transformLabel, deepAssign } from '../../utils';\nimport { BidirectionalBarOptions } from './types';\nimport { FIRST_AXES_VIEW, SECOND_AXES_VIEW, SERIES_FIELD_KEY } from './constant';\nimport { isHorizontal, transformData } from './utils';\n\n/**\n * geometry 处理\n * @param params\n */\nfunction geometry(params: Params<BidirectionalBarOptions>): Params<BidirectionalBarOptions> {\n const { chart, options } = params;\n const { data, xField, yField, color, barStyle, widthRatio, legend, layout } = options;\n\n // 处理数据\n const groupData: any[] = transformData(xField, yField, SERIES_FIELD_KEY, data, isHorizontal(layout));\n // 在创建子 view 执行后不行,需要在前面处理 legend\n if (legend) {\n chart.legend(SERIES_FIELD_KEY, legend);\n } else if (legend === false) {\n chart.legend(false);\n }\n // 创建 view\n let firstView: View;\n let secondView: View;\n const [firstViewData, secondViewData] = groupData;\n\n // 横向\n if (isHorizontal(layout)) {\n firstView = chart.createView({\n region: {\n start: { x: 0, y: 0 },\n end: { x: 0.5, y: 1 },\n },\n id: FIRST_AXES_VIEW,\n });\n\n firstView.coordinate().transpose().reflect('x');\n\n secondView = chart.createView({\n region: {\n start: { x: 0.5, y: 0 },\n end: { x: 1, y: 1 },\n },\n id: SECOND_AXES_VIEW,\n });\n secondView.coordinate().transpose();\n\n // @说明: 测试发现,横向因为轴的反转,需要数据也反转,不然会图形渲染是反的(翻转操作进入到 transform 中处理)\n firstView.data(firstViewData);\n secondView.data(secondViewData);\n } else {\n // 纵向\n firstView = chart.createView({\n region: {\n start: { x: 0, y: 0 },\n end: { x: 1, y: 0.5 },\n },\n id: FIRST_AXES_VIEW,\n });\n secondView = chart.createView({\n region: {\n start: { x: 0, y: 0.5 },\n end: { x: 1, y: 1 },\n },\n id: SECOND_AXES_VIEW,\n });\n secondView.coordinate().reflect('y');\n\n firstView.data(firstViewData);\n secondView.data(secondViewData);\n }\n const left = deepAssign({}, params, {\n chart: firstView,\n options: {\n widthRatio,\n xField,\n yField: yField[0],\n seriesField: SERIES_FIELD_KEY,\n interval: {\n color,\n style: barStyle,\n },\n },\n });\n interval(left);\n\n const right = deepAssign({}, params, {\n chart: secondView,\n options: {\n xField,\n yField: yField[1],\n seriesField: SERIES_FIELD_KEY,\n widthRatio,\n interval: {\n color,\n style: barStyle,\n },\n },\n });\n\n interval(right);\n\n return params;\n}\n\n/**\n * meta 配置\n * - 对称条形图对数据进行了处理,通过 SERIES_FIELD_KEY 来对两条 yField 数据进行分类\n * @param params\n */\nfunction meta(params: Params<BidirectionalBarOptions>): Params<BidirectionalBarOptions> {\n const { options, chart } = params;\n const { xAxis, yAxis, xField, yField } = options;\n const firstView = findViewById(chart, FIRST_AXES_VIEW);\n const secondView = findViewById(chart, SECOND_AXES_VIEW);\n\n const aliasMap = {};\n keys(options?.meta || {}).map((metaKey) => {\n if (get(options?.meta, [metaKey, 'alias'])) {\n aliasMap[metaKey] = options.meta[metaKey].alias;\n }\n });\n\n chart.scale({\n [SERIES_FIELD_KEY]: {\n sync: true,\n formatter: (v) => {\n return get(aliasMap, v, v);\n },\n },\n });\n\n scale({\n [xField]: xAxis,\n [yField[0]]: yAxis[yField[0]],\n })(deepAssign({}, params, { chart: firstView }));\n\n scale({\n [xField]: xAxis,\n [yField[1]]: yAxis[yField[1]],\n })(deepAssign({}, params, { chart: secondView }));\n\n return params;\n}\n\n/**\n * axis 配置\n * @param params\n */\nfunction axis(params: Params<BidirectionalBarOptions>): Params<BidirectionalBarOptions> {\n const { chart, options } = params;\n const { xAxis, yAxis, xField, yField, layout } = options;\n\n const firstView = findViewById(chart, FIRST_AXES_VIEW);\n const secondView = findViewById(chart, SECOND_AXES_VIEW);\n // 第二个 view axis 始终隐藏; 注意 bottom 的时候,只隐藏 label,其他共用配置\n // @ts-ignore\n if (xAxis?.position === 'bottom') {\n // fixme 直接设置 label: null 会导致 tickLine 无法显示\n secondView.axis(xField, { ...xAxis, label: { formatter: () => '' } });\n } else {\n secondView.axis(xField, false);\n }\n\n // 为 false 则是不显示 firstView 轴\n if (xAxis === false) {\n firstView.axis(xField, false);\n } else {\n firstView.axis(xField, {\n // 不同布局 firstView 的坐标轴显示位置\n position: isHorizontal(layout) ? 'top' : 'bottom',\n ...xAxis,\n });\n }\n\n if (yAxis === false) {\n firstView.axis(yField[0], false);\n secondView.axis(yField[1], false);\n } else {\n firstView.axis(yField[0], yAxis[yField[0]]);\n secondView.axis(yField[1], yAxis[yField[1]]);\n }\n /**\n * 这个注入,主要是在syncViewPadding时候拿到相对应的配置:布局和轴的位置\n * TODO 之后希望 g2 View 对象可以开放 setter 可以设置一些需要的东西\n */\n\n //@ts-ignore\n chart.__axisPosition = {\n position: firstView.getOptions().axes[xField].position,\n layout,\n };\n return params;\n}\n\n/**\n * interaction 配置\n * @param params\n */\nexport function interaction(params: Params<BidirectionalBarOptions>): Params<BidirectionalBarOptions> {\n const { chart } = params;\n\n commonInteraction(deepAssign({}, params, { chart: findViewById(chart, FIRST_AXES_VIEW) }));\n commonInteraction(deepAssign({}, params, { chart: findViewById(chart, SECOND_AXES_VIEW) }));\n\n return params;\n}\n\n/**\n * limitInPlot\n * @param params\n */\nexport function limitInPlot(params: Params<BidirectionalBarOptions>): Params<BidirectionalBarOptions> {\n const { chart, options } = params;\n const { yField, yAxis } = options;\n\n commonLimitInPlot(\n deepAssign({}, params, {\n chart: findViewById(chart, FIRST_AXES_VIEW),\n options: {\n yAxis: yAxis[yField[0]],\n },\n })\n );\n\n commonLimitInPlot(\n deepAssign({}, params, {\n chart: findViewById(chart, SECOND_AXES_VIEW),\n options: {\n yAxis: yAxis[yField[1]],\n },\n })\n );\n\n return params;\n}\n\n/**\n * theme\n * @param params\n */\nexport function theme(params: Params<BidirectionalBarOptions>): Params<BidirectionalBarOptions> {\n const { chart } = params;\n\n commonTheme(deepAssign({}, params, { chart: findViewById(chart, FIRST_AXES_VIEW) }));\n commonTheme(deepAssign({}, params, { chart: findViewById(chart, SECOND_AXES_VIEW) }));\n\n return params;\n}\n\n/**\n * animation\n * @param params\n */\nexport function animation(params: Params<BidirectionalBarOptions>): Params<BidirectionalBarOptions> {\n const { chart } = params;\n\n commonAnimation(deepAssign({}, params, { chart: findViewById(chart, FIRST_AXES_VIEW) }));\n commonAnimation(deepAssign({}, params, { chart: findViewById(chart, SECOND_AXES_VIEW) }));\n\n return params;\n}\n\n/**\n * label 配置 (1. 设置 offset 偏移量默认值 2. leftView 偏移量需要 *= -1)\n * @param params\n */\nfunction label(params: Params<BidirectionalBarOptions>): Params<BidirectionalBarOptions> {\n const { chart, options } = params;\n const { label, yField, layout } = options;\n\n const firstView = findViewById(chart, FIRST_AXES_VIEW);\n const secondView = findViewById(chart, SECOND_AXES_VIEW);\n const leftGeometry = findGeometry(firstView, 'interval');\n const rightGeometry = findGeometry(secondView, 'interval');\n\n if (!label) {\n leftGeometry.label(false);\n rightGeometry.label(false);\n } else {\n const { callback, ...cfg } = label;\n /** ---- 设置默认配置 ---- */\n // 默认居中\n if (!cfg.position) {\n cfg.position = 'middle';\n }\n if (cfg.offset === undefined) {\n cfg.offset = 2;\n }\n\n /** ---- leftView label 设置 ---- */\n const leftLabelCfg = { ...cfg };\n if (isHorizontal(layout)) {\n // 设置 textAlign 默认值\n const textAlign = leftLabelCfg.style?.textAlign || (cfg.position === 'middle' ? 'center' : 'left');\n cfg.style = deepAssign({}, cfg.style, { textAlign });\n const textAlignMap = { left: 'right', right: 'left', center: 'center' };\n leftLabelCfg.style = deepAssign({}, leftLabelCfg.style, { textAlign: textAlignMap[textAlign] });\n } else {\n const positionMap = { top: 'bottom', bottom: 'top', middle: 'middle' };\n if (typeof cfg.position === 'string') {\n cfg.position = positionMap[cfg.position];\n } else if (typeof cfg.position === 'function') {\n cfg.position = (...args) => positionMap[(cfg.position as Function).apply(this, args)];\n }\n // 设置 textBaseline 默认值\n const textBaseline = leftLabelCfg.style?.textBaseline || 'bottom';\n leftLabelCfg.style = deepAssign({}, leftLabelCfg.style, { textBaseline });\n const textBaselineMap = { top: 'bottom', bottom: 'top', middle: 'middle' };\n cfg.style = deepAssign({}, cfg.style, { textBaseline: textBaselineMap[textBaseline] });\n }\n\n leftGeometry.label({\n fields: [yField[0]],\n callback,\n cfg: transformLabel(leftLabelCfg),\n });\n rightGeometry.label({\n fields: [yField[1]],\n callback,\n cfg: transformLabel(cfg),\n });\n }\n\n return params;\n}\n\n/**\n * 对称条形图适配器\n * @param chart\n * @param options\n */\nexport function adaptor(params: Params<BidirectionalBarOptions>) {\n // flow 的方式处理所有的配置到 G2 API\n return flow(geometry, meta, axis, limitInPlot, theme, label, tooltip, interaction, animation)(params);\n}\n"]}
1
+ {"version":3,"file":"adaptor.js","sourceRoot":"","sources":["../../../src/plots/bidirectional-bar/adaptor.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAEvC,OAAO,EACL,OAAO,EACP,WAAW,IAAI,iBAAiB,EAChC,SAAS,IAAI,eAAe,EAC5B,KAAK,IAAI,WAAW,EACpB,WAAW,IAAI,iBAAiB,EAChC,KAAK,GACN,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACpD,OAAO,EAAE,IAAI,EAAE,YAAY,EAAE,YAAY,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAE3F,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AACjF,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAEtD;;;GAGG;AACH,SAAS,QAAQ,CAAC,MAAuC;IAC/C,IAAA,KAAK,GAAc,MAAM,MAApB,EAAE,OAAO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AAC,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,WAAW,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,WAAW,EAAE,SAAS,CAAC,CAAC,MAAM,CAAC,CAAC;AACxG,CAAC","sourcesContent":["import { View } from '@antv/g2';\nimport { get, keys } from '@antv/util';\nimport { Params } from '../../core/adaptor';\nimport {\n tooltip,\n interaction as commonInteraction,\n animation as commonAnimation,\n theme as commonTheme,\n limitInPlot as commonLimitInPlot,\n scale,\n} from '../../adaptor/common';\nimport { interval } from '../../adaptor/geometries';\nimport { flow, findViewById, findGeometry, transformLabel, deepAssign } from '../../utils';\nimport { BidirectionalBarOptions } from './types';\nimport { FIRST_AXES_VIEW, SECOND_AXES_VIEW, SERIES_FIELD_KEY } from './constant';\nimport { isHorizontal, transformData } from './utils';\n\n/**\n * geometry 处理\n * @param params\n */\nfunction geometry(params: Params<BidirectionalBarOptions>): Params<BidirectionalBarOptions> {\n const { chart, options } = params;\n const { data, xField, yField, color, barStyle, widthRatio, legend, layout } = options;\n\n // 处理数据\n const groupData: any[] = transformData(xField, yField, SERIES_FIELD_KEY, data, isHorizontal(layout));\n // 在创建子 view 执行后不行,需要在前面处理 legend\n if (legend) {\n chart.legend(SERIES_FIELD_KEY, legend);\n } else if (legend === false) {\n chart.legend(false);\n }\n // 创建 view\n let firstView: View;\n let secondView: View;\n const [firstViewData, secondViewData] = groupData;\n\n // 横向\n if (isHorizontal(layout)) {\n firstView = chart.createView({\n region: {\n start: { x: 0, y: 0 },\n end: { x: 0.5, y: 1 },\n },\n id: FIRST_AXES_VIEW,\n });\n\n firstView.coordinate().transpose().reflect('x');\n\n secondView = chart.createView({\n region: {\n start: { x: 0.5, y: 0 },\n end: { x: 1, y: 1 },\n },\n id: SECOND_AXES_VIEW,\n });\n secondView.coordinate().transpose();\n\n // @说明: 测试发现,横向因为轴的反转,需要数据也反转,不然会图形渲染是反的(翻转操作进入到 transform 中处理)\n firstView.data(firstViewData);\n secondView.data(secondViewData);\n } else {\n // 纵向\n firstView = chart.createView({\n region: {\n start: { x: 0, y: 0 },\n end: { x: 1, y: 0.5 },\n },\n id: FIRST_AXES_VIEW,\n });\n secondView = chart.createView({\n region: {\n start: { x: 0, y: 0.5 },\n end: { x: 1, y: 1 },\n },\n id: SECOND_AXES_VIEW,\n });\n secondView.coordinate().reflect('y');\n\n firstView.data(firstViewData);\n secondView.data(secondViewData);\n }\n const left = deepAssign({}, params, {\n chart: firstView,\n options: {\n widthRatio,\n xField,\n yField: yField[0],\n seriesField: SERIES_FIELD_KEY,\n interval: {\n color,\n style: barStyle,\n },\n },\n });\n interval(left);\n\n const right = deepAssign({}, params, {\n chart: secondView,\n options: {\n xField,\n yField: yField[1],\n seriesField: SERIES_FIELD_KEY,\n widthRatio,\n interval: {\n color,\n style: barStyle,\n },\n },\n });\n\n interval(right);\n\n return params;\n}\n\n/**\n * meta 配置\n * - 对称条形图对数据进行了处理,通过 SERIES_FIELD_KEY 来对两条 yField 数据进行分类\n * @param params\n */\nfunction meta(params: Params<BidirectionalBarOptions>): Params<BidirectionalBarOptions> {\n const { options, chart } = params;\n const { xAxis, yAxis, xField, yField } = options;\n const firstView = findViewById(chart, FIRST_AXES_VIEW);\n const secondView = findViewById(chart, SECOND_AXES_VIEW);\n\n const aliasMap = {};\n keys(options?.meta || {}).map((metaKey) => {\n if (get(options?.meta, [metaKey, 'alias'])) {\n aliasMap[metaKey] = options.meta[metaKey].alias;\n }\n });\n\n chart.scale({\n [SERIES_FIELD_KEY]: {\n sync: true,\n formatter: (v) => {\n return get(aliasMap, v, v);\n },\n },\n });\n\n scale({\n [xField]: xAxis,\n [yField[0]]: yAxis[yField[0]],\n })(deepAssign({}, params, { chart: firstView }));\n\n scale({\n [xField]: xAxis,\n [yField[1]]: yAxis[yField[1]],\n })(deepAssign({}, params, { chart: secondView }));\n\n return params;\n}\n\n/**\n * axis 配置\n * @param params\n */\nfunction axis(params: Params<BidirectionalBarOptions>): Params<BidirectionalBarOptions> {\n const { chart, options } = params;\n const { xAxis, yAxis, xField, yField, layout } = options;\n\n const firstView = findViewById(chart, FIRST_AXES_VIEW);\n const secondView = findViewById(chart, SECOND_AXES_VIEW);\n // 第二个 view axis 始终隐藏; 注意 bottom 的时候,只隐藏 label,其他共用配置\n // @ts-ignore\n if (xAxis?.position === 'bottom') {\n // fixme 直接设置 label: null 会导致 tickLine 无法显示\n secondView.axis(xField, { ...xAxis, label: { formatter: () => '' } });\n } else {\n secondView.axis(xField, false);\n }\n\n // 为 false 则是不显示 firstView 轴\n if (xAxis === false) {\n firstView.axis(xField, false);\n } else {\n firstView.axis(xField, {\n // 不同布局 firstView 的坐标轴显示位置\n position: isHorizontal(layout) ? 'top' : 'bottom',\n ...xAxis,\n });\n }\n\n if (yAxis === false) {\n firstView.axis(yField[0], false);\n secondView.axis(yField[1], false);\n } else {\n firstView.axis(yField[0], yAxis[yField[0]]);\n secondView.axis(yField[1], yAxis[yField[1]]);\n }\n /**\n * 这个注入,主要是在syncViewPadding时候拿到相对应的配置:布局和轴的位置\n * TODO 之后希望 g2 View 对象可以开放 setter 可以设置一些需要的东西\n */\n\n //@ts-ignore\n chart.__axisPosition = {\n position: firstView.getOptions().axes[xField].position,\n layout,\n };\n return params;\n}\n\n/**\n * interaction 配置\n * @param params\n */\nexport function interaction(params: Params<BidirectionalBarOptions>): Params<BidirectionalBarOptions> {\n const { chart } = params;\n\n commonInteraction(deepAssign({}, params, { chart: findViewById(chart, FIRST_AXES_VIEW) }));\n commonInteraction(deepAssign({}, params, { chart: findViewById(chart, SECOND_AXES_VIEW) }));\n\n return params;\n}\n\n/**\n * limitInPlot\n * @param params\n */\nexport function limitInPlot(params: Params<BidirectionalBarOptions>): Params<BidirectionalBarOptions> {\n const { chart, options } = params;\n const { yField, yAxis } = options;\n\n commonLimitInPlot(\n deepAssign({}, params, {\n chart: findViewById(chart, FIRST_AXES_VIEW),\n options: {\n yAxis: yAxis[yField[0]],\n },\n })\n );\n\n commonLimitInPlot(\n deepAssign({}, params, {\n chart: findViewById(chart, SECOND_AXES_VIEW),\n options: {\n yAxis: yAxis[yField[1]],\n },\n })\n );\n\n return params;\n}\n\n/**\n * theme\n * @param params\n */\nexport function theme(params: Params<BidirectionalBarOptions>): Params<BidirectionalBarOptions> {\n const { chart } = params;\n\n commonTheme(deepAssign({}, params, { chart: findViewById(chart, FIRST_AXES_VIEW) }));\n commonTheme(deepAssign({}, params, { chart: findViewById(chart, SECOND_AXES_VIEW) }));\n commonTheme(params);\n\n return params;\n}\n\n/**\n * animation\n * @param params\n */\nexport function animation(params: Params<BidirectionalBarOptions>): Params<BidirectionalBarOptions> {\n const { chart } = params;\n\n commonAnimation(deepAssign({}, params, { chart: findViewById(chart, FIRST_AXES_VIEW) }));\n commonAnimation(deepAssign({}, params, { chart: findViewById(chart, SECOND_AXES_VIEW) }));\n\n return params;\n}\n\n/**\n * label 配置 (1. 设置 offset 偏移量默认值 2. leftView 偏移量需要 *= -1)\n * @param params\n */\nfunction label(params: Params<BidirectionalBarOptions>): Params<BidirectionalBarOptions> {\n const { chart, options } = params;\n const { label, yField, layout } = options;\n\n const firstView = findViewById(chart, FIRST_AXES_VIEW);\n const secondView = findViewById(chart, SECOND_AXES_VIEW);\n const leftGeometry = findGeometry(firstView, 'interval');\n const rightGeometry = findGeometry(secondView, 'interval');\n\n if (!label) {\n leftGeometry.label(false);\n rightGeometry.label(false);\n } else {\n const { callback, ...cfg } = label;\n /** ---- 设置默认配置 ---- */\n // 默认居中\n if (!cfg.position) {\n cfg.position = 'middle';\n }\n if (cfg.offset === undefined) {\n cfg.offset = 2;\n }\n\n /** ---- leftView label 设置 ---- */\n const leftLabelCfg = { ...cfg };\n if (isHorizontal(layout)) {\n // 设置 textAlign 默认值\n const textAlign = leftLabelCfg.style?.textAlign || (cfg.position === 'middle' ? 'center' : 'left');\n cfg.style = deepAssign({}, cfg.style, { textAlign });\n const textAlignMap = { left: 'right', right: 'left', center: 'center' };\n leftLabelCfg.style = deepAssign({}, leftLabelCfg.style, { textAlign: textAlignMap[textAlign] });\n } else {\n const positionMap = { top: 'bottom', bottom: 'top', middle: 'middle' };\n if (typeof cfg.position === 'string') {\n cfg.position = positionMap[cfg.position];\n } else if (typeof cfg.position === 'function') {\n cfg.position = (...args) => positionMap[(cfg.position as Function).apply(this, args)];\n }\n // 设置 textBaseline 默认值\n const textBaseline = leftLabelCfg.style?.textBaseline || 'bottom';\n leftLabelCfg.style = deepAssign({}, leftLabelCfg.style, { textBaseline });\n const textBaselineMap = { top: 'bottom', bottom: 'top', middle: 'middle' };\n cfg.style = deepAssign({}, cfg.style, { textBaseline: textBaselineMap[textBaseline] });\n }\n\n leftGeometry.label({\n fields: [yField[0]],\n callback,\n cfg: transformLabel(leftLabelCfg),\n });\n rightGeometry.label({\n fields: [yField[1]],\n callback,\n cfg: transformLabel(cfg),\n });\n }\n\n return params;\n}\n\n/**\n * 对称条形图适配器\n * @param chart\n * @param options\n */\nexport function adaptor(params: Params<BidirectionalBarOptions>) {\n // flow 的方式处理所有的配置到 G2 API\n return flow(geometry, meta, axis, limitInPlot, theme, label, tooltip, interaction, animation)(params);\n}\n"]}
package/lib/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export declare const version = "2.4.11";
1
+ export declare const version = "2.4.12";
2
2
  import * as G2 from '@antv/g2';
3
3
  export { G2 };
4
4
  import { registerLocale } from './core/locale';
package/lib/index.js CHANGED
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.adaptors = exports.registerLocale = exports.G2 = exports.version = void 0;
4
4
  var tslib_1 = require("tslib");
5
- exports.version = '2.4.11';
5
+ exports.version = '2.4.12';
6
6
  // G2 自定义能力透出
7
7
  var G2 = tslib_1.__importStar(require("@antv/g2"));
8
8
  exports.G2 = G2;
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;AAAa,QAAA,OAAO,GAAG,QAA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,gGAAA,GAAG,OAAa;AAEzB,oBAAoB;AACpB,mCAAyC;AAAhC,0FAAA,GAAG,OAAO;AAGnB,2DAA2D;AAC3D,uCAAsC;AAA7B,8FAAA,KAAK,OAAA;AAGd,uCAAuC;AACvC,iCAAiD;AAAxC,6FAAA,IAAI,OAAA;AAAE,yGAAA,gBAAgB,OAAA;AAE/B,0CAA0C;AAC1C,mDAAoF;AAA3E,kGAAA,IAAI,OAAA;AAAE,sGAAA,QAAQ,OAAA;AAAE,kGAAA,IAAI,OAAA;AAAE,mGAAA,KAAK,OAAA;AAAE,qGAAA,OAAO,OAAA;AAAE,oGAAA,MAAM,OAAA;AASrD,uCAAuC;AACvC,2CAAqG;AACxF,QAAA,QAAQ,GAAG,EAAE,KAAK,gBAAA,EAAE,MAAM,iBAAA,EAAE,OAAO,kBAAA,EAAE,UAAU,qBAAA,EAAE,WAAW,sBAAA,EAAE,KAAK,gBAAA,EAAE,SAAS,oBAAA,EAAE,CAAC;AAE9F,oDAAoD;AACpD,6BAA4B;AAAnB,0FAAA,GAAG,OAAA","sourcesContent":["export const version = '2.4.11';\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, addWaterWave } 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
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;AAAa,QAAA,OAAO,GAAG,QAAQ,CAAC;AAEhC,aAAa;AACb,mDAA+B;AACtB,gBAAE;AAEX,QAAQ;AACR,wCAA+C;AAOtC,+FAPA,uBAAc,OAOA;AANvB,yCAA+C;AAC/C,yCAA+C;AAC/C,8BAA8B;AAC9B,uBAAc,CAAC,OAAO,EAAE,oBAAY,CAAC,CAAC;AACtC,uBAAc,CAAC,OAAO,EAAE,oBAAY,CAAC,CAAC;AAItC,WAAW;AACX,wCAA0C;AAAjC,mGAAA,SAAS,OAAA;AAElB,uBAAuB;AACvB,oCAAmC;AAA1B,4FAAA,IAAI,OAAA;AAKb,SAAS;AACT,kDAAwB;AAExB,2DAA2D;AAC3D,qCAAoC;AAA3B,4FAAA,IAAI,OAAA;AAGb,2DAA2D;AAC3D,qCAAoC;AAA3B,4FAAA,IAAI,OAAA;AAGb,uDAAuD;AACvD,yCAAwC;AAA/B,gGAAA,MAAM,OAAA;AAGf,yDAAyD;AACzD,mCAAkC;AAAzB,0FAAA,GAAG,OAAA;AAGZ,0DAA0D;AAC1D,mCAAkC;AAAzB,0FAAA,GAAG,OAAA;AAGZ,uEAAuE;AACvE,qCAAoC;AAA3B,4FAAA,IAAI,OAAA;AAGb,uE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2 };\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, addWaterWave } 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"]}
@@ -222,6 +222,7 @@ function theme(params) {
222
222
  var chart = params.chart;
223
223
  common_1.theme(utils_1.deepAssign({}, params, { chart: utils_1.findViewById(chart, constant_1.FIRST_AXES_VIEW) }));
224
224
  common_1.theme(utils_1.deepAssign({}, params, { chart: utils_1.findViewById(chart, constant_1.SECOND_AXES_VIEW) }));
225
+ common_1.theme(params);
225
226
  return params;
226
227
  }
227
228
  exports.theme = theme;
@@ -1 +1 @@
1
- {"version":3,"file":"adaptor.js","sourceRoot":"","sources":["../../../src/pl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ACH,aAAa,CAAC,KAAK,CAAC;YAClB,MAAM,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;YACnB,QAAQ,UAAA;YACR,GAAG,EAAE,sBAAc,CAAC,KAAG,CAAC;SACzB,CAAC,CAAC;KACJ;IAED,OAAO,MAAM,CAAC;AAChB,CAAC;AAED;;;;GAIG;AACH,SAAgB,OAAO,CAAC,MAAuC;IAC7D,0BAA0B;IAC1B,OAAO,YAAI,CAAC,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,WAAW,EAAE,KAAK,EAAE,KAAK,EAAE,gBAAO,EAAE,WAAW,EAAE,SAAS,CAAC,CAAC,MAAM,CAAC,CAAC;AACxG,CAAC;AAHD,0BAGC","sourcesContent":["import { View } from '@antv/g2';\nimport { get, keys } from '@antv/util';\nimport { Params } from '../../core/adaptor';\nimport {\n tooltip,\n interaction as commonInteraction,\n animation as commonAnimation,\n theme as commonTheme,\n limitInPlot as commonLimitInPlot,\n scale,\n} from '../../adaptor/common';\nimport { interval } from '../../adaptor/geometries';\nimport { flow, findViewById, findGeometry, transformLabel, deepAssign } from '../../utils';\nimport { BidirectionalBarOptions } from './types';\nimport { FIRST_AXES_VIEW, SECOND_AXES_VIEW, SERIES_FIELD_KEY } from './constant';\nimport { isHorizontal, transformData } from './utils';\n\n/**\n * geometry 处理\n * @param params\n */\nfunction geometry(params: Params<BidirectionalBarOptions>): Params<BidirectionalBarOptions> {\n const { chart, options } = params;\n const { data, xField, yField, color, barStyle, widthRatio, legend, layout } = options;\n\n // 处理数据\n const groupData: any[] = transformData(xField, yField, SERIES_FIELD_KEY, data, isHorizontal(layout));\n // 在创建子 view 执行后不行,需要在前面处理 legend\n if (legend) {\n chart.legend(SERIES_FIELD_KEY, legend);\n } else if (legend === false) {\n chart.legend(false);\n }\n // 创建 view\n let firstView: View;\n let secondView: View;\n const [firstViewData, secondViewData] = groupData;\n\n // 横向\n if (isHorizontal(layout)) {\n firstView = chart.createView({\n region: {\n start: { x: 0, y: 0 },\n end: { x: 0.5, y: 1 },\n },\n id: FIRST_AXES_VIEW,\n });\n\n firstView.coordinate().transpose().reflect('x');\n\n secondView = chart.createView({\n region: {\n start: { x: 0.5, y: 0 },\n end: { x: 1, y: 1 },\n },\n id: SECOND_AXES_VIEW,\n });\n secondView.coordinate().transpose();\n\n // @说明: 测试发现,横向因为轴的反转,需要数据也反转,不然会图形渲染是反的(翻转操作进入到 transform 中处理)\n firstView.data(firstViewData);\n secondView.data(secondViewData);\n } else {\n // 纵向\n firstView = chart.createView({\n region: {\n start: { x: 0, y: 0 },\n end: { x: 1, y: 0.5 },\n },\n id: FIRST_AXES_VIEW,\n });\n secondView = chart.createView({\n region: {\n start: { x: 0, y: 0.5 },\n end: { x: 1, y: 1 },\n },\n id: SECOND_AXES_VIEW,\n });\n secondView.coordinate().reflect('y');\n\n firstView.data(firstViewData);\n secondView.data(secondViewData);\n }\n const left = deepAssign({}, params, {\n chart: firstView,\n options: {\n widthRatio,\n xField,\n yField: yField[0],\n seriesField: SERIES_FIELD_KEY,\n interval: {\n color,\n style: barStyle,\n },\n },\n });\n interval(left);\n\n const right = deepAssign({}, params, {\n chart: secondView,\n options: {\n xField,\n yField: yField[1],\n seriesField: SERIES_FIELD_KEY,\n widthRatio,\n interval: {\n color,\n style: barStyle,\n },\n },\n });\n\n interval(right);\n\n return params;\n}\n\n/**\n * meta 配置\n * - 对称条形图对数据进行了处理,通过 SERIES_FIELD_KEY 来对两条 yField 数据进行分类\n * @param params\n */\nfunction meta(params: Params<BidirectionalBarOptions>): Params<BidirectionalBarOptions> {\n const { options, chart } = params;\n const { xAxis, yAxis, xField, yField } = options;\n const firstView = findViewById(chart, FIRST_AXES_VIEW);\n const secondView = findViewById(chart, SECOND_AXES_VIEW);\n\n const aliasMap = {};\n keys(options?.meta || {}).map((metaKey) => {\n if (get(options?.meta, [metaKey, 'alias'])) {\n aliasMap[metaKey] = options.meta[metaKey].alias;\n }\n });\n\n chart.scale({\n [SERIES_FIELD_KEY]: {\n sync: true,\n formatter: (v) => {\n return get(aliasMap, v, v);\n },\n },\n });\n\n scale({\n [xField]: xAxis,\n [yField[0]]: yAxis[yField[0]],\n })(deepAssign({}, params, { chart: firstView }));\n\n scale({\n [xField]: xAxis,\n [yField[1]]: yAxis[yField[1]],\n })(deepAssign({}, params, { chart: secondView }));\n\n return params;\n}\n\n/**\n * axis 配置\n * @param params\n */\nfunction axis(params: Params<BidirectionalBarOptions>): Params<BidirectionalBarOptions> {\n const { chart, options } = params;\n const { xAxis, yAxis, xField, yField, layout } = options;\n\n const firstView = findViewById(chart, FIRST_AXES_VIEW);\n const secondView = findViewById(chart, SECOND_AXES_VIEW);\n // 第二个 view axis 始终隐藏; 注意 bottom 的时候,只隐藏 label,其他共用配置\n // @ts-ignore\n if (xAxis?.position === 'bottom') {\n // fixme 直接设置 label: null 会导致 tickLine 无法显示\n secondView.axis(xField, { ...xAxis, label: { formatter: () => '' } });\n } else {\n secondView.axis(xField, false);\n }\n\n // 为 false 则是不显示 firstView 轴\n if (xAxis === false) {\n firstView.axis(xField, false);\n } else {\n firstView.axis(xField, {\n // 不同布局 firstView 的坐标轴显示位置\n position: isHorizontal(layout) ? 'top' : 'bottom',\n ...xAxis,\n });\n }\n\n if (yAxis === false) {\n firstView.axis(yField[0], false);\n secondView.axis(yField[1], false);\n } else {\n firstView.axis(yField[0], yAxis[yField[0]]);\n secondView.axis(yField[1], yAxis[yField[1]]);\n }\n /**\n * 这个注入,主要是在syncViewPadding时候拿到相对应的配置:布局和轴的位置\n * TODO 之后希望 g2 View 对象可以开放 setter 可以设置一些需要的东西\n */\n\n //@ts-ignore\n chart.__axisPosition = {\n position: firstView.getOptions().axes[xField].position,\n layout,\n };\n return params;\n}\n\n/**\n * interaction 配置\n * @param params\n */\nexport function interaction(params: Params<BidirectionalBarOptions>): Params<BidirectionalBarOptions> {\n const { chart } = params;\n\n commonInteraction(deepAssign({}, params, { chart: findViewById(chart, FIRST_AXES_VIEW) }));\n commonInteraction(deepAssign({}, params, { chart: findViewById(chart, SECOND_AXES_VIEW) }));\n\n return params;\n}\n\n/**\n * limitInPlot\n * @param params\n */\nexport function limitInPlot(params: Params<BidirectionalBarOptions>): Params<BidirectionalBarOptions> {\n const { chart, options } = params;\n const { yField, yAxis } = options;\n\n commonLimitInPlot(\n deepAssign({}, params, {\n chart: findViewById(chart, FIRST_AXES_VIEW),\n options: {\n yAxis: yAxis[yField[0]],\n },\n })\n );\n\n commonLimitInPlot(\n deepAssign({}, params, {\n chart: findViewById(chart, SECOND_AXES_VIEW),\n options: {\n yAxis: yAxis[yField[1]],\n },\n })\n );\n\n return params;\n}\n\n/**\n * theme\n * @param params\n */\nexport function theme(params: Params<BidirectionalBarOptions>): Params<BidirectionalBarOptions> {\n const { chart } = params;\n\n commonTheme(deepAssign({}, params, { chart: findViewById(chart, FIRST_AXES_VIEW) }));\n commonTheme(deepAssign({}, params, { chart: findViewById(chart, SECOND_AXES_VIEW) }));\n\n return params;\n}\n\n/**\n * animation\n * @param params\n */\nexport function animation(params: Params<BidirectionalBarOptions>): Params<BidirectionalBarOptions> {\n const { chart } = params;\n\n commonAnimation(deepAssign({}, params, { chart: findViewById(chart, FIRST_AXES_VIEW) }));\n commonAnimation(deepAssign({}, params, { chart: findViewById(chart, SECOND_AXES_VIEW) }));\n\n return params;\n}\n\n/**\n * label 配置 (1. 设置 offset 偏移量默认值 2. leftView 偏移量需要 *= -1)\n * @param params\n */\nfunction label(params: Params<BidirectionalBarOptions>): Params<BidirectionalBarOptions> {\n const { chart, options } = params;\n const { label, yField, layout } = options;\n\n const firstView = findViewById(chart, FIRST_AXES_VIEW);\n const secondView = findViewById(chart, SECOND_AXES_VIEW);\n const leftGeometry = findGeometry(firstView, 'interval');\n const rightGeometry = findGeometry(secondView, 'interval');\n\n if (!label) {\n leftGeometry.label(false);\n rightGeometry.label(false);\n } else {\n const { callback, ...cfg } = label;\n /** ---- 设置默认配置 ---- */\n // 默认居中\n if (!cfg.position) {\n cfg.position = 'middle';\n }\n if (cfg.offset === undefined) {\n cfg.offset = 2;\n }\n\n /** ---- leftView label 设置 ---- */\n const leftLabelCfg = { ...cfg };\n if (isHorizontal(layout)) {\n // 设置 textAlign 默认值\n const textAlign = leftLabelCfg.style?.textAlign || (cfg.position === 'middle' ? 'center' : 'left');\n cfg.style = deepAssign({}, cfg.style, { textAlign });\n const textAlignMap = { left: 'right', right: 'left', center: 'center' };\n leftLabelCfg.style = deepAssign({}, leftLabelCfg.style, { textAlign: textAlignMap[textAlign] });\n } else {\n const positionMap = { top: 'bottom', bottom: 'top', middle: 'middle' };\n if (typeof cfg.position === 'string') {\n cfg.position = positionMap[cfg.position];\n } else if (typeof cfg.position === 'function') {\n cfg.position = (...args) => positionMap[(cfg.position as Function).apply(this, args)];\n }\n // 设置 textBaseline 默认值\n const textBaseline = leftLabelCfg.style?.textBaseline || 'bottom';\n leftLabelCfg.style = deepAssign({}, leftLabelCfg.style, { textBaseline });\n const textBaselineMap = { top: 'bottom', bottom: 'top', middle: 'middle' };\n cfg.style = deepAssign({}, cfg.style, { textBaseline: textBaselineMap[textBaseline] });\n }\n\n leftGeometry.label({\n fields: [yField[0]],\n callback,\n cfg: transformLabel(leftLabelCfg),\n });\n rightGeometry.label({\n fields: [yField[1]],\n callback,\n cfg: transformLabel(cfg),\n });\n }\n\n return params;\n}\n\n/**\n * 对称条形图适配器\n * @param chart\n * @param options\n */\nexport function adaptor(params: Params<BidirectionalBarOptions>) {\n // flow 的方式处理所有的配置到 G2 API\n return flow(geometry, meta, axis, limitInPlot, theme, label, tooltip, interaction, animation)(params);\n}\n"]}
1
+ {"version":3,"file":"adaptor.js","sourceRoot":"","sources":["../../../src/plots/bidirectional-bar/adaptor.ts"],"names":[],"mappings":";;;;AACA,mCAAuC;AAEvC,+CAO8B;AAC9B,uDAAoD;AACpD,qCAA2F;AAE3F,uCAAiF;AACjF,iCAAsD;AAEtD;;;GAGG;AACH,SAAS,QAAQ,CAAC,MAAuC;IAC/C,IAAA,KAAK,G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ACJ;IAED,OAAO,MAAM,CAAC;AAChB,CAAC;AAED;;;;GAIG;AACH,SAAgB,OAAO,CAAC,MAAuC;IAC7D,0BAA0B;IAC1B,OAAO,YAAI,CAAC,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,WAAW,EAAE,KAAK,EAAE,KAAK,EAAE,gBAAO,EAAE,WAAW,EAAE,SAAS,CAAC,CAAC,MAAM,CAAC,CAAC;AACxG,CAAC;AAHD,0BAGC","sourcesContent":["import { View } from '@antv/g2';\nimport { get, keys } from '@antv/util';\nimport { Params } from '../../core/adaptor';\nimport {\n tooltip,\n interaction as commonInteraction,\n animation as commonAnimation,\n theme as commonTheme,\n limitInPlot as commonLimitInPlot,\n scale,\n} from '../../adaptor/common';\nimport { interval } from '../../adaptor/geometries';\nimport { flow, findViewById, findGeometry, transformLabel, deepAssign } from '../../utils';\nimport { BidirectionalBarOptions } from './types';\nimport { FIRST_AXES_VIEW, SECOND_AXES_VIEW, SERIES_FIELD_KEY } from './constant';\nimport { isHorizontal, transformData } from './utils';\n\n/**\n * geometry 处理\n * @param params\n */\nfunction geometry(params: Params<BidirectionalBarOptions>): Params<BidirectionalBarOptions> {\n const { chart, options } = params;\n const { data, xField, yField, color, barStyle, widthRatio, legend, layout } = options;\n\n // 处理数据\n const groupData: any[] = transformData(xField, yField, SERIES_FIELD_KEY, data, isHorizontal(layout));\n // 在创建子 view 执行后不行,需要在前面处理 legend\n if (legend) {\n chart.legend(SERIES_FIELD_KEY, legend);\n } else if (legend === false) {\n chart.legend(false);\n }\n // 创建 view\n let firstView: View;\n let secondView: View;\n const [firstViewData, secondViewData] = groupData;\n\n // 横向\n if (isHorizontal(layout)) {\n firstView = chart.createView({\n region: {\n start: { x: 0, y: 0 },\n end: { x: 0.5, y: 1 },\n },\n id: FIRST_AXES_VIEW,\n });\n\n firstView.coordinate().transpose().reflect('x');\n\n secondView = chart.createView({\n region: {\n start: { x: 0.5, y: 0 },\n end: { x: 1, y: 1 },\n },\n id: SECOND_AXES_VIEW,\n });\n secondView.coordinate().transpose();\n\n // @说明: 测试发现,横向因为轴的反转,需要数据也反转,不然会图形渲染是反的(翻转操作进入到 transform 中处理)\n firstView.data(firstViewData);\n secondView.data(secondViewData);\n } else {\n // 纵向\n firstView = chart.createView({\n region: {\n start: { x: 0, y: 0 },\n end: { x: 1, y: 0.5 },\n },\n id: FIRST_AXES_VIEW,\n });\n secondView = chart.createView({\n region: {\n start: { x: 0, y: 0.5 },\n end: { x: 1, y: 1 },\n },\n id: SECOND_AXES_VIEW,\n });\n secondView.coordinate().reflect('y');\n\n firstView.data(firstViewData);\n secondView.data(secondViewData);\n }\n const left = deepAssign({}, params, {\n chart: firstView,\n options: {\n widthRatio,\n xField,\n yField: yField[0],\n seriesField: SERIES_FIELD_KEY,\n interval: {\n color,\n style: barStyle,\n },\n },\n });\n interval(left);\n\n const right = deepAssign({}, params, {\n chart: secondView,\n options: {\n xField,\n yField: yField[1],\n seriesField: SERIES_FIELD_KEY,\n widthRatio,\n interval: {\n color,\n style: barStyle,\n },\n },\n });\n\n interval(right);\n\n return params;\n}\n\n/**\n * meta 配置\n * - 对称条形图对数据进行了处理,通过 SERIES_FIELD_KEY 来对两条 yField 数据进行分类\n * @param params\n */\nfunction meta(params: Params<BidirectionalBarOptions>): Params<BidirectionalBarOptions> {\n const { options, chart } = params;\n const { xAxis, yAxis, xField, yField } = options;\n const firstView = findViewById(chart, FIRST_AXES_VIEW);\n const secondView = findViewById(chart, SECOND_AXES_VIEW);\n\n const aliasMap = {};\n keys(options?.meta || {}).map((metaKey) => {\n if (get(options?.meta, [metaKey, 'alias'])) {\n aliasMap[metaKey] = options.meta[metaKey].alias;\n }\n });\n\n chart.scale({\n [SERIES_FIELD_KEY]: {\n sync: true,\n formatter: (v) => {\n return get(aliasMap, v, v);\n },\n },\n });\n\n scale({\n [xField]: xAxis,\n [yField[0]]: yAxis[yField[0]],\n })(deepAssign({}, params, { chart: firstView }));\n\n scale({\n [xField]: xAxis,\n [yField[1]]: yAxis[yField[1]],\n })(deepAssign({}, params, { chart: secondView }));\n\n return params;\n}\n\n/**\n * axis 配置\n * @param params\n */\nfunction axis(params: Params<BidirectionalBarOptions>): Params<BidirectionalBarOptions> {\n const { chart, options } = params;\n const { xAxis, yAxis, xField, yField, layout } = options;\n\n const firstView = findViewById(chart, FIRST_AXES_VIEW);\n const secondView = findViewById(chart, SECOND_AXES_VIEW);\n // 第二个 view axis 始终隐藏; 注意 bottom 的时候,只隐藏 label,其他共用配置\n // @ts-ignore\n if (xAxis?.position === 'bottom') {\n // fixme 直接设置 label: null 会导致 tickLine 无法显示\n secondView.axis(xField, { ...xAxis, label: { formatter: () => '' } });\n } else {\n secondView.axis(xField, false);\n }\n\n // 为 false 则是不显示 firstView 轴\n if (xAxis === false) {\n firstView.axis(xField, false);\n } else {\n firstView.axis(xField, {\n // 不同布局 firstView 的坐标轴显示位置\n position: isHorizontal(layout) ? 'top' : 'bottom',\n ...xAxis,\n });\n }\n\n if (yAxis === false) {\n firstView.axis(yField[0], false);\n secondView.axis(yField[1], false);\n } else {\n firstView.axis(yField[0], yAxis[yField[0]]);\n secondView.axis(yField[1], yAxis[yField[1]]);\n }\n /**\n * 这个注入,主要是在syncViewPadding时候拿到相对应的配置:布局和轴的位置\n * TODO 之后希望 g2 View 对象可以开放 setter 可以设置一些需要的东西\n */\n\n //@ts-ignore\n chart.__axisPosition = {\n position: firstView.getOptions().axes[xField].position,\n layout,\n };\n return params;\n}\n\n/**\n * interaction 配置\n * @param params\n */\nexport function interaction(params: Params<BidirectionalBarOptions>): Params<BidirectionalBarOptions> {\n const { chart } = params;\n\n commonInteraction(deepAssign({}, params, { chart: findViewById(chart, FIRST_AXES_VIEW) }));\n commonInteraction(deepAssign({}, params, { chart: findViewById(chart, SECOND_AXES_VIEW) }));\n\n return params;\n}\n\n/**\n * limitInPlot\n * @param params\n */\nexport function limitInPlot(params: Params<BidirectionalBarOptions>): Params<BidirectionalBarOptions> {\n const { chart, options } = params;\n const { yField, yAxis } = options;\n\n commonLimitInPlot(\n deepAssign({}, params, {\n chart: findViewById(chart, FIRST_AXES_VIEW),\n options: {\n yAxis: yAxis[yField[0]],\n },\n })\n );\n\n commonLimitInPlot(\n deepAssign({}, params, {\n chart: findViewById(chart, SECOND_AXES_VIEW),\n options: {\n yAxis: yAxis[yField[1]],\n },\n })\n );\n\n return params;\n}\n\n/**\n * theme\n * @param params\n */\nexport function theme(params: Params<BidirectionalBarOptions>): Params<BidirectionalBarOptions> {\n const { chart } = params;\n\n commonTheme(deepAssign({}, params, { chart: findViewById(chart, FIRST_AXES_VIEW) }));\n commonTheme(deepAssign({}, params, { chart: findViewById(chart, SECOND_AXES_VIEW) }));\n commonTheme(params);\n\n return params;\n}\n\n/**\n * animation\n * @param params\n */\nexport function animation(params: Params<BidirectionalBarOptions>): Params<BidirectionalBarOptions> {\n const { chart } = params;\n\n commonAnimation(deepAssign({}, params, { chart: findViewById(chart, FIRST_AXES_VIEW) }));\n commonAnimation(deepAssign({}, params, { chart: findViewById(chart, SECOND_AXES_VIEW) }));\n\n return params;\n}\n\n/**\n * label 配置 (1. 设置 offset 偏移量默认值 2. leftView 偏移量需要 *= -1)\n * @param params\n */\nfunction label(params: Params<BidirectionalBarOptions>): Params<BidirectionalBarOptions> {\n const { chart, options } = params;\n const { label, yField, layout } = options;\n\n const firstView = findViewById(chart, FIRST_AXES_VIEW);\n const secondView = findViewById(chart, SECOND_AXES_VIEW);\n const leftGeometry = findGeometry(firstView, 'interval');\n const rightGeometry = findGeometry(secondView, 'interval');\n\n if (!label) {\n leftGeometry.label(false);\n rightGeometry.label(false);\n } else {\n const { callback, ...cfg } = label;\n /** ---- 设置默认配置 ---- */\n // 默认居中\n if (!cfg.position) {\n cfg.position = 'middle';\n }\n if (cfg.offset === undefined) {\n cfg.offset = 2;\n }\n\n /** ---- leftView label 设置 ---- */\n const leftLabelCfg = { ...cfg };\n if (isHorizontal(layout)) {\n // 设置 textAlign 默认值\n const textAlign = leftLabelCfg.style?.textAlign || (cfg.position === 'middle' ? 'center' : 'left');\n cfg.style = deepAssign({}, cfg.style, { textAlign });\n const textAlignMap = { left: 'right', right: 'left', center: 'center' };\n leftLabelCfg.style = deepAssign({}, leftLabelCfg.style, { textAlign: textAlignMap[textAlign] });\n } else {\n const positionMap = { top: 'bottom', bottom: 'top', middle: 'middle' };\n if (typeof cfg.position === 'string') {\n cfg.position = positionMap[cfg.position];\n } else if (typeof cfg.position === 'function') {\n cfg.position = (...args) => positionMap[(cfg.position as Function).apply(this, args)];\n }\n // 设置 textBaseline 默认值\n const textBaseline = leftLabelCfg.style?.textBaseline || 'bottom';\n leftLabelCfg.style = deepAssign({}, leftLabelCfg.style, { textBaseline });\n const textBaselineMap = { top: 'bottom', bottom: 'top', middle: 'middle' };\n cfg.style = deepAssign({}, cfg.style, { textBaseline: textBaselineMap[textBaseline] });\n }\n\n leftGeometry.label({\n fields: [yField[0]],\n callback,\n cfg: transformLabel(leftLabelCfg),\n });\n rightGeometry.label({\n fields: [yField[1]],\n callback,\n cfg: transformLabel(cfg),\n });\n }\n\n return params;\n}\n\n/**\n * 对称条形图适配器\n * @param chart\n * @param options\n */\nexport function adaptor(params: Params<BidirectionalBarOptions>) {\n // flow 的方式处理所有的配置到 G2 API\n return flow(geometry, meta, axis, limitInPlot, theme, label, tooltip, interaction, animation)(params);\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@antv/g2plot",
3
- "version": "2.4.11",
3
+ "version": "2.4.12",
4
4
  "description": "An interactive and responsive charting library",
5
5
  "keywords": [
6
6
  "chart",
package/src/index.ts CHANGED
@@ -1,4 +1,4 @@
1
- export const version = '2.4.11';
1
+ export const version = '2.4.12';
2
2
 
3
3
  // G2 自定义能力透出
4
4
  import * as G2 from '@antv/g2';
@@ -256,6 +256,7 @@ export function theme(params: Params<BidirectionalBarOptions>): Params<Bidirecti
256
256
 
257
257
  commonTheme(deepAssign({}, params, { chart: findViewById(chart, FIRST_AXES_VIEW) }));
258
258
  commonTheme(deepAssign({}, params, { chart: findViewById(chart, SECOND_AXES_VIEW) }));
259
+ commonTheme(params);
259
260
 
260
261
  return params;
261
262
  }