@amcharts/amcharts5 5.16.2 → 5.17.1

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 (227) hide show
  1. package/.internal/charts/map/MapChartDefaultTheme.d.ts.map +1 -1
  2. package/.internal/charts/map/MapChartDefaultTheme.js +3 -0
  3. package/.internal/charts/map/MapChartDefaultTheme.js.map +1 -1
  4. package/.internal/charts/map/MapSankeyNodes.d.ts +155 -0
  5. package/.internal/charts/map/MapSankeyNodes.d.ts.map +1 -0
  6. package/.internal/charts/map/MapSankeyNodes.js +151 -0
  7. package/.internal/charts/map/MapSankeyNodes.js.map +1 -0
  8. package/.internal/charts/map/MapSankeySeries.d.ts +412 -0
  9. package/.internal/charts/map/MapSankeySeries.d.ts.map +1 -0
  10. package/.internal/charts/map/MapSankeySeries.js +868 -0
  11. package/.internal/charts/map/MapSankeySeries.js.map +1 -0
  12. package/.internal/core/Classes.d.ts +6 -0
  13. package/.internal/core/Classes.d.ts.map +1 -1
  14. package/.internal/core/Classes.js.map +1 -1
  15. package/.internal/core/Registry.js +1 -1
  16. package/.internal/core/Registry.js.map +1 -1
  17. package/.internal/core/util/Entity.d.ts.map +1 -1
  18. package/.internal/core/util/Entity.js +6 -0
  19. package/.internal/core/util/Entity.js.map +1 -1
  20. package/.internal/core/util/Math.d.ts +132 -49
  21. package/.internal/core/util/Math.d.ts.map +1 -1
  22. package/.internal/core/util/Math.js +151 -50
  23. package/.internal/core/util/Math.js.map +1 -1
  24. package/.internal/core/util/Object.d.ts +24 -1
  25. package/.internal/core/util/Object.d.ts.map +1 -1
  26. package/.internal/core/util/Object.js +24 -1
  27. package/.internal/core/util/Object.js.map +1 -1
  28. package/.internal/core/util/Utils.d.ts +69 -3
  29. package/.internal/core/util/Utils.d.ts.map +1 -1
  30. package/.internal/core/util/Utils.js +72 -18
  31. package/.internal/core/util/Utils.js.map +1 -1
  32. package/.internal/plugins/json/Classes-script.d.ts +6 -0
  33. package/.internal/plugins/json/Classes-script.d.ts.map +1 -1
  34. package/.internal/plugins/json/Classes-script.js +3 -0
  35. package/.internal/plugins/json/Classes-script.js.map +1 -1
  36. package/.internal/plugins/json/Classes.d.ts +6 -0
  37. package/.internal/plugins/json/Classes.d.ts.map +1 -1
  38. package/.internal/plugins/json/Classes.js +3 -0
  39. package/.internal/plugins/json/Classes.js.map +1 -1
  40. package/CHANGELOG.md +23 -8
  41. package/examples/javascript/flow-arc-horizontal/package.json +1 -1
  42. package/examples/javascript/flow-arc-vertical/package.json +1 -1
  43. package/examples/javascript/flow-chord/package.json +1 -1
  44. package/examples/javascript/flow-chord-directed/package.json +1 -1
  45. package/examples/javascript/flow-chord-non-ribbon/package.json +1 -1
  46. package/examples/javascript/flow-sankey/package.json +1 -1
  47. package/examples/javascript/gantt/package.json +1 -1
  48. package/examples/javascript/gantt-multilevel/package.json +1 -1
  49. package/examples/javascript/gantt-simple/package.json +1 -1
  50. package/examples/javascript/gauge/package.json +1 -1
  51. package/examples/javascript/gauge-bands/package.json +1 -1
  52. package/examples/javascript/hierarchy-force-directed/package.json +1 -1
  53. package/examples/javascript/hierarchy-pack/package.json +1 -1
  54. package/examples/javascript/hierarchy-partition/package.json +1 -1
  55. package/examples/javascript/hierarchy-sunburst/package.json +1 -1
  56. package/examples/javascript/hierarchy-tree/package.json +1 -1
  57. package/examples/javascript/hierarchy-treemap/package.json +1 -1
  58. package/examples/javascript/hierarchy-voronoi-treemap/package.json +1 -1
  59. package/examples/javascript/jest/package.json +1 -1
  60. package/examples/javascript/json-pie/package.json +1 -1
  61. package/examples/javascript/json-xy/package.json +1 -1
  62. package/examples/javascript/map-animating-along-lines/package.json +1 -1
  63. package/examples/javascript/map-clustered-points/package.json +1 -1
  64. package/examples/javascript/map-day-and-night/package.json +1 -1
  65. package/examples/javascript/map-globe-rotate-to-country/package.json +1 -1
  66. package/examples/javascript/map-globe-with-projected-circles/package.json +1 -1
  67. package/examples/javascript/map-sankey/README.md +6 -0
  68. package/examples/javascript/map-sankey/index.css +11 -0
  69. package/examples/javascript/map-sankey/index.html +13 -0
  70. package/examples/javascript/map-sankey/index.js +361 -0
  71. package/examples/javascript/map-sankey/package.json +17 -0
  72. package/examples/javascript/map-sankey/webpack.config.js +38 -0
  73. package/examples/javascript/map-sankey-waypoints/README.md +6 -0
  74. package/examples/javascript/map-sankey-waypoints/index.css +11 -0
  75. package/examples/javascript/map-sankey-waypoints/index.html +13 -0
  76. package/examples/javascript/map-sankey-waypoints/index.js +394 -0
  77. package/examples/javascript/map-sankey-waypoints/package.json +17 -0
  78. package/examples/javascript/map-sankey-waypoints/webpack.config.js +38 -0
  79. package/examples/javascript/map-with-bubbles/package.json +1 -1
  80. package/examples/javascript/map-zoom-to-country/package.json +1 -1
  81. package/examples/javascript/misc-40-charts/package.json +1 -1
  82. package/examples/javascript/misc-microchart-grid/package.json +1 -1
  83. package/examples/javascript/pie-chart/package.json +1 -1
  84. package/examples/javascript/pie-donut-chart/package.json +1 -1
  85. package/examples/javascript/pie-variable-radius/package.json +1 -1
  86. package/examples/javascript/radar-column-iwatch-style/package.json +1 -1
  87. package/examples/javascript/radar-heat-map/package.json +1 -1
  88. package/examples/javascript/radar-line/package.json +1 -1
  89. package/examples/javascript/radar-time-line/package.json +1 -1
  90. package/examples/javascript/sliced-funnel/package.json +1 -1
  91. package/examples/javascript/sliced-pictorial-stacked/package.json +1 -1
  92. package/examples/javascript/sliced-pyramid/package.json +1 -1
  93. package/examples/javascript/stock-chart/package.json +1 -1
  94. package/examples/javascript/stock-chart-comparing-stocks/package.json +1 -1
  95. package/examples/javascript/stock-chart-data-granularity/package.json +1 -1
  96. package/examples/javascript/stock-chart-data-grouping/package.json +1 -1
  97. package/examples/javascript/stock-chart-intraday/package.json +1 -1
  98. package/examples/javascript/stock-chart-live/package.json +1 -1
  99. package/examples/javascript/stock-chart-volume-separate-panel/package.json +1 -1
  100. package/examples/javascript/timeline-horizontal-serpentine-chart/package.json +1 -1
  101. package/examples/javascript/timeline-linear-process-diagram/package.json +1 -1
  102. package/examples/javascript/timeline-serpentine-chart/package.json +1 -1
  103. package/examples/javascript/timeline-spiral-chart/package.json +1 -1
  104. package/examples/javascript/venn-diagram/package.json +1 -1
  105. package/examples/javascript/wordcloud-with-data/package.json +1 -1
  106. package/examples/javascript/wordcloud-with-text/package.json +1 -1
  107. package/examples/javascript/xy-100-percent-stacked-column/package.json +1 -1
  108. package/examples/javascript/xy-animated-bullet-at-the-end-of-the-series/package.json +1 -1
  109. package/examples/javascript/xy-bubble/package.json +1 -1
  110. package/examples/javascript/xy-candlestick/package.json +1 -1
  111. package/examples/javascript/xy-clustered-column/package.json +1 -1
  112. package/examples/javascript/xy-column/package.json +1 -1
  113. package/examples/javascript/xy-comparing-series-google-analytics-style/package.json +1 -1
  114. package/examples/javascript/xy-data-grouping/package.json +1 -1
  115. package/examples/javascript/xy-draggable-range/package.json +1 -1
  116. package/examples/javascript/xy-drawing-series-with-mouse-or-touch/package.json +1 -1
  117. package/examples/javascript/xy-dumbbell plot/package.json +1 -1
  118. package/examples/javascript/xy-evenly-spaced-date-axis/package.json +1 -1
  119. package/examples/javascript/xy-line/package.json +1 -1
  120. package/examples/javascript/xy-line-highlight-on-legend-hover/package.json +1 -1
  121. package/examples/javascript/xy-live-data/package.json +1 -1
  122. package/examples/javascript/xy-multiple-synced-value-axes/package.json +1 -1
  123. package/examples/javascript/xy-ohlc/package.json +1 -1
  124. package/examples/javascript/xy-real-time-data-sorting/package.json +1 -1
  125. package/examples/javascript/xy-smoothed-line/package.json +1 -1
  126. package/examples/javascript/xy-stacked-and-clustered-column/package.json +1 -1
  127. package/examples/javascript/xy-stacked-column/package.json +1 -1
  128. package/examples/javascript/xy-stacked-step/package.json +1 -1
  129. package/examples/javascript/xy-stock/package.json +1 -1
  130. package/examples/javascript/xy-stock-comparing/package.json +1 -1
  131. package/examples/typescript/flow-arc-horizontal/package.json +1 -1
  132. package/examples/typescript/flow-arc-vertical/package.json +1 -1
  133. package/examples/typescript/flow-chord/package.json +1 -1
  134. package/examples/typescript/flow-chord-directed/package.json +1 -1
  135. package/examples/typescript/flow-chord-non-ribbon/package.json +1 -1
  136. package/examples/typescript/flow-sankey/package.json +1 -1
  137. package/examples/typescript/gantt/package.json +1 -1
  138. package/examples/typescript/gantt-multilevel/package.json +1 -1
  139. package/examples/typescript/gantt-simple/package.json +1 -1
  140. package/examples/typescript/gauge/package.json +1 -1
  141. package/examples/typescript/gauge-bands/package.json +1 -1
  142. package/examples/typescript/hierarchy-force-directed/package.json +1 -1
  143. package/examples/typescript/hierarchy-pack/package.json +1 -1
  144. package/examples/typescript/hierarchy-partition/package.json +1 -1
  145. package/examples/typescript/hierarchy-sunburst/package.json +1 -1
  146. package/examples/typescript/hierarchy-tree/package.json +1 -1
  147. package/examples/typescript/hierarchy-treemap/package.json +1 -1
  148. package/examples/typescript/hierarchy-voronoi-treemap/package.json +1 -1
  149. package/examples/typescript/jest/package.json +1 -1
  150. package/examples/typescript/json-pie/package.json +1 -1
  151. package/examples/typescript/json-xy/package.json +1 -1
  152. package/examples/typescript/map-animating-along-lines/package.json +1 -1
  153. package/examples/typescript/map-clustered-points/package.json +1 -1
  154. package/examples/typescript/map-day-and-night/package.json +1 -1
  155. package/examples/typescript/map-globe-rotate-to-country/package.json +1 -1
  156. package/examples/typescript/map-globe-with-projected-circles/package.json +1 -1
  157. package/examples/typescript/map-sankey/README.md +6 -0
  158. package/examples/typescript/map-sankey/index.css +11 -0
  159. package/examples/typescript/map-sankey/index.html +13 -0
  160. package/examples/typescript/map-sankey/index.ts +361 -0
  161. package/examples/typescript/map-sankey/package.json +19 -0
  162. package/examples/typescript/map-sankey/tsconfig.json +12 -0
  163. package/examples/typescript/map-sankey/webpack.config.js +45 -0
  164. package/examples/typescript/map-sankey-waypoints/README.md +6 -0
  165. package/examples/typescript/map-sankey-waypoints/index.css +11 -0
  166. package/examples/typescript/map-sankey-waypoints/index.html +13 -0
  167. package/examples/typescript/map-sankey-waypoints/index.ts +394 -0
  168. package/examples/typescript/map-sankey-waypoints/package.json +19 -0
  169. package/examples/typescript/map-sankey-waypoints/tsconfig.json +12 -0
  170. package/examples/typescript/map-sankey-waypoints/webpack.config.js +45 -0
  171. package/examples/typescript/map-with-bubbles/package.json +1 -1
  172. package/examples/typescript/map-zoom-to-country/package.json +1 -1
  173. package/examples/typescript/misc-40-charts/package.json +1 -1
  174. package/examples/typescript/misc-microchart-grid/package.json +1 -1
  175. package/examples/typescript/pie-chart/package.json +1 -1
  176. package/examples/typescript/pie-donut-chart/package.json +1 -1
  177. package/examples/typescript/pie-variable-radius/package.json +1 -1
  178. package/examples/typescript/radar-column-iwatch-style/package.json +1 -1
  179. package/examples/typescript/radar-heat-map/package.json +1 -1
  180. package/examples/typescript/radar-line/package.json +1 -1
  181. package/examples/typescript/radar-time-line/package.json +1 -1
  182. package/examples/typescript/sliced-funnel/package.json +1 -1
  183. package/examples/typescript/sliced-pictorial-stacked/package.json +1 -1
  184. package/examples/typescript/sliced-pyramid/package.json +1 -1
  185. package/examples/typescript/stock-chart/package.json +1 -1
  186. package/examples/typescript/stock-chart-comparing-stocks/package.json +1 -1
  187. package/examples/typescript/stock-chart-data-granularity/package.json +1 -1
  188. package/examples/typescript/stock-chart-data-grouping/package.json +1 -1
  189. package/examples/typescript/stock-chart-intraday/package.json +1 -1
  190. package/examples/typescript/stock-chart-live/package.json +1 -1
  191. package/examples/typescript/stock-chart-volume-separate-panel/package.json +1 -1
  192. package/examples/typescript/timeline-horizontal-serpentine-chart/package.json +1 -1
  193. package/examples/typescript/timeline-linear-process-diagram/package.json +1 -1
  194. package/examples/typescript/timeline-serpentine-chart/package.json +1 -1
  195. package/examples/typescript/timeline-spiral-chart/package.json +1 -1
  196. package/examples/typescript/venn-diagram/package.json +1 -1
  197. package/examples/typescript/wordcloud-with-data/package.json +1 -1
  198. package/examples/typescript/wordcloud-with-text/package.json +1 -1
  199. package/examples/typescript/xy-100-percent-stacked-column/package.json +1 -1
  200. package/examples/typescript/xy-animated-bullet-at-the-end-of-the-series/package.json +1 -1
  201. package/examples/typescript/xy-bubble/package.json +1 -1
  202. package/examples/typescript/xy-candlestick/package.json +1 -1
  203. package/examples/typescript/xy-clustered-column/package.json +1 -1
  204. package/examples/typescript/xy-column/package.json +1 -1
  205. package/examples/typescript/xy-comparing-series-google-analytics-style/package.json +1 -1
  206. package/examples/typescript/xy-data-grouping/package.json +1 -1
  207. package/examples/typescript/xy-draggable-range/package.json +1 -1
  208. package/examples/typescript/xy-drawing-series-with-mouse-or-touch/package.json +1 -1
  209. package/examples/typescript/xy-dumbbell plot/package.json +1 -1
  210. package/examples/typescript/xy-evenly-spaced-date-axis/package.json +1 -1
  211. package/examples/typescript/xy-line/package.json +1 -1
  212. package/examples/typescript/xy-line-highlight-on-legend-hover/package.json +1 -1
  213. package/examples/typescript/xy-live-data/package.json +1 -1
  214. package/examples/typescript/xy-multiple-synced-value-axes/package.json +1 -1
  215. package/examples/typescript/xy-ohlc/package.json +1 -1
  216. package/examples/typescript/xy-real-time-data-sorting/package.json +1 -1
  217. package/examples/typescript/xy-smoothed-line/package.json +1 -1
  218. package/examples/typescript/xy-stacked-and-clustered-column/package.json +1 -1
  219. package/examples/typescript/xy-stacked-column/package.json +1 -1
  220. package/examples/typescript/xy-stacked-step/package.json +1 -1
  221. package/examples/typescript/xy-stock/package.json +1 -1
  222. package/examples/typescript/xy-stock-comparing/package.json +1 -1
  223. package/map.d.ts +2 -0
  224. package/map.d.ts.map +1 -1
  225. package/map.js +2 -0
  226. package/map.js.map +1 -1
  227. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"MapChartDefaultTheme.d.ts","sourceRoot":"","sources":["../../../../../src/.internal/charts/map/MapChartDefaultTheme.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAQzC;;GAEG;AACH,qBAAa,oBAAqB,SAAQ,KAAK;IAC9C,SAAS,CAAC,iBAAiB;CAoG3B"}
1
+ {"version":3,"file":"MapChartDefaultTheme.d.ts","sourceRoot":"","sources":["../../../../../src/.internal/charts/map/MapChartDefaultTheme.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAQzC;;GAEG;AACH,qBAAa,oBAAqB,SAAQ,KAAK;IAC9C,SAAS,CAAC,iBAAiB;CAwG3B"}
@@ -62,6 +62,9 @@ export class MapChartDefaultTheme extends Theme {
62
62
  r("MapLineSeries").setAll({
63
63
  affectsBounds: false
64
64
  });
65
+ r("MapSankeySeries").setAll({
66
+ affectsBounds: false
67
+ });
65
68
  {
66
69
  const rule = r("MapPolygon");
67
70
  rule.setAll({
@@ -1 +1 @@
1
- {"version":3,"file":"MapChartDefaultTheme.js","sourceRoot":"","sources":["../../../../../src/.internal/charts/map/MapChartDefaultTheme.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAErD,OAAO,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AAErC,OAAO,KAAK,KAAK,MAAM,sBAAsB,CAAC;AAG9C;;GAEG;AACH,MAAM,OAAO,oBAAqB,SAAQ,KAAK;IACpC,iBAAiB;QAC1B,KAAK,CAAC,iBAAiB,EAAE,CAAC;QAE1B,MAAM,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,eAAe,CAAC;QACtC,MAAM,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAE/B;;;;WAIG;QAEH,CAAC,CAAC,UAAU,CAAC,CAAC,MAAM,CAAC;YACpB,UAAU,EAAE,WAAW,EAAE;YACzB,IAAI,EAAE,YAAY;YAClB,IAAI,EAAE,YAAY;YAClB,SAAS,EAAE,IAAI;YACf,QAAQ,EAAE,CAAC;YACX,SAAS,EAAE,CAAC;YACZ,SAAS,EAAE,CAAC;YACZ,SAAS,EAAE,CA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G;gBACd,UAAU,EAAE,KAAK;gBACjB,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,CAAC;gBACd,QAAQ,EAAE,UAAU;gBACpB,WAAW,EAAE,GAAG;gBAChB,aAAa,EAAE,CAAC;aAChB,CAAC,CAAC;YAEH,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,eAAe,CAAC,CAAC;YAC5C,QAAQ,CAAC,IAAI,EAAE,QAAQ,EAAE,EAAE,EAAE,YAAY,CAAC,CAAC;SAC3C;QAGD,CAAC,CAAC,QAAQ,EAAE,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC;YACzC,OAAO,EAAE,KAAK;SACd,CAAC,CAAC;QAEH;;;;WAIG;QAEH,CAAC,CAAC,iBAAiB,CAAC,CAAC,MAAM,CAAC;YAC3B,IAAI,EAAE,EAAE;SACR,CAAC,CAAC;IACJ,CAAC;CACD","sourcesContent":["import { Theme } from \"../../core/Theme\";\r\nimport { setColor } from \"../../themes/DefaultTheme\";\r\n\r\nimport { geoMercator } from \"d3-geo\";\r\n\r\nimport * as $ease from \"../../core/util/Ease\";\r\n\r\n\r\n/**\r\n * @ignore\r\n */\r\nexport class MapChartDefaultTheme extends Theme {\r\n\tprotected setupDefaultRules() {\r\n\t\tsuper.setupDefaultRules();\r\n\r\n\t\tconst ic = this._root.interfaceColors;\r\n\t\tconst r = this.rule.bind(this);\r\n\r\n\t\t/**\r\n\t\t * ========================================================================\r\n\t\t * charts/map\r\n\t\t * ========================================================================\r\n\t\t */\r\n\r\n\t\tr(\"MapChart\").setAll({\r\n\t\t\tprojection: geoMercator(),\r\n\t\t\tpanX: \"translateX\",\r\n\t\t\tpanY: \"translateY\",\r\n\t\t\tpinchZoom: true,\r\n\t\t\tzoomStep: 2,\r\n\t\t\tzoomLevel: 1,\r\n\t\t\trotationX: 0,\r\n\t\t\trotationY: 0,\r\n\t\t\trotationZ: 0,\r\n\t\t\tmaxZoomLevel: 32,\r\n\t\t\tminZoomLevel: 1,\r\n\t\t\twheelY: \"zoom\",\r\n\t\t\twheelX: \"none\",\r\n\t\t\tanimationEasing: $ease.out($ease.cubic),\r\n\t\t\twheelEasing: $ease.out($ease.cubic),\r\n\t\t\twheelDuration: 0,\r\n\t\t\twheelSensitivity: 1,\r\n\t\t\tmaxPanOut: 0.4,\r\n\t\t\tcenterMapOnZoomOut: true\r\n\t\t});\r\n\r\n\t\t{\r\n\t\t\tconst rule = r(\"MapLine\");\r\n\r\n\t\t\trule.setAll({\r\n\t\t\t\tprecision: 0.5,\r\n\t\t\t\trole: \"figure\",\r\n\t\t\t});\r\n\r\n\t\t\tsetColor(rule, \"stroke\", ic, \"grid\");\r\n\t\t}\r\n\r\n\t\tr(\"MapPolygonSeries\").setAll({\r\n\t\t\taffectsBounds: true\r\n\t\t})\r\n\r\n\r\n\t\tr(\"MapPointSeries\").setAll({\r\n\t\t\taffectsBounds: false,\r\n\t\t\tclipFront: false,\r\n\t\t\tclipBack: true,\r\n\t\t\tautoScale: false\r\n\t\t})\r\n\r\n\t\tr(\"ClusteredPointSeries\").setAll({\r\n\t\t\tminDistance: 20,\r\n\t\t\tscatterDistance: 3,\r\n\t\t\tscatterRadius: 8,\r\n\t\t\tstopClusterZoom: 0.95\r\n\t\t})\r\n\r\n\t\tr(\"MapLineSeries\").setAll({\r\n\t\t\taffectsBounds: false\r\n\t\t})\r\n\r\n\t\t{\r\n\t\t\tconst rule = r(\"MapPolygon\");\r\n\r\n\t\t\trule.setAll({\r\n\t\t\t\tprecision: 0.5,\r\n\t\t\t\tisMeasured: false,\r\n\t\t\t\trole: \"figure\",\r\n\t\t\t\tfillOpacity: 1,\r\n\t\t\t\tposition: \"absolute\",\r\n\t\t\t\tstrokeWidth: 0.2,\r\n\t\t\t\tstrokeOpacity: 1\r\n\t\t\t});\r\n\r\n\t\t\tsetColor(rule, \"fill\", ic, \"primaryButton\");\r\n\t\t\tsetColor(rule, \"stroke\", ic, \"background\");\r\n\t\t}\r\n\r\n\r\n\t\tr(\"Button\", [\"zoomtools\", \"home\"]).setAll({\r\n\t\t\tvisible: false\r\n\t\t});\r\n\r\n\t\t/**\r\n\t\t * ------------------------------------------------------------------------\r\n\t\t * charts/map: Series\r\n\t\t * ------------------------------------------------------------------------\r\n\t\t */\r\n\r\n\t\tr(\"GraticuleSeries\").setAll({\r\n\t\t\tstep: 10\r\n\t\t});\r\n\t}\r\n}\r\n"]}
1
+ {"version":3,"file":"MapChartDefaultTheme.js","sourceRoot":"","sources":["../../../../../src/.internal/charts/map/MapChartDefaultTheme.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAErD,OAAO,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AAErC,OAAO,KAAK,KAAK,MAAM,sBAAsB,CAAC;AAG9C;;GAEG;AACH,MAAM,OAAO,oBAAqB,SAAQ,KAAK;IACpC,iBAAiB;QAC1B,KAAK,CAAC,iBAAiB,EAAE,CAAC;QAE1B,MAAM,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,eAAe,CAAC;QACtC,MAAM,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAE/B;;;;WAIG;QAEH,CAAC,CAAC,UAAU,CAAC,CAAC,MAAM,CAAC;YACpB,UAAU,EAAE,WAAW,EAAE;YACzB,IAAI,EAAE,YAAY;YAClB,IAAI,EAAE,YAAY;YAClB,SAAS,EAAE,IAAI;YACf,QAAQ,EAAE,CAAC;YACX,SAAS,EAAE,CAAC;YACZ,SAAS,EAAE,CAAC;YACZ,SAAS,EAAE,CAAC;YACZ,SAAS,EAAE,CAAC;YACZ,YAAY,EAAE,EAAE;YAChB,YAAY,EAAE,CAAC;YACf,MAAM,EAAE,MAAM;YACd,MAAM,EAAE,MAAM;YACd,eAAe,EAAE,KAAK,CAAC,GAAG,CA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EAAE,CAAC;gBACd,QAAQ,EAAE,UAAU;gBACpB,WAAW,EAAE,GAAG;gBAChB,aAAa,EAAE,CAAC;aAChB,CAAC,CAAC;YAEH,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,eAAe,CAAC,CAAC;YAC5C,QAAQ,CAAC,IAAI,EAAE,QAAQ,EAAE,EAAE,EAAE,YAAY,CAAC,CAAC;SAC3C;QAGD,CAAC,CAAC,QAAQ,EAAE,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC;YACzC,OAAO,EAAE,KAAK;SACd,CAAC,CAAC;QAEH;;;;WAIG;QAEH,CAAC,CAAC,iBAAiB,CAAC,CAAC,MAAM,CAAC;YAC3B,IAAI,EAAE,EAAE;SACR,CAAC,CAAC;IACJ,CAAC;CACD","sourcesContent":["import { Theme } from \"../../core/Theme\";\r\nimport { setColor } from \"../../themes/DefaultTheme\";\r\n\r\nimport { geoMercator } from \"d3-geo\";\r\n\r\nimport * as $ease from \"../../core/util/Ease\";\r\n\r\n\r\n/**\r\n * @ignore\r\n */\r\nexport class MapChartDefaultTheme extends Theme {\r\n\tprotected setupDefaultRules() {\r\n\t\tsuper.setupDefaultRules();\r\n\r\n\t\tconst ic = this._root.interfaceColors;\r\n\t\tconst r = this.rule.bind(this);\r\n\r\n\t\t/**\r\n\t\t * ========================================================================\r\n\t\t * charts/map\r\n\t\t * ========================================================================\r\n\t\t */\r\n\r\n\t\tr(\"MapChart\").setAll({\r\n\t\t\tprojection: geoMercator(),\r\n\t\t\tpanX: \"translateX\",\r\n\t\t\tpanY: \"translateY\",\r\n\t\t\tpinchZoom: true,\r\n\t\t\tzoomStep: 2,\r\n\t\t\tzoomLevel: 1,\r\n\t\t\trotationX: 0,\r\n\t\t\trotationY: 0,\r\n\t\t\trotationZ: 0,\r\n\t\t\tmaxZoomLevel: 32,\r\n\t\t\tminZoomLevel: 1,\r\n\t\t\twheelY: \"zoom\",\r\n\t\t\twheelX: \"none\",\r\n\t\t\tanimationEasing: $ease.out($ease.cubic),\r\n\t\t\twheelEasing: $ease.out($ease.cubic),\r\n\t\t\twheelDuration: 0,\r\n\t\t\twheelSensitivity: 1,\r\n\t\t\tmaxPanOut: 0.4,\r\n\t\t\tcenterMapOnZoomOut: true\r\n\t\t});\r\n\r\n\t\t{\r\n\t\t\tconst rule = r(\"MapLine\");\r\n\r\n\t\t\trule.setAll({\r\n\t\t\t\tprecision: 0.5,\r\n\t\t\t\trole: \"figure\",\r\n\t\t\t});\r\n\r\n\t\t\tsetColor(rule, \"stroke\", ic, \"grid\");\r\n\t\t}\r\n\r\n\t\tr(\"MapPolygonSeries\").setAll({\r\n\t\t\taffectsBounds: true\r\n\t\t})\r\n\r\n\r\n\t\tr(\"MapPointSeries\").setAll({\r\n\t\t\taffectsBounds: false,\r\n\t\t\tclipFront: false,\r\n\t\t\tclipBack: true,\r\n\t\t\tautoScale: false\r\n\t\t})\r\n\r\n\t\tr(\"ClusteredPointSeries\").setAll({\r\n\t\t\tminDistance: 20,\r\n\t\t\tscatterDistance: 3,\r\n\t\t\tscatterRadius: 8,\r\n\t\t\tstopClusterZoom: 0.95\r\n\t\t})\r\n\r\n\t\tr(\"MapLineSeries\").setAll({\r\n\t\t\taffectsBounds: false\r\n\t\t})\r\n\r\n\t\tr(\"MapSankeySeries\").setAll({\r\n\t\t\taffectsBounds: false\r\n\t\t})\r\n\r\n\t\t{\r\n\t\t\tconst rule = r(\"MapPolygon\");\r\n\r\n\t\t\trule.setAll({\r\n\t\t\t\tprecision: 0.5,\r\n\t\t\t\tisMeasured: false,\r\n\t\t\t\trole: \"figure\",\r\n\t\t\t\tfillOpacity: 1,\r\n\t\t\t\tposition: \"absolute\",\r\n\t\t\t\tstrokeWidth: 0.2,\r\n\t\t\t\tstrokeOpacity: 1\r\n\t\t\t});\r\n\r\n\t\t\tsetColor(rule, \"fill\", ic, \"primaryButton\");\r\n\t\t\tsetColor(rule, \"stroke\", ic, \"background\");\r\n\t\t}\r\n\r\n\r\n\t\tr(\"Button\", [\"zoomtools\", \"home\"]).setAll({\r\n\t\t\tvisible: false\r\n\t\t});\r\n\r\n\t\t/**\r\n\t\t * ------------------------------------------------------------------------\r\n\t\t * charts/map: Series\r\n\t\t * ------------------------------------------------------------------------\r\n\t\t */\r\n\r\n\t\tr(\"GraticuleSeries\").setAll({\r\n\t\t\tstep: 10\r\n\t\t});\r\n\t}\r\n}\r\n"]}
@@ -0,0 +1,155 @@
1
+ import type { DataItem } from "../../core/render/Component";
2
+ import type { Color } from "../../core/util/Color";
3
+ import type { ColorSet } from "../../core/util/ColorSet";
4
+ import type { MapSankeySeries, IMapSankeySeriesDataItem } from "./MapSankeySeries";
5
+ import { Series, ISeriesSettings, ISeriesDataItem, ISeriesPrivate, ISeriesEvents } from "../../core/render/Series";
6
+ import { MapPolygon } from "./MapPolygon";
7
+ import { ListTemplate } from "../../core/util/List";
8
+ export interface IMapSankeyNodesDataItem extends ISeriesDataItem {
9
+ /**
10
+ * Node name.
11
+ */
12
+ name: string;
13
+ /**
14
+ * Node color.
15
+ */
16
+ fill: Color;
17
+ /**
18
+ * Sum of values of all incoming links.
19
+ */
20
+ sumIncoming: number;
21
+ /**
22
+ * Sum of values of all outgoing links.
23
+ */
24
+ sumOutgoing: number;
25
+ /**
26
+ * Sum of values of all links: incoming and outgoing.
27
+ */
28
+ sum: number;
29
+ /**
30
+ * A list of incoming link data items.
31
+ */
32
+ incomingLinks: Array<DataItem<IMapSankeySeriesDataItem>>;
33
+ /**
34
+ * A list of outgoing link data items.
35
+ */
36
+ outgoingLinks: Array<DataItem<IMapSankeySeriesDataItem>>;
37
+ /**
38
+ * Node longitude.
39
+ */
40
+ longitude: number;
41
+ /**
42
+ * Node latitude.
43
+ */
44
+ latitude: number;
45
+ /**
46
+ * Related [[MapPolygon]] object (circle or bar shape).
47
+ */
48
+ mapPolygon: MapPolygon;
49
+ }
50
+ export interface IMapSankeyNodesSettings extends ISeriesSettings {
51
+ /**
52
+ * A field in data that holds name for the node.
53
+ * @default "name"
54
+ */
55
+ nameField?: string;
56
+ /**
57
+ * A field in data that holds color used for node fill.
58
+ * @default "fill"
59
+ */
60
+ fillField?: string;
61
+ /**
62
+ * A field in data that holds the node longitude.
63
+ * @default "longitude"
64
+ */
65
+ longitudeField?: string;
66
+ /**
67
+ * A field in data that holds the node latitude.
68
+ * @default "latitude"
69
+ */
70
+ latitudeField?: string;
71
+ /**
72
+ * A [[ColorSet]] that series will use to apply to its nodes.
73
+ */
74
+ colors?: ColorSet;
75
+ }
76
+ export interface IMapSankeyNodesPrivate extends ISeriesPrivate {
77
+ }
78
+ export interface IMapSankeyNodesEvents extends ISeriesEvents {
79
+ }
80
+ /**
81
+ * Holds instances of nodes for a [[MapSankeySeries]].
82
+ *
83
+ * @see {@link https://www.amcharts.com/docs/v5/charts/map-chart/map-sankey-series/} for more info
84
+ * @since 5.17.0
85
+ * @important
86
+ */
87
+ export declare class MapSankeyNodes extends Series {
88
+ static className: string;
89
+ static classNames: Array<string>;
90
+ _settings: IMapSankeyNodesSettings;
91
+ _privateSettings: IMapSankeyNodesPrivate;
92
+ _dataItemSettings: IMapSankeyNodesDataItem;
93
+ _events: IMapSankeyNodesEvents;
94
+ /**
95
+ * Related [[MapSankeySeries]].
96
+ */
97
+ flow: MapSankeySeries | undefined;
98
+ /**
99
+ * Flag indicating user has explicitly set node data.
100
+ * Prevents auto-clearing of nodes when link data changes.
101
+ * @ignore
102
+ */
103
+ _userDataSet: boolean;
104
+ /**
105
+ * A [[ListTemplate]] of all node polygons.
106
+ *
107
+ * `mapPolygons.template` can be used to configure node appearance.
108
+ *
109
+ * @default new ListTemplate<MapPolygon>
110
+ */
111
+ readonly mapPolygons: ListTemplate<MapPolygon>;
112
+ /**
113
+ * @ignore
114
+ */
115
+ _applyThemes(force?: boolean): boolean;
116
+ /**
117
+ * @ignore
118
+ */
119
+ protected _afterNew(): void;
120
+ /**
121
+ * @ignore
122
+ */
123
+ protected _onDataClear(): void;
124
+ /**
125
+ * Processes a newly added node data item, assigning a fill color
126
+ * and creating its map polygon.
127
+ *
128
+ * @param dataItem Data item to process
129
+ */
130
+ protected processDataItem(dataItem: DataItem<this["_dataItemSettings"]>): void;
131
+ /**
132
+ * @ignore
133
+ */
134
+ _updateNodeColor(dataItem: DataItem<this["_dataItemSettings"]>): void;
135
+ /**
136
+ * Creates a MapPolygon visual for a node data item.
137
+ * @ignore
138
+ */
139
+ makeMapPolygon(dataItem: DataItem<this["_dataItemSettings"]>): MapPolygon;
140
+ /**
141
+ * Add an incoming link to a node data item.
142
+ * @ignore
143
+ */
144
+ addIncomingLink(dataItem: DataItem<this["_dataItemSettings"]>, link: DataItem<IMapSankeySeriesDataItem>): void;
145
+ /**
146
+ * Add an outgoing link to a node data item.
147
+ * @ignore
148
+ */
149
+ addOutgoingLink(dataItem: DataItem<this["_dataItemSettings"]>, link: DataItem<IMapSankeySeriesDataItem>): void;
150
+ /**
151
+ * @ignore
152
+ */
153
+ disposeDataItem(dataItem: DataItem<this["_dataItemSettings"]>): void;
154
+ }
155
+ //# sourceMappingURL=MapSankeyNodes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MapSankeyNodes.d.ts","sourceRoot":"","sources":["../../../../../src/.internal/charts/map/MapSankeyNodes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAC5D,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,KAAK,EAAE,eAAe,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAC;AAEnF,OAAO,EAAE,MAAM,EAAE,eAAe,EAAE,eAAe,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACnH,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,OAAO,EAAE,YAAY,EAAE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qBAAqB,CAAC;IAE9C;;OAEG;IACI,IAAI,EAAE,eAAe,GAAG,SAAS,CAAC;IAEzC;;;;OAIG;IACI,YAAY,UAAS;IAE5B;;;;;;OAMG;IACH,SAAgB,WAAW,EAAE,YAAY,CAAC,UAAU,CAAC,CAGlD;IAEH;;OAEG;IACI,YAAY,CAAC,KAAK,GAAE,OAAe,GAAG,OAAO;IAQpD;;OAEG;IACH,SAAS,CAAC,SAAS;IAYnB;;OAEG;IACH,SAAS,CAAC,YAAY;IAQtB;;;;;OAKG;IACH,SAAS,CAAC,eAAe,CAAC,QAAQ,EAAE,QAAQ,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC;IAgBvE;;OAEG;IACI,gBAAgB,CAAC,QAAQ,EAAE,QAAQ,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC;IAOrE;;;OAGG;IACI,cAAc,CAAC,QAAQ,EAAE,QAAQ,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC,GAAG,UAAU;IAwBhF;;;OAGG;IACI,eAAe,CAAC,QAAQ,EAAE,QAAQ,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC,EAAE,IAAI,EAAE,QAAQ,CAAC,wBAAwB,CAAC;IAS9G;;;OAGG;IACI,eAAe,CAAC,QAAQ,EAAE,QAAQ,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC,EAAE,IAAI,EAAE,QAAQ,CAAC,wBAAwB,CAAC;IAS9G;;OAEG;IACI,eAAe,CAAC,QAAQ,EAAE,QAAQ,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC;CAQpE"}
@@ -0,0 +1,151 @@
1
+ import { Series } from "../../core/render/Series";
2
+ import { MapPolygon } from "./MapPolygon";
3
+ import { Template } from "../../core/util/Template";
4
+ import { ListTemplate } from "../../core/util/List";
5
+ /**
6
+ * Holds instances of nodes for a [[MapSankeySeries]].
7
+ *
8
+ * @see {@link https://www.amcharts.com/docs/v5/charts/map-chart/map-sankey-series/} for more info
9
+ * @since 5.17.0
10
+ * @important
11
+ */
12
+ export class MapSankeyNodes extends Series {
13
+ constructor() {
14
+ super(...arguments);
15
+ /**
16
+ * Flag indicating user has explicitly set node data.
17
+ * Prevents auto-clearing of nodes when link data changes.
18
+ * @ignore
19
+ */
20
+ this._userDataSet = false;
21
+ /**
22
+ * A [[ListTemplate]] of all node polygons.
23
+ *
24
+ * `mapPolygons.template` can be used to configure node appearance.
25
+ *
26
+ * @default new ListTemplate<MapPolygon>
27
+ */
28
+ this.mapPolygons = this.addDisposer(new ListTemplate(Template.new({}), () => MapPolygon._new(this._root, {}, [this.mapPolygons.template])));
29
+ }
30
+ /**
31
+ * @ignore
32
+ */
33
+ _applyThemes(force = false) {
34
+ const colors = this.get("colors");
35
+ if (colors) {
36
+ colors.reset();
37
+ }
38
+ return super._applyThemes(force);
39
+ }
40
+ /**
41
+ * @ignore
42
+ */
43
+ _afterNew() {
44
+ this.fields.push("name", "fill", "longitude", "latitude");
45
+ this._setRawDefault("idField", "id");
46
+ this._setRawDefault("nameField", "name");
47
+ this._setRawDefault("fillField", "fill");
48
+ this._setRawDefault("longitudeField", "longitude");
49
+ this._setRawDefault("latitudeField", "latitude");
50
+ super._afterNew();
51
+ }
52
+ /**
53
+ * @ignore
54
+ */
55
+ _onDataClear() {
56
+ const colors = this.get("colors");
57
+ if (colors) {
58
+ colors.reset();
59
+ }
60
+ this._userDataSet = true;
61
+ }
62
+ /**
63
+ * Processes a newly added node data item, assigning a fill color
64
+ * and creating its map polygon.
65
+ *
66
+ * @param dataItem Data item to process
67
+ */
68
+ processDataItem(dataItem) {
69
+ super.processDataItem(dataItem);
70
+ // Auto-assign fill from ColorSet if not provided
71
+ if (dataItem.get("fill") == null) {
72
+ const colors = this.get("colors");
73
+ if (colors) {
74
+ dataItem.setRaw("fill", colors.next());
75
+ }
76
+ }
77
+ // Create MapPolygon visual
78
+ const mapPolygon = this.makeMapPolygon(dataItem);
79
+ dataItem.setRaw("mapPolygon", mapPolygon);
80
+ }
81
+ /**
82
+ * @ignore
83
+ */
84
+ _updateNodeColor(dataItem) {
85
+ const mapPolygon = dataItem.get("mapPolygon");
86
+ if (mapPolygon) {
87
+ mapPolygon.set("fill", dataItem.get("fill"));
88
+ }
89
+ }
90
+ /**
91
+ * Creates a MapPolygon visual for a node data item.
92
+ * @ignore
93
+ */
94
+ makeMapPolygon(dataItem) {
95
+ const mapPolygon = this.mapPolygons.make();
96
+ this.mapPolygons.push(mapPolygon);
97
+ mapPolygon._setDataItem(dataItem);
98
+ // Set series to parent MapSankeySeries for projection access
99
+ if (this.flow) {
100
+ mapPolygon.series = this.flow;
101
+ this.flow.children.push(mapPolygon);
102
+ }
103
+ // Apply fill from data item and listen for changes
104
+ const fill = dataItem.get("fill");
105
+ if (fill) {
106
+ mapPolygon._setSoft("fill", fill);
107
+ }
108
+ dataItem.on("fill", () => {
109
+ this._updateNodeColor(dataItem);
110
+ });
111
+ return mapPolygon;
112
+ }
113
+ /**
114
+ * Add an incoming link to a node data item.
115
+ * @ignore
116
+ */
117
+ addIncomingLink(dataItem, link) {
118
+ let incoming = dataItem.get("incomingLinks");
119
+ if (!incoming) {
120
+ incoming = [];
121
+ dataItem.setRaw("incomingLinks", incoming);
122
+ }
123
+ incoming.push(link);
124
+ }
125
+ /**
126
+ * Add an outgoing link to a node data item.
127
+ * @ignore
128
+ */
129
+ addOutgoingLink(dataItem, link) {
130
+ let outgoing = dataItem.get("outgoingLinks");
131
+ if (!outgoing) {
132
+ outgoing = [];
133
+ dataItem.setRaw("outgoingLinks", outgoing);
134
+ }
135
+ outgoing.push(link);
136
+ }
137
+ /**
138
+ * @ignore
139
+ */
140
+ disposeDataItem(dataItem) {
141
+ super.disposeDataItem(dataItem);
142
+ const mapPolygon = dataItem.get("mapPolygon");
143
+ if (mapPolygon) {
144
+ this.mapPolygons.removeValue(mapPolygon);
145
+ mapPolygon.dispose();
146
+ }
147
+ }
148
+ }
149
+ MapSankeyNodes.className = "MapSankeyNodes";
150
+ MapSankeyNodes.classNames = Series.classNames.concat([MapSankeyNodes.className]);
151
+ //# sourceMappingURL=MapSankeyNodes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MapSankeyNodes.js","sourceRoot":"","sources":["../../../../../src/.internal/charts/map/MapSankeyNodes.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,MAAM,EAAmE,MAAM,0BAA0B,CAAC;AACnH,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AA6FpD;;;;;;GAMG;AACH,MAAM,OAAO,cAAe,SAAQ,MAAM;IAA1C;;QAeC;;;;WAIG;QACI,iBAAY,GAAG,KAAK,CAAC;QAE5B;;;;;;WAMG;QACa,gBAAW,GAA6B,IAAI,CAAC,WAAW,CAAC,IAAI,YAAY,CACxF,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC,EAChB,GAAG,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,EAAE,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC,CAClE,CAAC,CAAC;IAwIJ,CAAC;IAtIA;;OAEG;IACI,YAAY,CAAC,QAAiB,KAAK;QACzC,MAAM,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;QAClC,IAAI,MAAM,EAAE;YACX,MAAM,CAAC,KAAK,EAAE,CAAC;SACf;QACD,OAAO,KAAK,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC;IAClC,CAAC;IAED;;OAEG;IACO,SAAS;QAClB,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,UAAU,CAAC,CAAC;QAE1D,IAAI,CAAC,cAAc,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;QACrC,IAAI,CAAC,cAAc,CAAC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CAAC,MAAM,CAAC,eAAe,EAAE,QAAQ,CAAC,CAAC;SAC3C;QACD,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACrB,CAAC;IAED;;OAEG;IACI,eAAe,CAAC,QAA6C;QACnE,KAAK,CAAC,eAAe,CAAC,QAAQ,CAAC,CAAC;QAChC,MAAM,UAAU,GAAG,QAAQ,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;QAC9C,IAAI,UAAU,EAAE;YACf,IAAI,CAAC,WAAW,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;YACzC,UAAU,CAAC,OAAO,EAAE,CAAC;SACrB;IACF,CAAC;;AArKa,wBAAS,GAAW,gBAAgB,CAAC;AACrC,yBAAU,GAAkB,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,cAAc,CAAC,SAAS,CAAC,CAAC,CAAC","sourcesContent":["import type { DataItem } from \"../../core/render/Component\";\nimport type { Color } from \"../../core/util/Color\";\nimport type { ColorSet } from \"../../core/util/ColorSet\";\nimport type { MapSankeySeries, IMapSankeySeriesDataItem } from \"./MapSankeySeries\";\n\nimport { Series, ISeriesSettings, ISeriesDataItem, ISeriesPrivate, ISeriesEvents } from \"../../core/render/Series\";\nimport { MapPolygon } from \"./MapPolygon\";\nimport { Template } from \"../../core/util/Template\";\nimport { ListTemplate } from \"../../core/util/List\";\n\nexport interface IMapSankeyNodesDataItem extends ISeriesDataItem {\n\n\t/**\n\t * Node name.\n\t */\n\tname: string;\n\n\t/**\n\t * Node color.\n\t */\n\tfill: Color;\n\n\t/**\n\t * Sum of values of all incoming links.\n\t */\n\tsumIncoming: number;\n\n\t/**\n\t * Sum of values of all outgoing links.\n\t */\n\tsumOutgoing: number;\n\n\t/**\n\t * Sum of values of all links: incoming and outgoing.\n\t */\n\tsum: number;\n\n\t/**\n\t * A list of incoming link data items.\n\t */\n\tincomingLinks: Array<DataItem<IMapSankeySeriesDataItem>>;\n\n\t/**\n\t * A list of outgoing link data items.\n\t */\n\toutgoingLinks: Array<DataItem<IMapSankeySeriesDataItem>>;\n\n\t/**\n\t * Node longitude.\n\t */\n\tlongitude: number;\n\n\t/**\n\t * Node latitude.\n\t */\n\tlatitude: number;\n\n\t/**\n\t * Related [[MapPolygon]] object (circle or bar shape).\n\t */\n\tmapPolygon: MapPolygon;\n}\n\nexport interface IMapSankeyNodesSettings extends ISeriesSettings {\n\n\t/**\n\t * A field in data that holds name for the node.\n\t * @default \"name\"\n\t */\n\tnameField?: string;\n\n\t/**\n\t * A field in data that holds color used for node fill.\n\t * @default \"fill\"\n\t */\n\tfillField?: string;\n\n\t/**\n\t * A field in data that holds the node longitude.\n\t * @default \"longitude\"\n\t */\n\tlongitudeField?: string;\n\n\t/**\n\t * A field in data that holds the node latitude.\n\t * @default \"latitude\"\n\t */\n\tlatitudeField?: string;\n\n\t/**\n\t * A [[ColorSet]] that series will use to apply to its nodes.\n\t */\n\tcolors?: ColorSet;\n}\n\nexport interface IMapSankeyNodesPrivate extends ISeriesPrivate {\n}\n\nexport interface IMapSankeyNodesEvents extends ISeriesEvents {\n}\n\n/**\n * Holds instances of nodes for a [[MapSankeySeries]].\n *\n * @see {@link https://www.amcharts.com/docs/v5/charts/map-chart/map-sankey-series/} for more info\n * @since 5.17.0\n * @important\n */\nexport class MapSankeyNodes extends Series {\n\n\tpublic static className: string = \"MapSankeyNodes\";\n\tpublic static classNames: Array<string> = Series.classNames.concat([MapSankeyNodes.className]);\n\n\tdeclare public _settings: IMapSankeyNodesSettings;\n\tdeclare public _privateSettings: IMapSankeyNodesPrivate;\n\tdeclare public _dataItemSettings: IMapSankeyNodesDataItem;\n\tdeclare public _events: IMapSankeyNodesEvents;\n\n\t/**\n\t * Related [[MapSankeySeries]].\n\t */\n\tpublic flow: MapSankeySeries | undefined;\n\n\t/**\n\t * Flag indicating user has explicitly set node data.\n\t * Prevents auto-clearing of nodes when link data changes.\n\t * @ignore\n\t */\n\tpublic _userDataSet = false;\n\n\t/**\n\t * A [[ListTemplate]] of all node polygons.\n\t *\n\t * `mapPolygons.template` can be used to configure node appearance.\n\t *\n\t * @default new ListTemplate<MapPolygon>\n\t */\n\tpublic readonly mapPolygons: ListTemplate<MapPolygon> = this.addDisposer(new ListTemplate(\n\t\tTemplate.new({}),\n\t\t() => MapPolygon._new(this._root, {}, [this.mapPolygons.template])\n\t));\n\n\t/**\n\t * @ignore\n\t */\n\tpublic _applyThemes(force: boolean = false): boolean {\n\t\tconst colors = this.get(\"colors\");\n\t\tif (colors) {\n\t\t\tcolors.reset();\n\t\t}\n\t\treturn super._applyThemes(force);\n\t}\n\n\t/**\n\t * @ignore\n\t */\n\tprotected _afterNew() {\n\t\tthis.fields.push(\"name\", \"fill\", \"longitude\", \"latitude\");\n\n\t\tthis._setRawDefault(\"idField\", \"id\");\n\t\tthis._setRawDefault(\"nameField\", \"name\");\n\t\tthis._setRawDefault(\"fillField\", \"fill\");\n\t\tthis._setRawDefault(\"longitudeField\", \"longitude\");\n\t\tthis._setRawDefault(\"latitudeField\", \"latitude\");\n\n\t\tsuper._afterNew();\n\t}\n\n\t/**\n\t * @ignore\n\t */\n\tprotected _onDataClear() {\n\t\tconst colors = this.get(\"colors\");\n\t\tif (colors) {\n\t\t\tcolors.reset();\n\t\t}\n\t\tthis._userDataSet = true;\n\t}\n\n\t/**\n\t * Processes a newly added node data item, assigning a fill color\n\t * and creating its map polygon.\n\t *\n\t * @param dataItem Data item to process\n\t */\n\tprotected processDataItem(dataItem: DataItem<this[\"_dataItemSettings\"]>) {\n\t\tsuper.processDataItem(dataItem);\n\n\t\t// Auto-assign fill from ColorSet if not provided\n\t\tif (dataItem.get(\"fill\") == null) {\n\t\t\tconst colors = this.get(\"colors\");\n\t\t\tif (colors) {\n\t\t\t\tdataItem.setRaw(\"fill\", colors.next());\n\t\t\t}\n\t\t}\n\n\t\t// Create MapPolygon visual\n\t\tconst mapPolygon = this.makeMapPolygon(dataItem);\n\t\tdataItem.setRaw(\"mapPolygon\", mapPolygon);\n\t}\n\n\t/**\n\t * @ignore\n\t */\n\tpublic _updateNodeColor(dataItem: DataItem<this[\"_dataItemSettings\"]>) {\n\t\tconst mapPolygon = dataItem.get(\"mapPolygon\");\n\t\tif (mapPolygon) {\n\t\t\tmapPolygon.set(\"fill\", dataItem.get(\"fill\"));\n\t\t}\n\t}\n\n\t/**\n\t * Creates a MapPolygon visual for a node data item.\n\t * @ignore\n\t */\n\tpublic makeMapPolygon(dataItem: DataItem<this[\"_dataItemSettings\"]>): MapPolygon {\n\t\tconst mapPolygon = this.mapPolygons.make();\n\t\tthis.mapPolygons.push(mapPolygon);\n\t\tmapPolygon._setDataItem(dataItem);\n\n\t\t// Set series to parent MapSankeySeries for projection access\n\t\tif (this.flow) {\n\t\t\tmapPolygon.series = this.flow;\n\t\t\tthis.flow.children.push(mapPolygon);\n\t\t}\n\n\t\t// Apply fill from data item and listen for changes\n\t\tconst fill = dataItem.get(\"fill\");\n\t\tif (fill) {\n\t\t\tmapPolygon._setSoft(\"fill\", fill);\n\t\t}\n\n\t\tdataItem.on(\"fill\", () => {\n\t\t\tthis._updateNodeColor(dataItem);\n\t\t});\n\n\t\treturn mapPolygon;\n\t}\n\n\t/**\n\t * Add an incoming link to a node data item.\n\t * @ignore\n\t */\n\tpublic addIncomingLink(dataItem: DataItem<this[\"_dataItemSettings\"]>, link: DataItem<IMapSankeySeriesDataItem>) {\n\t\tlet incoming = dataItem.get(\"incomingLinks\");\n\t\tif (!incoming) {\n\t\t\tincoming = [];\n\t\t\tdataItem.setRaw(\"incomingLinks\", incoming);\n\t\t}\n\t\tincoming.push(link);\n\t}\n\n\t/**\n\t * Add an outgoing link to a node data item.\n\t * @ignore\n\t */\n\tpublic addOutgoingLink(dataItem: DataItem<this[\"_dataItemSettings\"]>, link: DataItem<IMapSankeySeriesDataItem>) {\n\t\tlet outgoing = dataItem.get(\"outgoingLinks\");\n\t\tif (!outgoing) {\n\t\t\toutgoing = [];\n\t\t\tdataItem.setRaw(\"outgoingLinks\", outgoing);\n\t\t}\n\t\toutgoing.push(link);\n\t}\n\n\t/**\n\t * @ignore\n\t */\n\tpublic disposeDataItem(dataItem: DataItem<this[\"_dataItemSettings\"]>) {\n\t\tsuper.disposeDataItem(dataItem);\n\t\tconst mapPolygon = dataItem.get(\"mapPolygon\");\n\t\tif (mapPolygon) {\n\t\t\tthis.mapPolygons.removeValue(mapPolygon);\n\t\t\tmapPolygon.dispose();\n\t\t}\n\t}\n}\n"]}