@antv/g2plot 2.4.15 → 2.4.18

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.
Files changed (63) hide show
  1. package/dist/g2plot.min.js +3 -17
  2. package/dist/g2plot.min.js.map +1 -1
  3. package/esm/adaptor/geometries/area.js +2 -1
  4. package/esm/adaptor/geometries/area.js.map +1 -1
  5. package/esm/adaptor/geometries/edge.js +2 -1
  6. package/esm/adaptor/geometries/edge.js.map +1 -1
  7. package/esm/adaptor/geometries/interval.js +9 -2
  8. package/esm/adaptor/geometries/interval.js.map +1 -1
  9. package/esm/adaptor/geometries/line.js +2 -2
  10. package/esm/adaptor/geometries/line.js.map +1 -1
  11. package/esm/adaptor/geometries/point.js +2 -1
  12. package/esm/adaptor/geometries/point.js.map +1 -1
  13. package/esm/adaptor/geometries/polygon.js +2 -1
  14. package/esm/adaptor/geometries/polygon.js.map +1 -1
  15. package/esm/adaptor/geometries/schema.js +2 -1
  16. package/esm/adaptor/geometries/schema.js.map +1 -1
  17. package/esm/adaptor/pattern.d.ts +1 -1
  18. package/esm/index.d.ts +1 -1
  19. package/esm/index.js +1 -1
  20. package/esm/index.js.map +1 -1
  21. package/esm/plots/pie/adaptor.js +8 -5
  22. package/esm/plots/pie/adaptor.js.map +1 -1
  23. package/esm/plots/sankey/layout.js +14 -3
  24. package/esm/plots/sankey/layout.js.map +1 -1
  25. package/esm/types/common.d.ts +6 -0
  26. package/esm/types/common.js.map +1 -1
  27. package/lib/adaptor/geometries/area.js +2 -1
  28. package/lib/adaptor/geometries/area.js.map +1 -1
  29. package/lib/adaptor/geometries/edge.js +2 -1
  30. package/lib/adaptor/geometries/edge.js.map +1 -1
  31. package/lib/adaptor/geometries/interval.js +9 -2
  32. package/lib/adaptor/geometries/interval.js.map +1 -1
  33. package/lib/adaptor/geometries/line.js +2 -2
  34. package/lib/adaptor/geometries/line.js.map +1 -1
  35. package/lib/adaptor/geometries/point.js +2 -1
  36. package/lib/adaptor/geometries/point.js.map +1 -1
  37. package/lib/adaptor/geometries/polygon.js +2 -1
  38. package/lib/adaptor/geometries/polygon.js.map +1 -1
  39. package/lib/adaptor/geometries/schema.js +2 -1
  40. package/lib/adaptor/geometries/schema.js.map +1 -1
  41. package/lib/adaptor/pattern.d.ts +1 -1
  42. package/lib/index.d.ts +1 -1
  43. package/lib/index.js +1 -1
  44. package/lib/index.js.map +1 -1
  45. package/lib/plots/pie/adaptor.js +8 -5
  46. package/lib/plots/pie/adaptor.js.map +1 -1
  47. package/lib/plots/sankey/layout.js +14 -3
  48. package/lib/plots/sankey/layout.js.map +1 -1
  49. package/lib/types/common.d.ts +6 -0
  50. package/lib/types/common.js.map +1 -1
  51. package/package.json +2 -1
  52. package/src/adaptor/geometries/area.ts +2 -1
  53. package/src/adaptor/geometries/edge.ts +2 -1
  54. package/src/adaptor/geometries/interval.ts +9 -1
  55. package/src/adaptor/geometries/line.ts +2 -2
  56. package/src/adaptor/geometries/point.ts +2 -1
  57. package/src/adaptor/geometries/polygon.ts +2 -1
  58. package/src/adaptor/geometries/schema.ts +2 -1
  59. package/src/index.ts +1 -1
  60. package/src/plots/pie/adaptor.ts +8 -5
  61. package/src/plots/sankey/layout.ts +34 -21
  62. package/src/types/common.ts +6 -0
  63. package/CHANGELOG.md +0 -1521
@@ -8,7 +8,7 @@ import { geometry } from './base';
8
8
  */
9
9
  export function area(params) {
10
10
  var options = params.options;
11
- var area = options.area, xField = options.xField, yField = options.yField, seriesField = options.seriesField, smooth = options.smooth, tooltip = options.tooltip;
11
+ var area = options.area, xField = options.xField, yField = options.yField, seriesField = options.seriesField, smooth = options.smooth, tooltip = options.tooltip, useDeferredLabel = options.useDeferredLabel;
12
12
  var _a = getTooltipMapping(tooltip, [xField, yField, seriesField]), fields = _a.fields, formatter = _a.formatter;
13
13
  // 如果存在才处理
14
14
  return area
@@ -18,6 +18,7 @@ export function area(params) {
18
18
  colorField: seriesField,
19
19
  tooltipFields: fields,
20
20
  mapping: __assign({ shape: smooth ? 'smooth' : 'area', tooltip: formatter }, area),
21
+ args: { useDeferredLabel: useDeferredLabel },
21
22
  },
22
23
  }))
23
24
  : params;
@@ -1 +1 @@
1
- {"version":3,"file":"area.js","sourceRoot":"","sources":["../../../src/adaptor/geometries/area.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAmB,QAAQ,EAAkB,MAAM,QAAQ,CAAC;AAenE;;;GAGG;AACH,MAAM,UAAU,IAAI,CAAgC,MAAiB;IAC3D,IAAA,OAAO,GAAK,MAAM,QAAX,CAAY;IACnB,IAAA,IAAI,GAAmD,OAAO,KAA1D,EAAE,MAAM,GAA2C,OAAO,OAAlD,EAAE,MAAM,GAAmC,OAAO,OAA1C,EAAE,WAAW,GAAsB,OAAO,YAA7B,EAAE,MAAM,GAAc,OAAO,OAArB,EAAE,OAAO,GAAK,OAAO,QAAZ,CAAa;IAEjE,IAAA,KAAwB,iBAAiB,CAAC,OAAO,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,WAAW,CAAC,CAAC,EAA/E,MAAM,YAAA,EAAE,SAAS,eAA8D,CAAC;IAExF,UAAU;IACV,OAAO,IAAI;QACT,CAAC,CAAC,QAAQ,CACN,UAAU,CAAC,EAAE,EAAE,MAAM,EAAE;YACrB,OAAO,EAAE;gBACP,IAAI,EAAE,MAAM;gBACZ,UAAU,EAAE,WAAW;gBACvB,aAAa,EAAE,MAAM;gBACrB,OAAO,aACL,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,EACjC,OAAO,EAAE,SAAS,IACf,IAAI,CACR;aACF;SACF,CAAC,CACH;QACH,CAAC,CAAC,MAAM,CAAC;AACb,CAAC","sourcesContent":["import { Params } from '../../core/adaptor';\nimport { getTooltipMapping } from '../../utils/tooltip';\nimport { deepAssign } from '../../utils';\nimport { GeometryOptions, geometry, MappingOptions } from './base';\n\nexport interface AreaGeometryOptions extends GeometryOptions {\n /** x 轴字段 */\n readonly xField?: string;\n /** y 轴字段 */\n readonly yField?: string;\n /** 分组字段 */\n readonly seriesField?: string;\n /** 是否平滑 */\n readonly smooth?: boolean;\n /** area 图形的样式设置 */\n readonly area?: MappingOptions;\n}\n\n/**\n * area geometry 的配置处理\n * @param params\n */\nexport function area<O extends AreaGeometryOptions>(params: Params<O>): Params<O> {\n const { options } = params;\n const { area, xField, yField, seriesField, smooth, tooltip } = options;\n\n const { fields, formatter } = getTooltipMapping(tooltip, [xField, yField, seriesField]);\n\n // 如果存在才处理\n return area\n ? geometry(\n deepAssign({}, params, {\n options: {\n type: 'area',\n colorField: seriesField,\n tooltipFields: fields,\n mapping: {\n shape: smooth ? 'smooth' : 'area',\n tooltip: formatter,\n ...area,\n },\n },\n })\n )\n : params;\n}\n"]}
1
+ {"version":3,"file":"area.js","sourceRoot":"","sources":["../../../src/adaptor/geometries/area.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAmB,QAAQ,EAAkB,MAAM,QAAQ,CAAC;AAenE;;;GAGG;AACH,MAAM,UAAU,IAAI,CAAgC,MAAiB;IAC3D,IAAA,OAAO,GAAK,MAAM,QAAX,CAAY;IACnB,IAAA,IAAI,GAAqE,OAAO,KAA5E,EAAE,MAAM,GAA6D,OAAO,OAApE,EAAE,MAAM,GAAqD,OAAO,OAA5D,EAAE,WAAW,GAAwC,OAAO,YAA/C,EAAE,MAAM,GAAgC,OAAO,OAAvC,EAAE,OAAO,GAAuB,OAAO,QAA9B,EAAE,gBAAgB,GAAK,OAAO,iBAAZ,CAAa;IAEnF,IAAA,KAAwB,iBAAiB,CAAC,OAAO,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,WAAW,CAAC,CAAC,EAA/E,MAAM,YAAA,EAAE,SAAS,eAA8D,CAAC;IAExF,UAAU;IACV,OAAO,IAAI;QACT,CAAC,CAAC,QAAQ,CACN,UAAU,CAAC,EAAE,EAAE,MAAM,EAAE;YACrB,OAAO,EAAE;gBACP,IAAI,EAAE,MAAM;gBACZ,UAAU,EAAE,WAAW;gBACvB,aAAa,EAAE,MAAM;gBACrB,OAAO,aACL,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,EACjC,OAAO,EAAE,SAAS,IACf,IAAI,CACR;gBACD,IAAI,EAAE,EAAE,gBAAgB,kBAAA,EAAE;aAC3B;SACF,CAAC,CACH;QACH,CAAC,CAAC,MAAM,CAAC;AACb,CAAC","sourcesContent":["import { Params } from '../../core/adaptor';\nimport { getTooltipMapping } from '../../utils/tooltip';\nimport { deepAssign } from '../../utils';\nimport { GeometryOptions, geometry, MappingOptions } from './base';\n\nexport interface AreaGeometryOptions extends GeometryOptions {\n /** x 轴字段 */\n readonly xField?: string;\n /** y 轴字段 */\n readonly yField?: string;\n /** 分组字段 */\n readonly seriesField?: string;\n /** 是否平滑 */\n readonly smooth?: boolean;\n /** area 图形的样式设置 */\n readonly area?: MappingOptions;\n}\n\n/**\n * area geometry 的配置处理\n * @param params\n */\nexport function area<O extends AreaGeometryOptions>(params: Params<O>): Params<O> {\n const { options } = params;\n const { area, xField, yField, seriesField, smooth, tooltip, useDeferredLabel } = options;\n\n const { fields, formatter } = getTooltipMapping(tooltip, [xField, yField, seriesField]);\n\n // 如果存在才处理\n return area\n ? geometry(\n deepAssign({}, params, {\n options: {\n type: 'area',\n colorField: seriesField,\n tooltipFields: fields,\n mapping: {\n shape: smooth ? 'smooth' : 'area',\n tooltip: formatter,\n ...area,\n },\n args: { useDeferredLabel },\n },\n })\n )\n : params;\n}\n"]}
@@ -8,7 +8,7 @@ import { geometry } from './base';
8
8
  */
9
9
  export function edge(params) {
10
10
  var options = params.options;
11
- var edge = options.edge, xField = options.xField, yField = options.yField, seriesField = options.seriesField, tooltip = options.tooltip;
11
+ var edge = options.edge, xField = options.xField, yField = options.yField, seriesField = options.seriesField, tooltip = options.tooltip, useDeferredLabel = options.useDeferredLabel;
12
12
  var _a = getTooltipMapping(tooltip, [xField, yField, seriesField]), fields = _a.fields, formatter = _a.formatter;
13
13
  return edge
14
14
  ? geometry(deepAssign({}, params, {
@@ -17,6 +17,7 @@ export function edge(params) {
17
17
  colorField: seriesField,
18
18
  tooltipFields: fields,
19
19
  mapping: __assign({ tooltip: formatter }, edge),
20
+ args: { useDeferredLabel: useDeferredLabel },
20
21
  },
21
22
  }))
22
23
  : params;
@@ -1 +1 @@
1
- {"version":3,"file":"edge.js","sourceRoot":"","sources":["../../../src/adaptor/geometries/edge.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAmC,MAAM,QAAQ,CAAC;AAanE;;;GAGG;AACH,MAAM,UAAU,IAAI,CAAgC,MAAiB;IAC3D,IAAA,OAAO,GAAK,MAAM,QAAX,CAAY;IACnB,IAAA,IAAI,GAA2C,OAAO,KAAlD,EAAE,MAAM,GAAmC,OAAO,OAA1C,EAAE,MAAM,GAA2B,OAAO,OAAlC,EAAE,WAAW,GAAc,OAAO,YAArB,EAAE,OAAO,GAAK,OAAO,QAAZ,CAAa;IAEzD,IAAA,KAAwB,iBAAiB,CAAC,OAAO,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,WAAW,CAAC,CAAC,EAA/E,MAAM,YAAA,EAAE,SAAS,eAA8D,CAAC;IAExF,OAAO,IAAI;QACT,CAAC,CAAC,QAAQ,CACN,UAAU,CAAC,EAAE,EAAE,MAAM,EAAE;YACrB,OAAO,EAAE;gBACP,IAAI,EAAE,MAAM;gBACZ,UAAU,EAAE,WAAW;gBACvB,aAAa,EAAE,MAAM;gBACrB,OAAO,aACL,OAAO,EAAE,SAAS,IACf,IAAI,CACR;aACF;SACF,CAAC,CACH;QACH,CAAC,CAAC,MAAM,CAAC;AACb,CAAC","sourcesContent":["import { Params } from '../../core/adaptor';\nimport { getTooltipMapping } from '../../utils/tooltip';\nimport { deepAssign } from '../../utils';\nimport { geometry, MappingOptions, GeometryOptions } from './base';\n\nexport interface EdgeGeometryOptions extends GeometryOptions {\n /** x 轴字段 */\n readonly xField?: string;\n /** y 轴字段 */\n readonly yField?: string;\n /** 分组颜色字段 */\n readonly seriesField?: string;\n /** edge 图形映射规则 */\n readonly edge?: MappingOptions;\n}\n\n/**\n * edge 的配置处理\n * @param params\n */\nexport function edge<O extends EdgeGeometryOptions>(params: Params<O>): Params<O> {\n const { options } = params;\n const { edge, xField, yField, seriesField, tooltip } = options;\n\n const { fields, formatter } = getTooltipMapping(tooltip, [xField, yField, seriesField]);\n\n return edge\n ? geometry(\n deepAssign({}, params, {\n options: {\n type: 'edge',\n colorField: seriesField,\n tooltipFields: fields,\n mapping: {\n tooltip: formatter,\n ...edge,\n },\n },\n })\n )\n : params;\n}\n"]}
1
+ {"version":3,"file":"edge.js","sourceRoot":"","sources":["../../../src/adaptor/geometries/edge.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAmC,MAAM,QAAQ,CAAC;AAanE;;;GAGG;AACH,MAAM,UAAU,IAAI,CAAgC,MAAiB;IAC3D,IAAA,OAAO,GAAK,MAAM,QAAX,CAAY;IACnB,IAAA,IAAI,GAA6D,OAAO,KAApE,EAAE,MAAM,GAAqD,OAAO,OAA5D,EAAE,MAAM,GAA6C,OAAO,OAApD,EAAE,WAAW,GAAgC,OAAO,YAAvC,EAAE,OAAO,GAAuB,OAAO,QAA9B,EAAE,gBAAgB,GAAK,OAAO,iBAAZ,CAAa;IAE3E,IAAA,KAAwB,iBAAiB,CAAC,OAAO,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,WAAW,CAAC,CAAC,EAA/E,MAAM,YAAA,EAAE,SAAS,eAA8D,CAAC;IAExF,OAAO,IAAI;QACT,CAAC,CAAC,QAAQ,CACN,UAAU,CAAC,EAAE,EAAE,MAAM,EAAE;YACrB,OAAO,EAAE;gBACP,IAAI,EAAE,MAAM;gBACZ,UAAU,EAAE,WAAW;gBACvB,aAAa,EAAE,MAAM;gBACrB,OAAO,aACL,OAAO,EAAE,SAAS,IACf,IAAI,CACR;gBACD,IAAI,EAAE,EAAE,gBAAgB,kBAAA,EAAE;aAC3B;SACF,CAAC,CACH;QACH,CAAC,CAAC,MAAM,CAAC;AACb,CAAC","sourcesContent":["import { Params } from '../../core/adaptor';\nimport { getTooltipMapping } from '../../utils/tooltip';\nimport { deepAssign } from '../../utils';\nimport { geometry, MappingOptions, GeometryOptions } from './base';\n\nexport interface EdgeGeometryOptions extends GeometryOptions {\n /** x 轴字段 */\n readonly xField?: string;\n /** y 轴字段 */\n readonly yField?: string;\n /** 分组颜色字段 */\n readonly seriesField?: string;\n /** edge 图形映射规则 */\n readonly edge?: MappingOptions;\n}\n\n/**\n * edge 的配置处理\n * @param params\n */\nexport function edge<O extends EdgeGeometryOptions>(params: Params<O>): Params<O> {\n const { options } = params;\n const { edge, xField, yField, seriesField, tooltip, useDeferredLabel } = options;\n\n const { fields, formatter } = getTooltipMapping(tooltip, [xField, yField, seriesField]);\n\n return edge\n ? geometry(\n deepAssign({}, params, {\n options: {\n type: 'edge',\n colorField: seriesField,\n tooltipFields: fields,\n mapping: {\n tooltip: formatter,\n ...edge,\n },\n args: { useDeferredLabel },\n },\n })\n )\n : params;\n}\n"]}
@@ -47,7 +47,7 @@ function otherAdaptor(params) {
47
47
  }
48
48
  export function interval(params) {
49
49
  var options = params.options;
50
- var xField = options.xField, yField = options.yField, interval = options.interval, seriesField = options.seriesField, tooltip = options.tooltip, minColumnWidth = options.minColumnWidth, maxColumnWidth = options.maxColumnWidth, columnBackground = options.columnBackground, dodgePadding = options.dodgePadding, intervalPadding = options.intervalPadding;
50
+ var xField = options.xField, yField = options.yField, interval = options.interval, seriesField = options.seriesField, tooltip = options.tooltip, minColumnWidth = options.minColumnWidth, maxColumnWidth = options.maxColumnWidth, columnBackground = options.columnBackground, dodgePadding = options.dodgePadding, intervalPadding = options.intervalPadding, useDeferredLabel = options.useDeferredLabel;
51
51
  var _a = getTooltipMapping(tooltip, [xField, yField, seriesField]), fields = _a.fields, formatter = _a.formatter;
52
52
  // 保障一定要存在 interval 映射
53
53
  var ext = (interval
@@ -57,7 +57,14 @@ export function interval(params) {
57
57
  colorField: seriesField,
58
58
  tooltipFields: fields,
59
59
  mapping: __assign({ tooltip: formatter }, interval),
60
- args: { dodgePadding: dodgePadding, intervalPadding: intervalPadding, minColumnWidth: minColumnWidth, maxColumnWidth: maxColumnWidth, background: columnBackground },
60
+ args: {
61
+ dodgePadding: dodgePadding,
62
+ intervalPadding: intervalPadding,
63
+ minColumnWidth: minColumnWidth,
64
+ maxColumnWidth: maxColumnWidth,
65
+ background: columnBackground,
66
+ useDeferredLabel: useDeferredLabel,
67
+ },
61
68
  },
62
69
  }))
63
70
  : params).ext;
@@ -1 +1 @@
1
- {"version":3,"file":"interval.js","sourceRoot":"","sources":["../../../src/adaptor/geometries/interval.ts"],"names":[],"mappings":";AAAA,OAAO,EAAY,QAAQ,EAAc,MAAM,UAAU,CAAC;AAC1D,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAE7C,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAmC,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAiCnE;;;GAGG;AACH,SAAS,YAAY,CAAoC,MAAiB;IAChE,IAAA,KAAK,GAAmB,MAAM,MAAzB,EAAE,OAAO,GAA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AAiB;IACnE,IAAA,OAAO,GAAK,MAAM,QAAX,CAAY;IAEzB,IAAA,MAAM,GAUJ,OAAO,OAVH,EACN,MAAM,GASJ,OAAO,OATH,EACN,QAAQ,GAQN,OAAO,SARD,EACR,WAAW,GAOT,OAAO,YAPE,EACX,OAAO,GAML,OAAO,QANF,EACP,cAAc,GAKZ,OAAO,eALK,EACd,cAAc,GAIZ,OAAO,eAJK,EACd,gBAAgB,GAGd,OAAO,iBAHO,EAChB,YAAY,GAEV,OAAO,aAFG,EACZ,eAAe,GACb,OAAO,gBADM,CACL;IAEN,IAAA,KAAwB,iBAAiB,CAAC,OAAO,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,WAAW,CAAC,CAAC,EAA/E,MAAM,YAAA,EAAE,SAAS,eAA8D,CAAC;IAExF,sBAAsB;IACd,IAAA,GAAG,GAAK,CAAA,QAAQ;QACtB,CAAC,CAAC,QAAQ,CACN,UAAU,CAAC,EAAE,EAAE,MAAM,EAAE;YACrB,OAAO,EAAE;gBACP,IAAI,EAAE,UAAU;gBAChB,UAAU,EAAE,WAAW;gBACvB,aAAa,EAAE,MAAM;gBACrB,OAAO,aACL,OAAO,EAAE,SAAS,IACf,QAAQ,CACZ;gBACD,IAAI,EAAE,EAAE,YAAY,cAAA,EAAE,eAAe,iBAAA,EAAE,cAAc,gBAAA,EAAE,cAAc,gBAAA,EAAE,UAAU,EAAE,gBAAgB,EAAE;aACtG;SACF,CAAC,CACH;QACH,CAAC,CAAC,MAAM,CAAA,IAfC,CAeA;IAEX,OAAO,YAAY,uBACd,MAAM,KACT,GAAG,KAAA,IACH,CAAC;AACL,CAAC","sourcesContent":["import { Geometry, getTheme, ShapeAttrs } from '@antv/g2';\nimport { isNil, isObject } from '@antv/util';\nimport { Params } from '../../core/adaptor';\nimport { deepAssign } from '../../utils';\nimport { getTooltipMapping } from '../../utils/tooltip';\nimport { GeometryOptions, MappingOptions, geometry } from './base';\n\nexport interface IntervalGeometryOptions extends GeometryOptions {\n /** x 轴字段 */\n readonly xField: string;\n /** y 轴字段 */\n readonly yField: string;\n /** 拆分字段,在分组柱状图下同 groupField、colorField,在堆积柱状图下同 stackField、colorField */\n readonly seriesField?: string;\n /** 是否分组柱形图 */\n readonly isGroup?: boolean;\n /** 是否堆积柱状图 */\n readonly isStack?: boolean;\n /** 柱状图宽度占比 [0-1] */\n readonly widthRatio?: number;\n /** 分组间柱子之间的组间间距(像素级),仅对分组柱状图适用 */\n readonly intervalPadding?: number;\n /** 分组中柱子之间的间距 [0-1],仅对分组柱状图适用 */\n readonly marginRatio?: number;\n /** 分组中柱子之间的组内间距(像素级),仅对分组柱状图适用 */\n readonly dodgePadding?: number;\n /** 柱状图最小宽度(像素) */\n readonly minColumnWidth?: number;\n /** 柱状图最大宽度(像素) */\n readonly maxColumnWidth?: number;\n /** 柱子的背景样式设置 */\n readonly columnBackground?: { style: ShapeAttrs };\n /** 柱子视觉通道配置(含 color、shape、size、style、tooltip) */\n readonly interval?: MappingOptions;\n /** 分组字段,优先级高于 seriesField , isGroup: true 时会根据 groupField 进行分组。*/\n readonly groupField?: string;\n}\n\n/**\n * 柱形图其他的 adaptor\n * @param params\n */\nfunction otherAdaptor<O extends IntervalGeometryOptions>(params: Params<O>): Params<O> {\n const { chart, options, ext } = params;\n const { seriesField, isGroup, isStack, marginRatio, widthRatio, groupField, theme } = options;\n\n /**\n * adjust\n */\n const adjust = [];\n if (seriesField) {\n // group\n if (isGroup) {\n adjust.push({\n type: 'dodge',\n dodgeBy: groupField || seriesField,\n marginRatio,\n });\n }\n // stack\n if (isStack) {\n adjust.push({\n type: 'stack',\n marginRatio,\n });\n }\n }\n\n if (adjust.length && ext?.geometry) {\n const g = ext?.geometry as Geometry;\n g.adjust(adjust);\n }\n\n // widthRatio\n if (!isNil(widthRatio)) {\n chart.theme(\n deepAssign({}, isObject(theme) ? theme : getTheme(theme), {\n // columWidthRatio 配置覆盖 theme 中的配置\n columnWidthRatio: widthRatio,\n })\n );\n }\n\n return params;\n}\n\nexport function interval<O extends IntervalGeometryOptions>(params: Params<O>): Params<O> {\n const { options } = params;\n const {\n xField,\n yField,\n interval,\n seriesField,\n tooltip,\n minColumnWidth,\n maxColumnWidth,\n columnBackground,\n dodgePadding,\n intervalPadding,\n } = options;\n\n const { fields, formatter } = getTooltipMapping(tooltip, [xField, yField, seriesField]);\n\n // 保障一定要存在 interval 映射\n const { ext } = interval\n ? geometry(\n deepAssign({}, params, {\n options: {\n type: 'interval',\n colorField: seriesField,\n tooltipFields: fields,\n mapping: {\n tooltip: formatter,\n ...interval,\n },\n args: { dodgePadding, intervalPadding, minColumnWidth, maxColumnWidth, background: columnBackground },\n },\n })\n )\n : params;\n\n return otherAdaptor({\n ...params,\n ext,\n });\n}\n"]}
1
+ {"version":3,"file":"interval.js","sourceRoot":"","sources":["../../../src/adaptor/geometries/interval.ts"],"names":[],"mappings":";AAAA,OAAO,EAAY,QAAQ,EAAc,MAAM,UAAU,CAAC;AAC1D,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAE7C,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAmC,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAiCnE;;;GAGG;AACH,SAAS,YAAY,CAAoC,MAAiB;IAChE,IAAA,KAAK,GAAmB,MAAM,MAAzB,EAAE,OAAO,GAAU,MAAM,QAAhB,EAAE,GAAG,GAAK,MAAM,IAAX,CAAY;IAC/B,IAAA,WAAW,GAAmE,OAAO,YAA1E,EAAE,OAAO,GAA0D,OAAO,QAAjE,EAAE,OAAO,GAAiD,OAAO,QAAxD,EAAE,WAAW,GAAoC,OAAO,YAA3C,EAAE,UAAU,GAAwB,OAAO,WAA/B,EAAE,UAAU,GAAY,OAAO,WAAnB,EAAE,KAAK,GAAK,OAAO,MAAZ,CAAa;IAE9F;;OAEG;IACH,IAAM,MAAM,GA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,eAAe,GAEb,OAAO,gBAFM,EACf,gBAAgB,GACd,OAAO,iBADO,CACN;IAEN,IAAA,KAAwB,iBAAiB,CAAC,OAAO,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,WAAW,CAAC,CAAC,EAA/E,MAAM,YAAA,EAAE,SAAS,eAA8D,CAAC;IAExF,sBAAsB;IACd,IAAA,GAAG,GAAK,CAAA,QAAQ;QACtB,CAAC,CAAC,QAAQ,CACN,UAAU,CAAC,EAAE,EAAE,MAAM,EAAE;YACrB,OAAO,EAAE;gBACP,IAAI,EAAE,UAAU;gBAChB,UAAU,EAAE,WAAW;gBACvB,aAAa,EAAE,MAAM;gBACrB,OAAO,aACL,OAAO,EAAE,SAAS,IACf,QAAQ,CACZ;gBACD,IAAI,EAAE;oBACJ,YAAY,cAAA;oBACZ,eAAe,iBAAA;oBACf,cAAc,gBAAA;oBACd,cAAc,gBAAA;oBACd,UAAU,EAAE,gBAAgB;oBAC5B,gBAAgB,kBAAA;iBACjB;aACF;SACF,CAAC,CACH;QACH,CAAC,CAAC,MAAM,CAAA,IAtBC,CAsBA;IAEX,OAAO,YAAY,uBACd,MAAM,KACT,GAAG,KAAA,IACH,CAAC;AACL,CAAC","sourcesContent":["import { Geometry, getTheme, ShapeAttrs } from '@antv/g2';\nimport { isNil, isObject } from '@antv/util';\nimport { Params } from '../../core/adaptor';\nimport { deepAssign } from '../../utils';\nimport { getTooltipMapping } from '../../utils/tooltip';\nimport { GeometryOptions, MappingOptions, geometry } from './base';\n\nexport interface IntervalGeometryOptions extends GeometryOptions {\n /** x 轴字段 */\n readonly xField: string;\n /** y 轴字段 */\n readonly yField: string;\n /** 拆分字段,在分组柱状图下同 groupField、colorField,在堆积柱状图下同 stackField、colorField */\n readonly seriesField?: string;\n /** 是否分组柱形图 */\n readonly isGroup?: boolean;\n /** 是否堆积柱状图 */\n readonly isStack?: boolean;\n /** 柱状图宽度占比 [0-1] */\n readonly widthRatio?: number;\n /** 分组间柱子之间的组间间距(像素级),仅对分组柱状图适用 */\n readonly intervalPadding?: number;\n /** 分组中柱子之间的间距 [0-1],仅对分组柱状图适用 */\n readonly marginRatio?: number;\n /** 分组中柱子之间的组内间距(像素级),仅对分组柱状图适用 */\n readonly dodgePadding?: number;\n /** 柱状图最小宽度(像素) */\n readonly minColumnWidth?: number;\n /** 柱状图最大宽度(像素) */\n readonly maxColumnWidth?: number;\n /** 柱子的背景样式设置 */\n readonly columnBackground?: { style: ShapeAttrs };\n /** 柱子视觉通道配置(含 color、shape、size、style、tooltip) */\n readonly interval?: MappingOptions;\n /** 分组字段,优先级高于 seriesField , isGroup: true 时会根据 groupField 进行分组。*/\n readonly groupField?: string;\n}\n\n/**\n * 柱形图其他的 adaptor\n * @param params\n */\nfunction otherAdaptor<O extends IntervalGeometryOptions>(params: Params<O>): Params<O> {\n const { chart, options, ext } = params;\n const { seriesField, isGroup, isStack, marginRatio, widthRatio, groupField, theme } = options;\n\n /**\n * adjust\n */\n const adjust = [];\n if (seriesField) {\n // group\n if (isGroup) {\n adjust.push({\n type: 'dodge',\n dodgeBy: groupField || seriesField,\n marginRatio,\n });\n }\n // stack\n if (isStack) {\n adjust.push({\n type: 'stack',\n marginRatio,\n });\n }\n }\n\n if (adjust.length && ext?.geometry) {\n const g = ext?.geometry as Geometry;\n g.adjust(adjust);\n }\n\n // widthRatio\n if (!isNil(widthRatio)) {\n chart.theme(\n deepAssign({}, isObject(theme) ? theme : getTheme(theme), {\n // columWidthRatio 配置覆盖 theme 中的配置\n columnWidthRatio: widthRatio,\n })\n );\n }\n\n return params;\n}\n\nexport function interval<O extends IntervalGeometryOptions>(params: Params<O>): Params<O> {\n const { options } = params;\n const {\n xField,\n yField,\n interval,\n seriesField,\n tooltip,\n minColumnWidth,\n maxColumnWidth,\n columnBackground,\n dodgePadding,\n intervalPadding,\n useDeferredLabel,\n } = options;\n\n const { fields, formatter } = getTooltipMapping(tooltip, [xField, yField, seriesField]);\n\n // 保障一定要存在 interval 映射\n const { ext } = interval\n ? geometry(\n deepAssign({}, params, {\n options: {\n type: 'interval',\n colorField: seriesField,\n tooltipFields: fields,\n mapping: {\n tooltip: formatter,\n ...interval,\n },\n args: {\n dodgePadding,\n intervalPadding,\n minColumnWidth,\n maxColumnWidth,\n background: columnBackground,\n useDeferredLabel,\n },\n },\n })\n )\n : params;\n\n return otherAdaptor({\n ...params,\n ext,\n });\n}\n"]}
@@ -8,7 +8,7 @@ import { geometry } from './base';
8
8
  */
9
9
  export function line(params) {
10
10
  var options = params.options;
11
- var line = options.line, stepType = options.stepType, xField = options.xField, yField = options.yField, seriesField = options.seriesField, smooth = options.smooth, connectNulls = options.connectNulls, tooltip = options.tooltip;
11
+ var line = options.line, stepType = options.stepType, xField = options.xField, yField = options.yField, seriesField = options.seriesField, smooth = options.smooth, connectNulls = options.connectNulls, tooltip = options.tooltip, useDeferredLabel = options.useDeferredLabel;
12
12
  var _a = getTooltipMapping(tooltip, [xField, yField, seriesField]), fields = _a.fields, formatter = _a.formatter;
13
13
  // 如果存在才处理
14
14
  return line
@@ -21,7 +21,7 @@ export function line(params) {
21
21
  shape: stepType || (smooth ? 'smooth' : 'line'),
22
22
  tooltip: formatter,
23
23
  }, line),
24
- args: { connectNulls: connectNulls },
24
+ args: { connectNulls: connectNulls, useDeferredLabel: useDeferredLabel },
25
25
  },
26
26
  }))
27
27
  : params;
@@ -1 +1 @@
1
- {"version":3,"file":"line.js","sourceRoot":"","sources":["../../../src/adaptor/geometries/line.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAErC,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAmB,QAAQ,EAAkB,MAAM,QAAQ,CAAC;AAmBnE;;;GAGG;AACH,MAAM,UAAU,IAAI,CAAgC,MAAiB;IAC3D,IAAA,OAAO,GAAK,MAAM,QAAX,CAAY;IACnB,IAAA,IAAI,GAA2E,OAAO,KAAlF,EAAE,QAAQ,GAAiE,OAAO,SAAxE,EAAE,MAAM,GAAyD,OAAO,OAAhE,EAAE,MAAM,GAAiD,OAAO,OAAxD,EAAE,WAAW,GAAoC,OAAO,YAA3C,EAAE,MAAM,GAA4B,OAAO,OAAnC,EAAE,YAAY,GAAc,OAAO,aAArB,EAAE,OAAO,GAAK,OAAO,QAAZ,CAAa;IAEzF,IAAA,KAAwB,iBAAiB,CAAC,OAAO,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,WAAW,CAAC,CAAC,EAA/E,MAAM,YAAA,EAAE,SAAS,eAA8D,CAAC;IAExF,UAAU;IACV,OAAO,IAAI;QACT,CAAC,CAAC,QAAQ,CACN,UAAU,CAAC,EAAE,EAAE,MAAM,EAAE;YACrB,OAAO,EAAE;gBACP,IAAI,EAAE,MAAM;gBACZ,UAAU,EAAE,WAAW;gBACvB,aAAa,EAAE,MAAM;gBACrB,OAAO,EAAE,OAAO,CACd;oBACE,KAAK,EAAE,QAAQ,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC;oBAC/C,OAAO,EAAE,SAAS;iBACnB,EACD,IAAI,CACL;gBACD,IAAI,EAAE,EAAE,YAAY,cAAA,EAAE;aACvB;SACF,CAAC,CACH;QACH,CAAC,CAAC,MAAM,CAAC;AACb,CAAC","sourcesContent":["import { deepMix } from '@antv/util';\nimport { Params } from '../../core/adaptor';\nimport { getTooltipMapping } from '../../utils/tooltip';\nimport { deepAssign } from '../../utils';\nimport { GeometryOptions, geometry, MappingOptions } from './base';\n\nexport interface LineGeometryOptions extends GeometryOptions {\n /** x 轴字段 */\n readonly xField?: string;\n /** y 轴字段 */\n readonly yField?: string;\n /** 分组字段 */\n readonly seriesField?: string;\n /** 是否平滑 */\n readonly smooth?: boolean;\n /** 是否连接空数据 */\n readonly connectNulls?: boolean;\n /** line 映射配置 */\n readonly line?: MappingOptions;\n /** 阶梯折线图类型 */\n readonly stepType?: string;\n}\n\n/**\n * line 辅助点的配置处理\n * @param params\n */\nexport function line<O extends LineGeometryOptions>(params: Params<O>): Params<O> {\n const { options } = params;\n const { line, stepType, xField, yField, seriesField, smooth, connectNulls, tooltip } = options;\n\n const { fields, formatter } = getTooltipMapping(tooltip, [xField, yField, seriesField]);\n\n // 如果存在才处理\n return line\n ? geometry(\n deepAssign({}, params, {\n options: {\n type: 'line',\n colorField: seriesField,\n tooltipFields: fields,\n mapping: deepMix(\n {\n shape: stepType || (smooth ? 'smooth' : 'line'),\n tooltip: formatter,\n },\n line\n ),\n args: { connectNulls },\n },\n })\n )\n : params;\n}\n"]}
1
+ {"version":3,"file":"line.js","sourceRoot":"","sources":["../../../src/adaptor/geometries/line.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAErC,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAmB,QAAQ,EAAkB,MAAM,QAAQ,CAAC;AAmBnE;;;GAGG;AACH,MAAM,UAAU,IAAI,CAAgC,MAAiB;IAC3D,IAAA,OAAO,GAAK,MAAM,QAAX,CAAY;IACnB,IAAA,IAAI,GAA6F,OAAO,KAApG,EAAE,QAAQ,GAAmF,OAAO,SAA1F,EAAE,MAAM,GAA2E,OAAO,OAAlF,EAAE,MAAM,GAAmE,OAAO,OAA1E,EAAE,WAAW,GAAsD,OAAO,YAA7D,EAAE,MAAM,GAA8C,OAAO,OAArD,EAAE,YAAY,GAAgC,OAAO,aAAvC,EAAE,OAAO,GAAuB,OAAO,QAA9B,EAAE,gBAAgB,GAAK,OAAO,iBAAZ,CAAa;IAE3G,IAAA,KAAwB,iBAAiB,CAAC,OAAO,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,WAAW,CAAC,CAAC,EAA/E,MAAM,YAAA,EAAE,SAAS,eAA8D,CAAC;IAExF,UAAU;IACV,OAAO,IAAI;QACT,CAAC,CAAC,QAAQ,CACN,UAAU,CAAC,EAAE,EAAE,MAAM,EAAE;YACrB,OAAO,EAAE;gBACP,IAAI,EAAE,MAAM;gBACZ,UAAU,EAAE,WAAW;gBACvB,aAAa,EAAE,MAAM;gBACrB,OAAO,EAAE,OAAO,CACd;oBACE,KAAK,EAAE,QAAQ,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC;oBAC/C,OAAO,EAAE,SAAS;iBACnB,EACD,IAAI,CACL;gBACD,IAAI,EAAE,EAAE,YAAY,cAAA,EAAE,gBAAgB,kBAAA,EAAE;aACzC;SACF,CAAC,CACH;QACH,CAAC,CAAC,MAAM,CAAC;AACb,CAAC","sourcesContent":["import { deepMix } from '@antv/util';\nimport { Params } from '../../core/adaptor';\nimport { getTooltipMapping } from '../../utils/tooltip';\nimport { deepAssign } from '../../utils';\nimport { GeometryOptions, geometry, MappingOptions } from './base';\n\nexport interface LineGeometryOptions extends GeometryOptions {\n /** x 轴字段 */\n readonly xField?: string;\n /** y 轴字段 */\n readonly yField?: string;\n /** 分组字段 */\n readonly seriesField?: string;\n /** 是否平滑 */\n readonly smooth?: boolean;\n /** 是否连接空数据 */\n readonly connectNulls?: boolean;\n /** line 映射配置 */\n readonly line?: MappingOptions;\n /** 阶梯折线图类型 */\n readonly stepType?: string;\n}\n\n/**\n * line 辅助点的配置处理\n * @param params\n */\nexport function line<O extends LineGeometryOptions>(params: Params<O>): Params<O> {\n const { options } = params;\n const { line, stepType, xField, yField, seriesField, smooth, connectNulls, tooltip, useDeferredLabel } = options;\n\n const { fields, formatter } = getTooltipMapping(tooltip, [xField, yField, seriesField]);\n\n // 如果存在才处理\n return line\n ? geometry(\n deepAssign({}, params, {\n options: {\n type: 'line',\n colorField: seriesField,\n tooltipFields: fields,\n mapping: deepMix(\n {\n shape: stepType || (smooth ? 'smooth' : 'line'),\n tooltip: formatter,\n },\n line\n ),\n args: { connectNulls, useDeferredLabel },\n },\n })\n )\n : params;\n}\n"]}
@@ -8,7 +8,7 @@ import { geometry } from './base';
8
8
  */
9
9
  export function point(params) {
10
10
  var options = params.options;
11
- var point = options.point, xField = options.xField, yField = options.yField, seriesField = options.seriesField, sizeField = options.sizeField, shapeField = options.shapeField, tooltip = options.tooltip;
11
+ var point = options.point, xField = options.xField, yField = options.yField, seriesField = options.seriesField, sizeField = options.sizeField, shapeField = options.shapeField, tooltip = options.tooltip, useDeferredLabel = options.useDeferredLabel;
12
12
  var _a = getTooltipMapping(tooltip, [xField, yField, seriesField, sizeField, shapeField]), fields = _a.fields, formatter = _a.formatter;
13
13
  return point
14
14
  ? geometry(deepAssign({}, params, {
@@ -18,6 +18,7 @@ export function point(params) {
18
18
  shapeField: shapeField,
19
19
  tooltipFields: fields,
20
20
  mapping: __assign({ tooltip: formatter }, point),
21
+ args: { useDeferredLabel: useDeferredLabel },
21
22
  },
22
23
  }))
23
24
  : params;
@@ -1 +1 @@
1
- {"version":3,"file":"point.js","sourceRoot":"","sources":["../../../src/adaptor/geometries/point.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAmC,MAAM,QAAQ,CAAC;AAiBnE;;;GAGG;AACH,MAAM,UAAU,KAAK,CAAiC,MAAiB;IAC7D,IAAA,OAAO,GAAK,MAAM,QAAX,CAAY;IACnB,IAAA,KAAK,GAAkE,OAAO,MAAzE,EAAE,MAAM,GAA0D,OAAO,OAAjE,EAAE,MAAM,GAAkD,OAAO,OAAzD,EAAE,WAAW,GAAqC,OAAO,YAA5C,EAAE,SAAS,GAA0B,OAAO,UAAjC,EAAE,UAAU,GAAc,OAAO,WAArB,EAAE,OAAO,GAAK,OAAO,QAAZ,CAAa;IAEjF,IAAA,KAAwB,iBAAiB,CAAC,OAAO,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,SAAS,EAAE,UAAU,CAAC,CAAC,EAAtG,MAAM,YAAA,EAAE,SAAS,eAAqF,CAAC;IAE/G,OAAO,KAAK;QACV,CAAC,CAAC,QAAQ,CACN,UAAU,CAAC,EAAE,EAAE,MAAM,EAAE;YACrB,OAAO,EAAE;gBACP,IAAI,EAAE,OAAO;gBACb,UAAU,EAAE,WAAW;gBACvB,UAAU,EAAE,UAAU;gBACtB,aAAa,EAAE,MAAM;gBACrB,OAAO,aACL,OAAO,EAAE,SAAS,IACf,KAAK,CACT;aACF;SACF,CAAC,CACH;QACH,CAAC,CAAC,MAAM,CAAC;AACb,CAAC","sourcesContent":["import { Params } from '../../core/adaptor';\nimport { getTooltipMapping } from '../../utils/tooltip';\nimport { deepAssign } from '../../utils';\nimport { geometry, MappingOptions, GeometryOptions } from './base';\n\nexport interface PointGeometryOptions extends GeometryOptions {\n /** x 轴字段 */\n readonly xField?: string;\n /** y 轴字段 */\n readonly yField?: string;\n /** 分组字段 */\n readonly seriesField?: string;\n /** size 映射字段 */\n readonly sizeField?: string;\n /** shape 的映射字段 */\n readonly shapeField?: string;\n /** point 图形映射规则 */\n readonly point?: MappingOptions;\n}\n\n/**\n * point 辅助点的配置处理\n * @param params\n */\nexport function point<O extends PointGeometryOptions>(params: Params<O>): Params<O> {\n const { options } = params;\n const { point, xField, yField, seriesField, sizeField, shapeField, tooltip } = options;\n\n const { fields, formatter } = getTooltipMapping(tooltip, [xField, yField, seriesField, sizeField, shapeField]);\n\n return point\n ? geometry(\n deepAssign({}, params, {\n options: {\n type: 'point',\n colorField: seriesField,\n shapeField: shapeField,\n tooltipFields: fields,\n mapping: {\n tooltip: formatter,\n ...point,\n },\n },\n })\n )\n : params;\n}\n"]}
1
+ {"version":3,"file":"point.js","sourceRoot":"","sources":["../../../src/adaptor/geometries/point.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAmC,MAAM,QAAQ,CAAC;AAiBnE;;;GAGG;AACH,MAAM,UAAU,KAAK,CAAiC,MAAiB;IAC7D,IAAA,OAAO,GAAK,MAAM,QAAX,CAAY;IACnB,IAAA,KAAK,GAAoF,OAAO,MAA3F,EAAE,MAAM,GAA4E,OAAO,OAAnF,EAAE,MAAM,GAAoE,OAAO,OAA3E,EAAE,WAAW,GAAuD,OAAO,YAA9D,EAAE,SAAS,GAA4C,OAAO,UAAnD,EAAE,UAAU,GAAgC,OAAO,WAAvC,EAAE,OAAO,GAAuB,OAAO,QAA9B,EAAE,gBAAgB,GAAK,OAAO,iBAAZ,CAAa;IAEnG,IAAA,KAAwB,iBAAiB,CAAC,OAAO,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,SAAS,EAAE,UAAU,CAAC,CAAC,EAAtG,MAAM,YAAA,EAAE,SAAS,eAAqF,CAAC;IAE/G,OAAO,KAAK;QACV,CAAC,CAAC,QAAQ,CACN,UAAU,CAAC,EAAE,EAAE,MAAM,EAAE;YACrB,OAAO,EAAE;gBACP,IAAI,EAAE,OAAO;gBACb,UAAU,EAAE,WAAW;gBACvB,UAAU,EAAE,UAAU;gBACtB,aAAa,EAAE,MAAM;gBACrB,OAAO,aACL,OAAO,EAAE,SAAS,IACf,KAAK,CACT;gBACD,IAAI,EAAE,EAAE,gBAAgB,kBAAA,EAAE;aAC3B;SACF,CAAC,CACH;QACH,CAAC,CAAC,MAAM,CAAC;AACb,CAAC","sourcesContent":["import { Params } from '../../core/adaptor';\nimport { getTooltipMapping } from '../../utils/tooltip';\nimport { deepAssign } from '../../utils';\nimport { geometry, MappingOptions, GeometryOptions } from './base';\n\nexport interface PointGeometryOptions extends GeometryOptions {\n /** x 轴字段 */\n readonly xField?: string;\n /** y 轴字段 */\n readonly yField?: string;\n /** 分组字段 */\n readonly seriesField?: string;\n /** size 映射字段 */\n readonly sizeField?: string;\n /** shape 的映射字段 */\n readonly shapeField?: string;\n /** point 图形映射规则 */\n readonly point?: MappingOptions;\n}\n\n/**\n * point 辅助点的配置处理\n * @param params\n */\nexport function point<O extends PointGeometryOptions>(params: Params<O>): Params<O> {\n const { options } = params;\n const { point, xField, yField, seriesField, sizeField, shapeField, tooltip, useDeferredLabel } = options;\n\n const { fields, formatter } = getTooltipMapping(tooltip, [xField, yField, seriesField, sizeField, shapeField]);\n\n return point\n ? geometry(\n deepAssign({}, params, {\n options: {\n type: 'point',\n colorField: seriesField,\n shapeField: shapeField,\n tooltipFields: fields,\n mapping: {\n tooltip: formatter,\n ...point,\n },\n args: { useDeferredLabel },\n },\n })\n )\n : params;\n}\n"]}
@@ -8,7 +8,7 @@ import { geometry } from './base';
8
8
  */
9
9
  export function polygon(params) {
10
10
  var options = params.options;
11
- var polygon = options.polygon, xField = options.xField, yField = options.yField, seriesField = options.seriesField, tooltip = options.tooltip;
11
+ var polygon = options.polygon, xField = options.xField, yField = options.yField, seriesField = options.seriesField, tooltip = options.tooltip, useDeferredLabel = options.useDeferredLabel;
12
12
  var _a = getTooltipMapping(tooltip, [xField, yField, seriesField]), fields = _a.fields, formatter = _a.formatter;
13
13
  return polygon
14
14
  ? geometry(deepAssign({}, params, {
@@ -17,6 +17,7 @@ export function polygon(params) {
17
17
  colorField: seriesField,
18
18
  tooltipFields: fields,
19
19
  mapping: __assign({ tooltip: formatter }, polygon),
20
+ args: { useDeferredLabel: useDeferredLabel },
20
21
  },
21
22
  }))
22
23
  : params;
@@ -1 +1 @@
1
- {"version":3,"file":"polygon.js","sourceRoot":"","sources":["../../../src/adaptor/geometries/polygon.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAmC,MAAM,QAAQ,CAAC;AAanE;;;GAGG;AACH,MAAM,UAAU,OAAO,CAAmC,MAAiB;IACjE,IAAA,OAAO,GAAK,MAAM,QAAX,CAAY;IACnB,IAAA,OAAO,GAA2C,OAAO,QAAlD,EAAE,MAAM,GAAmC,OAAO,OAA1C,EAAE,MAAM,GAA2B,OAAO,OAAlC,EAAE,WAAW,GAAc,OAAO,YAArB,EAAE,OAAO,GAAK,OAAO,QAAZ,CAAa;IAE5D,IAAA,KAAwB,iBAAiB,CAAC,OAAO,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,WAAW,CAAC,CAAC,EAA/E,MAAM,YAAA,EAAE,SAAS,eAA8D,CAAC;IAExF,OAAO,OAAO;QACZ,CAAC,CAAC,QAAQ,CACN,UAAU,CAAC,EAAE,EAAE,MAAM,EAAE;YACrB,OAAO,EAAE;gBACP,IAAI,EAAE,SAAS;gBACf,UAAU,EAAE,WAAW;gBACvB,aAAa,EAAE,MAAM;gBACrB,OAAO,aACL,OAAO,EAAE,SAAS,IACf,OAAO,CACX;aACF;SACF,CAAC,CACH;QACH,CAAC,CAAC,MAAM,CAAC;AACb,CAAC","sourcesContent":["import { Params } from '../../core/adaptor';\nimport { getTooltipMapping } from '../../utils/tooltip';\nimport { deepAssign } from '../../utils';\nimport { geometry, MappingOptions, GeometryOptions } from './base';\n\nexport interface PolygonGeometryOptions extends GeometryOptions {\n /** x 轴字段 */\n readonly xField?: string;\n /** y 轴字段 */\n readonly yField?: string;\n /** 分组字段 */\n readonly seriesField?: string;\n /** point 图形映射规则 */\n readonly polygon?: MappingOptions;\n}\n\n/**\n * polygon 的配置处理\n * @param params\n */\nexport function polygon<O extends PolygonGeometryOptions>(params: Params<O>): Params<O> {\n const { options } = params;\n const { polygon, xField, yField, seriesField, tooltip } = options;\n\n const { fields, formatter } = getTooltipMapping(tooltip, [xField, yField, seriesField]);\n\n return polygon\n ? geometry(\n deepAssign({}, params, {\n options: {\n type: 'polygon',\n colorField: seriesField,\n tooltipFields: fields,\n mapping: {\n tooltip: formatter,\n ...polygon,\n },\n },\n })\n )\n : params;\n}\n"]}
1
+ {"version":3,"file":"polygon.js","sourceRoot":"","sources":["../../../src/adaptor/geometries/polygon.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAmC,MAAM,QAAQ,CAAC;AAanE;;;GAGG;AACH,MAAM,UAAU,OAAO,CAAmC,MAAiB;IACjE,IAAA,OAAO,GAAK,MAAM,QAAX,CAAY;IACnB,IAAA,OAAO,GAA6D,OAAO,QAApE,EAAE,MAAM,GAAqD,OAAO,OAA5D,EAAE,MAAM,GAA6C,OAAO,OAApD,EAAE,WAAW,GAAgC,OAAO,YAAvC,EAAE,OAAO,GAAuB,OAAO,QAA9B,EAAE,gBAAgB,GAAK,OAAO,iBAAZ,CAAa;IAE9E,IAAA,KAAwB,iBAAiB,CAAC,OAAO,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,WAAW,CAAC,CAAC,EAA/E,MAAM,YAAA,EAAE,SAAS,eAA8D,CAAC;IAExF,OAAO,OAAO;QACZ,CAAC,CAAC,QAAQ,CACN,UAAU,CAAC,EAAE,EAAE,MAAM,EAAE;YACrB,OAAO,EAAE;gBACP,IAAI,EAAE,SAAS;gBACf,UAAU,EAAE,WAAW;gBACvB,aAAa,EAAE,MAAM;gBACrB,OAAO,aACL,OAAO,EAAE,SAAS,IACf,OAAO,CACX;gBACD,IAAI,EAAE,EAAE,gBAAgB,kBAAA,EAAE;aAC3B;SACF,CAAC,CACH;QACH,CAAC,CAAC,MAAM,CAAC;AACb,CAAC","sourcesContent":["import { Params } from '../../core/adaptor';\nimport { getTooltipMapping } from '../../utils/tooltip';\nimport { deepAssign } from '../../utils';\nimport { geometry, MappingOptions, GeometryOptions } from './base';\n\nexport interface PolygonGeometryOptions extends GeometryOptions {\n /** x 轴字段 */\n readonly xField?: string;\n /** y 轴字段 */\n readonly yField?: string;\n /** 分组字段 */\n readonly seriesField?: string;\n /** point 图形映射规则 */\n readonly polygon?: MappingOptions;\n}\n\n/**\n * polygon 的配置处理\n * @param params\n */\nexport function polygon<O extends PolygonGeometryOptions>(params: Params<O>): Params<O> {\n const { options } = params;\n const { polygon, xField, yField, seriesField, tooltip, useDeferredLabel } = options;\n\n const { fields, formatter } = getTooltipMapping(tooltip, [xField, yField, seriesField]);\n\n return polygon\n ? geometry(\n deepAssign({}, params, {\n options: {\n type: 'polygon',\n colorField: seriesField,\n tooltipFields: fields,\n mapping: {\n tooltip: formatter,\n ...polygon,\n },\n args: { useDeferredLabel },\n },\n })\n )\n : params;\n}\n"]}
@@ -8,7 +8,7 @@ import { geometry } from './base';
8
8
  */
9
9
  export function schema(params) {
10
10
  var options = params.options;
11
- var schema = options.schema, xField = options.xField, yField = options.yField, seriesField = options.seriesField, tooltip = options.tooltip;
11
+ var schema = options.schema, xField = options.xField, yField = options.yField, seriesField = options.seriesField, tooltip = options.tooltip, useDeferredLabel = options.useDeferredLabel;
12
12
  var _a = getTooltipMapping(tooltip, [xField, yField, seriesField]), fields = _a.fields, formatter = _a.formatter;
13
13
  return schema
14
14
  ? geometry(deepAssign({}, params, {
@@ -17,6 +17,7 @@ export function schema(params) {
17
17
  colorField: seriesField,
18
18
  tooltipFields: fields,
19
19
  mapping: __assign({ tooltip: formatter }, schema),
20
+ args: { useDeferredLabel: useDeferredLabel },
20
21
  },
21
22
  }))
22
23
  : params;
@@ -1 +1 @@
1
- {"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../src/adaptor/geometries/schema.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAmC,MAAM,QAAQ,CAAC;AAanE;;;GAGG;AACH,MAAM,UAAU,MAAM,CAAkC,MAAiB;IAC/D,IAAA,OAAO,GAAK,MAAM,QAAX,CAAY;IACnB,IAAA,MAAM,GAA2C,OAAO,OAAlD,EAAE,MAAM,GAAmC,OAAO,OAA1C,EAAE,MAAM,GAA2B,OAAO,OAAlC,EAAE,WAAW,GAAc,OAAO,YAArB,EAAE,OAAO,GAAK,OAAO,QAAZ,CAAa;IAE3D,IAAA,KAAwB,iBAAiB,CAAC,OAAO,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,WAAW,CAAC,CAAC,EAA/E,MAAM,YAAA,EAAE,SAAS,eAA8D,CAAC;IAExF,OAAO,MAAM;QACX,CAAC,CAAC,QAAQ,CACN,UAAU,CAAC,EAAE,EAAE,MAAM,EAAE;YACrB,OAAO,EAAE;gBACP,IAAI,EAAE,QAAQ;gBACd,UAAU,EAAE,WAAW;gBACvB,aAAa,EAAE,MAAM;gBACrB,OAAO,aACL,OAAO,EAAE,SAAS,IACf,MAAM,CACV;aACF;SACF,CAAC,CACH;QACH,CAAC,CAAC,MAAM,CAAC;AACb,CAAC","sourcesContent":["import { Params } from '../../core/adaptor';\nimport { getTooltipMapping } from '../../utils/tooltip';\nimport { deepAssign } from '../../utils';\nimport { geometry, MappingOptions, GeometryOptions } from './base';\n\nexport interface SchemaGeometryOptions extends GeometryOptions {\n /** x 轴字段 */\n readonly xField?: string;\n /** y 轴字段 */\n readonly yField?: string;\n /** 分组字段 */\n readonly seriesField?: string;\n /** point 图形映射规则 */\n readonly schema?: MappingOptions;\n}\n\n/**\n * schema 的配置处理\n * @param params\n */\nexport function schema<O extends SchemaGeometryOptions>(params: Params<O>): Params<O> {\n const { options } = params;\n const { schema, xField, yField, seriesField, tooltip } = options;\n\n const { fields, formatter } = getTooltipMapping(tooltip, [xField, yField, seriesField]);\n\n return schema\n ? geometry(\n deepAssign({}, params, {\n options: {\n type: 'schema',\n colorField: seriesField,\n tooltipFields: fields,\n mapping: {\n tooltip: formatter,\n ...schema,\n },\n },\n })\n )\n : params;\n}\n"]}
1
+ {"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../src/adaptor/geometries/schema.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAmC,MAAM,QAAQ,CAAC;AAanE;;;GAGG;AACH,MAAM,UAAU,MAAM,CAAkC,MAAiB;IAC/D,IAAA,OAAO,GAAK,MAAM,QAAX,CAAY;IACnB,IAAA,MAAM,GAA6D,OAAO,OAApE,EAAE,MAAM,GAAqD,OAAO,OAA5D,EAAE,MAAM,GAA6C,OAAO,OAApD,EAAE,WAAW,GAAgC,OAAO,YAAvC,EAAE,OAAO,GAAuB,OAAO,QAA9B,EAAE,gBAAgB,GAAK,OAAO,iBAAZ,CAAa;IAE7E,IAAA,KAAwB,iBAAiB,CAAC,OAAO,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,WAAW,CAAC,CAAC,EAA/E,MAAM,YAAA,EAAE,SAAS,eAA8D,CAAC;IAExF,OAAO,MAAM;QACX,CAAC,CAAC,QAAQ,CACN,UAAU,CAAC,EAAE,EAAE,MAAM,EAAE;YACrB,OAAO,EAAE;gBACP,IAAI,EAAE,QAAQ;gBACd,UAAU,EAAE,WAAW;gBACvB,aAAa,EAAE,MAAM;gBACrB,OAAO,aACL,OAAO,EAAE,SAAS,IACf,MAAM,CACV;gBACD,IAAI,EAAE,EAAE,gBAAgB,kBAAA,EAAE;aAC3B;SACF,CAAC,CACH;QACH,CAAC,CAAC,MAAM,CAAC;AACb,CAAC","sourcesContent":["import { Params } from '../../core/adaptor';\nimport { getTooltipMapping } from '../../utils/tooltip';\nimport { deepAssign } from '../../utils';\nimport { geometry, MappingOptions, GeometryOptions } from './base';\n\nexport interface SchemaGeometryOptions extends GeometryOptions {\n /** x 轴字段 */\n readonly xField?: string;\n /** y 轴字段 */\n readonly yField?: string;\n /** 分组字段 */\n readonly seriesField?: string;\n /** point 图形映射规则 */\n readonly schema?: MappingOptions;\n}\n\n/**\n * schema 的配置处理\n * @param params\n */\nexport function schema<O extends SchemaGeometryOptions>(params: Params<O>): Params<O> {\n const { options } = params;\n const { schema, xField, yField, seriesField, tooltip, useDeferredLabel } = options;\n\n const { fields, formatter } = getTooltipMapping(tooltip, [xField, yField, seriesField]);\n\n return schema\n ? geometry(\n deepAssign({}, params, {\n options: {\n type: 'schema',\n colorField: seriesField,\n tooltipFields: fields,\n mapping: {\n tooltip: formatter,\n ...schema,\n },\n args: { useDeferredLabel },\n },\n })\n )\n : params;\n}\n"]}
@@ -7,4 +7,4 @@ import { Options } from '../types';
7
7
  * @param key key of style property
8
8
  * @returns
9
9
  */
10
- export declare function pattern(key: string): <O extends Pick<Options, "label" | "legend" | "meta" | "padding" | "animation" | "color" | "height" | "width" | "appendPadding" | "renderer" | "pixelRatio" | "autoFit" | "syncViewPadding" | "supportCSSTransform" | "limitInPlot" | "locale" | "defaultInteractions" | "localRefresh" | "theme" | "pattern" | "xAxis" | "yAxis" | "tooltip" | "slider" | "scrollbar" | "interactions" | "annotations" | "state"> = Pick<Options, "label" | "legend" | "meta" | "padding" | "animation" | "color" | "height" | "width" | "appendPadding" | "renderer" | "pixelRatio" | "autoFit" | "syncViewPadding" | "supportCSSTransform" | "limitInPlot" | "locale" | "defaultInteractions" | "localRefresh" | "theme" | "pattern" | "xAxis" | "yAxis" | "tooltip" | "slider" | "scrollbar" | "interactions" | "annotations" | "state">>(params: Params<O>) => Params<O>;
10
+ export declare function pattern(key: string): <O extends Pick<Options, "label" | "legend" | "meta" | "padding" | "animation" | "color" | "height" | "width" | "appendPadding" | "renderer" | "pixelRatio" | "autoFit" | "syncViewPadding" | "supportCSSTransform" | "limitInPlot" | "locale" | "defaultInteractions" | "localRefresh" | "useDeferredLabel" | "theme" | "pattern" | "xAxis" | "yAxis" | "tooltip" | "slider" | "scrollbar" | "interactions" | "annotations" | "state"> = Pick<Options, "label" | "legend" | "meta" | "padding" | "animation" | "color" | "height" | "width" | "appendPadding" | "renderer" | "pixelRatio" | "autoFit" | "syncViewPadding" | "supportCSSTransform" | "limitInPlot" | "locale" | "defaultInteractions" | "localRefresh" | "useDeferredLabel" | "theme" | "pattern" | "xAxis" | "yAxis" | "tooltip" | "slider" | "scrollbar" | "interactions" | "annotations" | "state">>(params: Params<O>) => Params<O>;
package/esm/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export declare const version = "2.4.15";
1
+ export declare const version = "2.4.18";
2
2
  import * as G2 from '@antv/g2';
3
3
  export { G2 };
4
4
  import { registerLocale } from './core/locale';
package/esm/index.js CHANGED
@@ -1,4 +1,4 @@
1
- export var version = '2.4.15';
1
+ export var version = '2.4.18';
2
2
  // G2 自定义能力透出
3
3
  import * as G2 from '@antv/g2';
4
4
  export { G2 };
package/esm/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,IAAM,OAAO,GAAG,QAAQ,CAAC;AAEhC,aAAa;AACb,OAAO,KAAK,EAAE,MAAM,UAAU,CAAC;AAC/B,OAAO,EAAE,EAAE,EAAE,CAAC;AAEd,QAAQ;AACR,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,8BAA8B;AAC9B,cAAc,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC;AACtC,cAAc,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC;AACtC,uBAAuB;AACvB,OAAO,EAAE,cAAc,EAAE,CAAC;AAE1B,WAAW;AACX,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAE1C,uBAAuB;AACvB,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAKnC,SAAS;AACT,cAAc,SAAS,CAAC;AAExB,2DAA2D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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.15';\n\n// G2 自定义能力透出\nimport * as G2 from '@antv/g2';\nexport { G2 };\n\n// 国际化处理\nimport { registerLocale } from './core/locale';\nimport { EN_US_LOCALE } from './locales/en_US';\nimport { ZH_CN_LOCALE } from './locales/zh_CN';\n/** default locale register */\nregisterLocale('en-US', EN_US_LOCALE);\nregisterLocale('zh-CN', ZH_CN_LOCALE);\n/** 透出 国际化 工具函数,便于使用 */\nexport { registerLocale };\n\n/** 全局变量 */\nexport { setGlobal } from './core/global';\n\n/** G2Plot 的 Plot 基类 */\nexport { Plot } from './core/plot';\n\n/** Adaptor 及其参数的类型定义 */\nexport type { Adaptor, Params } from './core/adaptor';\n\n// 类型定义导出\nexport * from './types';\n\n// 折线图及类型定义 | author by [hustcc](https://github.com/hustcc)\nexport { Line } from './plots/line';\nexport type { LineOptions } from './plots/line';\n\n// 面积图及类型定义 | author by [hustcc](https://github.com/hustcc)\nexport { Area } from './plots/area';\nexport type { AreaOptions } from './plots/area';\n\n// 柱形图及类型定义 | author by [zqlu](https://github.com/zqlu)\nexport { Column } from './plots/column';\nexport type { ColumnOptions } from './plots/column';\n\n// 条形图及类型定义 | author by [BBSQQ](https://github.com/BBSQQ)\nexport { Bar } from './plots/bar';\nexport type { BarOptions } from './plots/bar';\n\n// 饼图及类型定义 | author by [visiky](https://github.com/visiky)\nexport { Pie } from './plots/pie';\nexport type { PieOptions } from './plots/pie';\n\n// 玫瑰图及类型定义 | author by [zhangzhonghe](https://github.com/zhangzhonghe)\nexport { Rose } from './plots/rose';\nexport type { RoseOptions } from './plots/rose';\n\n// 词云图及类型定义 | author by [zhangzhonghe](https://github.com/zhangzhonghe)\nexport { WordCloud } from './plots/word-cloud';\nexport type { WordCloudOptions } from './plots/word-cloud';\n\n// 散点图及类型定义 | author by [lxfu1](https://github.com/lxfu1)\nexport { Scatter } from './plots/scatter';\nexport type { ScatterOptions } from './plots/scatter';\n\n// 雷达图及类型定义 | author by [visiky](https://github.com/visiky)\nexport { Radar } from './plots/radar';\nexport type { RadarOptions } from './plots/radar';\n\n// 混合图形 | author by [liuzhenying](https://github.com/liuzhenying)\nexport { DualAxes } from './plots/dual-axes';\nexport type { DualAxesOptions } from './plots/dual-axes';\n\n// 迷你折线图及类型定义 | author by [connono](https://github.com/connono)\nexport { TinyLine } from './plots/tiny-line';\nexport type { TinyLineOptions } from './plots/tiny-line';\n\n// 迷你柱形图及类型定义 | author by [connono](https://github.com/connono)\nexport { TinyColumn } from './plots/tiny-column';\nexport type { TinyColumnOptions } from './plots/tiny-column';\n\n// 迷你面积图及类型定义 | author by [connono](https://github.com/connono)\nexport { TinyArea } from './plots/tiny-area';\nexport type { TinyAreaOptions } from './plots/tiny-area';\n\n// 直方图及类型定义 | author by [arcsin1](https://github.com/arcsin1), [visiky](https://github.com/visiky)\nexport { Histogram } from './plots/histogram';\nexport type { HistogramOptions } from './plots/histogram';\n\n// 进度图及类型定义 | author by [connono](https://github.com/connono)\nexport { Progress } from './plots/progress';\nexport type { ProgressOptions } from './plots/progress';\n\n// 环形进度图及类型定义 | author by [connono](https://github.com/connono)\nexport { RingProgress } from './plots/ring-progress';\nexport type { RingProgressOptions } from './plots/ring-progress';\n\n// 热力图及类型定义 | author by [jiazhewang](https://github.com/jiazhewang)\nexport { Heatmap } from './plots/heatmap';\nexport type { HeatmapOptions } from './plots/heatmap';\n\n// 箱线图及类型定义 | author by [BBSQQ](https://github.com/BBSQQ), [visiky](https://github.com/visiky)\nexport { Box } from './plots/box';\nexport type { BoxOptions } from './plots/box';\n\n// 小提琴图及类型定义 | author by [YiSiWang](https://github.com/YiSiWang), [visiky](https://github.com/visiky)\nexport { Violin } from './plots/violin';\nexport type { ViolinOptions } from './plots/violin';\n\n// 韦恩图及类型定义 | author by [visiky](https://github.com/visiky)\nexport { Venn } from './plots/venn';\nexport type { VennOptions } from './plots/venn';\n\n// K线图及类型定义 | author by [jhwong](https://github.com/jinhuiWong), [visiky](https://github.com/visiky)\nexport { Stock } from './plots/stock';\nexport type { StockOptions } from './plots/stock';\n\n// 漏斗图及类型定义\nexport { Funnel, FUNNEL_CONVERSATION_FIELD } from './plots/funnel';\nexport type { FunnelOptions } from './plots/funnel';\n\n// 水波图及类型定义 | author by [CarisL](https://github.com/CarisL), [hustcc](https://github.com/hustcc), [pearmini](https://github.com/pearmini)\nexport { Liquid, addWaterWave } from './plots/liquid';\nexport type { LiquidOptions } from './plots/liquid';\n\n// 子弹图及类型定义 | author by [arcsin1](https://github.com/arcsin1)\nexport { Bullet } from './plots/bullet';\nexport type { BulletOptions } from './plots/bullet';\n\n// 旭日图及类型定义 | author by [lxfu1](https://github.com/lxfu1), [visiky](https://github.com/visiky)\nexport { Sunburst } from './plots/sunburst';\nexport type { SunburstOptions } from './plots/sunburst';\n\n// 仪表盘及类型定义 | author by [hustcc](https://github.com/hustcc)\nexport { Gauge } from './plots/gauge';\nexport type { GaugeOptions } from './plots/gauge';\n\n// 瀑布图 | author by [visiky](https://github.com/visiky)\nexport { Waterfall } from './plots/waterfall';\nexport type { WaterfallOptions } from './plots/waterfall';\n\n// 玉珏图 | author by [yujs](https://github.com/yujs) | updated by [visiky](https://github.com/visiky)\nexport { RadialBar } from './plots/radial-bar';\nexport type { RadialBarOptions } from './plots/radial-bar';\n\n// 对称条形图及类型定义 | author by [arcsin1](https://github.com/arcsin1)\nexport { BidirectionalBar } from './plots/bidirectional-bar';\nexport type { BidirectionalBarOptions } from './plots/bidirectional-bar';\n\n// 矩形树图\nexport { Treemap } from './plots/treemap';\nexport type { TreemapOptions } from './plots/treemap';\n\n// 桑基图及类型定义 | author by [hustcc](https://github.com/hustcc)\nexport { Sankey } from './plots/sankey';\nexport type { SankeyOptions } from './plots/sankey';\n\n// 弦图及类型定义 | author by [MrSmallLiu](https://github.com/MrSmallLiu), [visiky](https://github.com/visiky)\nexport { Chord } from './plots/chord';\nexport type { ChordOptions } from './plots/chord';\n\n// circle-packing 及类型定义 | author by [visiky](https://github.com/visiky), [Angeli](https://github.com/Angelii)\nexport { CirclePacking } from './plots/circle-packing';\nexport type { CirclePackingOptions } from './plots/circle-packing';\n\n// 以下开放自定义图表开发的能力(目前仅仅是孵化中)\n/** 所有开放图表都使用 G2Plot.P 作为入口开发,理论上官方的所有图表都可以走 G2Plot.P 的入口(暂时不处理) */\nexport { P } from './plugin';\n\n/** 开放 getCanvasPatterng 方法 */\nexport { getCanvasPattern } from './utils/pattern';\n\n// 已经废弃,更名为 Mix\nexport { Mix as MultiView } from './plots/mix';\nexport type { MixOptions as MultiViewOptions } from './plots/mix';\n/** 开放多图层图表 (mix) */\nexport { Mix as Mix } from './plots/mix';\nexport type { MixOptions } from './plots/mix';\n\n// 分面图及类型定义 | author by [visiky](https://github.com/visiky)\nexport { Facet } from './plots/facet';\nexport type { FacetOptions } from './plots/facet';\n\n/** 开发 adaptor 可能会用到的方法或一些工具方法,不强制使用 */\nexport { flow, measureTextWidth } from './utils';\n\n/** 各个 geometry 的 adaptor,可以让开发者更快的构造图形 */\nexport { line, interval, area, point, polygon, schema } from './adaptor/geometries';\nexport type {\n LineGeometryOptions,\n IntervalGeometryOptions,\n AreaGeometryOptions,\n PointGeometryOptions,\n PolygonGeometryOptions,\n SchemaGeometryOptions,\n} from './adaptor/geometries';\n/** 开放一些通用的 adaptor 通道方法,实验阶段:不保证稳定性 */\nimport { scale, legend, tooltip, annotation, interaction, theme, animation } from './adaptor/common';\nexport const adaptors = { scale, legend, tooltip, annotation, interaction, theme, animation };\n\n/** 对于没有开发完成的图表,可以暂时先放到 Lab 下面,先做体验,稳定后放到根 export */\nexport { Lab } from './lab';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,IAAM,OAAO,GAAG,QAAQ,CAAC;AAEhC,aAAa;AACb,OAAO,KAAK,EAAE,MAAM,UAAU,CAAC;AAC/B,OAAO,EAAE,EAAE,EAAE,CAAC;AAEd,QAAQ;AACR,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,8BAA8B;AAC9B,cAAc,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC;AACtC,cAAc,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC;AACtC,uBAAuB;AACvB,OAAO,EAAE,cAAc,EAAE,CAAC;AAE1B,WAAW;AACX,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAE1C,uBAAuB;AACvB,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAKnC,SAAS;AACT,cAAc,SAAS,CAAC;AAExB,2DAA2D;AAC3D,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAGpC,2DAA2D;AAC3D,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc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C,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.18';\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"]}
@@ -166,11 +166,14 @@ export function transformStatisticOptions(options) {
166
166
  if (titleOpt_1 !== false) {
167
167
  titleOpt_1 = deepAssign({}, {
168
168
  formatter: function (datum) {
169
- // 交互中
170
- if (datum) {
171
- return datum[colorField];
172
- }
173
- return !isNil(titleOpt_1.content) ? titleOpt_1.content : i18n.get(['statistic', 'total']);
169
+ // 交互中, datum existed.
170
+ var text = datum
171
+ ? datum[colorField]
172
+ : !isNil(titleOpt_1.content)
173
+ ? titleOpt_1.content
174
+ : i18n.get(['statistic', 'total']);
175
+ var metaFormatter = get(meta, [colorField, 'formatter']) || (function (v) { return v; });
176
+ return metaFormatter(text);
174
177
  },
175
178
  }, titleOpt_1);
176
179
  }
@@ -1 +1 @@
1
- {"version":3,"file":"adaptor.js","sourceRoot":"","sources":["../../../src/plots/pie/adaptor.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,KAAK,EAAE,GAAG,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAE1G,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AACnF,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AACnE,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACpD,OAAO,EAAE,OAAO,EAAE,MAAM,uBA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E,CAAC,CAAC,GAAG,EAAE,EAAE,KAAK,EAAE,aAAW,EAAE,CAAC,CAAC,CAAC;SAC1E;aAAM;YACL,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,GAAG,IAAI,EAAE,CAAC,CAAC;SACxC;IACH,CAAC,CAAC,CAAC;IAEH,OAAO,MAAM,CAAC;AAChB,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,OAAO,CAAC,MAA0B;IAChD,0BAA0B;IAC1B,OAAO,IAAI,CACT,OAAO,CAAC,UAAU,CAAC,EACnB,QAAQ,EACR,IAAI,EACJ,KAAK,EACL,UAAU,EACV,MAAM,EACN,OAAO,EACP,KAAK,EACL,KAAK;IACL,mBAAmB;IACnB,aAAa,EACb,WAAW,EACX,SAAS,CACV,CAAC,MAAM,CAAC,CAAC;AACZ,CAAC","sourcesContent":["import { isFunction, isString, isNil, get, isArray, isNumber, each, toString, isEmpty } from '@antv/util';\nimport { Params } from '../../core/adaptor';\nimport { legend, animation, theme, state, annotation } from '../../adaptor/common';\nimport { getMappingFunction } from '../../adaptor/geometries/base';\nimport { interval } from '../../adaptor/geometries';\nimport { pattern } from '../../adaptor/pattern';\nimport { getLocale } from '../../core/locale';\nimport { Interaction } from '../../types/interaction';\nimport { flow, template, transformLabel, deepAssign, renderStatistic, processIllegalData } from '../../utils';\nimport { Data, Datum } from '../../types';\nimport { DEFAULT_OPTIONS } from './contants';\nimport { adaptOffset, getTotalValue, isAllZero } from './utils';\nimport { PIE_STATISTIC } from './interactions';\nimport { PieOptions } from './types';\n\n/**\n * 字段\n * @param params\n */\nfunction geometry(params: Params<PieOptions>): Params<PieOptions> {\n const { chart, options } = params;\n const { data, angleField, colorField, color, pieStyle } = options;\n\n // 处理不合法的数据\n let processData = processIllegalData(data, angleField);\n\n if (isAllZero(processData, angleField)) {\n // 数据全 0 处理,调整 position 映射\n const percentageField = '$$percentage$$';\n processData = processData.map((d) => ({ ...d, [percentageField]: 1 / processData.length }));\n chart.data(processData);\n\n const p = deepAssign({}, params, {\n options: {\n xField: '1',\n yField: percentageField,\n seriesField: colorField,\n isStack: true,\n interval: {\n color,\n style: pieStyle,\n },\n args: {\n zIndexReversed: true,\n sortZIndex: true,\n },\n },\n });\n\n interval(p);\n } else {\n chart.data(processData);\n\n const p = deepAssign({}, params, {\n options: {\n xField: '1',\n yField: angleField,\n seriesField: colorField,\n isStack: true,\n interval: {\n color,\n style: pieStyle,\n },\n args: {\n zIndexReversed: true,\n sortZIndex: true,\n },\n },\n });\n\n interval(p);\n }\n\n return params;\n}\n\n/**\n * meta 配置\n * @param params\n */\nfunction meta(params: Params<PieOptions>): Params<PieOptions> {\n const { chart, options } = params;\n const { meta, colorField } = options;\n\n // meta 直接是 scale 的信息\n const scales = deepAssign({}, meta);\n chart.scale(scales, {\n [colorField]: { type: 'cat' },\n });\n\n return params;\n}\n\n/**\n * coord 配置\n * @param params\n */\nfunction coordinate(params: Params<PieOptions>): Params<PieOptions> {\n const { chart, options } = params;\n const { radius, innerRadius, startAngle, endAngle } = options;\n\n chart.coordinate({\n type: 'theta',\n cfg: {\n radius,\n innerRadius,\n startAngle,\n endAngle,\n },\n });\n\n return params;\n}\n\n/**\n * label 配置\n * @param params\n */\nfunction label(params: Params<PieOptions>): Params<PieOptions> {\n const { chart, options } = params;\n const { label, colorField, angleField } = options;\n\n const geometry = chart.geometries[0];\n // label 为 false, 空 则不显示 label\n if (!label) {\n geometry.label(false);\n } else {\n const { callback, ...cfg } = label;\n const labelCfg = transformLabel(cfg);\n\n // ① 提供模板字符串的 label content 配置\n if (labelCfg.content) {\n const { content } = labelCfg;\n labelCfg.content = (data: object, dataum: any, index: number) => {\n const name = data[colorField];\n const value = data[angleField];\n // dymatic get scale, scale is ready this time\n const angleScale = chart.getScaleByField(angleField);\n const percent = angleScale?.scale(value);\n return isFunction(content)\n ? // append percent (number) to data, users can get origin data from `dataum._origin`\n content({ ...data, percent }, dataum, index)\n : isString(content)\n ? template(content as string, {\n value,\n name,\n // percentage (string), default keep 2\n percentage: isNumber(percent) && !isNil(value) ? `${(percent * 100).toFixed(2)}%` : null,\n })\n : content;\n };\n }\n\n const LABEL_LAYOUT_TYPE_MAP = {\n inner: '',\n outer: 'pie-outer',\n spider: 'pie-spider',\n };\n const labelLayoutType = labelCfg.type ? LABEL_LAYOUT_TYPE_MAP[labelCfg.type] : 'pie-outer';\n const labelLayoutCfg = labelCfg.layout ? (!isArray(labelCfg.layout) ? [labelCfg.layout] : labelCfg.layout) : [];\n labelCfg.layout = (labelLayoutType ? [{ type: labelLayoutType }] : []).concat(labelLayoutCfg);\n\n geometry.label({\n // fix: could not create scale, when field is undefined(attributes 中的 fields 定义都会被用来创建 scale)\n fields: colorField ? [angleField, colorField] : [angleField],\n callback,\n cfg: {\n ...labelCfg,\n offset: adaptOffset(labelCfg.type, labelCfg.offset),\n type: 'pie',\n },\n });\n }\n return params;\n}\n\n/**\n * statistic options 处理\n * 1. 默认继承 default options 的样式\n * 2. 默认使用 meta 的 formatter\n */\nexport function transformStatisticOptions(options: PieOptions): PieOptions {\n const { innerRadius, statistic, angleField, colorField, meta, locale } = options;\n\n const i18n = getLocale(locale);\n\n if (innerRadius && statistic) {\n let { title: titleOpt, content: contentOpt } = deepAssign({}, DEFAULT_OPTIONS.statistic, statistic);\n if (titleOpt !== false) {\n titleOpt = deepAssign(\n {},\n {\n formatter: (datum: Datum) => {\n // 交互中\n if (datum) {\n return datum[colorField];\n }\n return !isNil(titleOpt.content) ? titleOpt.content : i18n.get(['statistic', 'total']);\n },\n },\n titleOpt\n );\n }\n if (contentOpt !== false) {\n contentOpt = deepAssign(\n {},\n {\n formatter: (datum: Datum, data: Data) => {\n const dataValue = datum ? datum[angleField] : getTotalValue(data, angleField);\n const metaFormatter = get(meta, [angleField, 'formatter']) || ((v) => v);\n // 交互中\n if (datum) {\n return metaFormatter(dataValue);\n }\n return !isNil(contentOpt.content) ? contentOpt.content : metaFormatter(dataValue);\n },\n },\n contentOpt\n );\n }\n\n return deepAssign({}, { statistic: { title: titleOpt, content: contentOpt } }, options);\n }\n return options;\n}\n\n/**\n * statistic 中心文本配置\n * @param params\n */\nexport function pieAnnotation(params: Params<PieOptions>): Params<PieOptions> {\n const { chart, options } = params;\n const { innerRadius, statistic } = transformStatisticOptions(options);\n // 先清空标注,再重新渲染\n chart.getController('annotation').clear(true);\n\n // 先进行其他 annotations,再去渲染统计文本\n flow(annotation())(params);\n\n /** 中心文本 指标卡 */\n if (innerRadius && statistic) {\n renderStatistic(chart, { statistic, plotType: 'pie' });\n }\n\n return params;\n}\n\n/**\n * 饼图 tooltip 配置\n * 1. 强制 tooltip.shared 为 false\n * @param params\n */\nfunction tooltip(params: Params<PieOptions>): Params<PieOptions> {\n const { chart, options } = params;\n const { tooltip, colorField, angleField, data } = options;\n\n if (tooltip === false) {\n chart.tooltip(tooltip);\n } else {\n chart.tooltip(deepAssign({}, tooltip, { shared: false }));\n\n // 主要解决 all zero, 对于非 all zero 不再适用\n if (isAllZero(data, angleField)) {\n let fields = get(tooltip, 'fields');\n let formatter = get(tooltip, 'formatter');\n\n if (isEmpty(get(tooltip, 'fields'))) {\n fields = [colorField, angleField];\n formatter = formatter || ((datum) => ({ name: datum[colorField], value: toString(datum[angleField]) }));\n }\n chart.geometries[0].tooltip(fields.join('*'), getMappingFunction(fields, formatter));\n }\n }\n\n return params;\n}\n\n/**\n * Interaction 配置 (饼图特殊的 interaction, 中心文本变更的时候,需要将一些配置参数传进去)\n * @param params\n */\nexport function interaction(params: Params<PieOptions>): Params<PieOptions> {\n const { chart, options } = params;\n const { interactions, statistic, annotations } = transformStatisticOptions(options);\n\n each(interactions, (i: Interaction) => {\n if (i.enable === false) {\n chart.removeInteraction(i.type);\n } else if (i.type === 'pie-statistic-active') {\n // 只针对 start 阶段的配置,进行添加参数信息\n let startStages = [];\n if (!i.cfg?.start) {\n startStages = [\n {\n trigger: 'element:mouseenter',\n action: `${PIE_STATISTIC}:change`,\n arg: { statistic, annotations },\n },\n ];\n }\n each(i.cfg?.start, (stage) => {\n startStages.push({ ...stage, arg: { statistic, annotations } });\n });\n chart.interaction(i.type, deepAssign({}, i.cfg, { start: startStages }));\n } else {\n chart.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<PieOptions>) {\n // flow 的方式处理所有的配置到 G2 API\n return flow<Params<PieOptions>>(\n pattern('pieStyle'),\n geometry,\n meta,\n theme,\n coordinate,\n legend,\n tooltip,\n label,\n state,\n /** 指标卡中心文本 放在下层 */\n pieAnnotation,\n interaction,\n animation\n )(params);\n}\n"]}
1
+ {"version":3,"file":"adaptor.js","sourceRoot":"","sources":["../../../src/plots/pie/adaptor.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,KAAK,EAAE,GAAG,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAE1G,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AACnF,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AACnE,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACpD,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAE9C,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,cAAc,EAAE,UAAU,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAE9G,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAC7C,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAChE,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAG/C;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,CAAC,GAAG,IAAI,EAAE,CAAC,CAAC;SACxC;IACH,CAAC,CAAC,CAAC;IAEH,OAAO,MAAM,CAAC;AAChB,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,OAAO,CAAC,MAA0B;IAChD,0BAA0B;IAC1B,OAAO,IAAI,CACT,OAAO,CAAC,UAAU,CAAC,EACnB,QAAQ,EACR,IAAI,EACJ,KAAK,EACL,UAAU,EACV,MAAM,EACN,OAAO,EACP,KAAK,EACL,KAAK;IACL,mBAAmB;IACnB,aAAa,EACb,WAAW,EACX,SAAS,CACV,CAAC,MAAM,CAAC,CAAC;AACZ,CAAC","sourcesContent":["import { isFunction, isString, isNil, get, isArray, isNumber, each, toString, isEmpty } from '@antv/util';\nimport { Params } from '../../core/adaptor';\nimport { legend, animation, theme, state, annotation } from '../../adaptor/common';\nimport { getMappingFunction } from '../../adaptor/geometries/base';\nimport { interval } from '../../adaptor/geometries';\nimport { pattern } from '../../adaptor/pattern';\nimport { getLocale } from '../../core/locale';\nimport { Interaction } from '../../types/interaction';\nimport { flow, template, transformLabel, deepAssign, renderStatistic, processIllegalData } from '../../utils';\nimport { Data, Datum } from '../../types';\nimport { DEFAULT_OPTIONS } from './contants';\nimport { adaptOffset, getTotalValue, isAllZero } from './utils';\nimport { PIE_STATISTIC } from './interactions';\nimport { PieOptions } from './types';\n\n/**\n * 字段\n * @param params\n */\nfunction geometry(params: Params<PieOptions>): Params<PieOptions> {\n const { chart, options } = params;\n const { data, angleField, colorField, color, pieStyle } = options;\n\n // 处理不合法的数据\n let processData = processIllegalData(data, angleField);\n\n if (isAllZero(processData, angleField)) {\n // 数据全 0 处理,调整 position 映射\n const percentageField = '$$percentage$$';\n processData = processData.map((d) => ({ ...d, [percentageField]: 1 / processData.length }));\n chart.data(processData);\n\n const p = deepAssign({}, params, {\n options: {\n xField: '1',\n yField: percentageField,\n seriesField: colorField,\n isStack: true,\n interval: {\n color,\n style: pieStyle,\n },\n args: {\n zIndexReversed: true,\n sortZIndex: true,\n },\n },\n });\n\n interval(p);\n } else {\n chart.data(processData);\n\n const p = deepAssign({}, params, {\n options: {\n xField: '1',\n yField: angleField,\n seriesField: colorField,\n isStack: true,\n interval: {\n color,\n style: pieStyle,\n },\n args: {\n zIndexReversed: true,\n sortZIndex: true,\n },\n },\n });\n\n interval(p);\n }\n\n return params;\n}\n\n/**\n * meta 配置\n * @param params\n */\nfunction meta(params: Params<PieOptions>): Params<PieOptions> {\n const { chart, options } = params;\n const { meta, colorField } = options;\n\n // meta 直接是 scale 的信息\n const scales = deepAssign({}, meta);\n chart.scale(scales, {\n [colorField]: { type: 'cat' },\n });\n\n return params;\n}\n\n/**\n * coord 配置\n * @param params\n */\nfunction coordinate(params: Params<PieOptions>): Params<PieOptions> {\n const { chart, options } = params;\n const { radius, innerRadius, startAngle, endAngle } = options;\n\n chart.coordinate({\n type: 'theta',\n cfg: {\n radius,\n innerRadius,\n startAngle,\n endAngle,\n },\n });\n\n return params;\n}\n\n/**\n * label 配置\n * @param params\n */\nfunction label(params: Params<PieOptions>): Params<PieOptions> {\n const { chart, options } = params;\n const { label, colorField, angleField } = options;\n\n const geometry = chart.geometries[0];\n // label 为 false, 空 则不显示 label\n if (!label) {\n geometry.label(false);\n } else {\n const { callback, ...cfg } = label;\n const labelCfg = transformLabel(cfg);\n\n // ① 提供模板字符串的 label content 配置\n if (labelCfg.content) {\n const { content } = labelCfg;\n labelCfg.content = (data: object, dataum: any, index: number) => {\n const name = data[colorField];\n const value = data[angleField];\n // dymatic get scale, scale is ready this time\n const angleScale = chart.getScaleByField(angleField);\n const percent = angleScale?.scale(value);\n return isFunction(content)\n ? // append percent (number) to data, users can get origin data from `dataum._origin`\n content({ ...data, percent }, dataum, index)\n : isString(content)\n ? template(content as string, {\n value,\n name,\n // percentage (string), default keep 2\n percentage: isNumber(percent) && !isNil(value) ? `${(percent * 100).toFixed(2)}%` : null,\n })\n : content;\n };\n }\n\n const LABEL_LAYOUT_TYPE_MAP = {\n inner: '',\n outer: 'pie-outer',\n spider: 'pie-spider',\n };\n const labelLayoutType = labelCfg.type ? LABEL_LAYOUT_TYPE_MAP[labelCfg.type] : 'pie-outer';\n const labelLayoutCfg = labelCfg.layout ? (!isArray(labelCfg.layout) ? [labelCfg.layout] : labelCfg.layout) : [];\n labelCfg.layout = (labelLayoutType ? [{ type: labelLayoutType }] : []).concat(labelLayoutCfg);\n\n geometry.label({\n // fix: could not create scale, when field is undefined(attributes 中的 fields 定义都会被用来创建 scale)\n fields: colorField ? [angleField, colorField] : [angleField],\n callback,\n cfg: {\n ...labelCfg,\n offset: adaptOffset(labelCfg.type, labelCfg.offset),\n type: 'pie',\n },\n });\n }\n return params;\n}\n\n/**\n * statistic options 处理\n * 1. 默认继承 default options 的样式\n * 2. 默认使用 meta 的 formatter\n */\nexport function transformStatisticOptions(options: PieOptions): PieOptions {\n const { innerRadius, statistic, angleField, colorField, meta, locale } = options;\n\n const i18n = getLocale(locale);\n\n if (innerRadius && statistic) {\n let { title: titleOpt, content: contentOpt } = deepAssign({}, DEFAULT_OPTIONS.statistic, statistic);\n if (titleOpt !== false) {\n titleOpt = deepAssign(\n {},\n {\n formatter: (datum: Datum) => {\n // 交互中, datum existed.\n const text = datum\n ? datum[colorField]\n : !isNil(titleOpt.content)\n ? titleOpt.content\n : i18n.get(['statistic', 'total']);\n const metaFormatter = get(meta, [colorField, 'formatter']) || ((v) => v);\n return metaFormatter(text);\n },\n },\n titleOpt\n );\n }\n if (contentOpt !== false) {\n contentOpt = deepAssign(\n {},\n {\n formatter: (datum: Datum, data: Data) => {\n const dataValue = datum ? datum[angleField] : getTotalValue(data, angleField);\n const metaFormatter = get(meta, [angleField, 'formatter']) || ((v) => v);\n // 交互中\n if (datum) {\n return metaFormatter(dataValue);\n }\n return !isNil(contentOpt.content) ? contentOpt.content : metaFormatter(dataValue);\n },\n },\n contentOpt\n );\n }\n\n return deepAssign({}, { statistic: { title: titleOpt, content: contentOpt } }, options);\n }\n return options;\n}\n\n/**\n * statistic 中心文本配置\n * @param params\n */\nexport function pieAnnotation(params: Params<PieOptions>): Params<PieOptions> {\n const { chart, options } = params;\n const { innerRadius, statistic } = transformStatisticOptions(options);\n // 先清空标注,再重新渲染\n chart.getController('annotation').clear(true);\n\n // 先进行其他 annotations,再去渲染统计文本\n flow(annotation())(params);\n\n /** 中心文本 指标卡 */\n if (innerRadius && statistic) {\n renderStatistic(chart, { statistic, plotType: 'pie' });\n }\n\n return params;\n}\n\n/**\n * 饼图 tooltip 配置\n * 1. 强制 tooltip.shared 为 false\n * @param params\n */\nfunction tooltip(params: Params<PieOptions>): Params<PieOptions> {\n const { chart, options } = params;\n const { tooltip, colorField, angleField, data } = options;\n\n if (tooltip === false) {\n chart.tooltip(tooltip);\n } else {\n chart.tooltip(deepAssign({}, tooltip, { shared: false }));\n\n // 主要解决 all zero, 对于非 all zero 不再适用\n if (isAllZero(data, angleField)) {\n let fields = get(tooltip, 'fields');\n let formatter = get(tooltip, 'formatter');\n\n if (isEmpty(get(tooltip, 'fields'))) {\n fields = [colorField, angleField];\n formatter = formatter || ((datum) => ({ name: datum[colorField], value: toString(datum[angleField]) }));\n }\n chart.geometries[0].tooltip(fields.join('*'), getMappingFunction(fields, formatter));\n }\n }\n\n return params;\n}\n\n/**\n * Interaction 配置 (饼图特殊的 interaction, 中心文本变更的时候,需要将一些配置参数传进去)\n * @param params\n */\nexport function interaction(params: Params<PieOptions>): Params<PieOptions> {\n const { chart, options } = params;\n const { interactions, statistic, annotations } = transformStatisticOptions(options);\n\n each(interactions, (i: Interaction) => {\n if (i.enable === false) {\n chart.removeInteraction(i.type);\n } else if (i.type === 'pie-statistic-active') {\n // 只针对 start 阶段的配置,进行添加参数信息\n let startStages = [];\n if (!i.cfg?.start) {\n startStages = [\n {\n trigger: 'element:mouseenter',\n action: `${PIE_STATISTIC}:change`,\n arg: { statistic, annotations },\n },\n ];\n }\n each(i.cfg?.start, (stage) => {\n startStages.push({ ...stage, arg: { statistic, annotations } });\n });\n chart.interaction(i.type, deepAssign({}, i.cfg, { start: startStages }));\n } else {\n chart.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<PieOptions>) {\n // flow 的方式处理所有的配置到 G2 API\n return flow<Params<PieOptions>>(\n pattern('pieStyle'),\n geometry,\n meta,\n theme,\n coordinate,\n legend,\n tooltip,\n label,\n state,\n /** 指标卡中心文本 放在下层 */\n pieAnnotation,\n interaction,\n animation\n )(params);\n}\n"]}
@@ -53,7 +53,8 @@ export function sankeyLayout(sankeyLayoutOptions, data) {
53
53
  // 进行桑基图布局处理
54
54
  var layoutData = sankeyProcessor(data);
55
55
  // post process (x, y), etc.
56
- layoutData.nodes.forEach(function (node) {
56
+ var nodes = layoutData.nodes
57
+ .map(function (node) {
57
58
  var x0 = node.x0, x1 = node.x1, y0 = node.y0, y1 = node.y1;
58
59
  /* points
59
60
  * 3---2
@@ -62,15 +63,25 @@ export function sankeyLayout(sankeyLayoutOptions, data) {
62
63
  */
63
64
  node.x = [x0, x1, x1, x0];
64
65
  node.y = [y0, y0, y1, y1];
66
+ return node;
67
+ })
68
+ .filter(function (node) {
69
+ return node.name !== null;
65
70
  });
66
- layoutData.links.forEach(function (edge) {
71
+ var links = layoutData.links
72
+ .map(function (edge) {
67
73
  var source = edge.source, target = edge.target;
68
74
  var sx = source.x1;
69
75
  var tx = target.x0;
70
76
  edge.x = [sx, sx, tx, tx];
71
77
  var offset = edge.width / 2;
72
78
  edge.y = [edge.y0 + offset, edge.y0 - offset, edge.y1 + offset, edge.y1 - offset];
79
+ return edge;
80
+ })
81
+ .filter(function (edge) {
82
+ var source = edge.source, target = edge.target;
83
+ return source.name !== null && target.name !== null;
73
84
  });
74
- return layoutData;
85
+ return { nodes: nodes, links: links };
75
86
  }
76
87
  //# sourceMappingURL=layout.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"layout.js","sourceRoot":"","sources":["../../../src/plots/sankey/layout.ts"],"names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,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC;QAC9B,IAAI,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,GAAG,MAAM,EAAE,IAAI,CAAC,EAAE,GAAG,MAAM,EAAE,IAAI,CAAC,EAAE,GAAG,MAAM,EAAE,IAAI,CAAC,EAAE,GAAG,MAAM,CAAC,CAAC;IACpF,CAAC,CAAC,CAAC;IAEH,OAAO,UAAU,CAAC;AACpB,CAAC","sourcesContent":["import { assign, isString, isFunction } from '@antv/util';\nimport { Datum } from '../../types';\nimport { sankey, left, right, center, justify } from './sankey';\n\nconst ALIGN_METHOD = {\n left,\n right,\n center,\n justify,\n};\n\ntype InputNode = {\n readonly name: string;\n};\n\ntype InputLink = {\n readonly source: number;\n readonly target: number;\n readonly value: number;\n};\n\ntype OutputNode = {\n readonly name: string;\n readonly x0: number;\n readonly x1: number;\n readonly y0: number;\n readonly y1: number;\n readonly depth: number;\n readonly value: number;\n\n // 用于绘制 polygon\n x: number[];\n y: number[];\n};\n\ntype OutputLink = {\n readonly source: OutputNode;\n readonly target: OutputNode;\n readonly value: number;\n readonly width: number;\n readonly y0: number;\n readonly y1: number;\n\n // 用于绘制 edge\n x?: number[];\n y?: number[];\n};\n\n/**\n * 桑基图布局的数据结构定义\n */\nexport type SankeyLayoutInputData = {\n readonly nodes: InputNode[];\n readonly links: InputLink[];\n};\n\ntype SankeyLayoutOutputData = {\n readonly nodes: OutputNode[];\n readonly links: OutputLink[];\n};\n\n/**\n * 对齐方式的类型定义\n */\nexport type NodeAlign = keyof typeof ALIGN_METHOD | Function;\n\n/**\n * 节点的 depth 自定义\n */\nexport type NodeDepth = (datum: Datum, maxDepth: number) => number;\n\n/**\n * 节点排序方法的类型定义\n */\nexport type NodeSort = (a: Datum, b: Datum) => number;\n\n/**\n * 布局参数的定义\n */\nexport type SankeyLayoutOptions = {\n readonly nodeId?: (node: Datum) => any;\n // readonly value?: (node: Datum) => any;\n // readonly source?: (edge: Datum) => any;\n // readonly target?: (edge: Datum) => any;\n // sankey.nodeSort(undefined) is the default and resorts by ascending breadth during each iteration.\n // sankey.nodeSort(null) specifies the input order of nodes and never sorts.\n // sankey.nodeSort(function) specifies the given order as a comparator function and sorts once on initialization.\n readonly nodeSort?: (a: any, b: any) => number;\n readonly nodeAlign?: NodeAlign;\n readonly nodeWidth?: number;\n readonly nodePadding?: number;\n readonly nodeDepth?: NodeDepth;\n};\n\n/**\n * 默认值\n */\nconst DEFAULT_OPTIONS: Partial<SankeyLayoutOptions> = {\n nodeId: (node: Datum) => node.index,\n nodeAlign: 'justify',\n nodeWidth: 0.008,\n nodePadding: 0.03,\n nodeSort: undefined,\n};\n\n/**\n * 获得 align function\n * @param nodeAlign\n * @param nodeDepth\n */\nexport function getNodeAlignFunction(nodeAlign: NodeAlign) {\n const func = isString(nodeAlign) ? ALIGN_METHOD[nodeAlign] : isFunction(nodeAlign) ? nodeAlign : null;\n\n return func || justify;\n}\n\nexport function getDefaultOptions(sankeyLayoutOptions: SankeyLayoutOptions) {\n return assign({}, DEFAULT_OPTIONS, sankeyLayoutOptions);\n}\n\n/**\n * 桑基图利用数据进行布局的函数,最终返回节点、边的位置(0 - 1 的信息)\n * 将会修改 data 数据\n * @param sankeyLayoutOptions\n * @param data\n */\nexport function sankeyLayout(\n sankeyLayoutOptions: SankeyLayoutOptions,\n data: SankeyLayoutInputData\n): SankeyLayoutOutputData {\n const options = getDefaultOptions(sankeyLayoutOptions);\n\n const { nodeId, nodeSort, nodeAlign, nodeWidth, nodePadding, nodeDepth } = options;\n\n const sankeyProcessor = sankey()\n // .links((d: any) => d.links)\n // .nodes((d: any) => d.nodes)\n .nodeSort(nodeSort)\n .nodeWidth(nodeWidth)\n .nodePadding(nodePadding)\n .nodeDepth(nodeDepth)\n .nodeAlign(getNodeAlignFunction(nodeAlign))\n .extent([\n [0, 0],\n [1, 1],\n ])\n .nodeId(nodeId);\n\n // 进行桑基图布局处理\n const layoutData: SankeyLayoutOutputData = sankeyProcessor(data);\n\n // post process (x, y), etc.\n layoutData.nodes.forEach((node) => {\n const { x0, x1, y0, y1 } = node;\n /* points\n * 3---2\n * | |\n * 0---1\n */\n node.x = [x0, x1, x1, x0];\n node.y = [y0, y0, y1, y1];\n });\n\n layoutData.links.forEach((edge) => {\n const { source, target } = edge;\n const sx = source.x1;\n const tx = target.x0;\n edge.x = [sx, sx, tx, tx];\n const offset = edge.width / 2;\n edge.y = [edge.y0 + offset, edge.y0 - offset, edge.y1 + offset, edge.y1 - offset];\n });\n\n return layoutData;\n}\n"]}
1
+ {"version":3,"file":"layout.js","sourceRoot":"","sources":["../../../src/plots/sankey/layout.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAE1D,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAEhE,IAAM,YAAY,GAAG;IACnB,IAAI,MAAA;IACJ,KAAK,OAAA;IACL,MAAM,QAAA;IACN,OAAO,SAAA;CACR,CAAC;AAqFF;;GAEG;AACH,IAAM,eAAe,GAAiC;IACpD,MAAM,EAAE,UAAC,IAAW,IAAK,OAAA,IAAI,CAAC,KAAK,EAAV,CAAU;IACnC,SAAS,EAAE,SAAS;IACpB,SAAS,EAAE,KAAK;IAChB,WAAW,EAAE,IAAI;IACjB,QAAQ,EAAE,SAAS;CACpB,CAAC;AAEF;;;;GAIG;AACH,MAAM,UAAU,oBAAoB,CAAC,SAAoB;IACvD,IAAM,IAAI,GAAG,QAAQ,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC;IAEtG,OAAO,IAAI,IAAI,OAAO,CAAC;AACzB,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,mB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EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC;QAE1B,OAAO,IAAI,CAAC;IACd,CAAC,CAAC;SACD,MAAM,CAAC,UAAC,IAAI;QACX,OAAO,IAAI,CAAC,IAAI,KAAK,IAAI,CAAC;IAC5B,CAAC,CAAC,CAAC;IAEL,IAAM,KAAK,GAAG,UAAU,CAAC,KAAK;SAC3B,GAAG,CAAC,UAAC,IAAI;QACA,IAAA,MAAM,GAAa,IAAI,OAAjB,EAAE,MAAM,GAAK,IAAI,OAAT,CAAU;QAChC,IAAM,EAAE,GAAG,MAAM,CAAC,EAAE,CAAC;QACrB,IAAM,EAAE,GAAG,MAAM,CAAC,EAAE,CAAC;QACrB,IAAI,CAAC,CAAC,GAAG,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC;QAC1B,IAAM,MAAM,GAAG,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC;QAC9B,IAAI,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,GAAG,MAAM,EAAE,IAAI,CAAC,EAAE,GAAG,MAAM,EAAE,IAAI,CAAC,EAAE,GAAG,MAAM,EAAE,IAAI,CAAC,EAAE,GAAG,MAAM,CAAC,CAAC;QAElF,OAAO,IAAI,CAAC;IACd,CAAC,CAAC;SACD,MAAM,CAAC,UAAC,IAAI;QACH,IAAA,MAAM,GAAa,IAAI,OAAjB,EAAE,MAAM,GAAK,IAAI,OAAT,CAAU;QAChC,OAAO,MAAM,CAAC,IAAI,KAAK,IAAI,IAAI,MAAM,CAAC,IAAI,KAAK,IAAI,CAAC;IACtD,CAAC,CAAC,CAAC;IAEL,OAAO,EAAE,KAAK,OAAA,EAAE,KAAK,OAAA,EAAE,CAAC;AAC1B,CAAC","sourcesContent":["import { assign, isString, isFunction } from '@antv/util';\nimport { Datum } from '../../types';\nimport { sankey, left, right, center, justify } from './sankey';\n\nconst ALIGN_METHOD = {\n left,\n right,\n center,\n justify,\n};\n\ntype InputNode = {\n readonly name: string;\n};\n\ntype InputLink = {\n readonly source: number;\n readonly target: number;\n readonly value: number;\n};\n\ntype OutputNode = {\n readonly name: string;\n readonly x0: number;\n readonly x1: number;\n readonly y0: number;\n readonly y1: number;\n readonly depth: number;\n readonly value: number;\n\n // 用于绘制 polygon\n x: number[];\n y: number[];\n};\n\ntype OutputLink = {\n readonly source: OutputNode;\n readonly target: OutputNode;\n readonly value: number;\n readonly width: number;\n readonly y0: number;\n readonly y1: number;\n\n // 用于绘制 edge\n x?: number[];\n y?: number[];\n};\n\n/**\n * 桑基图布局的数据结构定义\n */\nexport type SankeyLayoutInputData = {\n readonly nodes: InputNode[];\n readonly links: InputLink[];\n};\n\ntype SankeyLayoutOutputData = {\n readonly nodes: OutputNode[];\n readonly links: OutputLink[];\n};\n\n/**\n * 对齐方式的类型定义\n */\nexport type NodeAlign = keyof typeof ALIGN_METHOD | Function;\n\n/**\n * 节点的 depth 自定义\n */\nexport type NodeDepth = (datum: Datum, maxDepth: number) => number;\n\n/**\n * 节点排序方法的类型定义\n */\nexport type NodeSort = (a: Datum, b: Datum) => number;\n\n/**\n * 布局参数的定义\n */\nexport type SankeyLayoutOptions = {\n readonly nodeId?: (node: Datum) => any;\n // readonly value?: (node: Datum) => any;\n // readonly source?: (edge: Datum) => any;\n // readonly target?: (edge: Datum) => any;\n // sankey.nodeSort(undefined) is the default and resorts by ascending breadth during each iteration.\n // sankey.nodeSort(null) specifies the input order of nodes and never sorts.\n // sankey.nodeSort(function) specifies the given order as a comparator function and sorts once on initialization.\n readonly nodeSort?: (a: any, b: any) => number;\n readonly nodeAlign?: NodeAlign;\n readonly nodeWidth?: number;\n readonly nodePadding?: number;\n readonly nodeDepth?: NodeDepth;\n};\n\n/**\n * 默认值\n */\nconst DEFAULT_OPTIONS: Partial<SankeyLayoutOptions> = {\n nodeId: (node: Datum) => node.index,\n nodeAlign: 'justify',\n nodeWidth: 0.008,\n nodePadding: 0.03,\n nodeSort: undefined,\n};\n\n/**\n * 获得 align function\n * @param nodeAlign\n * @param nodeDepth\n */\nexport function getNodeAlignFunction(nodeAlign: NodeAlign) {\n const func = isString(nodeAlign) ? ALIGN_METHOD[nodeAlign] : isFunction(nodeAlign) ? nodeAlign : null;\n\n return func || justify;\n}\n\nexport function getDefaultOptions(sankeyLayoutOptions: SankeyLayoutOptions) {\n return assign({}, DEFAULT_OPTIONS, sankeyLayoutOptions);\n}\n\n/**\n * 桑基图利用数据进行布局的函数,最终返回节点、边的位置(0 - 1 的信息)\n * 将会修改 data 数据\n * @param sankeyLayoutOptions\n * @param data\n */\nexport function sankeyLayout(\n sankeyLayoutOptions: SankeyLayoutOptions,\n data: SankeyLayoutInputData\n): SankeyLayoutOutputData {\n const options = getDefaultOptions(sankeyLayoutOptions);\n\n const { nodeId, nodeSort, nodeAlign, nodeWidth, nodePadding, nodeDepth } = options;\n\n const sankeyProcessor = sankey()\n // .links((d: any) => d.links)\n // .nodes((d: any) => d.nodes)\n .nodeSort(nodeSort)\n .nodeWidth(nodeWidth)\n .nodePadding(nodePadding)\n .nodeDepth(nodeDepth)\n .nodeAlign(getNodeAlignFunction(nodeAlign))\n .extent([\n [0, 0],\n [1, 1],\n ])\n .nodeId(nodeId);\n\n // 进行桑基图布局处理\n const layoutData: SankeyLayoutOutputData = sankeyProcessor(data);\n\n // post process (x, y), etc.\n const nodes = layoutData.nodes\n .map((node) => {\n const { x0, x1, y0, y1 } = node;\n /* points\n * 3---2\n * | |\n * 0---1\n */\n node.x = [x0, x1, x1, x0];\n node.y = [y0, y0, y1, y1];\n\n return node;\n })\n .filter((node) => {\n return node.name !== null;\n });\n\n const links = layoutData.links\n .map((edge) => {\n const { source, target } = edge;\n const sx = source.x1;\n const tx = target.x0;\n edge.x = [sx, sx, tx, tx];\n const offset = edge.width / 2;\n edge.y = [edge.y0 + offset, edge.y0 - offset, edge.y1 + offset, edge.y1 - offset];\n\n return edge;\n })\n .filter((edge) => {\n const { source, target } = edge;\n return source.name !== null && target.name !== null;\n });\n\n return { nodes, links };\n}\n"]}
@@ -135,6 +135,12 @@ export declare type Options = {
135
135
  * @default false
136
136
  */
137
137
  readonly supportCSSTransform?: boolean;
138
+ /**
139
+ * @title 是否开启 label 延迟渲染
140
+ * @description 开启后 label 渲染会在浏览器空闲时机执行。可制定具体 number 数值,来限定 timeout 时间 (建议开启时,指定 timeout 时间)
141
+ * @default false
142
+ */
143
+ readonly useDeferredLabel?: boolean | number;
138
144
  /**
139
145
  * @title 数据
140
146
  * @description 设置画布具体的数据