@antv/g2plot 2.4.5 → 2.4.9
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 +64 -0
- package/README.md +1 -1
- package/dist/g2plot.min.js +4 -4
- package/dist/g2plot.min.js.map +1 -1
- package/esm/core/plot.d.ts +2 -2
- package/esm/core/plot.js +4 -3
- package/esm/core/plot.js.map +1 -1
- package/esm/index.d.ts +2 -2
- package/esm/index.js +2 -2
- package/esm/index.js.map +1 -1
- package/esm/plots/area/constants.js +1 -0
- package/esm/plots/area/constants.js.map +1 -1
- package/esm/plots/area/types.d.ts +35 -10
- package/esm/plots/area/types.js.map +1 -1
- package/esm/plots/bar/constants.js +3 -0
- package/esm/plots/bar/constants.js.map +1 -1
- package/esm/plots/bar/types.d.ts +16 -3
- package/esm/plots/bar/types.js.map +1 -1
- package/esm/plots/bidirectional-bar/types.d.ts +21 -6
- package/esm/plots/bidirectional-bar/types.js.map +1 -1
- package/esm/plots/box/types.d.ts +20 -6
- package/esm/plots/box/types.js.map +1 -1
- package/esm/plots/bullet/types.d.ts +36 -9
- package/esm/plots/bullet/types.js.map +1 -1
- package/esm/plots/chord/types.d.ts +14 -10
- package/esm/plots/chord/types.js.map +1 -1
- package/esm/plots/circle-packing/types.d.ts +25 -8
- package/esm/plots/circle-packing/types.js.map +1 -1
- package/esm/plots/column/constants.js +3 -0
- package/esm/plots/column/constants.js.map +1 -1
- package/esm/plots/column/types.d.ts +57 -16
- package/esm/plots/column/types.js.map +1 -1
- package/esm/plots/dual-axes/types.d.ts +31 -6
- package/esm/plots/dual-axes/types.js.map +1 -1
- package/esm/plots/dual-axes/util/render-sider.js +1 -1
- package/esm/plots/dual-axes/util/render-sider.js.map +1 -1
- package/esm/plots/facet/types.d.ts +54 -34
- package/esm/plots/facet/types.js.map +1 -1
- package/esm/plots/funnel/types.d.ts +40 -11
- package/esm/plots/funnel/types.js.map +1 -1
- package/esm/plots/gauge/adaptor.js +1 -0
- package/esm/plots/gauge/adaptor.js.map +1 -1
- package/esm/plots/gauge/types.d.ts +83 -21
- package/esm/plots/gauge/types.js.map +1 -1
- package/esm/plots/heatmap/types.d.ts +47 -12
- package/esm/plots/heatmap/types.js.map +1 -1
- package/esm/plots/histogram/types.d.ts +17 -6
- package/esm/plots/histogram/types.js.map +1 -1
- package/esm/plots/line/adaptor.js +2 -2
- package/esm/plots/line/adaptor.js.map +1 -1
- package/esm/plots/line/constants.js +1 -0
- package/esm/plots/line/constants.js.map +1 -1
- package/esm/plots/line/types.d.ts +42 -12
- package/esm/plots/line/types.js.map +1 -1
- package/esm/plots/liquid/adaptor.js +2 -1
- package/esm/plots/liquid/adaptor.js.map +1 -1
- package/esm/plots/liquid/index.d.ts +1 -0
- package/esm/plots/liquid/index.js +1 -0
- package/esm/plots/liquid/index.js.map +1 -1
- package/esm/plots/liquid/shapes/liquid.d.ts +16 -1
- package/esm/plots/liquid/shapes/liquid.js +17 -10
- package/esm/plots/liquid/shapes/liquid.js.map +1 -1
- package/esm/plots/liquid/types.d.ts +57 -16
- package/esm/plots/liquid/types.js.map +1 -1
- package/esm/plots/mix/types.d.ts +31 -22
- package/esm/plots/mix/types.js.map +1 -1
- package/esm/plots/pie/adaptor.js +2 -0
- package/esm/plots/pie/adaptor.js.map +1 -1
- package/esm/plots/pie/contants.js +1 -0
- package/esm/plots/pie/contants.js.map +1 -1
- package/esm/plots/pie/types.d.ts +27 -10
- package/esm/plots/pie/types.js.map +1 -1
- package/esm/plots/progress/adaptor.js +1 -0
- package/esm/plots/progress/adaptor.js.map +1 -1
- package/esm/plots/progress/types.d.ts +13 -4
- package/esm/plots/progress/types.js.map +1 -1
- package/esm/plots/radar/types.d.ts +39 -12
- package/esm/plots/radar/types.js.map +1 -1
- package/esm/plots/radial-bar/types.d.ts +39 -12
- package/esm/plots/radial-bar/types.js.map +1 -1
- package/esm/plots/ring-progress/types.d.ts +18 -6
- package/esm/plots/ring-progress/types.js.map +1 -1
- package/esm/plots/rose/constant.js +1 -0
- package/esm/plots/rose/constant.js.map +1 -1
- package/esm/plots/rose/types.d.ts +32 -12
- package/esm/plots/rose/types.js.map +1 -1
- package/esm/plots/sankey/adaptor.js +31 -2
- package/esm/plots/sankey/adaptor.js.map +1 -1
- package/esm/plots/sankey/types.d.ts +57 -30
- package/esm/plots/sankey/types.js.map +1 -1
- package/esm/plots/scatter/adaptor.d.ts +1 -1
- package/esm/plots/scatter/adaptor.js +2 -2
- package/esm/plots/scatter/adaptor.js.map +1 -1
- package/esm/plots/scatter/types.d.ts +76 -22
- package/esm/plots/scatter/types.js.map +1 -1
- package/esm/plots/stock/types.d.ts +20 -7
- package/esm/plots/stock/types.js.map +1 -1
- package/esm/plots/sunburst/types.d.ts +40 -12
- package/esm/plots/sunburst/types.js.map +1 -1
- package/esm/plots/tiny-area/types.d.ts +16 -5
- package/esm/plots/tiny-area/types.js.map +1 -1
- package/esm/plots/tiny-column/types.d.ts +10 -3
- package/esm/plots/tiny-column/types.js.map +1 -1
- package/esm/plots/tiny-line/types.d.ts +17 -5
- package/esm/plots/tiny-line/types.js.map +1 -1
- package/esm/plots/treemap/types.d.ts +17 -6
- package/esm/plots/treemap/types.js.map +1 -1
- package/esm/plots/venn/types.d.ts +20 -6
- package/esm/plots/venn/types.js.map +1 -1
- package/esm/plots/violin/types.d.ts +52 -17
- package/esm/plots/violin/types.js.map +1 -1
- package/esm/plots/waterfall/types.d.ts +42 -10
- package/esm/plots/waterfall/types.js.map +1 -1
- package/esm/plots/word-cloud/types.d.ts +91 -44
- package/esm/plots/word-cloud/types.js.map +1 -1
- package/esm/types/button.d.ts +8 -4
- package/esm/types/button.js.map +1 -1
- package/esm/types/common.d.ts +145 -33
- package/esm/types/common.js.map +1 -1
- package/esm/types/drill-down.d.ts +28 -7
- package/esm/types/drill-down.js.map +1 -1
- package/esm/types/interaction.d.ts +26 -6
- package/esm/types/interaction.js.map +1 -1
- package/esm/types/label.d.ts +11 -3
- package/esm/types/label.js.map +1 -1
- package/esm/types/meta.d.ts +4 -7
- package/esm/types/meta.js.map +1 -1
- package/esm/types/pattern.d.ts +58 -18
- package/esm/types/pattern.js.map +1 -1
- package/esm/types/state.d.ts +11 -3
- package/esm/types/state.js.map +1 -1
- package/esm/types/statistic.d.ts +38 -6
- package/esm/types/statistic.js.map +1 -1
- package/esm/types/tooltip.d.ts +7 -2
- package/esm/types/tooltip.js.map +1 -1
- package/esm/utils/transform/percent.js +2 -2
- package/esm/utils/transform/percent.js.map +1 -1
- package/lib/core/plot.d.ts +2 -2
- package/lib/core/plot.js +4 -3
- package/lib/core/plot.js.map +1 -1
- package/lib/index.d.ts +2 -2
- package/lib/index.js +2 -1
- package/lib/index.js.map +1 -1
- package/lib/plots/area/constants.js +1 -0
- package/lib/plots/area/constants.js.map +1 -1
- package/lib/plots/area/types.d.ts +35 -10
- package/lib/plots/area/types.js.map +1 -1
- package/lib/plots/bar/constants.js +3 -0
- package/lib/plots/bar/constants.js.map +1 -1
- package/lib/plots/bar/types.d.ts +16 -3
- package/lib/plots/bar/types.js.map +1 -1
- package/lib/plots/bidirectional-bar/types.d.ts +21 -6
- package/lib/plots/bidirectional-bar/types.js.map +1 -1
- package/lib/plots/box/types.d.ts +20 -6
- package/lib/plots/box/types.js.map +1 -1
- package/lib/plots/bullet/types.d.ts +36 -9
- package/lib/plots/bullet/types.js.map +1 -1
- package/lib/plots/chord/types.d.ts +14 -10
- package/lib/plots/chord/types.js.map +1 -1
- package/lib/plots/circle-packing/types.d.ts +25 -8
- package/lib/plots/circle-packing/types.js.map +1 -1
- package/lib/plots/column/constants.js +3 -0
- package/lib/plots/column/constants.js.map +1 -1
- package/lib/plots/column/types.d.ts +57 -16
- package/lib/plots/column/types.js.map +1 -1
- package/lib/plots/dual-axes/types.d.ts +31 -6
- package/lib/plots/dual-axes/types.js.map +1 -1
- package/lib/plots/dual-axes/util/render-sider.js +1 -1
- package/lib/plots/dual-axes/util/render-sider.js.map +1 -1
- package/lib/plots/facet/types.d.ts +54 -34
- package/lib/plots/facet/types.js.map +1 -1
- package/lib/plots/funnel/types.d.ts +40 -11
- package/lib/plots/funnel/types.js.map +1 -1
- package/lib/plots/gauge/adaptor.js +1 -0
- package/lib/plots/gauge/adaptor.js.map +1 -1
- package/lib/plots/gauge/types.d.ts +83 -21
- package/lib/plots/gauge/types.js.map +1 -1
- package/lib/plots/heatmap/types.d.ts +47 -12
- package/lib/plots/heatmap/types.js.map +1 -1
- package/lib/plots/histogram/types.d.ts +17 -6
- package/lib/plots/histogram/types.js.map +1 -1
- package/lib/plots/line/adaptor.js +1 -1
- package/lib/plots/line/adaptor.js.map +1 -1
- package/lib/plots/line/constants.js +1 -0
- package/lib/plots/line/constants.js.map +1 -1
- package/lib/plots/line/types.d.ts +42 -12
- package/lib/plots/line/types.js.map +1 -1
- package/lib/plots/liquid/adaptor.js +2 -1
- package/lib/plots/liquid/adaptor.js.map +1 -1
- package/lib/plots/liquid/index.d.ts +1 -0
- package/lib/plots/liquid/index.js +2 -0
- package/lib/plots/liquid/index.js.map +1 -1
- package/lib/plots/liquid/shapes/liquid.d.ts +16 -1
- package/lib/plots/liquid/shapes/liquid.js +19 -10
- package/lib/plots/liquid/shapes/liquid.js.map +1 -1
- package/lib/plots/liquid/types.d.ts +57 -16
- package/lib/plots/liquid/types.js.map +1 -1
- package/lib/plots/mix/types.d.ts +31 -22
- package/lib/plots/mix/types.js.map +1 -1
- package/lib/plots/pie/adaptor.js +2 -0
- package/lib/plots/pie/adaptor.js.map +1 -1
- package/lib/plots/pie/contants.js +1 -0
- package/lib/plots/pie/contants.js.map +1 -1
- package/lib/plots/pie/types.d.ts +27 -10
- package/lib/plots/pie/types.js.map +1 -1
- package/lib/plots/progress/adaptor.js +1 -0
- package/lib/plots/progress/adaptor.js.map +1 -1
- package/lib/plots/progress/types.d.ts +13 -4
- package/lib/plots/progress/types.js.map +1 -1
- package/lib/plots/radar/types.d.ts +39 -12
- package/lib/plots/radar/types.js.map +1 -1
- package/lib/plots/radial-bar/types.d.ts +39 -12
- package/lib/plots/radial-bar/types.js.map +1 -1
- package/lib/plots/ring-progress/types.d.ts +18 -6
- package/lib/plots/ring-progress/types.js.map +1 -1
- package/lib/plots/rose/constant.js +1 -0
- package/lib/plots/rose/constant.js.map +1 -1
- package/lib/plots/rose/types.d.ts +32 -12
- package/lib/plots/rose/types.js.map +1 -1
- package/lib/plots/sankey/adaptor.js +30 -1
- package/lib/plots/sankey/adaptor.js.map +1 -1
- package/lib/plots/sankey/types.d.ts +57 -30
- package/lib/plots/sankey/types.js.map +1 -1
- package/lib/plots/scatter/adaptor.d.ts +1 -1
- package/lib/plots/scatter/adaptor.js +1 -1
- package/lib/plots/scatter/adaptor.js.map +1 -1
- package/lib/plots/scatter/types.d.ts +76 -22
- package/lib/plots/scatter/types.js.map +1 -1
- package/lib/plots/stock/types.d.ts +20 -7
- package/lib/plots/stock/types.js.map +1 -1
- package/lib/plots/sunburst/types.d.ts +40 -12
- package/lib/plots/sunburst/types.js.map +1 -1
- package/lib/plots/tiny-area/types.d.ts +16 -5
- package/lib/plots/tiny-area/types.js.map +1 -1
- package/lib/plots/tiny-column/types.d.ts +10 -3
- package/lib/plots/tiny-column/types.js.map +1 -1
- package/lib/plots/tiny-line/types.d.ts +17 -5
- package/lib/plots/tiny-line/types.js.map +1 -1
- package/lib/plots/treemap/types.d.ts +17 -6
- package/lib/plots/treemap/types.js.map +1 -1
- package/lib/plots/venn/types.d.ts +20 -6
- package/lib/plots/venn/types.js.map +1 -1
- package/lib/plots/violin/types.d.ts +52 -17
- package/lib/plots/violin/types.js.map +1 -1
- package/lib/plots/waterfall/types.d.ts +42 -10
- package/lib/plots/waterfall/types.js.map +1 -1
- package/lib/plots/word-cloud/types.d.ts +91 -44
- package/lib/plots/word-cloud/types.js.map +1 -1
- package/lib/types/button.d.ts +8 -4
- package/lib/types/button.js.map +1 -1
- package/lib/types/common.d.ts +145 -33
- package/lib/types/common.js.map +1 -1
- package/lib/types/drill-down.d.ts +28 -7
- package/lib/types/drill-down.js.map +1 -1
- package/lib/types/interaction.d.ts +26 -6
- package/lib/types/interaction.js.map +1 -1
- package/lib/types/label.d.ts +11 -3
- package/lib/types/label.js.map +1 -1
- package/lib/types/meta.d.ts +4 -7
- package/lib/types/meta.js.map +1 -1
- package/lib/types/pattern.d.ts +58 -18
- package/lib/types/pattern.js.map +1 -1
- package/lib/types/state.d.ts +11 -3
- package/lib/types/state.js.map +1 -1
- package/lib/types/statistic.d.ts +38 -6
- package/lib/types/statistic.js.map +1 -1
- package/lib/types/tooltip.d.ts +7 -2
- package/lib/types/tooltip.js.map +1 -1
- package/lib/utils/transform/percent.js +2 -2
- package/lib/utils/transform/percent.js.map +1 -1
- package/package.json +2 -2
- package/src/core/plot.ts +5 -4
- package/src/index.ts +2 -2
- package/src/plots/area/constants.ts +1 -0
- package/src/plots/area/types.ts +35 -10
- package/src/plots/bar/constants.ts +3 -0
- package/src/plots/bar/types.ts +16 -3
- package/src/plots/bidirectional-bar/types.ts +21 -6
- package/src/plots/box/types.ts +20 -6
- package/src/plots/bullet/types.ts +36 -17
- package/src/plots/chord/types.ts +14 -11
- package/src/plots/circle-packing/types.ts +25 -14
- package/src/plots/column/constants.ts +3 -0
- package/src/plots/column/types.ts +57 -20
- package/src/plots/dual-axes/types.ts +31 -16
- package/src/plots/dual-axes/util/render-sider.ts +1 -1
- package/src/plots/facet/types.ts +54 -49
- package/src/plots/funnel/types.ts +40 -13
- package/src/plots/gauge/adaptor.ts +1 -0
- package/src/plots/gauge/types.ts +86 -27
- package/src/plots/heatmap/types.ts +49 -14
- package/src/plots/histogram/types.ts +17 -9
- package/src/plots/line/adaptor.ts +12 -1
- package/src/plots/line/constants.ts +1 -0
- package/src/plots/line/types.ts +42 -14
- package/src/plots/liquid/adaptor.ts +2 -1
- package/src/plots/liquid/index.ts +2 -0
- package/src/plots/liquid/shapes/liquid.ts +22 -11
- package/src/plots/liquid/types.ts +57 -16
- package/src/plots/mix/types.ts +31 -35
- package/src/plots/pie/adaptor.ts +2 -0
- package/src/plots/pie/contants.ts +1 -0
- package/src/plots/pie/types.ts +27 -10
- package/src/plots/progress/adaptor.ts +1 -0
- package/src/plots/progress/types.ts +13 -4
- package/src/plots/radar/types.ts +39 -12
- package/src/plots/radial-bar/types.ts +39 -12
- package/src/plots/ring-progress/types.ts +18 -6
- package/src/plots/rose/constant.ts +1 -0
- package/src/plots/rose/types.ts +32 -12
- package/src/plots/sankey/adaptor.ts +35 -2
- package/src/plots/sankey/types.ts +58 -30
- package/src/plots/scatter/adaptor.ts +3 -1
- package/src/plots/scatter/types.ts +77 -24
- package/src/plots/stock/types.ts +21 -8
- package/src/plots/sunburst/types.ts +42 -12
- package/src/plots/tiny-area/types.ts +16 -5
- package/src/plots/tiny-column/types.ts +10 -3
- package/src/plots/tiny-line/types.ts +17 -5
- package/src/plots/treemap/types.ts +17 -7
- package/src/plots/venn/types.ts +21 -6
- package/src/plots/violin/types.ts +52 -17
- package/src/plots/waterfall/types.ts +42 -10
- package/src/plots/word-cloud/types.ts +91 -44
- package/src/types/button.ts +8 -4
- package/src/types/common.ts +145 -37
- package/src/types/drill-down.ts +28 -7
- package/src/types/interaction.ts +26 -6
- package/src/types/label.ts +11 -3
- package/src/types/meta.ts +4 -7
- package/src/types/pattern.ts +58 -18
- package/src/types/state.ts +11 -3
- package/src/types/statistic.ts +38 -6
- package/src/types/tooltip.ts +7 -2
- package/src/utils/transform/percent.ts +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/plots/pie/types.ts"],"names":[],"mappings":"","sourcesContent":["import { Options, Statistic, StyleAttr } from '../../types';\nimport { Label } from '../../types/label';\n\nexport type StatisticData = {\n title: string;\n value: string | number | null;\n};\n\nexport interface PieOptions extends Options {\n
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/plots/pie/types.ts"],"names":[],"mappings":"","sourcesContent":["import { Options, Statistic, StyleAttr } from '../../types';\nimport { Label } from '../../types/label';\n\nexport type StatisticData = {\n title: string;\n value: string | number | null;\n};\n\nexport interface PieOptions extends Options {\n /**\n * @title 角度映射字段\n */\n readonly angleField: string;\n /**\n * @title 颜色映射字段\n */\n readonly colorField: string;\n /**\n * @title 饼图半径\n */\n readonly radius?: number;\n /**\n * @title 饼图内半径\n */\n readonly innerRadius?: number;\n /**\n * @title 饼图标签\n * @description type: 'inner' | 'outer' | 'spider'\n */\n readonly label?: Label;\n /**\n * @title 饼图图形样式\n */\n readonly pieStyle?: StyleAttr;\n // 设置扇形图\n /**\n * @title 圆环的开始角度\n */\n readonly startAngle?: number;\n /**\n * @title 圆环的结束角度\n */\n readonly endAngle?: number;\n /**\n * @title 指标卡组件\n * @description 显示在环图中心,可以代替tooltip,显示环图数据的总计值和各项数据,启用 statistic 组件的同时将自动关闭tooltip\n */\n readonly statistic?: Statistic;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"adaptor.js","sourceRoot":"","sources":["../../../src/plots/progress/adaptor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAC3E,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAEpD,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE1C;;;GAGG;AACH,MAAM,UAAU,QAAQ,CAAC,MAA+B;IAC9C,IAAA,KAAK,GAAc,MAAM,MAApB,EAAE,OAAO,GAAK,MAAM,QAAX,CAAY;IAC1B,IAAA,OAAO,GAA0C,OAAO,QAAjD,EAAE,aAAa,GAA2B,OAAO,cAAlC,EAAE,KAAK,GAAoB,OAA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../core/adaptor';\nimport { flow, deepAssign } from '../../utils';\nimport { scale, animation, theme, annotation } from '../../adaptor/common';\nimport { interval } from '../../adaptor/geometries';\nimport { ProgressOptions } from './types';\nimport { DEFAULT_COLOR } from './constants';\nimport { getProgressData } from './utils';\n\n/**\n * 字段\n * @param params\n */\nexport function geometry(params: Params<ProgressOptions>): Params<ProgressOptions> {\n const { chart, options } = params;\n const { percent, progressStyle, color, barWidthRatio } = options;\n\n chart.data(getProgressData(percent));\n\n const p = deepAssign({}, params, {\n options: {\n xField: '1',\n yField: 'percent',\n seriesField: 'type',\n isStack: true,\n widthRatio: barWidthRatio,\n interval: {\n style: progressStyle,\n color: isString(color) ? [color, DEFAULT_COLOR[1]] : color,\n },\n args: {\n zIndexReversed: true,\n sortZIndex: true,\n },\n },\n });\n\n interval(p);\n\n // 关闭组件\n chart.tooltip(false);\n chart.axis(false);\n chart.legend(false);\n\n return params;\n}\n\n/**\n * other 配置\n * @param params\n */\nfunction coordinate(params: Params<ProgressOptions>): Params<ProgressOptions> {\n const { chart } = params;\n\n chart.coordinate('rect').transpose();\n\n return params;\n}\n\n/**\n * 进度图适配器\n * @param chart\n * @param options\n */\nexport function adaptor(params: Params<ProgressOptions>) {\n // @ts-ignore\n return flow(geometry, scale({}), coordinate, animation, theme, annotation())(params);\n}\n"]}
|
|
@@ -1,12 +1,21 @@
|
|
|
1
1
|
import { Options, StyleAttr, ColorAttr } from '../../types';
|
|
2
2
|
/** mini 图类型定义需要 omit 很多的 G2 Options 配置 */
|
|
3
3
|
export interface ProgressOptions extends Omit<Options, 'data' | 'color'> {
|
|
4
|
-
/**
|
|
4
|
+
/**
|
|
5
|
+
* @title 进度百分比
|
|
6
|
+
*/
|
|
5
7
|
readonly percent: number;
|
|
6
|
-
/**
|
|
8
|
+
/**
|
|
9
|
+
* @title 条图宽度占比
|
|
10
|
+
* @description 范围[0-1]
|
|
11
|
+
*/
|
|
7
12
|
readonly barWidthRatio?: number;
|
|
8
|
-
/**
|
|
13
|
+
/**
|
|
14
|
+
* @title 进度条颜色
|
|
15
|
+
*/
|
|
9
16
|
readonly color?: ColorAttr;
|
|
10
|
-
/**
|
|
17
|
+
/**
|
|
18
|
+
* @title 进度条样式
|
|
19
|
+
*/
|
|
11
20
|
readonly progressStyle?: StyleAttr;
|
|
12
21
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/plots/progress/types.ts"],"names":[],"mappings":"","sourcesContent":["import { Options, StyleAttr, ColorAttr } from '../../types';\n\n/** mini 图类型定义需要 omit 很多的 G2 Options 配置 */\nexport interface ProgressOptions extends Omit<Options, 'data' | 'color'> {\n
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/plots/progress/types.ts"],"names":[],"mappings":"","sourcesContent":["import { Options, StyleAttr, ColorAttr } from '../../types';\n\n/** mini 图类型定义需要 omit 很多的 G2 Options 配置 */\nexport interface ProgressOptions extends Omit<Options, 'data' | 'color'> {\n /**\n * @title 进度百分比\n */\n readonly percent: number;\n /**\n * @title 条图宽度占比\n * @description 范围[0-1]\n */\n readonly barWidthRatio?: number;\n /**\n * @title 进度条颜色\n */\n readonly color?: ColorAttr;\n /**\n * @title 进度条样式\n */\n readonly progressStyle?: StyleAttr;\n}\n"]}
|
|
@@ -1,28 +1,55 @@
|
|
|
1
1
|
import { PointGeometryOptions, AreaGeometryOptions } from '../../adaptor/geometries';
|
|
2
2
|
import { Options, ShapeStyle } from '../../types';
|
|
3
3
|
export interface RadarOptions extends Options {
|
|
4
|
-
/**
|
|
4
|
+
/**
|
|
5
|
+
* @title x轴字段
|
|
6
|
+
*/
|
|
5
7
|
readonly xField: string;
|
|
6
|
-
/**
|
|
8
|
+
/**
|
|
9
|
+
* @title y轴字段
|
|
10
|
+
* @description 映射雷达图的射线长度
|
|
11
|
+
*/
|
|
7
12
|
readonly yField: string;
|
|
8
|
-
/**
|
|
13
|
+
/**
|
|
14
|
+
* @title 分组字段
|
|
15
|
+
*/
|
|
9
16
|
readonly seriesField?: string;
|
|
10
|
-
/**
|
|
17
|
+
/**
|
|
18
|
+
* @title 是否平滑
|
|
19
|
+
* @default false
|
|
20
|
+
*/
|
|
11
21
|
readonly smooth?: boolean;
|
|
12
|
-
/**
|
|
22
|
+
/**
|
|
23
|
+
* @title 折线图形样式
|
|
24
|
+
*/
|
|
13
25
|
readonly lineStyle?: ShapeStyle | ((x: any, y: any, series?: any) => ShapeStyle);
|
|
14
|
-
/**
|
|
26
|
+
/**
|
|
27
|
+
* @title 数据点图形样式
|
|
28
|
+
*/
|
|
15
29
|
readonly point?: PointGeometryOptions['point'] & Pick<PointGeometryOptions, 'state'>;
|
|
16
|
-
/**
|
|
30
|
+
/**
|
|
31
|
+
* @title area 图形样式
|
|
32
|
+
* @description 均提供回调的方式, 不开放 field 映射配置
|
|
33
|
+
*/
|
|
17
34
|
readonly area?: AreaGeometryOptions['area'];
|
|
18
|
-
/**
|
|
35
|
+
/**
|
|
36
|
+
* @title 角度轴配置
|
|
37
|
+
*/
|
|
19
38
|
readonly xAxis?: any;
|
|
20
|
-
/**
|
|
39
|
+
/**
|
|
40
|
+
* @title 径向轴配置
|
|
41
|
+
*/
|
|
21
42
|
readonly yAxis?: any;
|
|
22
|
-
/**
|
|
43
|
+
/**
|
|
44
|
+
* @title 雷达图半径
|
|
45
|
+
*/
|
|
23
46
|
readonly radius?: number;
|
|
24
|
-
/**
|
|
47
|
+
/**
|
|
48
|
+
* @title 雷达图开始角度
|
|
49
|
+
*/
|
|
25
50
|
readonly startAngle?: number;
|
|
26
|
-
/**
|
|
51
|
+
/**
|
|
52
|
+
* @title 雷达图结束角度
|
|
53
|
+
*/
|
|
27
54
|
readonly endAngle?: number;
|
|
28
55
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/plots/radar/types.ts"],"names":[],"mappings":"","sourcesContent":["import { PointGeometryOptions, AreaGeometryOptions } from '../../adaptor/geometries';\nimport { Options, ShapeStyle } from '../../types';\n\nexport interface RadarOptions extends Options {\n
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/plots/radar/types.ts"],"names":[],"mappings":"","sourcesContent":["import { PointGeometryOptions, AreaGeometryOptions } from '../../adaptor/geometries';\nimport { Options, ShapeStyle } from '../../types';\n\nexport interface RadarOptions extends Options {\n /**\n * @title x轴字段\n */\n readonly xField: string;\n /**\n * @title y轴字段\n * @description 映射雷达图的射线长度\n */\n readonly yField: string;\n /**\n * @title 分组字段\n */\n readonly seriesField?: string;\n /**\n * @title 是否平滑\n * @default false\n */\n readonly smooth?: boolean;\n /**\n * @title 折线图形样式\n */\n readonly lineStyle?: ShapeStyle | ((x: any, y: any, series?: any) => ShapeStyle);\n /**\n * @title 数据点图形样式\n */\n readonly point?: PointGeometryOptions['point'] & Pick<PointGeometryOptions, 'state'>;\n /**\n * @title area 图形样式\n * @description 均提供回调的方式, 不开放 field 映射配置\n */\n readonly area?: AreaGeometryOptions['area'];\n /**\n * @title 角度轴配置\n */\n readonly xAxis?: any;\n /**\n * @title 径向轴配置\n */\n readonly yAxis?: any;\n /**\n * @title 雷达图半径\n */\n readonly radius?: number;\n /**\n * @title 雷达图开始角度\n */\n readonly startAngle?: number;\n /**\n * @title 雷达图结束角度\n */\n readonly endAngle?: number;\n}\n"]}
|
|
@@ -3,28 +3,55 @@ import { Options } from '../../types';
|
|
|
3
3
|
import { BarOptions } from '../bar';
|
|
4
4
|
/** 配置类型定义 */
|
|
5
5
|
export interface RadialBarOptions extends Options, Pick<BarOptions, 'barBackground' | 'minBarWidth' | 'maxBarWidth'> {
|
|
6
|
-
/**
|
|
6
|
+
/**
|
|
7
|
+
* @title x轴字段
|
|
8
|
+
*/
|
|
7
9
|
readonly xField?: string;
|
|
8
|
-
/**
|
|
10
|
+
/**
|
|
11
|
+
* @title y轴字段
|
|
12
|
+
*/
|
|
9
13
|
readonly yField?: string;
|
|
10
|
-
/**
|
|
14
|
+
/**
|
|
15
|
+
* @title 样式
|
|
16
|
+
*/
|
|
11
17
|
readonly barStyle?: ShapeAttrs;
|
|
12
|
-
/**
|
|
18
|
+
/**
|
|
19
|
+
* @title 最大旋转角度
|
|
20
|
+
* @description 范围0-360
|
|
21
|
+
*/
|
|
13
22
|
readonly maxAngle?: number;
|
|
14
|
-
/**
|
|
23
|
+
/**
|
|
24
|
+
* @title 圆半径
|
|
25
|
+
*/
|
|
15
26
|
readonly radius?: number;
|
|
16
|
-
/**
|
|
27
|
+
/**
|
|
28
|
+
* @title 圆内半径
|
|
29
|
+
*/
|
|
17
30
|
readonly innerRadius?: number;
|
|
18
|
-
/**
|
|
31
|
+
/**
|
|
32
|
+
* @title 圆环的开始角度
|
|
33
|
+
*/
|
|
19
34
|
readonly startAngle?: number;
|
|
20
|
-
/**
|
|
35
|
+
/**
|
|
36
|
+
* @title 圆环的结束角度
|
|
37
|
+
*/
|
|
21
38
|
readonly endAngle?: number;
|
|
22
|
-
/**
|
|
39
|
+
/**
|
|
40
|
+
* @title 颜色字段
|
|
41
|
+
*/
|
|
23
42
|
readonly colorField?: string;
|
|
24
|
-
/**
|
|
43
|
+
/**
|
|
44
|
+
* @title 类型
|
|
45
|
+
*/
|
|
25
46
|
readonly type?: string;
|
|
26
|
-
/**
|
|
47
|
+
/**
|
|
48
|
+
* @title 是否叠加
|
|
49
|
+
* @default false
|
|
50
|
+
*/
|
|
27
51
|
readonly isStack?: boolean;
|
|
28
|
-
/**
|
|
52
|
+
/**
|
|
53
|
+
* @title 是否分组
|
|
54
|
+
* @default false
|
|
55
|
+
*/
|
|
29
56
|
readonly isGroup?: boolean;
|
|
30
57
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/plots/radial-bar/types.ts"],"names":[],"mappings":"","sourcesContent":["import { ShapeAttrs } from '@antv/g-base';\nimport { Options } from '../../types';\nimport { BarOptions } from '../bar';\n\n/** 配置类型定义 */\nexport interface RadialBarOptions extends Options, Pick<BarOptions, 'barBackground' | 'minBarWidth' | 'maxBarWidth'> {\n
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/plots/radial-bar/types.ts"],"names":[],"mappings":"","sourcesContent":["import { ShapeAttrs } from '@antv/g-base';\nimport { Options } from '../../types';\nimport { BarOptions } from '../bar';\n\n/** 配置类型定义 */\nexport interface RadialBarOptions extends Options, Pick<BarOptions, 'barBackground' | 'minBarWidth' | 'maxBarWidth'> {\n /**\n * @title x轴字段\n */\n readonly xField?: string;\n /**\n * @title y轴字段\n */\n readonly yField?: string;\n /**\n * @title 样式\n */\n readonly barStyle?: ShapeAttrs;\n /**\n * @title 最大旋转角度\n * @description 范围0-360\n */\n readonly maxAngle?: number;\n /**\n * @title 圆半径\n */\n readonly radius?: number;\n /**\n * @title 圆内半径\n */\n readonly innerRadius?: number;\n /**\n * @title 圆环的开始角度\n */\n readonly startAngle?: number;\n /**\n * @title 圆环的结束角度\n */\n readonly endAngle?: number;\n /**\n * @title 颜色字段\n */\n readonly colorField?: string;\n /**\n * @title 类型\n */\n readonly type?: string;\n /**\n * @title 是否叠加\n * @default false\n */\n readonly isStack?: boolean;\n /**\n * @title 是否分组\n * @default false\n */\n readonly isGroup?: boolean;\n}\n"]}
|
|
@@ -1,16 +1,28 @@
|
|
|
1
1
|
import { Options, StyleAttr, ColorAttr, Statistic } from '../../types';
|
|
2
2
|
/** mini 图类型定义需要 omit 很多的 G2 Options 配置 */
|
|
3
3
|
export interface RingProgressOptions extends Omit<Options, 'data' | 'tooltip' | 'legend' | 'label' | 'color'> {
|
|
4
|
-
/**
|
|
4
|
+
/**
|
|
5
|
+
* @title 进度百分比
|
|
6
|
+
*/
|
|
5
7
|
readonly percent: number;
|
|
6
|
-
/**
|
|
8
|
+
/**
|
|
9
|
+
* @title 外环的半径
|
|
10
|
+
*/
|
|
7
11
|
readonly radius?: number;
|
|
8
|
-
/**
|
|
12
|
+
/**
|
|
13
|
+
* @title 内环的半径
|
|
14
|
+
*/
|
|
9
15
|
readonly innerRadius?: number;
|
|
10
|
-
/**
|
|
16
|
+
/**
|
|
17
|
+
* @title 进度条颜色
|
|
18
|
+
*/
|
|
11
19
|
readonly color?: ColorAttr;
|
|
12
|
-
/**
|
|
20
|
+
/**
|
|
21
|
+
* @title 进度条样式
|
|
22
|
+
*/
|
|
13
23
|
readonly progressStyle?: StyleAttr;
|
|
14
|
-
/**
|
|
24
|
+
/**
|
|
25
|
+
* @title 统计内容组件
|
|
26
|
+
*/
|
|
15
27
|
readonly statistic?: Statistic;
|
|
16
28
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/plots/ring-progress/types.ts"],"names":[],"mappings":"","sourcesContent":["import { Options, StyleAttr, ColorAttr, Statistic } from '../../types';\n\n/** mini 图类型定义需要 omit 很多的 G2 Options 配置 */\nexport interface RingProgressOptions extends Omit<Options, 'data' | 'tooltip' | 'legend' | 'label' | 'color'> {\n
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/plots/ring-progress/types.ts"],"names":[],"mappings":"","sourcesContent":["import { Options, StyleAttr, ColorAttr, Statistic } from '../../types';\n\n/** mini 图类型定义需要 omit 很多的 G2 Options 配置 */\nexport interface RingProgressOptions extends Omit<Options, 'data' | 'tooltip' | 'legend' | 'label' | 'color'> {\n /**\n * @title 进度百分比\n */\n readonly percent: number;\n /**\n * @title 外环的半径\n */\n readonly radius?: number;\n /**\n * @title 内环的半径\n */\n readonly innerRadius?: number;\n /**\n * @title 进度条颜色\n */\n readonly color?: ColorAttr;\n /**\n * @title 进度条样式\n */\n readonly progressStyle?: StyleAttr;\n /**\n * @title 统计内容组件\n */\n readonly statistic?: Statistic;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constant.js","sourceRoot":"","sources":["../../../src/plots/rose/constant.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AACvC,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC;;GAEG;AACH,MAAM,CAAC,IAAM,eAAe,GAAG,UAAU,CAAC,EAAE,EAAE,IAAI,CAAC,iBAAiB,EAAE,EAAE;IACtE,KAAK,EAAE,KAAK;IACZ,KAAK,EAAE,KAAK;IACZ,MAAM,EAAE;QACN,QAAQ,EAAE,OAAO;
|
|
1
|
+
{"version":3,"file":"constant.js","sourceRoot":"","sources":["../../../src/plots/rose/constant.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AACvC,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC;;GAEG;AACH,MAAM,CAAC,IAAM,eAAe,GAAG,UAAU,CAAC,EAAE,EAAE,IAAI,CAAC,iBAAiB,EAAE,EAAE;IACtE,KAAK,EAAE,KAAK;IACZ,KAAK,EAAE,KAAK;IACZ,MAAM,EAAE;QACN,QAAQ,EAAE,OAAO;QACjB,KAAK,EAAE,EAAE;KACV;IACD,WAAW,EAAE;QACX,MAAM,EAAE,MAAM;QACd,SAAS,EAAE,CAAC;KACb;IACD,KAAK,EAAE;QACL,MAAM,EAAE;YACN,IAAI,EAAE,gBAAgB;SACvB;KACF;IACD,OAAO,EAAE;QACP,MAAM,EAAE,IAAI;QACZ,WAAW,EAAE,KAAK;KACnB;IACD,YAAY,EAAE,CAAC,EAAE,IAAI,EAAE,eAAe,EAAE,CAAC;CAC1C,CAAC,CAAC","sourcesContent":["import { Plot } from '../../core/plot';\nimport { deepAssign } from '../../utils';\n\n/**\n * 玫瑰图 默认配置项\n */\nexport const DEFAULT_OPTIONS = deepAssign({}, Plot.getDefaultOptions(), {\n xAxis: false,\n yAxis: false,\n legend: {\n position: 'right',\n radio: {},\n },\n sectorStyle: {\n stroke: '#fff',\n lineWidth: 1,\n },\n label: {\n layout: {\n type: 'limit-in-shape',\n },\n },\n tooltip: {\n shared: true,\n showMarkers: false,\n },\n interactions: [{ type: 'active-region' }],\n});\n"]}
|
|
@@ -1,29 +1,49 @@
|
|
|
1
1
|
import { Options, StyleAttr } from '../../types';
|
|
2
2
|
export interface RoseOptions extends Options {
|
|
3
|
-
/**
|
|
3
|
+
/**
|
|
4
|
+
* @title 扇形切片分类所对应的数据字段名
|
|
5
|
+
* @description 每个扇形的弧度相等
|
|
6
|
+
*/
|
|
4
7
|
readonly xField: string;
|
|
5
|
-
/**
|
|
8
|
+
/**
|
|
9
|
+
* @title 扇形切片半径长度所对应的数据字段名
|
|
10
|
+
*/
|
|
6
11
|
readonly yField: string;
|
|
7
|
-
/**
|
|
12
|
+
/**
|
|
13
|
+
* @title 拆分字段
|
|
14
|
+
*/
|
|
8
15
|
readonly seriesField?: string;
|
|
9
|
-
/**
|
|
16
|
+
/**
|
|
17
|
+
* @title 是否分组玫瑰图
|
|
18
|
+
* @default false
|
|
19
|
+
*/
|
|
10
20
|
readonly isGroup?: boolean;
|
|
11
|
-
/**
|
|
21
|
+
/**
|
|
22
|
+
* @title 是否堆积玫瑰图
|
|
23
|
+
* @default false
|
|
24
|
+
*/
|
|
12
25
|
readonly isStack?: boolean;
|
|
13
26
|
/**
|
|
14
|
-
*
|
|
15
|
-
* 1 代表玫瑰图大小为 1,即撑满绘图区域
|
|
27
|
+
* @title 玫瑰图的半径
|
|
28
|
+
* @description 原点为画布中心。配置值域为 (0,1] 1 代表玫瑰图大小为 1,即撑满绘图区域
|
|
16
29
|
*/
|
|
17
30
|
readonly radius?: number;
|
|
18
|
-
/**
|
|
31
|
+
/**
|
|
32
|
+
* @title 内部空心圆的半径
|
|
33
|
+
* @description 规则与 radius 一致
|
|
34
|
+
*/
|
|
19
35
|
readonly innerRadius?: number;
|
|
20
|
-
/**
|
|
36
|
+
/**
|
|
37
|
+
* @title 玫瑰图开始角度
|
|
38
|
+
*/
|
|
21
39
|
readonly startAngle?: number;
|
|
22
|
-
/**
|
|
40
|
+
/**
|
|
41
|
+
* @title 玫瑰图结束角度
|
|
42
|
+
*/
|
|
23
43
|
readonly endAngle?: number;
|
|
24
44
|
/**
|
|
25
|
-
*
|
|
26
|
-
* sectorStyle 可以直接指定,也可以通过 callback 的方式,根据数据为每个扇形切片指定单独的样式
|
|
45
|
+
* @title 设置扇形样式
|
|
46
|
+
* @description sectorStyle 中的fill会覆盖 color 的配置,sectorStyle 可以直接指定,也可以通过 callback 的方式,根据数据为每个扇形切片指定单独的样式
|
|
27
47
|
*/
|
|
28
48
|
readonly sectorStyle?: StyleAttr;
|
|
29
49
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/plots/rose/types.ts"],"names":[],"mappings":"","sourcesContent":["import { Options, StyleAttr } from '../../types';\n\nexport interface RoseOptions extends Options {\n
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/plots/rose/types.ts"],"names":[],"mappings":"","sourcesContent":["import { Options, StyleAttr } from '../../types';\n\nexport interface RoseOptions extends Options {\n /**\n * @title 扇形切片分类所对应的数据字段名\n * @description 每个扇形的弧度相等\n */\n readonly xField: string;\n /**\n * @title 扇形切片半径长度所对应的数据字段名\n */\n readonly yField: string;\n /**\n * @title 拆分字段\n */\n readonly seriesField?: string;\n /**\n * @title 是否分组玫瑰图\n * @default false\n */\n readonly isGroup?: boolean;\n /**\n * @title 是否堆积玫瑰图\n * @default false\n */\n readonly isStack?: boolean;\n /**\n * @title 玫瑰图的半径\n * @description 原点为画布中心。配置值域为 (0,1] 1 代表玫瑰图大小为 1,即撑满绘图区域\n */\n readonly radius?: number;\n /**\n * @title 内部空心圆的半径\n * @description 规则与 radius 一致\n */\n readonly innerRadius?: number;\n /**\n * @title 玫瑰图开始角度\n */\n readonly startAngle?: number;\n /**\n * @title 玫瑰图结束角度\n */\n readonly endAngle?: number;\n /**\n * @title 设置扇形样式\n * @description sectorStyle 中的fill会覆盖 color 的配置,sectorStyle 可以直接指定,也可以通过 callback 的方式,根据数据为每个扇形切片指定单独的样式\n */\n readonly sectorStyle?: StyleAttr;\n}\n"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { __spreadArrays } from "tslib";
|
|
2
2
|
import { uniq } from '@antv/util';
|
|
3
|
-
import {
|
|
4
|
-
import { deepAssign, flow } from '../../utils';
|
|
3
|
+
import { theme } from '../../adaptor/common';
|
|
4
|
+
import { deepAssign, findViewById, flow } from '../../utils';
|
|
5
5
|
import { polygon, edge } from '../../adaptor/geometries';
|
|
6
6
|
import { transformToViewsData } from './helper';
|
|
7
7
|
import { X_FIELD, Y_FIELD, COLOR_FIELD, EDGES_VIEW_ID, NODES_VIEW_ID } from './constant';
|
|
@@ -121,6 +121,35 @@ export function nodeDraggable(params) {
|
|
|
121
121
|
}
|
|
122
122
|
return params;
|
|
123
123
|
}
|
|
124
|
+
/**
|
|
125
|
+
* Interaction 配置
|
|
126
|
+
* @param params
|
|
127
|
+
*/
|
|
128
|
+
function interaction(params) {
|
|
129
|
+
var chart = params.chart, options = params.options;
|
|
130
|
+
var _a = options.interactions, interactions = _a === void 0 ? [] : _a;
|
|
131
|
+
var nodeInteractions = [].concat(interactions, options.nodeInteractions || []);
|
|
132
|
+
var edgeInteractions = [].concat(interactions, options.edgeInteractions || []);
|
|
133
|
+
var nodeView = findViewById(chart, NODES_VIEW_ID);
|
|
134
|
+
var edgeView = findViewById(chart, EDGES_VIEW_ID);
|
|
135
|
+
nodeInteractions.forEach(function (i) {
|
|
136
|
+
if ((i === null || i === void 0 ? void 0 : i.enable) === false) {
|
|
137
|
+
nodeView.removeInteraction(i.type);
|
|
138
|
+
}
|
|
139
|
+
else {
|
|
140
|
+
nodeView.interaction(i.type, i.cfg || {});
|
|
141
|
+
}
|
|
142
|
+
});
|
|
143
|
+
edgeInteractions.forEach(function (i) {
|
|
144
|
+
if ((i === null || i === void 0 ? void 0 : i.enable) === false) {
|
|
145
|
+
edgeView.removeInteraction(i.type);
|
|
146
|
+
}
|
|
147
|
+
else {
|
|
148
|
+
edgeView.interaction(i.type, i.cfg || {});
|
|
149
|
+
}
|
|
150
|
+
});
|
|
151
|
+
return params;
|
|
152
|
+
}
|
|
124
153
|
/**
|
|
125
154
|
* 图适配器
|
|
126
155
|
* @param chart
|
|
@@ -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,
|
|
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;AAE7C,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAC7D,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAEhD,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAEzF;;;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,UAAU,CACf,EAAE,EACF;QACE,OAAO,EAAE;YACP,OAAO,EAAE;gBACP,MAAM,EAAE,IAAI,iBAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,GAAK,SAAS,EAAE;aAC5E;YACD,KAAK,EAAE;gBACL,MAAM,EAAE,IAAI,iBAAE,GAAG,EAAE,MAA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IAAM,QAAQ,GAAG,YAAY,CAAC,KAAK,EAAE,aAAa,CAAC,CAAC;IACpD,IAAM,QAAQ,GAAG,YAAY,CAAC,KAAK,EAAE,aAAa,CAAC,CAAC;IAEpD,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,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 { Params } from '../../core/adaptor';\nimport { deepAssign, findViewById, flow } from '../../utils';\nimport { polygon, edge } from '../../adaptor/geometries';\nimport { transformToViewsData } from './helper';\nimport { SankeyOptions } from './types';\nimport { X_FIELD, Y_FIELD, COLOR_FIELD, EDGES_VIEW_ID, NODES_VIEW_ID } from './constant';\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 // 同时设置整个 view 动画选项\n if (typeof animation === 'boolean') {\n chart.animate(animation);\n } else {\n chart.animate(true);\n }\n\n const geometries = [...chart.views[0].geometries, ...chart.views[1].geometries];\n\n // 所有的 Geometry 都使用同一动画(各个图形如有区别,自行覆盖)\n geometries.forEach((g) => {\n g.animate(animation);\n });\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,116 +1,143 @@
|
|
|
1
1
|
import { Data, Options, State, StyleAttr } from '../../types';
|
|
2
2
|
import { NodeDepth, NodeSort } from './layout';
|
|
3
3
|
/**
|
|
4
|
-
* node-link 数据类型的结构
|
|
4
|
+
* @title node-link 数据类型的结构
|
|
5
5
|
*/
|
|
6
6
|
export declare type NodeLinkData = {
|
|
7
7
|
/**
|
|
8
|
-
* 节点数据
|
|
8
|
+
* @title 节点数据
|
|
9
9
|
*/
|
|
10
10
|
readonly nodes: {
|
|
11
11
|
/**
|
|
12
|
-
* id
|
|
12
|
+
* @title id
|
|
13
|
+
* @description 唯一即可,一般可以直接等于 name
|
|
13
14
|
*/
|
|
14
15
|
readonly id: string;
|
|
15
16
|
/**
|
|
16
|
-
*
|
|
17
|
+
* @title 节点的名称
|
|
18
|
+
* @description 用于 UI 上的现实
|
|
17
19
|
*/
|
|
18
20
|
readonly name: string;
|
|
19
21
|
/**
|
|
20
|
-
*
|
|
22
|
+
* @title 节点的值
|
|
23
|
+
* @description 不传则节点大小有来源求和决定
|
|
21
24
|
*/
|
|
22
25
|
readonly fixedValue?: number;
|
|
23
26
|
}[];
|
|
24
|
-
/**
|
|
25
|
-
*
|
|
26
|
-
*/
|
|
27
27
|
readonly links: {
|
|
28
28
|
/**
|
|
29
|
-
*
|
|
29
|
+
* @title 来源节点
|
|
30
|
+
* @description 在 nodes 中的 index
|
|
30
31
|
*/
|
|
31
32
|
readonly source: number;
|
|
32
33
|
/**
|
|
33
|
-
*
|
|
34
|
+
* @title 目标节点
|
|
35
|
+
* @description 在 nodes 中的 index
|
|
34
36
|
*/
|
|
35
37
|
readonly target: number;
|
|
36
38
|
/**
|
|
37
|
-
* 边的值
|
|
39
|
+
* @title 边的值
|
|
38
40
|
*/
|
|
39
41
|
readonly value: number;
|
|
40
42
|
}[];
|
|
41
43
|
};
|
|
42
|
-
/**
|
|
44
|
+
/**
|
|
45
|
+
* @title 配置类型定义
|
|
46
|
+
*/
|
|
43
47
|
export interface SankeyOptions extends Omit<Options, 'data' | 'xField' | 'yField' | 'xAxis' | 'yAxis'> {
|
|
44
48
|
/**
|
|
45
|
-
*
|
|
49
|
+
* @title 数据集的类型
|
|
50
|
+
* @description 数据集的类型 'node-link' | 'detail'
|
|
51
|
+
* @default "detail"
|
|
46
52
|
*/
|
|
47
53
|
readonly dataType?: 'node-link' | 'detail';
|
|
48
54
|
/**
|
|
49
|
-
*
|
|
55
|
+
* @title 来源字段
|
|
56
|
+
* @description dataType = 'node-link' 的时候,不用传
|
|
50
57
|
*/
|
|
51
58
|
readonly sourceField?: string;
|
|
52
59
|
/**
|
|
53
|
-
*
|
|
60
|
+
* @title 去向字段
|
|
61
|
+
* @description dataType = 'node-link' 的时候,不用传
|
|
54
62
|
*/
|
|
55
63
|
readonly targetField?: string;
|
|
56
64
|
/**
|
|
57
|
-
*
|
|
65
|
+
* @title 权重字段
|
|
66
|
+
* @description dataType = 'node-link' 的时候,不用传
|
|
58
67
|
*/
|
|
59
68
|
readonly weightField?: string;
|
|
60
69
|
/**
|
|
61
|
-
*
|
|
70
|
+
* @title 附加的元字段
|
|
62
71
|
*/
|
|
63
72
|
readonly rawFields?: string[];
|
|
64
73
|
/**
|
|
65
|
-
* 数据
|
|
74
|
+
* @title 数据
|
|
66
75
|
*/
|
|
67
76
|
readonly data: Data | NodeLinkData;
|
|
68
77
|
/**
|
|
69
|
-
*
|
|
78
|
+
* @title 节点宽度
|
|
79
|
+
* @description 参考画布的宽度
|
|
80
|
+
* @default 0.008
|
|
70
81
|
*/
|
|
71
82
|
readonly nodeWidthRatio?: number;
|
|
72
83
|
/**
|
|
73
|
-
*
|
|
84
|
+
* @title 节点宽度的像素设置
|
|
85
|
+
* @description 优先级高于 nodeWidthRatio
|
|
74
86
|
*/
|
|
75
87
|
readonly nodeWidth?: number;
|
|
76
88
|
/**
|
|
77
|
-
*
|
|
89
|
+
* @title 节点之间的间距比例
|
|
90
|
+
* @description 参考画布高度
|
|
91
|
+
* @default 0.03
|
|
78
92
|
*/
|
|
79
93
|
readonly nodePaddingRatio?: number;
|
|
80
94
|
/**
|
|
81
|
-
*
|
|
95
|
+
* @title 节点间距的像素设置
|
|
96
|
+
* @description 优先级高于 nodePaddingRatio
|
|
82
97
|
*/
|
|
83
98
|
readonly nodePadding?: number;
|
|
84
99
|
/**
|
|
85
|
-
*
|
|
100
|
+
* @title 节点对齐的方式
|
|
101
|
+
* @description 节点对齐的方式 'left' | 'right' | 'center' | 'justify'
|
|
102
|
+
* @default "justify"
|
|
86
103
|
*/
|
|
87
104
|
readonly nodeAlign?: 'left' | 'right' | 'center' | 'justify';
|
|
88
105
|
/**
|
|
89
|
-
*
|
|
106
|
+
* @title 节点排序方式
|
|
90
107
|
*/
|
|
91
108
|
readonly nodeSort?: NodeSort;
|
|
92
109
|
/**
|
|
93
|
-
*
|
|
110
|
+
* @title 节点排放分层的顺序
|
|
111
|
+
* @description 从 0 开始,并且返回值需要保证所有的层级都有节点
|
|
94
112
|
*/
|
|
95
113
|
readonly nodeDepth?: NodeDepth;
|
|
96
114
|
/**
|
|
97
|
-
* 节点样式
|
|
115
|
+
* @title 节点样式
|
|
98
116
|
*/
|
|
99
117
|
readonly nodeStyle?: StyleAttr;
|
|
100
118
|
/**
|
|
101
|
-
* 节点状态样式
|
|
119
|
+
* @title 节点状态样式
|
|
102
120
|
*/
|
|
103
121
|
readonly nodeState?: State;
|
|
104
122
|
/**
|
|
105
|
-
* 边样式
|
|
123
|
+
* @title 边样式
|
|
106
124
|
*/
|
|
107
125
|
readonly edgeStyle?: StyleAttr;
|
|
108
126
|
/**
|
|
109
|
-
* 边状态样式
|
|
127
|
+
* @title 边状态样式
|
|
110
128
|
*/
|
|
111
129
|
readonly edgeState?: State;
|
|
112
130
|
/**
|
|
113
|
-
*
|
|
131
|
+
* @title 节点位置是否可以拖拽
|
|
132
|
+
* @default false
|
|
114
133
|
*/
|
|
115
134
|
readonly nodeDraggable?: boolean;
|
|
135
|
+
/**
|
|
136
|
+
* @title 边交互
|
|
137
|
+
*/
|
|
138
|
+
readonly edgeInteractions?: Options['interactions'];
|
|
139
|
+
/**
|
|
140
|
+
* @title 节点交互
|
|
141
|
+
*/
|
|
142
|
+
readonly nodeInteractions?: Options['interactions'];
|
|
116
143
|
}
|