@antv/g2plot 2.4.13 → 2.4.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +16 -0
- package/dist/g2plot.min.js +1 -1
- package/dist/g2plot.min.js.map +1 -1
- package/esm/index.d.ts +1 -1
- package/esm/index.js +1 -1
- package/esm/index.js.map +1 -1
- package/esm/plots/mix/adaptor.d.ts +5 -0
- package/esm/plots/mix/adaptor.js +18 -5
- package/esm/plots/mix/adaptor.js.map +1 -1
- package/esm/plots/mix/types.d.ts +24 -2
- package/esm/plots/mix/types.js.map +1 -1
- package/esm/plots/mix/utils.d.ts +17 -17
- package/esm/plots/mix/utils.js.map +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -1
- package/lib/index.js.map +1 -1
- package/lib/plots/mix/adaptor.d.ts +5 -0
- package/lib/plots/mix/adaptor.js +19 -5
- package/lib/plots/mix/adaptor.js.map +1 -1
- package/lib/plots/mix/types.d.ts +24 -2
- package/lib/plots/mix/types.js.map +1 -1
- package/lib/plots/mix/utils.d.ts +17 -17
- package/lib/plots/mix/utils.js.map +1 -1
- package/package.json +1 -1
- package/src/index.ts +1 -1
- package/src/plots/mix/adaptor.ts +24 -5
- package/src/plots/mix/types.ts +24 -2
- package/src/plots/mix/utils.ts +17 -17
package/esm/index.d.ts
CHANGED
package/esm/index.js
CHANGED
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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;AACvG,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAGtC,6GAA6G;AAC7G,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAGvD,2BAA2B;AAC3B,mEAAmE;AACnE,OAAO,EAAE,CAAC,EAAE,MAAM,UAAU,CAAC;AAE7B,8BAA8B;AAC9B,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAEnD,eAAe;AACf,OAAO,EAAE,GAAG,IAAI,SAAS,EAAE,MAAM,aAAa,CAAC;AAE/C,oBAAoB;AACpB,OAAO,EAAE,GAAG,IAAI,GAAG,EAAE,MAAM,aAAa,CAAC;AAGzC,2DAA2D;AAC3D,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAGtC,uCAAuC;AACvC,OAAO,EAAE,IAAI,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAEjD,0CAA0C;AAC1C,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AASpF,uCAAuC;AACvC,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACrG,MAAM,CAAC,IAAM,QAAQ,GAAG,EAAE,KAAK,OAAA,EAAE,MAAM,QAAA,EAAE,OAAO,SAAA,EAAE,UAAU,YAAA,EAAE,WAAW,aAAA,EAAE,KAAK,OAAA,EAAE,SAAS,WAAA,EAAE,CAAC;AAE9F,oDAAoD;AACpD,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC","sourcesContent":["export const version = '2.4.13';\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,Y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,wBAAwB,CAAC;AAGvD,2BAA2B;AAC3B,mEAAmE;AACnE,OAAO,EAAE,CAAC,EAAE,MAAM,UAAU,CAAC;AAE7B,8BAA8B;AAC9B,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAEnD,eAAe;AACf,OAAO,EAAE,GAAG,IAAI,SAAS,EAAE,MAAM,aAAa,CAAC;AAE/C,oBAAoB;AACpB,OAAO,EAAE,GAAG,IAAI,GAAG,EAAE,MAAM,aAAa,CAAC;AAGzC,2DAA2D;AAC3D,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAGtC,uCAAuC;AACvC,OAAO,EAAE,IAAI,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAEjD,0CAA0C;AAC1C,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AASpF,uCAAuC;AACvC,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACrG,MAAM,CAAC,IAAM,QAAQ,GAAG,EAAE,KAAK,OAAA,EAAE,MAAM,QAAA,EAAE,OAAO,SAAA,EAAE,UAAU,YAAA,EAAE,WAAW,aAAA,EAAE,KAAK,OAAA,EAAE,SAAS,WAAA,EAAE,CAAC;AAE9F,oDAAoD;AACpD,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC","sourcesContent":["export const version = '2.4.14';\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"]}
|
package/esm/plots/mix/adaptor.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { __assign } from "tslib";
|
|
2
2
|
import { each } from '@antv/util';
|
|
3
3
|
import { geometry as geometryAdaptor } from '../../adaptor/geometries/base';
|
|
4
|
-
import { interaction, animation, theme, tooltip } from '../../adaptor/common';
|
|
4
|
+
import { interaction, animation, theme, tooltip, annotation } from '../../adaptor/common';
|
|
5
5
|
import { PLOT_CONTAINER_OPTIONS } from '../../core/plot';
|
|
6
6
|
import { AXIS_META_CONFIG_KEYS } from '../../constant';
|
|
7
7
|
import { deepAssign, flow, pick } from '../../utils';
|
|
@@ -102,19 +102,32 @@ function multiView(params) {
|
|
|
102
102
|
*/
|
|
103
103
|
function multiPlot(params) {
|
|
104
104
|
var chart = params.chart, options = params.options;
|
|
105
|
-
var plots = options.plots;
|
|
105
|
+
var plots = options.plots, _a = options.data, data = _a === void 0 ? [] : _a;
|
|
106
106
|
each(plots, function (plot) {
|
|
107
|
-
var type = plot.type, region = plot.region, _a = plot.options, options = _a === void 0 ? {} : _a;
|
|
107
|
+
var type = plot.type, region = plot.region, _a = plot.options, options = _a === void 0 ? {} : _a, top = plot.top;
|
|
108
108
|
var tooltip = options.tooltip;
|
|
109
|
+
if (top) {
|
|
110
|
+
execPlotAdaptor(type, chart, __assign(__assign({}, options), { data: data }));
|
|
111
|
+
return;
|
|
112
|
+
}
|
|
109
113
|
var viewOfG2 = chart.createView(__assign({ region: region }, pick(options, PLOT_CONTAINER_OPTIONS)));
|
|
110
114
|
if (tooltip) {
|
|
111
115
|
// 配置 tooltip 交互
|
|
112
116
|
viewOfG2.interaction('tooltip');
|
|
113
117
|
}
|
|
114
|
-
execPlotAdaptor(type, viewOfG2, options);
|
|
118
|
+
execPlotAdaptor(type, viewOfG2, __assign({ data: data }, options));
|
|
115
119
|
});
|
|
116
120
|
return params;
|
|
117
121
|
}
|
|
122
|
+
/**
|
|
123
|
+
* 处理缩略轴的 adaptor (mix)
|
|
124
|
+
* @param params
|
|
125
|
+
*/
|
|
126
|
+
export function slider(params) {
|
|
127
|
+
var chart = params.chart, options = params.options;
|
|
128
|
+
chart.option('slider', options.slider);
|
|
129
|
+
return params;
|
|
130
|
+
}
|
|
118
131
|
/**
|
|
119
132
|
* 图适配器
|
|
120
133
|
* @param chart
|
|
@@ -122,7 +135,7 @@ function multiPlot(params) {
|
|
|
122
135
|
*/
|
|
123
136
|
export function adaptor(params) {
|
|
124
137
|
return flow(animation, // 多 view 的图,动画配置放到最前面
|
|
125
|
-
multiView, multiPlot, interaction, animation, theme, tooltip
|
|
138
|
+
multiView, multiPlot, interaction, animation, theme, tooltip, slider, annotation()
|
|
126
139
|
// ... 其他的 adaptor flow
|
|
127
140
|
)(params);
|
|
128
141
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"adaptor.js","sourceRoot":"","sources":["../../../src/plots/mix/adaptor.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAElC,OAAO,EAAE,QAAQ,IAAI,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAC5E,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"adaptor.js","sourceRoot":"","sources":["../../../src/plots/mix/adaptor.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAElC,OAAO,EAAE,QAAQ,IAAI,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAC5E,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAE1F,OAAO,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAKrD,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE1C;;;GAGG;AACH,SAAS,SAAS,CAAC,MAA0B;IACnC,IAAA,KAAK,GAAc,MAAM,MAApB,EAAE,OAAO,GAAK,MAAM,QAAX,CAAY;IAC1B,IAAA,KAAK,GAAa,OAAO,MAApB,EAAE,MAAM,GAAK,OAAO,OAAZ,CAAa;IAElC,IAAI,CAAC,KAAK,EAAE,UAAC,CAAQ;QACX,IAAA,MAAM,GAAmF,CAAC,OAApF,EAAE,IAAI,GAA6E,CAAC,KAA9E,EAAE,IAAI,GAAuE,CAAC,KAAxE,EAAE,IAAI,GAAiE,CAAC,KAAlE,EAAE,UAAU,GAAqD,CAAC,WAAtD,EAAE,YAAY,GAAuC,CAAC,aAAxC,EAAE,WAA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C,CAAC;IAEvC,OAAO,MAAM,CAAC;AAChB,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,OAAO,CAAC,MAA0B;IAChD,OAAO,IAAI,CACT,SAAS,EAAE,sBAAsB;IACjC,SAAS,EACT,SAAS,EACT,WAAW,EACX,SAAS,EACT,KAAK,EACL,OAAO,EACP,MAAM,EACN,UAAU,EAAE;IACZ,uBAAuB;KACxB,CAAC,MAAM,CAAC,CAAC;AACZ,CAAC","sourcesContent":["import { each } from '@antv/util';\nimport { Geometry } from '@antv/g2';\nimport { geometry as geometryAdaptor } from '../../adaptor/geometries/base';\nimport { interaction, animation, theme, tooltip, annotation } from '../../adaptor/common';\nimport { Params } from '../../core/adaptor';\nimport { PLOT_CONTAINER_OPTIONS } from '../../core/plot';\nimport { AXIS_META_CONFIG_KEYS } from '../../constant';\nimport { deepAssign, flow, pick } from '../../utils';\nimport { Axis } from '../../types/axis';\nimport { Legend } from '../../types/legend';\nimport { Interaction } from '../../types/interaction';\nimport { MixOptions, IView, IGeometry } from './types';\nimport { execPlotAdaptor } from './utils';\n\n/**\n * geometry 处理\n * @param params\n */\nfunction multiView(params: Params<MixOptions>): Params<MixOptions> {\n const { chart, options } = params;\n const { views, legend } = options;\n\n each(views, (v: IView) => {\n const { region, data, meta, axes, coordinate, interactions, annotations, tooltip, geometries } = v;\n\n // 1. 创建 view\n const viewOfG2 = chart.createView({\n region,\n });\n\n // 2. data\n viewOfG2.data(data);\n\n // 3. meta\n let scales: Record<string, any> = {};\n if (axes) {\n each(axes, (axis: Axis, field: string) => {\n scales[field] = pick(axis, AXIS_META_CONFIG_KEYS);\n });\n }\n\n scales = deepAssign({}, meta, scales);\n viewOfG2.scale(scales);\n\n // 4. x y axis\n if (!axes) {\n viewOfG2.axis(false);\n } else {\n each(axes, (axis: Axis, field: string) => {\n viewOfG2.axis(field, axis);\n });\n }\n\n // 5. coordinate\n viewOfG2.coordinate(coordinate);\n\n // 6. geometry\n each(geometries, (geometry: IGeometry) => {\n const { ext } = geometryAdaptor({\n chart: viewOfG2,\n options: geometry,\n });\n\n // adjust\n const { adjust } = geometry;\n if (adjust) {\n ext.geometry.adjust(adjust);\n }\n });\n\n // 7. interactions\n each(interactions, (interaction: Interaction) => {\n if (interaction.enable === false) {\n viewOfG2.removeInteraction(interaction.type);\n } else {\n viewOfG2.interaction(interaction.type, interaction.cfg);\n }\n });\n\n // 8. annotations\n each(annotations, (annotation) => {\n viewOfG2.annotation()[annotation.type]({\n ...annotation,\n });\n });\n\n // 9. animation (先做动画)\n if (typeof v.animation === 'boolean') {\n viewOfG2.animate(false);\n } else {\n viewOfG2.animate(true);\n // 9.1 所有的 Geometry 都使用同一动画(各个图形如有区别,todo 自行覆盖)\n each(viewOfG2.geometries, (g: Geometry) => {\n g.animate(v.animation);\n });\n }\n\n if (tooltip) {\n // 10. tooltip\n viewOfG2.interaction('tooltip');\n viewOfG2.tooltip(tooltip);\n }\n });\n\n // legend\n if (!legend) {\n chart.legend(false);\n } else {\n each(legend, (l: Legend, field: string) => {\n chart.legend(field, l);\n });\n }\n\n // tooltip\n chart.tooltip(options.tooltip);\n return params;\n}\n\n/**\n * 支持嵌套使用 g2plot 内置图表\n * @param params\n */\nfunction multiPlot(params: Params<MixOptions>): Params<MixOptions> {\n const { chart, options } = params;\n const { plots, data = [] } = options;\n\n each(plots, (plot) => {\n const { type, region, options = {}, top } = plot;\n const { tooltip } = options;\n\n if (top) {\n execPlotAdaptor(type, chart, { ...options, data });\n return;\n }\n\n const viewOfG2 = chart.createView({ region, ...pick(options, PLOT_CONTAINER_OPTIONS) });\n if (tooltip) {\n // 配置 tooltip 交互\n viewOfG2.interaction('tooltip');\n }\n\n execPlotAdaptor(type, viewOfG2, { data, ...options });\n });\n\n return params;\n}\n\n/**\n * 处理缩略轴的 adaptor (mix)\n * @param params\n */\nexport function slider(params: Params<MixOptions>): Params<MixOptions> {\n const { chart, options } = params;\n\n chart.option('slider', options.slider);\n\n return params;\n}\n\n/**\n * 图适配器\n * @param chart\n * @param options\n */\nexport function adaptor(params: Params<MixOptions>) {\n return flow(\n animation, // 多 view 的图,动画配置放到最前面\n multiView,\n multiPlot,\n interaction,\n animation,\n theme,\n tooltip,\n slider,\n annotation()\n // ... 其他的 adaptor flow\n )(params);\n}\n"]}
|
package/esm/plots/mix/types.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ import { Geometry } from '../../adaptor/geometries/base';
|
|
|
6
6
|
import { Animation } from '../../types/animation';
|
|
7
7
|
import { Annotation } from '../../types/annotation';
|
|
8
8
|
import { Interaction } from '../../types/interaction';
|
|
9
|
+
import { Slider } from '../../types/slider';
|
|
9
10
|
import { IPlotTypes } from './utils';
|
|
10
11
|
/**
|
|
11
12
|
* @title geometry 映射信息
|
|
@@ -65,16 +66,31 @@ export declare type IView = {
|
|
|
65
66
|
* @title 子 plot 的配置
|
|
66
67
|
*/
|
|
67
68
|
export declare type IPlot = IPlotTypes & {
|
|
69
|
+
/**
|
|
70
|
+
* @title 数据
|
|
71
|
+
* @description 设置画布具体的数据. 默认基础顶层 data
|
|
72
|
+
*/
|
|
73
|
+
readonly data?: Record<string, any>[];
|
|
68
74
|
/**
|
|
69
75
|
* @title plot view 的布局范围
|
|
70
76
|
* @default "占满全部"
|
|
71
77
|
*/
|
|
72
78
|
readonly region?: Region;
|
|
79
|
+
/**
|
|
80
|
+
* @title 是否为顶层
|
|
81
|
+
* @description 设置为 true 时,几何图形挂在顶层 chart 对象上,而不是子 view 下。此时 region 设置无效,data 继承顶层 data 配置。
|
|
82
|
+
* @default false
|
|
83
|
+
*/
|
|
84
|
+
readonly top?: boolean;
|
|
73
85
|
};
|
|
74
86
|
/**
|
|
75
87
|
* @title 类型定义
|
|
76
88
|
*/
|
|
77
89
|
export interface MixOptions extends Omit<Options, 'data' | 'legend' | 'xAxis' | 'yAxis' | 'legend' | 'tooltip' | 'slider' | 'scrollbar'> {
|
|
90
|
+
/**
|
|
91
|
+
* @title 顶层数据配置
|
|
92
|
+
*/
|
|
93
|
+
readonly data?: Options['data'];
|
|
78
94
|
/**
|
|
79
95
|
* @title 是否同步子 view 的配置
|
|
80
96
|
* @description 目前仅仅支持 true / false,后续需要增加 function 的方式进行自定义 view 之前的布局同步
|
|
@@ -92,12 +108,18 @@ export interface MixOptions extends Omit<Options, 'data' | 'legend' | 'xAxis' |
|
|
|
92
108
|
readonly plots?: IPlot[];
|
|
93
109
|
/**
|
|
94
110
|
* @title tooltip 配置
|
|
95
|
-
* @description tooltip
|
|
111
|
+
* @description Mix tooltip 组件配置,统一顶层配置
|
|
112
|
+
* TODO 字段映射
|
|
96
113
|
*/
|
|
97
114
|
readonly tooltip?: Tooltip;
|
|
98
115
|
/**
|
|
99
116
|
* @title legend 配置
|
|
100
|
-
* @description
|
|
117
|
+
* @description Mix 图例配置,统一顶层配置
|
|
101
118
|
*/
|
|
102
119
|
readonly legend?: false | Record<string, Legend>;
|
|
120
|
+
/**
|
|
121
|
+
* @title slider 配置
|
|
122
|
+
* @description Mix 缩略轴配置,统一顶层配置
|
|
123
|
+
*/
|
|
124
|
+
readonly slider?: Slider;
|
|
103
125
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/plots/mix/types.ts"],"names":[],"mappings":"","sourcesContent":["import { Types } from '@antv/g2';\nimport { Data, Meta, Options, Region, Tooltip } from '../../types';\nimport { Axis } from '../../types/axis';\nimport { Legend } from '../../types/legend';\nimport { Geometry } from '../../adaptor/geometries/base';\nimport { Animation } from '../../types/animation';\nimport { Annotation } from '../../types/annotation';\nimport { Interaction } from '../../types/interaction';\nimport { IPlotTypes } from './utils';\n\n/**\n * @title geometry 映射信息\n */\nexport type IGeometry = Geometry & {\n adjust?: Types.AdjustOption;\n};\n/**\n * @title 子 view 的配置\n * @description 暂时不开嵌套 view 的情况\n */\nexport type IView = {\n /**\n * @title view 的布局范围\n * @default \"占满全部\"\n */\n readonly region?: Region;\n /**\n * @title view 中的数据\n */\n readonly data: Data;\n /**\n * @title view 中对应的 meta 字段配置\n */\n readonly meta?: Record<string, Meta>;\n /**\n * @title 坐标系的配置\n * @description 每一个 view 具有相同的坐标系\n */\n readonly coordinate?: Types.CoordinateOption;\n /**\n * @title 图形 geometry 及映射配置\n */\n readonly geometries: IGeometry[];\n /**\n * @title x,y 轴\n */\n readonly axes?: false | Record<string, Axis>;\n /**\n * @title interactions\n */\n readonly interactions?: Interaction[];\n /**\n * @title annotation\n */\n readonly annotations?: Annotation[];\n /**\n * @title annotation\n */\n readonly animation?: Animation;\n /**\n * @title tooltip\n */\n readonly tooltip?: Tooltip;\n};\n\n/**\n * @title 子 plot 的配置\n */\nexport type IPlot = IPlotTypes & {\n /**\n * @title plot view 的布局范围\n * @default \"占满全部\"\n */\n readonly region?: Region;\n};\n\n/**\n * @title 类型定义\n */\nexport interface MixOptions\n extends Omit<Options, 'data' | 'legend' | 'xAxis' | 'yAxis' | 'legend' | 'tooltip' | 'slider' | 'scrollbar'> {\n /**\n * @title 是否同步子 view 的配置\n * @description 目前仅仅支持 true / false,后续需要增加 function 的方式进行自定义 view 之前的布局同步\n */\n readonly syncViewPadding?: boolean;\n /**\n * @title 每一个图层的配置\n * @description 每个图层包括有自己的:数据、图形、图形映射\n */\n readonly views?: IView[];\n /**\n * @title 限定与指定 plot 类型\n * @description 支持使用已有的 plot,限定与指定 plot 类型\n */\n readonly plots?: IPlot[];\n /**\n * @title tooltip 配置\n * @description tooltip
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/plots/mix/types.ts"],"names":[],"mappings":"","sourcesContent":["import { Types } from '@antv/g2';\nimport { Data, Meta, Options, Region, Tooltip } from '../../types';\nimport { Axis } from '../../types/axis';\nimport { Legend } from '../../types/legend';\nimport { Geometry } from '../../adaptor/geometries/base';\nimport { Animation } from '../../types/animation';\nimport { Annotation } from '../../types/annotation';\nimport { Interaction } from '../../types/interaction';\nimport { Slider } from '../../types/slider';\nimport { IPlotTypes } from './utils';\n\n/**\n * @title geometry 映射信息\n */\nexport type IGeometry = Geometry & {\n adjust?: Types.AdjustOption;\n};\n/**\n * @title 子 view 的配置\n * @description 暂时不开嵌套 view 的情况\n */\nexport type IView = {\n /**\n * @title view 的布局范围\n * @default \"占满全部\"\n */\n readonly region?: Region;\n /**\n * @title view 中的数据\n */\n readonly data: Data;\n /**\n * @title view 中对应的 meta 字段配置\n */\n readonly meta?: Record<string, Meta>;\n /**\n * @title 坐标系的配置\n * @description 每一个 view 具有相同的坐标系\n */\n readonly coordinate?: Types.CoordinateOption;\n /**\n * @title 图形 geometry 及映射配置\n */\n readonly geometries: IGeometry[];\n /**\n * @title x,y 轴\n */\n readonly axes?: false | Record<string, Axis>;\n /**\n * @title interactions\n */\n readonly interactions?: Interaction[];\n /**\n * @title annotation\n */\n readonly annotations?: Annotation[];\n /**\n * @title annotation\n */\n readonly animation?: Animation;\n /**\n * @title tooltip\n */\n readonly tooltip?: Tooltip;\n};\n\n/**\n * @title 子 plot 的配置\n */\nexport type IPlot = IPlotTypes & {\n /**\n * @title 数据\n * @description 设置画布具体的数据. 默认基础顶层 data\n */\n readonly data?: Record<string, any>[];\n /**\n * @title plot view 的布局范围\n * @default \"占满全部\"\n */\n readonly region?: Region;\n /**\n * @title 是否为顶层\n * @description 设置为 true 时,几何图形挂在顶层 chart 对象上,而不是子 view 下。此时 region 设置无效,data 继承顶层 data 配置。\n * @default false\n */\n readonly top?: boolean;\n};\n\n/**\n * @title 类型定义\n */\nexport interface MixOptions\n extends Omit<Options, 'data' | 'legend' | 'xAxis' | 'yAxis' | 'legend' | 'tooltip' | 'slider' | 'scrollbar'> {\n /**\n * @title 顶层数据配置\n */\n readonly data?: Options['data'];\n /**\n * @title 是否同步子 view 的配置\n * @description 目前仅仅支持 true / false,后续需要增加 function 的方式进行自定义 view 之前的布局同步\n */\n readonly syncViewPadding?: boolean;\n /**\n * @title 每一个图层的配置\n * @description 每个图层包括有自己的:数据、图形、图形映射\n */\n readonly views?: IView[];\n /**\n * @title 限定与指定 plot 类型\n * @description 支持使用已有的 plot,限定与指定 plot 类型\n */\n readonly plots?: IPlot[];\n /**\n * @title tooltip 配置\n * @description Mix tooltip 组件配置,统一顶层配置\n * TODO 字段映射\n */\n readonly tooltip?: Tooltip;\n /**\n * @title legend 配置\n * @description Mix 图例配置,统一顶层配置\n */\n readonly legend?: false | Record<string, Legend>;\n /**\n * @title slider 配置\n * @description Mix 缩略轴配置,统一顶层配置\n */\n readonly slider?: Slider;\n}\n"]}
|
package/esm/plots/mix/utils.d.ts
CHANGED
|
@@ -15,9 +15,9 @@ import { HistogramOptions } from '../histogram';
|
|
|
15
15
|
import { FunnelOptions } from '../funnel';
|
|
16
16
|
import { StockOptions } from '../stock';
|
|
17
17
|
/**
|
|
18
|
-
* 移除 options 中的 width、height 设置
|
|
18
|
+
* 移除 options 中的 width、height、data 设置
|
|
19
19
|
*/
|
|
20
|
-
declare type
|
|
20
|
+
declare type OmitPlotOptions<T> = Omit<T, 'width' | 'height' | 'data'>;
|
|
21
21
|
/**
|
|
22
22
|
* multi-view 中的支持的 plots 类型(带 options 定义)
|
|
23
23
|
*/
|
|
@@ -29,49 +29,49 @@ export declare type IPlotTypes = {
|
|
|
29
29
|
/**
|
|
30
30
|
* plot 配置
|
|
31
31
|
*/
|
|
32
|
-
readonly options:
|
|
32
|
+
readonly options: OmitPlotOptions<LineOptions>;
|
|
33
33
|
} | {
|
|
34
34
|
readonly type: 'pie';
|
|
35
|
-
readonly options:
|
|
35
|
+
readonly options: OmitPlotOptions<PieOptions>;
|
|
36
36
|
} | {
|
|
37
37
|
readonly type: 'bar';
|
|
38
|
-
readonly options:
|
|
38
|
+
readonly options: OmitPlotOptions<BarOptions>;
|
|
39
39
|
} | {
|
|
40
40
|
readonly type: 'column';
|
|
41
|
-
readonly options:
|
|
41
|
+
readonly options: OmitPlotOptions<ColumnOptions>;
|
|
42
42
|
} | {
|
|
43
43
|
readonly type: 'area';
|
|
44
|
-
readonly options:
|
|
44
|
+
readonly options: OmitPlotOptions<AreaOptions>;
|
|
45
45
|
} | {
|
|
46
46
|
readonly type: 'gauge';
|
|
47
|
-
readonly options:
|
|
47
|
+
readonly options: OmitPlotOptions<GaugeOptions>;
|
|
48
48
|
} | {
|
|
49
49
|
readonly type: 'tiny-line';
|
|
50
|
-
readonly options:
|
|
50
|
+
readonly options: OmitPlotOptions<TinyLineOptions>;
|
|
51
51
|
} | {
|
|
52
52
|
readonly type: 'tiny-area';
|
|
53
|
-
readonly options:
|
|
53
|
+
readonly options: OmitPlotOptions<TinyAreaOptions>;
|
|
54
54
|
} | {
|
|
55
55
|
readonly type: 'tiny-column';
|
|
56
|
-
readonly options:
|
|
56
|
+
readonly options: OmitPlotOptions<TinyColumnOptions>;
|
|
57
57
|
} | {
|
|
58
58
|
readonly type: 'ring-progress';
|
|
59
|
-
readonly options:
|
|
59
|
+
readonly options: OmitPlotOptions<RingProgressOptions>;
|
|
60
60
|
} | {
|
|
61
61
|
readonly type: 'progress';
|
|
62
|
-
readonly options:
|
|
62
|
+
readonly options: OmitPlotOptions<ProgressOptions>;
|
|
63
63
|
} | {
|
|
64
64
|
readonly type: 'histogram';
|
|
65
|
-
readonly options:
|
|
65
|
+
readonly options: OmitPlotOptions<HistogramOptions>;
|
|
66
66
|
} | {
|
|
67
67
|
readonly type: 'scatter';
|
|
68
|
-
readonly options:
|
|
68
|
+
readonly options: OmitPlotOptions<ScatterOptions>;
|
|
69
69
|
} | {
|
|
70
70
|
readonly type: 'funnel';
|
|
71
|
-
readonly options:
|
|
71
|
+
readonly options: OmitPlotOptions<FunnelOptions>;
|
|
72
72
|
} | {
|
|
73
73
|
readonly type: 'stock';
|
|
74
|
-
readonly options:
|
|
74
|
+
readonly options: OmitPlotOptions<StockOptions>;
|
|
75
75
|
};
|
|
76
76
|
/**
|
|
77
77
|
* 执行 plot 的 adaptor, 默认都带上 defaultOptions
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/plots/m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E,UAAU;IACzB,WAAW,EAAE,QAAQ;IACrB,eAAe,EAAE,YAAY;IAC7B,QAAQ,EAAE,QAAQ;IAClB,OAAO,EAAE,OAAO;IAChB,SAAS,EAAE,SAAS;IACpB,MAAM,EAAE,MAAM;IACd,KAAK,EAAE,KAAK;CACb,CAAC;AAEF;;GAEG;AACH,IAAM,mBAAmB,GAAG;IAC1B,GAAG,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE;IACrB,MAAM,EAAE,EAAE,OAAO,EAAE,EAAE,WAAW,EAAE,KAAK,EAAE,EAAE;IAC3C,GAAG,EAAE,EAAE,OAAO,EAAE,EAAE,WAAW,EAAE,KAAK,EAAE,EAAE;CACzC,CAAC;AAEF;;;GAGG;AACH,MAAM,UAAU,eAAe,CAC7B,IAAO,EACP,IAAU,EACV,OAA8B;IAE9B,IAAM,GAAG,GAAG,gBAAgB,CAAC,IAAI,CAAC,CAAC;IACnC,IAAI,CAAC,GAAG,EAAE;QACR,OAAO,CAAC,KAAK,CAAC,oBAAkB,IAAI,UAAO,CAAC,CAAC;QAC7C,OAAO;KACR;IACD,IAAM,MAAM,GAAG,aAAa,CAAC,IAAI,CAAC,CAAC;IACnC,MAAM,CAAC;QACL,KAAK,EAAE,IAAI;QACX,OAAO,EAAE,UAAU,CAAC,EAAE,EAAE,GAAG,CAAC,iBAAiB,EAAE,EAAE,GAAG,CAAC,mBAAmB,EAAE,IAAI,EAAE,EAAE,CAAC,EAAE,OAAO,CAAC;KAC9F,CAAC,CAAC;AACL,CAAC","sourcesContent":["import { View } from '@antv/g2';\nimport { get } from '@antv/util';\nimport { deepAssign } from '../../utils';\nimport { adaptor as lineAdaptor } from '../line/adaptor';\nimport { adaptor as pieAdaptor } from '../pie/adaptor';\nimport { adaptor as columnAdaptor } from '../column/adaptor';\nimport { adaptor as barAdaptor } from '../bar/adaptor';\nimport { adaptor as areaAdaptor } from '../area/adaptor';\nimport { adaptor as gaugeAdaptor } from '../gauge/adaptor';\nimport { adaptor as tinyLineAdaptor } from '../tiny-line/adaptor';\nimport { adaptor as tinyColumnAdaptor } from '../tiny-column/adaptor';\nimport { adaptor as tinyAreaAdaptor } from '../tiny-area/adaptor';\nimport { adaptor as ringProgressAdaptor } from '../ring-progress/adaptor';\nimport { adaptor as progressAdaptor } from '../progress/adaptor';\nimport { adaptor as scatterAdaptor } from '../scatter/adaptor';\nimport { adaptor as histogramAdaptor } from '../histogram/adaptor';\nimport { adaptor as funnelAdaptor } from '../funnel/adaptor';\nimport { adaptor as stockAdaptor } from '../stock/adaptor';\nimport { Line, LineOptions } from '../line';\nimport { Pie, PieOptions } from '../pie';\nimport { Bar, BarOptions } from '../bar';\nimport { Column, ColumnOptions } from '../column';\nimport { Area, AreaOptions } from '../area';\nimport { Gauge, GaugeOptions } from '../gauge';\nimport { TinyLine, TinyLineOptions } from '../tiny-line';\nimport { TinyArea, TinyAreaOptions } from '../tiny-area';\nimport { TinyColumn, TinyColumnOptions } from '../tiny-column';\nimport { RingProgress, RingProgressOptions } from '../ring-progress';\nimport { Progress, ProgressOptions } from '../progress';\nimport { Scatter, ScatterOptions } from '../scatter';\nimport { Histogram, HistogramOptions } from '../histogram';\nimport { Funnel, FunnelOptions } from '../funnel';\nimport { Stock, StockOptions } from '../stock';\n\n/**\n * 移除 options 中的 width、height 设置\n */\ntype
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/plots/mix/utils.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AACjC,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,gBAAgB,CAAC;AACvD,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAC7D,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,gBAA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AG,EAAE,EAAE,OAAO,EAAE,EAAE,WAAW,EAAE,KAAK,EAAE,EAAE;CACzC,CAAC;AAEF;;;GAGG;AACH,MAAM,UAAU,eAAe,CAC7B,IAAO,EACP,IAAU,EACV,OAA8B;IAE9B,IAAM,GAAG,GAAG,gBAAgB,CAAC,IAAI,CAAC,CAAC;IACnC,IAAI,CAAC,GAAG,EAAE;QACR,OAAO,CAAC,KAAK,CAAC,oBAAkB,IAAI,UAAO,CAAC,CAAC;QAC7C,OAAO;KACR;IACD,IAAM,MAAM,GAAG,aAAa,CAAC,IAAI,CAAC,CAAC;IACnC,MAAM,CAAC;QACL,KAAK,EAAE,IAAI;QACX,OAAO,EAAE,UAAU,CAAC,EAAE,EAAE,GAAG,CAAC,iBAAiB,EAAE,EAAE,GAAG,CAAC,mBAAmB,EAAE,IAAI,EAAE,EAAE,CAAC,EAAE,OAAO,CAAC;KAC9F,CAAC,CAAC;AACL,CAAC","sourcesContent":["import { View } from '@antv/g2';\nimport { get } from '@antv/util';\nimport { deepAssign } from '../../utils';\nimport { adaptor as lineAdaptor } from '../line/adaptor';\nimport { adaptor as pieAdaptor } from '../pie/adaptor';\nimport { adaptor as columnAdaptor } from '../column/adaptor';\nimport { adaptor as barAdaptor } from '../bar/adaptor';\nimport { adaptor as areaAdaptor } from '../area/adaptor';\nimport { adaptor as gaugeAdaptor } from '../gauge/adaptor';\nimport { adaptor as tinyLineAdaptor } from '../tiny-line/adaptor';\nimport { adaptor as tinyColumnAdaptor } from '../tiny-column/adaptor';\nimport { adaptor as tinyAreaAdaptor } from '../tiny-area/adaptor';\nimport { adaptor as ringProgressAdaptor } from '../ring-progress/adaptor';\nimport { adaptor as progressAdaptor } from '../progress/adaptor';\nimport { adaptor as scatterAdaptor } from '../scatter/adaptor';\nimport { adaptor as histogramAdaptor } from '../histogram/adaptor';\nimport { adaptor as funnelAdaptor } from '../funnel/adaptor';\nimport { adaptor as stockAdaptor } from '../stock/adaptor';\nimport { Line, LineOptions } from '../line';\nimport { Pie, PieOptions } from '../pie';\nimport { Bar, BarOptions } from '../bar';\nimport { Column, ColumnOptions } from '../column';\nimport { Area, AreaOptions } from '../area';\nimport { Gauge, GaugeOptions } from '../gauge';\nimport { TinyLine, TinyLineOptions } from '../tiny-line';\nimport { TinyArea, TinyAreaOptions } from '../tiny-area';\nimport { TinyColumn, TinyColumnOptions } from '../tiny-column';\nimport { RingProgress, RingProgressOptions } from '../ring-progress';\nimport { Progress, ProgressOptions } from '../progress';\nimport { Scatter, ScatterOptions } from '../scatter';\nimport { Histogram, HistogramOptions } from '../histogram';\nimport { Funnel, FunnelOptions } from '../funnel';\nimport { Stock, StockOptions } from '../stock';\n\n/**\n * 移除 options 中的 width、height、data 设置\n */\ntype OmitPlotOptions<T> = Omit<T, 'width' | 'height' | 'data'>;\n\n/**\n * multi-view 中的支持的 plots 类型(带 options 定义)\n */\nexport type IPlotTypes =\n | {\n /**\n * plot 类型\n */\n readonly type: 'line';\n /**\n * plot 配置\n */\n readonly options: OmitPlotOptions<LineOptions>;\n }\n | {\n readonly type: 'pie';\n readonly options: OmitPlotOptions<PieOptions>;\n }\n | {\n readonly type: 'bar';\n readonly options: OmitPlotOptions<BarOptions>;\n }\n | {\n readonly type: 'column';\n readonly options: OmitPlotOptions<ColumnOptions>;\n }\n | {\n readonly type: 'area';\n readonly options: OmitPlotOptions<AreaOptions>;\n }\n | {\n readonly type: 'gauge';\n readonly options: OmitPlotOptions<GaugeOptions>;\n }\n | {\n readonly type: 'tiny-line';\n readonly options: OmitPlotOptions<TinyLineOptions>;\n }\n | {\n readonly type: 'tiny-area';\n readonly options: OmitPlotOptions<TinyAreaOptions>;\n }\n | {\n readonly type: 'tiny-column';\n readonly options: OmitPlotOptions<TinyColumnOptions>;\n }\n | {\n readonly type: 'ring-progress';\n readonly options: OmitPlotOptions<RingProgressOptions>;\n }\n | {\n readonly type: 'progress';\n readonly options: OmitPlotOptions<ProgressOptions>;\n }\n | {\n readonly type: 'histogram';\n readonly options: OmitPlotOptions<HistogramOptions>;\n }\n | {\n readonly type: 'scatter';\n readonly options: OmitPlotOptions<ScatterOptions>;\n }\n | {\n readonly type: 'funnel';\n readonly options: OmitPlotOptions<FunnelOptions>;\n }\n | {\n readonly type: 'stock';\n readonly options: OmitPlotOptions<StockOptions>;\n };\n\n/**\n * 可在 multi-view 中使用的 plots\n */\nconst PLOT_ADAPTORS = {\n line: lineAdaptor,\n pie: pieAdaptor,\n column: columnAdaptor,\n bar: barAdaptor,\n area: areaAdaptor,\n gauge: gaugeAdaptor,\n 'tiny-line': tinyLineAdaptor,\n 'tiny-column': tinyColumnAdaptor,\n 'tiny-area': tinyAreaAdaptor,\n 'ring-progress': ringProgressAdaptor,\n progress: progressAdaptor,\n scatter: scatterAdaptor,\n histogram: histogramAdaptor,\n funnel: funnelAdaptor,\n stock: stockAdaptor,\n};\n\n/**\n * 获取指定 plot 的 class contructor\n * @param {string} plot\n */\nconst PLOT_CONSTRUCTOR = {\n line: Line,\n pie: Pie,\n column: Column,\n bar: Bar,\n area: Area,\n gauge: Gauge,\n 'tiny-line': TinyLine,\n 'tiny-column': TinyColumn,\n 'tiny-area': TinyArea,\n 'ring-progress': RingProgress,\n progress: Progress,\n scatter: Scatter,\n histogram: Histogram,\n funnel: Funnel,\n stock: Stock,\n};\n\n/**\n * 在 mix 图表以及 facet 图表中,defaultOptions 进行复写简化\n */\nconst DEFAULT_OPTIONS_MAP = {\n pie: { label: false },\n column: { tooltip: { showMarkers: false } },\n bar: { tooltip: { showMarkers: false } },\n};\n\n/**\n * 执行 plot 的 adaptor, 默认都带上 defaultOptions\n * @param {string} plot\n */\nexport function execPlotAdaptor<T extends IPlotTypes['type']>(\n plot: T,\n view: View,\n options: IPlotTypes['options']\n): void {\n const cls = PLOT_CONSTRUCTOR[plot];\n if (!cls) {\n console.error(`could not find ${plot} plot`);\n return;\n }\n const module = PLOT_ADAPTORS[plot];\n module({\n chart: view,\n options: deepAssign({}, cls.getDefaultOptions(), get(DEFAULT_OPTIONS_MAP, plot, {}), options),\n });\n}\n"]}
|
package/lib/index.d.ts
CHANGED
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.
|
|
5
|
+
exports.version = '2.4.14';
|
|
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,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,OA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/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,uB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B,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.14';\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"]}
|
package/lib/plots/mix/adaptor.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.adaptor = void 0;
|
|
3
|
+
exports.adaptor = exports.slider = void 0;
|
|
4
4
|
var tslib_1 = require("tslib");
|
|
5
5
|
var util_1 = require("@antv/util");
|
|
6
6
|
var base_1 = require("../../adaptor/geometries/base");
|
|
@@ -105,19 +105,33 @@ function multiView(params) {
|
|
|
105
105
|
*/
|
|
106
106
|
function multiPlot(params) {
|
|
107
107
|
var chart = params.chart, options = params.options;
|
|
108
|
-
var plots = options.plots;
|
|
108
|
+
var plots = options.plots, _a = options.data, data = _a === void 0 ? [] : _a;
|
|
109
109
|
util_1.each(plots, function (plot) {
|
|
110
|
-
var type = plot.type, region = plot.region, _a = plot.options, options = _a === void 0 ? {} : _a;
|
|
110
|
+
var type = plot.type, region = plot.region, _a = plot.options, options = _a === void 0 ? {} : _a, top = plot.top;
|
|
111
111
|
var tooltip = options.tooltip;
|
|
112
|
+
if (top) {
|
|
113
|
+
utils_2.execPlotAdaptor(type, chart, tslib_1.__assign(tslib_1.__assign({}, options), { data: data }));
|
|
114
|
+
return;
|
|
115
|
+
}
|
|
112
116
|
var viewOfG2 = chart.createView(tslib_1.__assign({ region: region }, utils_1.pick(options, plot_1.PLOT_CONTAINER_OPTIONS)));
|
|
113
117
|
if (tooltip) {
|
|
114
118
|
// 配置 tooltip 交互
|
|
115
119
|
viewOfG2.interaction('tooltip');
|
|
116
120
|
}
|
|
117
|
-
utils_2.execPlotAdaptor(type, viewOfG2, options);
|
|
121
|
+
utils_2.execPlotAdaptor(type, viewOfG2, tslib_1.__assign({ data: data }, options));
|
|
118
122
|
});
|
|
119
123
|
return params;
|
|
120
124
|
}
|
|
125
|
+
/**
|
|
126
|
+
* 处理缩略轴的 adaptor (mix)
|
|
127
|
+
* @param params
|
|
128
|
+
*/
|
|
129
|
+
function slider(params) {
|
|
130
|
+
var chart = params.chart, options = params.options;
|
|
131
|
+
chart.option('slider', options.slider);
|
|
132
|
+
return params;
|
|
133
|
+
}
|
|
134
|
+
exports.slider = slider;
|
|
121
135
|
/**
|
|
122
136
|
* 图适配器
|
|
123
137
|
* @param chart
|
|
@@ -125,7 +139,7 @@ function multiPlot(params) {
|
|
|
125
139
|
*/
|
|
126
140
|
function adaptor(params) {
|
|
127
141
|
return utils_1.flow(common_1.animation, // 多 view 的图,动画配置放到最前面
|
|
128
|
-
multiView, multiPlot, common_1.interaction, common_1.animation, common_1.theme, common_1.tooltip
|
|
142
|
+
multiView, multiPlot, common_1.interaction, common_1.animation, common_1.theme, common_1.tooltip, slider, common_1.annotation()
|
|
129
143
|
// ... 其他的 adaptor flow
|
|
130
144
|
)(params);
|
|
131
145
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"adaptor.js","sourceRoot":"","sources":["../../../src/plots/mix/adaptor.ts"],"names":[],"mappings":";;;;AAAA,mCAAkC;AAElC,sDAA4E;AAC5E,+
|
|
1
|
+
{"version":3,"file":"adaptor.js","sourceRoot":"","sources":["../../../src/plots/mix/adaptor.ts"],"names":[],"mappings":";;;;AAAA,mCAAkC;AAElC,sDAA4E;AAC5E,+CAA0F;AAE1F,wCAAyD;AACzD,2CAAuD;AACvD,qCAAqD;AAKrD,iCAA0C;AAE1C;;;GAGG;AACH,SAAS,SAAS,CAAC,MAA0B;IACnC,IAAA,KAAK,GAAc,MAAM,MAApB,EAAE,OAAO,GAAK,MAAM,QAAX,CAAY;IAC1B,IAAA,KAAK,GAAa,OAAO,MAApB,EAAE,MAAM,GAAK,OAAO,OAAZ,CA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AO,EAAG,CAAC;IACxD,CAAC,CAAC,CAAC;IAEH,OAAO,MAAM,CAAC;AAChB,CAAC;AAED;;;GAGG;AACH,SAAgB,MAAM,CAAC,MAA0B;IACvC,IAAA,KAAK,GAAc,MAAM,MAApB,EAAE,OAAO,GAAK,MAAM,QAAX,CAAY;IAElC,KAAK,CAAC,MAAM,CAAC,QAAQ,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;IAEvC,OAAO,MAAM,CAAC;AAChB,CAAC;AAND,wBAMC;AAED;;;;GAIG;AACH,SAAgB,OAAO,CAAC,MAA0B;IAChD,OAAO,YAAI,CACT,kBAAS,EAAE,sBAAsB;IACjC,SAAS,EACT,SAAS,EACT,oBAAW,EACX,kBAAS,EACT,cAAK,EACL,gBAAO,EACP,MAAM,EACN,mBAAU,EAAE;IACZ,uBAAuB;KACxB,CAAC,MAAM,CAAC,CAAC;AACZ,CAAC;AAbD,0BAaC","sourcesContent":["import { each } from '@antv/util';\nimport { Geometry } from '@antv/g2';\nimport { geometry as geometryAdaptor } from '../../adaptor/geometries/base';\nimport { interaction, animation, theme, tooltip, annotation } from '../../adaptor/common';\nimport { Params } from '../../core/adaptor';\nimport { PLOT_CONTAINER_OPTIONS } from '../../core/plot';\nimport { AXIS_META_CONFIG_KEYS } from '../../constant';\nimport { deepAssign, flow, pick } from '../../utils';\nimport { Axis } from '../../types/axis';\nimport { Legend } from '../../types/legend';\nimport { Interaction } from '../../types/interaction';\nimport { MixOptions, IView, IGeometry } from './types';\nimport { execPlotAdaptor } from './utils';\n\n/**\n * geometry 处理\n * @param params\n */\nfunction multiView(params: Params<MixOptions>): Params<MixOptions> {\n const { chart, options } = params;\n const { views, legend } = options;\n\n each(views, (v: IView) => {\n const { region, data, meta, axes, coordinate, interactions, annotations, tooltip, geometries } = v;\n\n // 1. 创建 view\n const viewOfG2 = chart.createView({\n region,\n });\n\n // 2. data\n viewOfG2.data(data);\n\n // 3. meta\n let scales: Record<string, any> = {};\n if (axes) {\n each(axes, (axis: Axis, field: string) => {\n scales[field] = pick(axis, AXIS_META_CONFIG_KEYS);\n });\n }\n\n scales = deepAssign({}, meta, scales);\n viewOfG2.scale(scales);\n\n // 4. x y axis\n if (!axes) {\n viewOfG2.axis(false);\n } else {\n each(axes, (axis: Axis, field: string) => {\n viewOfG2.axis(field, axis);\n });\n }\n\n // 5. coordinate\n viewOfG2.coordinate(coordinate);\n\n // 6. geometry\n each(geometries, (geometry: IGeometry) => {\n const { ext } = geometryAdaptor({\n chart: viewOfG2,\n options: geometry,\n });\n\n // adjust\n const { adjust } = geometry;\n if (adjust) {\n ext.geometry.adjust(adjust);\n }\n });\n\n // 7. interactions\n each(interactions, (interaction: Interaction) => {\n if (interaction.enable === false) {\n viewOfG2.removeInteraction(interaction.type);\n } else {\n viewOfG2.interaction(interaction.type, interaction.cfg);\n }\n });\n\n // 8. annotations\n each(annotations, (annotation) => {\n viewOfG2.annotation()[annotation.type]({\n ...annotation,\n });\n });\n\n // 9. animation (先做动画)\n if (typeof v.animation === 'boolean') {\n viewOfG2.animate(false);\n } else {\n viewOfG2.animate(true);\n // 9.1 所有的 Geometry 都使用同一动画(各个图形如有区别,todo 自行覆盖)\n each(viewOfG2.geometries, (g: Geometry) => {\n g.animate(v.animation);\n });\n }\n\n if (tooltip) {\n // 10. tooltip\n viewOfG2.interaction('tooltip');\n viewOfG2.tooltip(tooltip);\n }\n });\n\n // legend\n if (!legend) {\n chart.legend(false);\n } else {\n each(legend, (l: Legend, field: string) => {\n chart.legend(field, l);\n });\n }\n\n // tooltip\n chart.tooltip(options.tooltip);\n return params;\n}\n\n/**\n * 支持嵌套使用 g2plot 内置图表\n * @param params\n */\nfunction multiPlot(params: Params<MixOptions>): Params<MixOptions> {\n const { chart, options } = params;\n const { plots, data = [] } = options;\n\n each(plots, (plot) => {\n const { type, region, options = {}, top } = plot;\n const { tooltip } = options;\n\n if (top) {\n execPlotAdaptor(type, chart, { ...options, data });\n return;\n }\n\n const viewOfG2 = chart.createView({ region, ...pick(options, PLOT_CONTAINER_OPTIONS) });\n if (tooltip) {\n // 配置 tooltip 交互\n viewOfG2.interaction('tooltip');\n }\n\n execPlotAdaptor(type, viewOfG2, { data, ...options });\n });\n\n return params;\n}\n\n/**\n * 处理缩略轴的 adaptor (mix)\n * @param params\n */\nexport function slider(params: Params<MixOptions>): Params<MixOptions> {\n const { chart, options } = params;\n\n chart.option('slider', options.slider);\n\n return params;\n}\n\n/**\n * 图适配器\n * @param chart\n * @param options\n */\nexport function adaptor(params: Params<MixOptions>) {\n return flow(\n animation, // 多 view 的图,动画配置放到最前面\n multiView,\n multiPlot,\n interaction,\n animation,\n theme,\n tooltip,\n slider,\n annotation()\n // ... 其他的 adaptor flow\n )(params);\n}\n"]}
|