@antv/g2plot 2.4.25 → 2.4.26

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.25";
1
+ export declare const version = "2.4.26";
2
2
  import * as G2 from '@antv/g2';
3
3
  /** 开放一些通用的 adaptor 通道方法,实验阶段:不保证稳定性 */
4
4
  import { animation, annotation, interaction, legend, scale, theme, tooltip } from './adaptor/common';
package/esm/index.js CHANGED
@@ -1,4 +1,4 @@
1
- export var version = '2.4.25';
1
+ export var version = '2.4.26';
2
2
  // G2 自定义能力透出
3
3
  import * as G2 from '@antv/g2';
4
4
  /** 开放一些通用的 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,QAAQ,CAAC;AAEhC,aAAa;AACb,OAAO,KAAK,EAAE,MAAM,UAAU,CAAC;AAC/B,uCAAuC;AACvC,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AACrG,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,0CAA0C;AAC1C,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAWpF,WAAW;AACX,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1C,uBAAuB;AACvB,OAAO,EAAE,IAAI,EAAE,MAAM,aAA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,OAAO,EAAE,CAAC,EAAE,MAAM,UAAU,CAAC;AAC7B,SAAS;AACT,cAAc,SAAS,CAAC;AACxB,uCAAuC;AACvC,OAAO,EAAE,IAAI,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AACjD,8BAA8B;AAC9B,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,EAAE,EAAE,EAAE,CAAC;AACd,uBAAuB;AACvB,OAAO,EAAE,cAAc,EAAE,CAAC;AAE1B,8BAA8B;AAC9B,cAAc,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC;AACtC,cAAc,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC;AAEtC,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","sourcesContent":["export const version = '2.4.25';\n\n// G2 自定义能力透出\nimport * as G2 from '@antv/g2';\n/** 开放一些通用的 adaptor 通道方法,实验阶段:不保证稳定性 */\nimport { animation, annotation, interaction, legend, scale, theme, tooltip } from './adaptor/common';\n// 国际化处理\nimport { registerLocale } from './core/locale';\nimport { EN_US_LOCALE } from './locales/en_US';\nimport { ZH_CN_LOCALE } from './locales/zh_CN';\n/** 各个 geometry 的 adaptor,可以让开发者更快的构造图形 */\nexport { area, interval, line, point, polygon, schema } from './adaptor/geometries';\nexport type {\n AreaGeometryOptions,\n IntervalGeometryOptions,\n LineGeometryOptions,\n PointGeometryOptions,\n PolygonGeometryOptions,\n SchemaGeometryOptions,\n} from './adaptor/geometries';\n/** Adaptor 及其参数的类型定义 */\nexport type { Adaptor, Params } from './core/adaptor';\n/** 全局变量 */\nexport { setGlobal } from './core/global';\n/** G2Plot 的 Plot 基类 */\nexport { Plot } from './core/plot';\n/** 对于没有开发完成的图表,可以暂时先放到 Lab 下面,先做体验,稳定后放到根 export */\nexport { Lab } from './lab';\n// 面积图及类型定义 | author by [hustcc](https://github.com/hustcc)\nexport { Area } from './plots/area';\nexport type { AreaOptions } from './plots/area';\n// 条形图及类型定义 | author by [BBSQQ](https://github.com/BBSQQ)\nexport { Bar } from './plots/bar';\nexport type { BarOptions } from './plots/bar';\n// 对称条形图及类型定义 | author by [arcsin1](https://github.com/arcsin1)\nexport { BidirectionalBar } from './plots/bidirectional-bar';\nexport type { BidirectionalBarOptions } from './plots/bidirectional-bar';\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// 子弹图及类型定义 | author by [arcsin1](https://github.com/arcsin1)\nexport { Bullet } from './plots/bullet';\nexport type { BulletOptions } from './plots/bullet';\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// 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// 柱形图及类型定义 | author by [zqlu](https://github.com/zqlu)\nexport { Column } from './plots/column';\nexport type { ColumnOptions } from './plots/column';\n// 混合图形 | author by [liuzhenying](https://github.com/liuzhenying)\nexport { DualAxes } from './plots/dual-axes';\nexport type { DualAxesOptions } from './plots/dual-axes';\n// 分面图及类型定义 | author by [visiky](https://github.com/visiky)\nexport { Facet } from './plots/facet';\nexport type { FacetOptions } from './plots/facet';\n// 漏斗图及类型定义\nexport { Funnel, FUNNEL_CONVERSATION_FIELD } from './plots/funnel';\nexport type { FunnelOptions } from './plots/funnel';\n// 仪表盘及类型定义 | author by [hustcc](https://github.com/hustcc)\nexport { Gauge } from './plots/gauge';\nexport type { GaugeOptions } from './plots/gauge';\n// 热力图及类型定义 | author by [jiazhewang](https://github.com/jiazhewang)\nexport { Heatmap } from './plots/heatmap';\nexport type { HeatmapOptions } from './plots/heatmap';\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// 折线图及类型定义 | author by [hustcc](https://github.com/hustcc)\nexport { Line } from './plots/line';\nexport type { LineOptions } from './plots/line';\n// 水波图及类型定义 | author by [CarisL](https://github.com/CarisL), [hustcc](https://github.com/hustcc), [pearmini](https://github.com/pearmini)\nexport { addWaterWave, Liquid } from './plots/liquid';\nexport type { LiquidOptions } from './plots/liquid';\n// 已经废弃,更名为 Mix\nexport { Mix as Mix, Mix as MultiView } from './plots/mix';\nexport type { MixOptions, MixOptions as MultiViewOptions } from './plots/mix';\n// 饼图及类型定义 | author by [visiky](https://github.com/visiky)\nexport { Pie } from './plots/pie';\nexport type { PieOptions } from './plots/pie';\n// 进度图及类型定义 | author by [connono](https://github.com/connono)\nexport { Progress } from './plots/progress';\nexport type { ProgressOptions } from './plots/progress';\n// 雷达图及类型定义 | author by [visiky](https://github.com/visiky)\nexport { Radar } from './plots/radar';\nexport type { RadarOptions } from './plots/radar';\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// 环形进度图及类型定义 | author by [connono](https://github.com/connono)\nexport { RingProgress } from './plots/ring-progress';\nexport type { RingProgressOptions } from './plots/ring-progress';\n// 玫瑰图及类型定义 | author by [zhangzhonghe](https://github.com/zhangzhonghe)\nexport { Rose } from './plots/rose';\nexport type { RoseOptions } from './plots/rose';\n// 桑基图及类型定义 | author by [hustcc](https://github.com/hustcc)\nexport { Sankey } from './plots/sankey';\nexport type { SankeyOptions } from './plots/sankey';\n// 散点图及类型定义 | author by [lxfu1](https://github.com/lxfu1)\nexport { Scatter } from './plots/scatter';\nexport type { ScatterOptions } from './plots/scatter';\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// 旭日图及类型定义 | author by [lxfu1](https://github.com/lxfu1), [visiky](https://github.com/visiky)\nexport { Sunburst } from './plots/sunburst';\nexport type { SunburstOptions } from './plots/sunburst';\n// 迷你面积图及类型定义 | author by [connono](https://github.com/connono)\nexport { TinyArea } from './plots/tiny-area';\nexport type { TinyAreaOptions } from './plots/tiny-area';\n// 迷你柱形图及类型定义 | author by [connono](https://github.com/connono)\nexport { TinyColumn } from './plots/tiny-column';\nexport type { TinyColumnOptions } from './plots/tiny-column';\n// 迷你折线图及类型定义 | author by [connono](https://github.com/connono)\nexport { TinyLine } from './plots/tiny-line';\nexport type { TinyLineOptions } from './plots/tiny-line';\n// 矩形树图\nexport { Treemap } from './plots/treemap';\nexport type { TreemapOptions } from './plots/treemap';\n// 韦恩图及类型定义 | author by [visiky](https://github.com/visiky)\nexport { Venn } from './plots/venn';\nexport type { VennOptions } from './plots/venn';\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// 瀑布图 | author by [visiky](https://github.com/visiky)\nexport { Waterfall } from './plots/waterfall';\nexport type { WaterfallOptions } from './plots/waterfall';\n// 词云图及类型定义 | author by [zhangzhonghe](https://github.com/zhangzhonghe)\nexport { WordCloud } from './plots/word-cloud';\nexport type { WordCloudOptions } from './plots/word-cloud';\n// 以下开放自定义图表开发的能力(目前仅仅是孵化中)\n/** 所有开放图表都使用 G2Plot.P 作为入口开发,理论上官方的所有图表都可以走 G2Plot.P 的入口(暂时不处理) */\nexport { P } from './plugin';\n// 类型定义导出\nexport * from './types';\n/** 开发 adaptor 可能会用到的方法或一些工具方法,不强制使用 */\nexport { flow, measureTextWidth } from './utils';\n/** 开放 getCanvasPatterng 方法 */\nexport { getCanvasPattern } from './utils/pattern';\nexport { G2 };\n/** 透出 国际化 工具函数,便于使用 */\nexport { registerLocale };\n\n/** default locale register */\nregisterLocale('en-US', EN_US_LOCALE);\nregisterLocale('zh-CN', ZH_CN_LOCALE);\n\nexport const adaptors = { scale, legend, tooltip, annotation, interaction, theme, animation };\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,uCAAuC;AACvC,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AACrG,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,0CAA0C;AAC1C,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAWpF,WAAW;AACX,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1C,uBAAuB;AACvB,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AACnC,oDAAoD;AACpD,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAC5B,2DAA2D;AAC3D,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEpC,yDAAyD;AACzD,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAElC,+DAA+D;AAC/D,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAE7D,8FAA8F;AAC9F,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CA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9B,cAAc,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC;AACtC,cAAc,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC;AAEtC,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","sourcesContent":["export const version = '2.4.26';\n\n// G2 自定义能力透出\nimport * as G2 from '@antv/g2';\n/** 开放一些通用的 adaptor 通道方法,实验阶段:不保证稳定性 */\nimport { animation, annotation, interaction, legend, scale, theme, tooltip } from './adaptor/common';\n// 国际化处理\nimport { registerLocale } from './core/locale';\nimport { EN_US_LOCALE } from './locales/en_US';\nimport { ZH_CN_LOCALE } from './locales/zh_CN';\n/** 各个 geometry 的 adaptor,可以让开发者更快的构造图形 */\nexport { area, interval, line, point, polygon, schema } from './adaptor/geometries';\nexport type {\n AreaGeometryOptions,\n IntervalGeometryOptions,\n LineGeometryOptions,\n PointGeometryOptions,\n PolygonGeometryOptions,\n SchemaGeometryOptions,\n} from './adaptor/geometries';\n/** Adaptor 及其参数的类型定义 */\nexport type { Adaptor, Params } from './core/adaptor';\n/** 全局变量 */\nexport { setGlobal } from './core/global';\n/** G2Plot 的 Plot 基类 */\nexport { Plot } from './core/plot';\n/** 对于没有开发完成的图表,可以暂时先放到 Lab 下面,先做体验,稳定后放到根 export */\nexport { Lab } from './lab';\n// 面积图及类型定义 | author by [hustcc](https://github.com/hustcc)\nexport { Area } from './plots/area';\nexport type { AreaOptions } from './plots/area';\n// 条形图及类型定义 | author by [BBSQQ](https://github.com/BBSQQ)\nexport { Bar } from './plots/bar';\nexport type { BarOptions } from './plots/bar';\n// 对称条形图及类型定义 | author by [arcsin1](https://github.com/arcsin1)\nexport { BidirectionalBar } from './plots/bidirectional-bar';\nexport type { BidirectionalBarOptions } from './plots/bidirectional-bar';\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// 子弹图及类型定义 | author by [arcsin1](https://github.com/arcsin1)\nexport { Bullet } from './plots/bullet';\nexport type { BulletOptions } from './plots/bullet';\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// 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// 柱形图及类型定义 | author by [zqlu](https://github.com/zqlu)\nexport { Column } from './plots/column';\nexport type { ColumnOptions } from './plots/column';\n// 混合图形 | author by [liuzhenying](https://github.com/liuzhenying)\nexport { DualAxes } from './plots/dual-axes';\nexport type { DualAxesOptions } from './plots/dual-axes';\n// 分面图及类型定义 | author by [visiky](https://github.com/visiky)\nexport { Facet } from './plots/facet';\nexport type { FacetOptions } from './plots/facet';\n// 漏斗图及类型定义\nexport { Funnel, FUNNEL_CONVERSATION_FIELD } from './plots/funnel';\nexport type { FunnelOptions } from './plots/funnel';\n// 仪表盘及类型定义 | author by [hustcc](https://github.com/hustcc)\nexport { Gauge } from './plots/gauge';\nexport type { GaugeOptions } from './plots/gauge';\n// 热力图及类型定义 | author by [jiazhewang](https://github.com/jiazhewang)\nexport { Heatmap } from './plots/heatmap';\nexport type { HeatmapOptions } from './plots/heatmap';\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// 折线图及类型定义 | author by [hustcc](https://github.com/hustcc)\nexport { Line } from './plots/line';\nexport type { LineOptions } from './plots/line';\n// 水波图及类型定义 | author by [CarisL](https://github.com/CarisL), [hustcc](https://github.com/hustcc), [pearmini](https://github.com/pearmini)\nexport { addWaterWave, Liquid } from './plots/liquid';\nexport type { LiquidOptions } from './plots/liquid';\n// 已经废弃,更名为 Mix\nexport { Mix as Mix, Mix as MultiView } from './plots/mix';\nexport type { MixOptions, MixOptions as MultiViewOptions } from './plots/mix';\n// 饼图及类型定义 | author by [visiky](https://github.com/visiky)\nexport { Pie } from './plots/pie';\nexport type { PieOptions } from './plots/pie';\n// 进度图及类型定义 | author by [connono](https://github.com/connono)\nexport { Progress } from './plots/progress';\nexport type { ProgressOptions } from './plots/progress';\n// 雷达图及类型定义 | author by [visiky](https://github.com/visiky)\nexport { Radar } from './plots/radar';\nexport type { RadarOptions } from './plots/radar';\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// 环形进度图及类型定义 | author by [connono](https://github.com/connono)\nexport { RingProgress } from './plots/ring-progress';\nexport type { RingProgressOptions } from './plots/ring-progress';\n// 玫瑰图及类型定义 | author by [zhangzhonghe](https://github.com/zhangzhonghe)\nexport { Rose } from './plots/rose';\nexport type { RoseOptions } from './plots/rose';\n// 桑基图及类型定义 | author by [hustcc](https://github.com/hustcc)\nexport { Sankey } from './plots/sankey';\nexport type { SankeyOptions } from './plots/sankey';\n// 散点图及类型定义 | author by [lxfu1](https://github.com/lxfu1)\nexport { Scatter } from './plots/scatter';\nexport type { ScatterOptions } from './plots/scatter';\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// 旭日图及类型定义 | author by [lxfu1](https://github.com/lxfu1), [visiky](https://github.com/visiky)\nexport { Sunburst } from './plots/sunburst';\nexport type { SunburstOptions } from './plots/sunburst';\n// 迷你面积图及类型定义 | author by [connono](https://github.com/connono)\nexport { TinyArea } from './plots/tiny-area';\nexport type { TinyAreaOptions } from './plots/tiny-area';\n// 迷你柱形图及类型定义 | author by [connono](https://github.com/connono)\nexport { TinyColumn } from './plots/tiny-column';\nexport type { TinyColumnOptions } from './plots/tiny-column';\n// 迷你折线图及类型定义 | author by [connono](https://github.com/connono)\nexport { TinyLine } from './plots/tiny-line';\nexport type { TinyLineOptions } from './plots/tiny-line';\n// 矩形树图\nexport { Treemap } from './plots/treemap';\nexport type { TreemapOptions } from './plots/treemap';\n// 韦恩图及类型定义 | author by [visiky](https://github.com/visiky)\nexport { Venn } from './plots/venn';\nexport type { VennOptions } from './plots/venn';\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// 瀑布图 | author by [visiky](https://github.com/visiky)\nexport { Waterfall } from './plots/waterfall';\nexport type { WaterfallOptions } from './plots/waterfall';\n// 词云图及类型定义 | author by [zhangzhonghe](https://github.com/zhangzhonghe)\nexport { WordCloud } from './plots/word-cloud';\nexport type { WordCloudOptions } from './plots/word-cloud';\n// 以下开放自定义图表开发的能力(目前仅仅是孵化中)\n/** 所有开放图表都使用 G2Plot.P 作为入口开发,理论上官方的所有图表都可以走 G2Plot.P 的入口(暂时不处理) */\nexport { P } from './plugin';\n// 类型定义导出\nexport * from './types';\n/** 开发 adaptor 可能会用到的方法或一些工具方法,不强制使用 */\nexport { flow, measureTextWidth } from './utils';\n/** 开放 getCanvasPatterng 方法 */\nexport { getCanvasPattern } from './utils/pattern';\nexport { G2 };\n/** 透出 国际化 工具函数,便于使用 */\nexport { registerLocale };\n\n/** default locale register */\nregisterLocale('en-US', EN_US_LOCALE);\nregisterLocale('zh-CN', ZH_CN_LOCALE);\n\nexport const adaptors = { scale, legend, tooltip, annotation, interaction, theme, animation };\n"]}
@@ -30,7 +30,7 @@ function defaultOptions(params) {
30
30
  */
31
31
  function geometry(params) {
32
32
  var chart = params.chart, options = params.options;
33
- var color = options.color, nodeStyle = options.nodeStyle, edgeStyle = options.edgeStyle, label = options.label, tooltip = options.tooltip, nodeState = options.nodeState, edgeState = options.edgeState;
33
+ var color = options.color, nodeStyle = options.nodeStyle, edgeStyle = options.edgeStyle, label = options.label, tooltip = options.tooltip, nodeState = options.nodeState, edgeState = options.edgeState, _a = options.rawFields, rawFields = _a === void 0 ? [] : _a;
34
34
  // 1. 组件,优先设置,因为子 view 会继承配置
35
35
  chart.legend(false);
36
36
  chart.tooltip(tooltip);
@@ -39,7 +39,7 @@ function geometry(params) {
39
39
  chart.coordinate().reflect('y');
40
40
  // 2. node edge views
41
41
  // @ts-ignore
42
- var _a = transformToViewsData(options, chart.width, chart.height), nodes = _a.nodes, edges = _a.edges;
42
+ var _b = transformToViewsData(options, chart.width, chart.height), nodes = _b.nodes, edges = _b.edges;
43
43
  // edge view
44
44
  var edgeView = chart.createView({ id: EDGES_VIEW_ID });
45
45
  edgeView.data(edges);
@@ -50,6 +50,7 @@ function geometry(params) {
50
50
  xField: X_FIELD,
51
51
  yField: Y_FIELD,
52
52
  seriesField: COLOR_FIELD,
53
+ rawFields: __spreadArrays(['source', 'target'], rawFields),
53
54
  edge: {
54
55
  color: color,
55
56
  style: edgeStyle,
@@ -1 +1 @@
1
- {"version":3,"file":"adaptor.js","sourceRoot":"","sources":["../../../src/plots/sankey/adaptor.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAClC,OAAO,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAC7C,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAC;AAEzD,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAC7D,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,aAAa,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACzF,OAAO,EAAE,oBAAoB,EAAE,MAAM,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';\nimport { theme } from '../../adaptor/common';\nimport { edge, polygon } from '../../adaptor/geometries';\nimport { Params } from '../../core/adaptor';\nimport { deepAssign, findViewById, flow } from '../../utils';\nimport { addViewAnimation } from '../../utils/view';\nimport { COLOR_FIELD, EDGES_VIEW_ID, NODES_VIEW_ID, X_FIELD, Y_FIELD } from './constant';\nimport { transformToViewsData } from './helper';\nimport { SankeyOptions } from './types';\n\n/**\n * 默认配置项 处理\n * @param params\n */\nfunction defaultOptions(params: Params<SankeyOptions>): Params<SankeyOptions> {\n const { options } = params;\n const { rawFields = [] } = options;\n\n return deepAssign(\n {},\n {\n options: {\n tooltip: {\n fields: uniq(['name', 'source', 'target', 'value', 'isNode', ...rawFields]),\n },\n label: {\n fields: uniq(['x', 'name', ...rawFields]),\n },\n },\n },\n params\n );\n}\n\n/**\n * geometry 处理\n * @param params\n */\nfunction geometry(params: Params<SankeyOptions>): Params<SankeyOptions> {\n const { chart, options } = params;\n const { color, nodeStyle, edgeStyle, label, tooltip, nodeState, edgeState } = options;\n\n // 1. 组件,优先设置,因为子 view 会继承配置\n chart.legend(false);\n chart.tooltip(tooltip);\n chart.axis(false);\n // y 镜像一下,防止图形顺序和数据顺序反了\n chart.coordinate().reflect('y');\n\n // 2. node edge views\n // @ts-ignore\n const { nodes, edges } = transformToViewsData(options, chart.width, chart.height);\n\n // edge view\n const edgeView = chart.createView({ id: EDGES_VIEW_ID });\n edgeView.data(edges);\n\n edge({\n chart: edgeView,\n // @ts-ignore\n options: {\n xField: X_FIELD,\n yField: Y_FIELD,\n seriesField: COLOR_FIELD,\n edge: {\n color,\n style: edgeStyle,\n shape: 'arc',\n },\n tooltip,\n state: edgeState,\n },\n });\n\n const nodeView = chart.createView({ id: NODES_VIEW_ID });\n nodeView.data(nodes);\n\n polygon({\n chart: nodeView,\n options: {\n xField: X_FIELD,\n yField: Y_FIELD,\n seriesField: COLOR_FIELD,\n polygon: {\n color,\n style: nodeStyle,\n },\n label,\n tooltip,\n state: nodeState,\n },\n });\n\n chart.interaction('element-active');\n\n // scale\n chart.scale({\n x: { sync: true, nice: true, min: 0, max: 1, minLimit: 0, maxLimit: 1 },\n y: { sync: true, nice: true, min: 0, max: 1, minLimit: 0, maxLimit: 1 },\n name: { sync: 'color', type: 'cat' },\n });\n\n return params;\n}\n\n/**\n * 动画\n * @param params\n */\nexport function animation(params: Params<SankeyOptions>): Params<SankeyOptions> {\n const { chart, options } = params;\n const { animation } = options;\n\n const geometries = [...chart.views[0].geometries, ...chart.views[1].geometries];\n\n addViewAnimation(chart, animation, geometries);\n\n return params;\n}\n\n/**\n * 节点拖动\n * @param params\n */\nexport function nodeDraggable(params: Params<SankeyOptions>): Params<SankeyOptions> {\n const { chart, options } = params;\n const { nodeDraggable } = options;\n\n const DRAG_INTERACTION = 'sankey-node-draggable';\n\n if (nodeDraggable) {\n chart.interaction(DRAG_INTERACTION);\n } else {\n chart.removeInteraction(DRAG_INTERACTION);\n }\n\n return params;\n}\n\n/**\n * Interaction 配置\n * @param params\n */\nfunction interaction(params: Params<SankeyOptions>): Params<SankeyOptions> {\n const { chart, options } = params;\n const { interactions = [] } = options;\n\n const nodeInteractions = [].concat(interactions, options.nodeInteractions || []);\n const edgeInteractions = [].concat(interactions, options.edgeInteractions || []);\n\n const nodeView = findViewById(chart, NODES_VIEW_ID);\n const edgeView = findViewById(chart, EDGES_VIEW_ID);\n\n nodeInteractions.forEach((i) => {\n if (i?.enable === false) {\n nodeView.removeInteraction(i.type);\n } else {\n nodeView.interaction(i.type, i.cfg || {});\n }\n });\n\n edgeInteractions.forEach((i) => {\n if (i?.enable === false) {\n edgeView.removeInteraction(i.type);\n } else {\n edgeView.interaction(i.type, i.cfg || {});\n }\n });\n\n return params;\n}\n\n/**\n * 图适配器\n * @param chart\n * @param options\n */\nexport function adaptor(params: Params<SankeyOptions>) {\n // flow 的方式处理所有的配置到 G2 API\n return flow(\n defaultOptions,\n geometry,\n interaction,\n nodeDraggable,\n animation,\n theme\n // ... 其他的 adaptor flow\n )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,CAAC,CAAC;SAC3C;IACH,CAAC,CAAC,CAAC;IAEH,gBAAgB,CAAC,OAAO,CAAC,UAAC,CAAC;QACzB,IAAI,CAAA,CAAC,aAAD,CAAC,uBAAD,CAAC,CAAE,MAAM,MAAK,KAAK,EAAE;YACvB,QAAQ,CAAC,iBAAiB,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;SACpC;aAAM;YACL,QAAQ,CAAC,WAAW,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,GAAG,IAAI,EAAE,CAAC,CAAC;SAC3C;IACH,CAAC,CAAC,CAAC;IAEH,OAAO,MAAM,CAAC;AAChB,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,OAAO,CAAC,MAA6B;IACnD,0BAA0B;IAC1B,OAAO,IAAI,CACT,cAAc,EACd,QAAQ,EACR,WAAW,EACX,aAAa,EACb,SAAS,EACT,KAAK;IACL,uBAAuB;KACxB,CAAC,MAAM,CAAC,CAAC;AACZ,CAAC","sourcesContent":["import { uniq } from '@antv/util';\nimport { theme } from '../../adaptor/common';\nimport { edge, polygon } from '../../adaptor/geometries';\nimport { Params } from '../../core/adaptor';\nimport { deepAssign, findViewById, flow } from '../../utils';\nimport { addViewAnimation } from '../../utils/view';\nimport { COLOR_FIELD, EDGES_VIEW_ID, NODES_VIEW_ID, X_FIELD, Y_FIELD } from './constant';\nimport { transformToViewsData } from './helper';\nimport { SankeyOptions } from './types';\n\n/**\n * 默认配置项 处理\n * @param params\n */\nfunction defaultOptions(params: Params<SankeyOptions>): Params<SankeyOptions> {\n const { options } = params;\n const { rawFields = [] } = options;\n\n return deepAssign(\n {},\n {\n options: {\n tooltip: {\n fields: uniq(['name', 'source', 'target', 'value', 'isNode', ...rawFields]),\n },\n label: {\n fields: uniq(['x', 'name', ...rawFields]),\n },\n },\n },\n params\n );\n}\n\n/**\n * geometry 处理\n * @param params\n */\nfunction geometry(params: Params<SankeyOptions>): Params<SankeyOptions> {\n const { chart, options } = params;\n const { color, nodeStyle, edgeStyle, label, tooltip, nodeState, edgeState, rawFields = [] } = options;\n\n // 1. 组件,优先设置,因为子 view 会继承配置\n chart.legend(false);\n chart.tooltip(tooltip);\n chart.axis(false);\n // y 镜像一下,防止图形顺序和数据顺序反了\n chart.coordinate().reflect('y');\n\n // 2. node edge views\n // @ts-ignore\n const { nodes, edges } = transformToViewsData(options, chart.width, chart.height);\n\n // edge view\n const edgeView = chart.createView({ id: EDGES_VIEW_ID });\n edgeView.data(edges);\n\n edge({\n chart: edgeView,\n // @ts-ignore\n options: {\n xField: X_FIELD,\n yField: Y_FIELD,\n seriesField: COLOR_FIELD,\n rawFields: ['source', 'target', ...rawFields],\n edge: {\n color,\n style: edgeStyle,\n shape: 'arc',\n },\n tooltip,\n state: edgeState,\n },\n });\n\n const nodeView = chart.createView({ id: NODES_VIEW_ID });\n nodeView.data(nodes);\n\n polygon({\n chart: nodeView,\n options: {\n xField: X_FIELD,\n yField: Y_FIELD,\n seriesField: COLOR_FIELD,\n polygon: {\n color,\n style: nodeStyle,\n },\n label,\n tooltip,\n state: nodeState,\n },\n });\n\n chart.interaction('element-active');\n\n // scale\n chart.scale({\n x: { sync: true, nice: true, min: 0, max: 1, minLimit: 0, maxLimit: 1 },\n y: { sync: true, nice: true, min: 0, max: 1, minLimit: 0, maxLimit: 1 },\n name: { sync: 'color', type: 'cat' },\n });\n\n return params;\n}\n\n/**\n * 动画\n * @param params\n */\nexport function animation(params: Params<SankeyOptions>): Params<SankeyOptions> {\n const { chart, options } = params;\n const { animation } = options;\n\n const geometries = [...chart.views[0].geometries, ...chart.views[1].geometries];\n\n addViewAnimation(chart, animation, geometries);\n\n return params;\n}\n\n/**\n * 节点拖动\n * @param params\n */\nexport function nodeDraggable(params: Params<SankeyOptions>): Params<SankeyOptions> {\n const { chart, options } = params;\n const { nodeDraggable } = options;\n\n const DRAG_INTERACTION = 'sankey-node-draggable';\n\n if (nodeDraggable) {\n chart.interaction(DRAG_INTERACTION);\n } else {\n chart.removeInteraction(DRAG_INTERACTION);\n }\n\n return params;\n}\n\n/**\n * Interaction 配置\n * @param params\n */\nfunction interaction(params: Params<SankeyOptions>): Params<SankeyOptions> {\n const { chart, options } = params;\n const { interactions = [] } = options;\n\n const nodeInteractions = [].concat(interactions, options.nodeInteractions || []);\n const edgeInteractions = [].concat(interactions, options.edgeInteractions || []);\n\n const nodeView = findViewById(chart, NODES_VIEW_ID);\n const edgeView = findViewById(chart, EDGES_VIEW_ID);\n\n nodeInteractions.forEach((i) => {\n if (i?.enable === false) {\n nodeView.removeInteraction(i.type);\n } else {\n nodeView.interaction(i.type, i.cfg || {});\n }\n });\n\n edgeInteractions.forEach((i) => {\n if (i?.enable === false) {\n edgeView.removeInteraction(i.type);\n } else {\n edgeView.interaction(i.type, i.cfg || {});\n }\n });\n\n return params;\n}\n\n/**\n * 图适配器\n * @param chart\n * @param options\n */\nexport function adaptor(params: Params<SankeyOptions>) {\n // flow 的方式处理所有的配置到 G2 API\n return flow(\n defaultOptions,\n geometry,\n interaction,\n nodeDraggable,\n animation,\n theme\n // ... 其他的 adaptor flow\n )(params);\n}\n"]}
package/lib/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export declare const version = "2.4.25";
1
+ export declare const version = "2.4.26";
2
2
  import * as G2 from '@antv/g2';
3
3
  /** 开放一些通用的 adaptor 通道方法,实验阶段:不保证稳定性 */
4
4
  import { animation, annotation, interaction, legend, scale, theme, tooltip } from './adaptor/common';
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.25';
5
+ exports.version = '2.4.26';
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.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ACrG,yCAAwC;AAA/B,gGAAA,MAAM,OAAA;AAEf,sDAAsD;AACtD,+CAA8C;AAArC,sGAAA,SAAS,OAAA;AAElB,uEAAuE;AACvE,iDAA+C;AAAtC,uGAAA,SAAS,OAAA;AAElB,2BAA2B;AAC3B,mEAAmE;AACnE,mCAA6B;AAApB,2FAAA,CAAC,OAAA;AACV,SAAS;AACT,kDAAwB;AACxB,uCAAuC;AACvC,iCAAiD;AAAxC,6FAAA,IAAI,OAAA;AAAE,yGAAA,gBAAgB,OAAA;AAC/B,8BAA8B;AAC9B,2CAAmD;AAA1C,2GAAA,gBAAgB,OAAA;AAKzB,8BAA8B;AAC9B,uBAAc,CAAC,OAAO,EAAE,oBAAY,CAAC,CAAC;AACtC,uBAAc,CAAC,OAAO,EAAE,oBAAY,CAAC,CAAC;AAEzB,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","sourcesContent":["export const version = '2.4.25';\n\n// G2 自定义能力透出\nimport * as G2 from '@antv/g2';\n/** 开放一些通用的 adaptor 通道方法,实验阶段:不保证稳定性 */\nimport { animation, annotation, interaction, legend, scale, theme, tooltip } from './adaptor/common';\n// 国际化处理\nimport { registerLocale } from './core/locale';\nimport { EN_US_LOCALE } from './locales/en_US';\nimport { ZH_CN_LOCALE } from './locales/zh_CN';\n/** 各个 geometry 的 adaptor,可以让开发者更快的构造图形 */\nexport { area, interval, line, point, polygon, schema } from './adaptor/geometries';\nexport type {\n AreaGeometryOptions,\n IntervalGeometryOptions,\n LineGeometryOptions,\n PointGeometryOptions,\n PolygonGeometryOptions,\n SchemaGeometryOptions,\n} from './adaptor/geometries';\n/** Adaptor 及其参数的类型定义 */\nexport type { Adaptor, Params } from './core/adaptor';\n/** 全局变量 */\nexport { setGlobal } from './core/global';\n/** G2Plot 的 Plot 基类 */\nexport { Plot } from './core/plot';\n/** 对于没有开发完成的图表,可以暂时先放到 Lab 下面,先做体验,稳定后放到根 export */\nexport { Lab } from './lab';\n// 面积图及类型定义 | author by [hustcc](https://github.com/hustcc)\nexport { Area } from './plots/area';\nexport type { AreaOptions } from './plots/area';\n// 条形图及类型定义 | author by [BBSQQ](https://github.com/BBSQQ)\nexport { Bar } from './plots/bar';\nexport type { BarOptions } from './plots/bar';\n// 对称条形图及类型定义 | author by [arcsin1](https://github.com/arcsin1)\nexport { BidirectionalBar } from './plots/bidirectional-bar';\nexport type { BidirectionalBarOptions } from './plots/bidirectional-bar';\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// 子弹图及类型定义 | author by [arcsin1](https://github.com/arcsin1)\nexport { Bullet } from './plots/bullet';\nexport type { BulletOptions } from './plots/bullet';\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// 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// 柱形图及类型定义 | author by [zqlu](https://github.com/zqlu)\nexport { Column } from './plots/column';\nexport type { ColumnOptions } from './plots/column';\n// 混合图形 | author by [liuzhenying](https://github.com/liuzhenying)\nexport { DualAxes } from './plots/dual-axes';\nexport type { DualAxesOptions } from './plots/dual-axes';\n// 分面图及类型定义 | author by [visiky](https://github.com/visiky)\nexport { Facet } from './plots/facet';\nexport type { FacetOptions } from './plots/facet';\n// 漏斗图及类型定义\nexport { Funnel, FUNNEL_CONVERSATION_FIELD } from './plots/funnel';\nexport type { FunnelOptions } from './plots/funnel';\n// 仪表盘及类型定义 | author by [hustcc](https://github.com/hustcc)\nexport { Gauge } from './plots/gauge';\nexport type { GaugeOptions } from './plots/gauge';\n// 热力图及类型定义 | author by [jiazhewang](https://github.com/jiazhewang)\nexport { Heatmap } from './plots/heatmap';\nexport type { HeatmapOptions } from './plots/heatmap';\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// 折线图及类型定义 | author by [hustcc](https://github.com/hustcc)\nexport { Line } from './plots/line';\nexport type { LineOptions } from './plots/line';\n// 水波图及类型定义 | author by [CarisL](https://github.com/CarisL), [hustcc](https://github.com/hustcc), [pearmini](https://github.com/pearmini)\nexport { addWaterWave, Liquid } from './plots/liquid';\nexport type { LiquidOptions } from './plots/liquid';\n// 已经废弃,更名为 Mix\nexport { Mix as Mix, Mix as MultiView } from './plots/mix';\nexport type { MixOptions, MixOptions as MultiViewOptions } from './plots/mix';\n// 饼图及类型定义 | author by [visiky](https://github.com/visiky)\nexport { Pie } from './plots/pie';\nexport type { PieOptions } from './plots/pie';\n// 进度图及类型定义 | author by [connono](https://github.com/connono)\nexport { Progress } from './plots/progress';\nexport type { ProgressOptions } from './plots/progress';\n// 雷达图及类型定义 | author by [visiky](https://github.com/visiky)\nexport { Radar } from './plots/radar';\nexport type { RadarOptions } from './plots/radar';\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// 环形进度图及类型定义 | author by [connono](https://github.com/connono)\nexport { RingProgress } from './plots/ring-progress';\nexport type { RingProgressOptions } from './plots/ring-progress';\n// 玫瑰图及类型定义 | author by [zhangzhonghe](https://github.com/zhangzhonghe)\nexport { Rose } from './plots/rose';\nexport type { RoseOptions } from './plots/rose';\n// 桑基图及类型定义 | author by [hustcc](https://github.com/hustcc)\nexport { Sankey } from './plots/sankey';\nexport type { SankeyOptions } from './plots/sankey';\n// 散点图及类型定义 | author by [lxfu1](https://github.com/lxfu1)\nexport { Scatter } from './plots/scatter';\nexport type { ScatterOptions } from './plots/scatter';\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// 旭日图及类型定义 | author by [lxfu1](https://github.com/lxfu1), [visiky](https://github.com/visiky)\nexport { Sunburst } from './plots/sunburst';\nexport type { SunburstOptions } from './plots/sunburst';\n// 迷你面积图及类型定义 | author by [connono](https://github.com/connono)\nexport { TinyArea } from './plots/tiny-area';\nexport type { TinyAreaOptions } from './plots/tiny-area';\n// 迷你柱形图及类型定义 | author by [connono](https://github.com/connono)\nexport { TinyColumn } from './plots/tiny-column';\nexport type { TinyColumnOptions } from './plots/tiny-column';\n// 迷你折线图及类型定义 | author by [connono](https://github.com/connono)\nexport { TinyLine } from './plots/tiny-line';\nexport type { TinyLineOptions } from './plots/tiny-line';\n// 矩形树图\nexport { Treemap } from './plots/treemap';\nexport type { TreemapOptions } from './plots/treemap';\n// 韦恩图及类型定义 | author by [visiky](https://github.com/visiky)\nexport { Venn } from './plots/venn';\nexport type { VennOptions } from './plots/venn';\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// 瀑布图 | author by [visiky](https://github.com/visiky)\nexport { Waterfall } from './plots/waterfall';\nexport type { WaterfallOptions } from './plots/waterfall';\n// 词云图及类型定义 | author by [zhangzhonghe](https://github.com/zhangzhonghe)\nexport { WordCloud } from './plots/word-cloud';\nexport type { WordCloudOptions } from './plots/word-cloud';\n// 以下开放自定义图表开发的能力(目前仅仅是孵化中)\n/** 所有开放图表都使用 G2Plot.P 作为入口开发,理论上官方的所有图表都可以走 G2Plot.P 的入口(暂时不处理) */\nexport { P } from './plugin';\n// 类型定义导出\nexport * from './types';\n/** 开发 adaptor 可能会用到的方法或一些工具方法,不强制使用 */\nexport { flow, measureTextWidth } from './utils';\n/** 开放 getCanvasPatterng 方法 */\nexport { getCanvasPattern } from './utils/pattern';\nexport { G2 };\n/** 透出 国际化 工具函数,便于使用 */\nexport { registerLocale };\n\n/** default locale register */\nregisterLocale('en-US', EN_US_LOCALE);\nregisterLocale('zh-CN', ZH_CN_LOCALE);\n\nexport const adaptors = { scale, legend, tooltip, annotation, interaction, theme, animation };\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;AA2ItB,gBAAE;AA1IX,uCAAuC;AACvC,2CAAqG;AACrG,QAAQ;AACR,wCAA+C;AAyItC,+FAzIA,uBAAc,OAyIA;AAxIvB,yCAA+C;AAC/C,yCAA+C;AAC/C,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;AAWrD,WAAW;AACX,wCAA0C;AAAjC,mGAAA,SAAS,OAAA;AAClB,uBAAuB;AACvB,oCAAmC;AAA1B,4FAAA,IAAI,OAAA;AACb,oDAAoD;AACpD,6BAA4B;AAAnB,0FAAA,GAAG,OAAA;AACZ,2DAA2D;AAC3D,qCAAoC;AAA3B,4FAAA,IAAI,OAAA;AAEb,yDAAyD;AACzD,mCAAkC;AAAzB,0FAAA,GAAG,OAAA;AAEZ,+DAA+D;AAC/D,+DAA6D;AAApD,qHAAA,gBAAgB,OAAA;AAEzB,8FAA8F;AAC9F,mCAAkC;AAAzB,0FAAA,GAAG,OAAA;AAEZ,6DAA6D;AAC7D,yCAAwC;AAA/B,gGAAA,MAAM,OAAA;AAEf,uGAAuG;AACvG,uCAAsC;AAA7B,8FAAA,KAAK,OAAA;AAEd,6GAA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QAAQ,OAAA;AAEjB,+DAA+D;AAC/D,+CAA6C;AAApC,qGAAA,QAAQ,OAAA;AAEjB,+DAA+D;AAC/D,mDAAiD;AAAxC,yGAAA,UAAU,OAAA;AAEnB,+DAA+D;AAC/D,+CAA6C;AAApC,qGAAA,QAAQ,OAAA;AAEjB,OAAO;AACP,2CAA0C;AAAjC,kGAAA,OAAO,OAAA;AAEhB,2DAA2D;AAC3D,qCAAoC;AAA3B,4FAAA,IAAI,OAAA;AAEb,qGAAqG;AACrG,yCAAwC;AAA/B,gGAAA,MAAM,OAAA;AAEf,sDAAsD;AACtD,+CAA8C;AAArC,sGAAA,SAAS,OAAA;AAElB,uEAAuE;AACvE,iDAA+C;AAAtC,uGAAA,SAAS,OAAA;AAElB,2BAA2B;AAC3B,mEAAmE;AACnE,mCAA6B;AAApB,2FAAA,CAAC,OAAA;AACV,SAAS;AACT,kDAAwB;AACxB,uCAAuC;AACvC,iCAAiD;AAAxC,6FAAA,IAAI,OAAA;AAAE,yGAAA,gBAAgB,OAAA;AAC/B,8BAA8B;AAC9B,2CAAmD;AAA1C,2GAAA,gBAAgB,OAAA;AAKzB,8BAA8B;AAC9B,uBAAc,CAAC,OAAO,EAAE,oBAAY,CAAC,CAAC;AACtC,uBAAc,CAAC,OAAO,EAAE,oBAAY,CAAC,CAAC;AAEzB,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","sourcesContent":["export const version = '2.4.26';\n\n// G2 自定义能力透出\nimport * as G2 from '@antv/g2';\n/** 开放一些通用的 adaptor 通道方法,实验阶段:不保证稳定性 */\nimport { animation, annotation, interaction, legend, scale, theme, tooltip } from './adaptor/common';\n// 国际化处理\nimport { registerLocale } from './core/locale';\nimport { EN_US_LOCALE } from './locales/en_US';\nimport { ZH_CN_LOCALE } from './locales/zh_CN';\n/** 各个 geometry 的 adaptor,可以让开发者更快的构造图形 */\nexport { area, interval, line, point, polygon, schema } from './adaptor/geometries';\nexport type {\n AreaGeometryOptions,\n IntervalGeometryOptions,\n LineGeometryOptions,\n PointGeometryOptions,\n PolygonGeometryOptions,\n SchemaGeometryOptions,\n} from './adaptor/geometries';\n/** Adaptor 及其参数的类型定义 */\nexport type { Adaptor, Params } from './core/adaptor';\n/** 全局变量 */\nexport { setGlobal } from './core/global';\n/** G2Plot 的 Plot 基类 */\nexport { Plot } from './core/plot';\n/** 对于没有开发完成的图表,可以暂时先放到 Lab 下面,先做体验,稳定后放到根 export */\nexport { Lab } from './lab';\n// 面积图及类型定义 | author by [hustcc](https://github.com/hustcc)\nexport { Area } from './plots/area';\nexport type { AreaOptions } from './plots/area';\n// 条形图及类型定义 | author by [BBSQQ](https://github.com/BBSQQ)\nexport { Bar } from './plots/bar';\nexport type { BarOptions } from './plots/bar';\n// 对称条形图及类型定义 | author by [arcsin1](https://github.com/arcsin1)\nexport { BidirectionalBar } from './plots/bidirectional-bar';\nexport type { BidirectionalBarOptions } from './plots/bidirectional-bar';\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// 子弹图及类型定义 | author by [arcsin1](https://github.com/arcsin1)\nexport { Bullet } from './plots/bullet';\nexport type { BulletOptions } from './plots/bullet';\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// 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// 柱形图及类型定义 | author by [zqlu](https://github.com/zqlu)\nexport { Column } from './plots/column';\nexport type { ColumnOptions } from './plots/column';\n// 混合图形 | author by [liuzhenying](https://github.com/liuzhenying)\nexport { DualAxes } from './plots/dual-axes';\nexport type { DualAxesOptions } from './plots/dual-axes';\n// 分面图及类型定义 | author by [visiky](https://github.com/visiky)\nexport { Facet } from './plots/facet';\nexport type { FacetOptions } from './plots/facet';\n// 漏斗图及类型定义\nexport { Funnel, FUNNEL_CONVERSATION_FIELD } from './plots/funnel';\nexport type { FunnelOptions } from './plots/funnel';\n// 仪表盘及类型定义 | author by [hustcc](https://github.com/hustcc)\nexport { Gauge } from './plots/gauge';\nexport type { GaugeOptions } from './plots/gauge';\n// 热力图及类型定义 | author by [jiazhewang](https://github.com/jiazhewang)\nexport { Heatmap } from './plots/heatmap';\nexport type { HeatmapOptions } from './plots/heatmap';\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// 折线图及类型定义 | author by [hustcc](https://github.com/hustcc)\nexport { Line } from './plots/line';\nexport type { LineOptions } from './plots/line';\n// 水波图及类型定义 | author by [CarisL](https://github.com/CarisL), [hustcc](https://github.com/hustcc), [pearmini](https://github.com/pearmini)\nexport { addWaterWave, Liquid } from './plots/liquid';\nexport type { LiquidOptions } from './plots/liquid';\n// 已经废弃,更名为 Mix\nexport { Mix as Mix, Mix as MultiView } from './plots/mix';\nexport type { MixOptions, MixOptions as MultiViewOptions } from './plots/mix';\n// 饼图及类型定义 | author by [visiky](https://github.com/visiky)\nexport { Pie } from './plots/pie';\nexport type { PieOptions } from './plots/pie';\n// 进度图及类型定义 | author by [connono](https://github.com/connono)\nexport { Progress } from './plots/progress';\nexport type { ProgressOptions } from './plots/progress';\n// 雷达图及类型定义 | author by [visiky](https://github.com/visiky)\nexport { Radar } from './plots/radar';\nexport type { RadarOptions } from './plots/radar';\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// 环形进度图及类型定义 | author by [connono](https://github.com/connono)\nexport { RingProgress } from './plots/ring-progress';\nexport type { RingProgressOptions } from './plots/ring-progress';\n// 玫瑰图及类型定义 | author by [zhangzhonghe](https://github.com/zhangzhonghe)\nexport { Rose } from './plots/rose';\nexport type { RoseOptions } from './plots/rose';\n// 桑基图及类型定义 | author by [hustcc](https://github.com/hustcc)\nexport { Sankey } from './plots/sankey';\nexport type { SankeyOptions } from './plots/sankey';\n// 散点图及类型定义 | author by [lxfu1](https://github.com/lxfu1)\nexport { Scatter } from './plots/scatter';\nexport type { ScatterOptions } from './plots/scatter';\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// 旭日图及类型定义 | author by [lxfu1](https://github.com/lxfu1), [visiky](https://github.com/visiky)\nexport { Sunburst } from './plots/sunburst';\nexport type { SunburstOptions } from './plots/sunburst';\n// 迷你面积图及类型定义 | author by [connono](https://github.com/connono)\nexport { TinyArea } from './plots/tiny-area';\nexport type { TinyAreaOptions } from './plots/tiny-area';\n// 迷你柱形图及类型定义 | author by [connono](https://github.com/connono)\nexport { TinyColumn } from './plots/tiny-column';\nexport type { TinyColumnOptions } from './plots/tiny-column';\n// 迷你折线图及类型定义 | author by [connono](https://github.com/connono)\nexport { TinyLine } from './plots/tiny-line';\nexport type { TinyLineOptions } from './plots/tiny-line';\n// 矩形树图\nexport { Treemap } from './plots/treemap';\nexport type { TreemapOptions } from './plots/treemap';\n// 韦恩图及类型定义 | author by [visiky](https://github.com/visiky)\nexport { Venn } from './plots/venn';\nexport type { VennOptions } from './plots/venn';\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// 瀑布图 | author by [visiky](https://github.com/visiky)\nexport { Waterfall } from './plots/waterfall';\nexport type { WaterfallOptions } from './plots/waterfall';\n// 词云图及类型定义 | author by [zhangzhonghe](https://github.com/zhangzhonghe)\nexport { WordCloud } from './plots/word-cloud';\nexport type { WordCloudOptions } from './plots/word-cloud';\n// 以下开放自定义图表开发的能力(目前仅仅是孵化中)\n/** 所有开放图表都使用 G2Plot.P 作为入口开发,理论上官方的所有图表都可以走 G2Plot.P 的入口(暂时不处理) */\nexport { P } from './plugin';\n// 类型定义导出\nexport * from './types';\n/** 开发 adaptor 可能会用到的方法或一些工具方法,不强制使用 */\nexport { flow, measureTextWidth } from './utils';\n/** 开放 getCanvasPatterng 方法 */\nexport { getCanvasPattern } from './utils/pattern';\nexport { G2 };\n/** 透出 国际化 工具函数,便于使用 */\nexport { registerLocale };\n\n/** default locale register */\nregisterLocale('en-US', EN_US_LOCALE);\nregisterLocale('zh-CN', ZH_CN_LOCALE);\n\nexport const adaptors = { scale, legend, tooltip, annotation, interaction, theme, animation };\n"]}
@@ -33,7 +33,7 @@ function defaultOptions(params) {
33
33
  */
34
34
  function geometry(params) {
35
35
  var chart = params.chart, options = params.options;
36
- var color = options.color, nodeStyle = options.nodeStyle, edgeStyle = options.edgeStyle, label = options.label, tooltip = options.tooltip, nodeState = options.nodeState, edgeState = options.edgeState;
36
+ var color = options.color, nodeStyle = options.nodeStyle, edgeStyle = options.edgeStyle, label = options.label, tooltip = options.tooltip, nodeState = options.nodeState, edgeState = options.edgeState, _a = options.rawFields, rawFields = _a === void 0 ? [] : _a;
37
37
  // 1. 组件,优先设置,因为子 view 会继承配置
38
38
  chart.legend(false);
39
39
  chart.tooltip(tooltip);
@@ -42,7 +42,7 @@ function geometry(params) {
42
42
  chart.coordinate().reflect('y');
43
43
  // 2. node edge views
44
44
  // @ts-ignore
45
- var _a = helper_1.transformToViewsData(options, chart.width, chart.height), nodes = _a.nodes, edges = _a.edges;
45
+ var _b = helper_1.transformToViewsData(options, chart.width, chart.height), nodes = _b.nodes, edges = _b.edges;
46
46
  // edge view
47
47
  var edgeView = chart.createView({ id: constant_1.EDGES_VIEW_ID });
48
48
  edgeView.data(edges);
@@ -53,6 +53,7 @@ function geometry(params) {
53
53
  xField: constant_1.X_FIELD,
54
54
  yField: constant_1.Y_FIELD,
55
55
  seriesField: constant_1.COLOR_FIELD,
56
+ rawFields: tslib_1.__spreadArrays(['source', 'target'], rawFields),
56
57
  edge: {
57
58
  color: color,
58
59
  style: edgeStyle,
@@ -1 +1 @@
1
- {"version":3,"file":"adaptor.js","sourceRoot":"","sources":["../../../src/plots/sankey/adaptor.ts"],"names":[],"mappings":";;;;AAAA,mCAAkC;AAClC,+CAA6C;AAC7C,uDAAyD;AAEzD,qCAA6D;AAC7D,yCAAoD;AACpD,uCAAyF;AACzF,mCAAgD;AAGhD;;;GAGG;AACH,SAAS,cAAc,CAAC,MAA6B;IAC3C,IAAA,OAAO,GAAK,MAAM,QAAX,CAAY;IACnB,IAAA,KAAmB,OAAO,UAAZ,EAAd,SAAS,mBAAG,EAAE,KAAA,CAAa;IAEnC,OAAO,kBAAU,CACf,EAAE,EACF;QACE,OAAO,EAAE;YACP,OAAO,EAAE;gBACP,MAAM,EAAE,WAAI,yBAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,GAAK,SAAS,EAAE;aAC5E;YACD,KAAK,EAAE;gBACL,MAAM,EAAE,WAAI,yBAAE,GAAG,EAAE,MAAM,GAAK,SAAS,EAAE;aAC1C;SACF;KACF,EACD,MAAM,CACP,CAAC;AACJ,CAAC;AAED;;;GAGG;AACH,SAAS,QAAQ,CAAC,MAA6B;IACrC,IAAA,KAAK,GAAc,MAAM,MAApB,EAAE,OAAO,GAAK,MAAM,QAAX,CAAY;IAC1B,IAAA,KAAK,GAAiE,OAAO,MAAxE,EAAE,SAAS,GAAsD,OAAO,UAA7D,EAAE,SAAS,GAA2C,OAAO,UAAlD,EAAE,KAAK,GAAoC,OAAO,MAA3C,EAAE,OAAO,GAA2B,OAAO,QAAlC,EAAE,SAAS,GAAgB,OA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vB,QAAQ,CAAC,iBAAiB,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;SACpC;aAAM;YACL,QAAQ,CAAC,WAAW,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,GAAG,IAAI,EAAE,CAAC,CAAC;SAC3C;IACH,CAAC,CAAC,CAAC;IAEH,OAAO,MAAM,CAAC;AAChB,CAAC;AAED;;;;GAIG;AACH,SAAgB,OAAO,CAAC,MAA6B;IACnD,0BAA0B;IAC1B,OAAO,YAAI,CACT,cAAc,EACd,QAAQ,EACR,WAAW,EACX,aAAa,EACb,SAAS,EACT,cAAK;IACL,uBAAuB;KACxB,CAAC,MAAM,CAAC,CAAC;AACZ,CAAC;AAXD,0BAWC","sourcesContent":["import { uniq } from '@antv/util';\nimport { theme } from '../../adaptor/common';\nimport { edge, polygon } from '../../adaptor/geometries';\nimport { Params } from '../../core/adaptor';\nimport { deepAssign, findViewById, flow } from '../../utils';\nimport { addViewAnimation } from '../../utils/view';\nimport { COLOR_FIELD, EDGES_VIEW_ID, NODES_VIEW_ID, X_FIELD, Y_FIELD } from './constant';\nimport { transformToViewsData } from './helper';\nimport { SankeyOptions } from './types';\n\n/**\n * 默认配置项 处理\n * @param params\n */\nfunction defaultOptions(params: Params<SankeyOptions>): Params<SankeyOptions> {\n const { options } = params;\n const { rawFields = [] } = options;\n\n return deepAssign(\n {},\n {\n options: {\n tooltip: {\n fields: uniq(['name', 'source', 'target', 'value', 'isNode', ...rawFields]),\n },\n label: {\n fields: uniq(['x', 'name', ...rawFields]),\n },\n },\n },\n params\n );\n}\n\n/**\n * geometry 处理\n * @param params\n */\nfunction geometry(params: Params<SankeyOptions>): Params<SankeyOptions> {\n const { chart, options } = params;\n const { color, nodeStyle, edgeStyle, label, tooltip, nodeState, edgeState } = options;\n\n // 1. 组件,优先设置,因为子 view 会继承配置\n chart.legend(false);\n chart.tooltip(tooltip);\n chart.axis(false);\n // y 镜像一下,防止图形顺序和数据顺序反了\n chart.coordinate().reflect('y');\n\n // 2. node edge views\n // @ts-ignore\n const { nodes, edges } = transformToViewsData(options, chart.width, chart.height);\n\n // edge view\n const edgeView = chart.createView({ id: EDGES_VIEW_ID });\n edgeView.data(edges);\n\n edge({\n chart: edgeView,\n // @ts-ignore\n options: {\n xField: X_FIELD,\n yField: Y_FIELD,\n seriesField: COLOR_FIELD,\n edge: {\n color,\n style: edgeStyle,\n shape: 'arc',\n },\n tooltip,\n state: edgeState,\n },\n });\n\n const nodeView = chart.createView({ id: NODES_VIEW_ID });\n nodeView.data(nodes);\n\n polygon({\n chart: nodeView,\n options: {\n xField: X_FIELD,\n yField: Y_FIELD,\n seriesField: COLOR_FIELD,\n polygon: {\n color,\n style: nodeStyle,\n },\n label,\n tooltip,\n state: nodeState,\n },\n });\n\n chart.interaction('element-active');\n\n // scale\n chart.scale({\n x: { sync: true, nice: true, min: 0, max: 1, minLimit: 0, maxLimit: 1 },\n y: { sync: true, nice: true, min: 0, max: 1, minLimit: 0, maxLimit: 1 },\n name: { sync: 'color', type: 'cat' },\n });\n\n return params;\n}\n\n/**\n * 动画\n * @param params\n */\nexport function animation(params: Params<SankeyOptions>): Params<SankeyOptions> {\n const { chart, options } = params;\n const { animation } = options;\n\n const geometries = [...chart.views[0].geometries, ...chart.views[1].geometries];\n\n addViewAnimation(chart, animation, geometries);\n\n return params;\n}\n\n/**\n * 节点拖动\n * @param params\n */\nexport function nodeDraggable(params: Params<SankeyOptions>): Params<SankeyOptions> {\n const { chart, options } = params;\n const { nodeDraggable } = options;\n\n const DRAG_INTERACTION = 'sankey-node-draggable';\n\n if (nodeDraggable) {\n chart.interaction(DRAG_INTERACTION);\n } else {\n chart.removeInteraction(DRAG_INTERACTION);\n }\n\n return params;\n}\n\n/**\n * Interaction 配置\n * @param params\n */\nfunction interaction(params: Params<SankeyOptions>): Params<SankeyOptions> {\n const { chart, options } = params;\n const { interactions = [] } = options;\n\n const nodeInteractions = [].concat(interactions, options.nodeInteractions || []);\n const edgeInteractions = [].concat(interactions, options.edgeInteractions || []);\n\n const nodeView = findViewById(chart, NODES_VIEW_ID);\n const edgeView = findViewById(chart, EDGES_VIEW_ID);\n\n nodeInteractions.forEach((i) => {\n if (i?.enable === false) {\n nodeView.removeInteraction(i.type);\n } else {\n nodeView.interaction(i.type, i.cfg || {});\n }\n });\n\n edgeInteractions.forEach((i) => {\n if (i?.enable === false) {\n edgeView.removeInteraction(i.type);\n } else {\n edgeView.interaction(i.type, i.cfg || {});\n }\n });\n\n return params;\n}\n\n/**\n * 图适配器\n * @param chart\n * @param options\n */\nexport function adaptor(params: Params<SankeyOptions>) {\n // flow 的方式处理所有的配置到 G2 API\n return flow(\n defaultOptions,\n geometry,\n interaction,\n nodeDraggable,\n animation,\n theme\n // ... 其他的 adaptor flow\n )(params);\n}\n"]}
1
+ {"version":3,"file":"adaptor.js","sourceRoot":"","sources":["../../../src/plots/sankey/adaptor.ts"],"names":[],"mappings":";;;;AAAA,mCAAkC;AAClC,+CAA6C;AAC7C,uDAAyD;AAEzD,qCAA6D;AAC7D,yCAAoD;AACpD,uCAAyF;AACzF,mCAAgD;AAGhD;;;GAGG;AACH,SAAS,cAAc,CAAC,MAA6B;IAC3C,IAAA,OAAO,GAAK,MAAM,QAAX,CAAY;IACnB,IAAA,KAAmB,OAAO,UAAZ,EAAd,SAAS,mBAAG,EAAE,KAAA,CAAa;IAEnC,OAAO,kBAAU,CACf,EAAE,EACF;QACE,OAAO,EAAE;YACP,OAAO,EAAE;gBACP,MAAM,EAAE,WAAI,yBAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,GAAK,SAAS,EAAE;aAC5E;YACD,KAAK,EAAE;gBACL,MAAM,EAAE,WAAI,yBAAE,GAAG,EAAE,MAAM,GAAK,SAAS,EAAE;aAC1C;SACF;KACF,EACD,MAAM,CACP,CAAC;AACJ,CAAC;AAED;;;GAGG;AACH,SAAS,QAAQ,CAAC,MAA6B;IACrC,IAAA,KAAK,GAAc,MAAM,MA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M,MAAK,KAAK,EAAE;YACvB,QAAQ,CAAC,iBAAiB,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;SACpC;aAAM;YACL,QAAQ,CAAC,WAAW,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,GAAG,IAAI,EAAE,CAAC,CAAC;SAC3C;IACH,CAAC,CAAC,CAAC;IAEH,gBAAgB,CAAC,OAAO,CAAC,UAAC,CAAC;QACzB,IAAI,CAAA,CAAC,aAAD,CAAC,uBAAD,CAAC,CAAE,MAAM,MAAK,KAAK,EAAE;YACvB,QAAQ,CAAC,iBAAiB,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;SACpC;aAAM;YACL,QAAQ,CAAC,WAAW,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,GAAG,IAAI,EAAE,CAAC,CAAC;SAC3C;IACH,CAAC,CAAC,CAAC;IAEH,OAAO,MAAM,CAAC;AAChB,CAAC;AAED;;;;GAIG;AACH,SAAgB,OAAO,CAAC,MAA6B;IACnD,0BAA0B;IAC1B,OAAO,YAAI,CACT,cAAc,EACd,QAAQ,EACR,WAAW,EACX,aAAa,EACb,SAAS,EACT,cAAK;IACL,uBAAuB;KACxB,CAAC,MAAM,CAAC,CAAC;AACZ,CAAC;AAXD,0BAWC","sourcesContent":["import { uniq } from '@antv/util';\nimport { theme } from '../../adaptor/common';\nimport { edge, polygon } from '../../adaptor/geometries';\nimport { Params } from '../../core/adaptor';\nimport { deepAssign, findViewById, flow } from '../../utils';\nimport { addViewAnimation } from '../../utils/view';\nimport { COLOR_FIELD, EDGES_VIEW_ID, NODES_VIEW_ID, X_FIELD, Y_FIELD } from './constant';\nimport { transformToViewsData } from './helper';\nimport { SankeyOptions } from './types';\n\n/**\n * 默认配置项 处理\n * @param params\n */\nfunction defaultOptions(params: Params<SankeyOptions>): Params<SankeyOptions> {\n const { options } = params;\n const { rawFields = [] } = options;\n\n return deepAssign(\n {},\n {\n options: {\n tooltip: {\n fields: uniq(['name', 'source', 'target', 'value', 'isNode', ...rawFields]),\n },\n label: {\n fields: uniq(['x', 'name', ...rawFields]),\n },\n },\n },\n params\n );\n}\n\n/**\n * geometry 处理\n * @param params\n */\nfunction geometry(params: Params<SankeyOptions>): Params<SankeyOptions> {\n const { chart, options } = params;\n const { color, nodeStyle, edgeStyle, label, tooltip, nodeState, edgeState, rawFields = [] } = options;\n\n // 1. 组件,优先设置,因为子 view 会继承配置\n chart.legend(false);\n chart.tooltip(tooltip);\n chart.axis(false);\n // y 镜像一下,防止图形顺序和数据顺序反了\n chart.coordinate().reflect('y');\n\n // 2. node edge views\n // @ts-ignore\n const { nodes, edges } = transformToViewsData(options, chart.width, chart.height);\n\n // edge view\n const edgeView = chart.createView({ id: EDGES_VIEW_ID });\n edgeView.data(edges);\n\n edge({\n chart: edgeView,\n // @ts-ignore\n options: {\n xField: X_FIELD,\n yField: Y_FIELD,\n seriesField: COLOR_FIELD,\n rawFields: ['source', 'target', ...rawFields],\n edge: {\n color,\n style: edgeStyle,\n shape: 'arc',\n },\n tooltip,\n state: edgeState,\n },\n });\n\n const nodeView = chart.createView({ id: NODES_VIEW_ID });\n nodeView.data(nodes);\n\n polygon({\n chart: nodeView,\n options: {\n xField: X_FIELD,\n yField: Y_FIELD,\n seriesField: COLOR_FIELD,\n polygon: {\n color,\n style: nodeStyle,\n },\n label,\n tooltip,\n state: nodeState,\n },\n });\n\n chart.interaction('element-active');\n\n // scale\n chart.scale({\n x: { sync: true, nice: true, min: 0, max: 1, minLimit: 0, maxLimit: 1 },\n y: { sync: true, nice: true, min: 0, max: 1, minLimit: 0, maxLimit: 1 },\n name: { sync: 'color', type: 'cat' },\n });\n\n return params;\n}\n\n/**\n * 动画\n * @param params\n */\nexport function animation(params: Params<SankeyOptions>): Params<SankeyOptions> {\n const { chart, options } = params;\n const { animation } = options;\n\n const geometries = [...chart.views[0].geometries, ...chart.views[1].geometries];\n\n addViewAnimation(chart, animation, geometries);\n\n return params;\n}\n\n/**\n * 节点拖动\n * @param params\n */\nexport function nodeDraggable(params: Params<SankeyOptions>): Params<SankeyOptions> {\n const { chart, options } = params;\n const { nodeDraggable } = options;\n\n const DRAG_INTERACTION = 'sankey-node-draggable';\n\n if (nodeDraggable) {\n chart.interaction(DRAG_INTERACTION);\n } else {\n chart.removeInteraction(DRAG_INTERACTION);\n }\n\n return params;\n}\n\n/**\n * Interaction 配置\n * @param params\n */\nfunction interaction(params: Params<SankeyOptions>): Params<SankeyOptions> {\n const { chart, options } = params;\n const { interactions = [] } = options;\n\n const nodeInteractions = [].concat(interactions, options.nodeInteractions || []);\n const edgeInteractions = [].concat(interactions, options.edgeInteractions || []);\n\n const nodeView = findViewById(chart, NODES_VIEW_ID);\n const edgeView = findViewById(chart, EDGES_VIEW_ID);\n\n nodeInteractions.forEach((i) => {\n if (i?.enable === false) {\n nodeView.removeInteraction(i.type);\n } else {\n nodeView.interaction(i.type, i.cfg || {});\n }\n });\n\n edgeInteractions.forEach((i) => {\n if (i?.enable === false) {\n edgeView.removeInteraction(i.type);\n } else {\n edgeView.interaction(i.type, i.cfg || {});\n }\n });\n\n return params;\n}\n\n/**\n * 图适配器\n * @param chart\n * @param options\n */\nexport function adaptor(params: Params<SankeyOptions>) {\n // flow 的方式处理所有的配置到 G2 API\n return flow(\n defaultOptions,\n geometry,\n interaction,\n nodeDraggable,\n animation,\n theme\n // ... 其他的 adaptor flow\n )(params);\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@antv/g2plot",
3
- "version": "2.4.25",
3
+ "version": "2.4.26",
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.25';
1
+ export const version = '2.4.26';
2
2
 
3
3
  // G2 自定义能力透出
4
4
  import * as G2 from '@antv/g2';
@@ -38,7 +38,7 @@ function defaultOptions(params: Params<SankeyOptions>): Params<SankeyOptions> {
38
38
  */
39
39
  function geometry(params: Params<SankeyOptions>): Params<SankeyOptions> {
40
40
  const { chart, options } = params;
41
- const { color, nodeStyle, edgeStyle, label, tooltip, nodeState, edgeState } = options;
41
+ const { color, nodeStyle, edgeStyle, label, tooltip, nodeState, edgeState, rawFields = [] } = options;
42
42
 
43
43
  // 1. 组件,优先设置,因为子 view 会继承配置
44
44
  chart.legend(false);
@@ -62,6 +62,7 @@ function geometry(params: Params<SankeyOptions>): Params<SankeyOptions> {
62
62
  xField: X_FIELD,
63
63
  yField: Y_FIELD,
64
64
  seriesField: COLOR_FIELD,
65
+ rawFields: ['source', 'target', ...rawFields],
65
66
  edge: {
66
67
  color,
67
68
  style: edgeStyle,