@amcharts/amcharts5 5.9.12 → 5.9.13

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 (163) hide show
  1. package/.internal/charts/hierarchy/HierarchyLink.d.ts +2 -0
  2. package/.internal/charts/hierarchy/HierarchyLink.d.ts.map +1 -1
  3. package/.internal/charts/hierarchy/HierarchyLink.js +22 -0
  4. package/.internal/charts/hierarchy/HierarchyLink.js.map +1 -1
  5. package/.internal/charts/xy/XYChart.d.ts.map +1 -1
  6. package/.internal/charts/xy/XYChart.js +3 -2
  7. package/.internal/charts/xy/XYChart.js.map +1 -1
  8. package/.internal/charts/xy/axes/ValueAxis.d.ts +2 -0
  9. package/.internal/charts/xy/axes/ValueAxis.d.ts.map +1 -1
  10. package/.internal/charts/xy/axes/ValueAxis.js +27 -4
  11. package/.internal/charts/xy/axes/ValueAxis.js.map +1 -1
  12. package/.internal/core/Registry.js +1 -1
  13. package/.internal/core/Registry.js.map +1 -1
  14. package/.internal/core/render/HeatLegend.d.ts.map +1 -1
  15. package/.internal/core/render/HeatLegend.js +4 -1
  16. package/.internal/core/render/HeatLegend.js.map +1 -1
  17. package/.internal/core/render/ZoomableContainer.d.ts.map +1 -1
  18. package/.internal/core/render/ZoomableContainer.js +15 -0
  19. package/.internal/core/render/ZoomableContainer.js.map +1 -1
  20. package/CHANGELOG.md +9 -0
  21. package/examples/javascript/flow-arc-horizontal/package.json +1 -1
  22. package/examples/javascript/flow-arc-vertical/package.json +1 -1
  23. package/examples/javascript/flow-chord/package.json +1 -1
  24. package/examples/javascript/flow-chord-directed/package.json +1 -1
  25. package/examples/javascript/flow-chord-non-ribbon/package.json +1 -1
  26. package/examples/javascript/flow-sankey/package.json +1 -1
  27. package/examples/javascript/gauge/package.json +1 -1
  28. package/examples/javascript/gauge-bands/package.json +1 -1
  29. package/examples/javascript/hierarchy-force-directed/package.json +1 -1
  30. package/examples/javascript/hierarchy-pack/package.json +1 -1
  31. package/examples/javascript/hierarchy-partition/package.json +1 -1
  32. package/examples/javascript/hierarchy-sunburst/package.json +1 -1
  33. package/examples/javascript/hierarchy-tree/package.json +1 -1
  34. package/examples/javascript/hierarchy-treemap/package.json +1 -1
  35. package/examples/javascript/hierarchy-voronoi-treemap/package.json +1 -1
  36. package/examples/javascript/jest/package.json +1 -1
  37. package/examples/javascript/json-pie/package.json +1 -1
  38. package/examples/javascript/json-xy/package.json +1 -1
  39. package/examples/javascript/map-animating-along-lines/package.json +1 -1
  40. package/examples/javascript/map-clustered-points/package.json +1 -1
  41. package/examples/javascript/map-day-and-night/package.json +1 -1
  42. package/examples/javascript/map-globe-rotate-to-country/package.json +1 -1
  43. package/examples/javascript/map-globe-with-projected-circles/package.json +1 -1
  44. package/examples/javascript/map-with-bubbles/package.json +1 -1
  45. package/examples/javascript/map-zoom-to-country/package.json +1 -1
  46. package/examples/javascript/misc-40-charts/package.json +1 -1
  47. package/examples/javascript/misc-microchart-grid/package.json +1 -1
  48. package/examples/javascript/pie-chart/package.json +1 -1
  49. package/examples/javascript/pie-donut-chart/package.json +1 -1
  50. package/examples/javascript/pie-variable-radius/package.json +1 -1
  51. package/examples/javascript/radar-column-iwatch-style/package.json +1 -1
  52. package/examples/javascript/radar-heat-map/package.json +1 -1
  53. package/examples/javascript/radar-line/package.json +1 -1
  54. package/examples/javascript/radar-time-line/package.json +1 -1
  55. package/examples/javascript/sliced-funnel/package.json +1 -1
  56. package/examples/javascript/sliced-pictorial-stacked/package.json +1 -1
  57. package/examples/javascript/sliced-pyramid/package.json +1 -1
  58. package/examples/javascript/stock-chart/package.json +1 -1
  59. package/examples/javascript/stock-chart-comparing-stocks/package.json +1 -1
  60. package/examples/javascript/stock-chart-data-granularity/package.json +1 -1
  61. package/examples/javascript/stock-chart-data-grouping/package.json +1 -1
  62. package/examples/javascript/stock-chart-intraday/package.json +1 -1
  63. package/examples/javascript/stock-chart-live/package.json +1 -1
  64. package/examples/javascript/stock-chart-volume-separate-panel/package.json +1 -1
  65. package/examples/javascript/venn-diagram/package.json +1 -1
  66. package/examples/javascript/wordcloud-with-data/package.json +1 -1
  67. package/examples/javascript/wordcloud-with-text/package.json +1 -1
  68. package/examples/javascript/xy-100-percent-stacked-column/package.json +1 -1
  69. package/examples/javascript/xy-animated-bullet-at-the-end-of-the-series/package.json +1 -1
  70. package/examples/javascript/xy-bubble/package.json +1 -1
  71. package/examples/javascript/xy-candlestick/package.json +1 -1
  72. package/examples/javascript/xy-clustered-column/package.json +1 -1
  73. package/examples/javascript/xy-column/package.json +1 -1
  74. package/examples/javascript/xy-comparing-series-google-analytics-style/package.json +1 -1
  75. package/examples/javascript/xy-data-grouping/package.json +1 -1
  76. package/examples/javascript/xy-draggable-range/package.json +1 -1
  77. package/examples/javascript/xy-drawing-series-with-mouse-or-touch/package.json +1 -1
  78. package/examples/javascript/xy-dumbbell plot/package.json +1 -1
  79. package/examples/javascript/xy-evenly-spaced-date-axis/package.json +1 -1
  80. package/examples/javascript/xy-line/package.json +1 -1
  81. package/examples/javascript/xy-line-highlight-on-legend-hover/package.json +1 -1
  82. package/examples/javascript/xy-live-data/package.json +1 -1
  83. package/examples/javascript/xy-multiple-synced-value-axes/package.json +1 -1
  84. package/examples/javascript/xy-ohlc/package.json +1 -1
  85. package/examples/javascript/xy-real-time-data-sorting/package.json +1 -1
  86. package/examples/javascript/xy-smoothed-line/package.json +1 -1
  87. package/examples/javascript/xy-stacked-and-clustered-column/package.json +1 -1
  88. package/examples/javascript/xy-stacked-column/package.json +1 -1
  89. package/examples/javascript/xy-stacked-step/package.json +1 -1
  90. package/examples/javascript/xy-stock/package.json +1 -1
  91. package/examples/javascript/xy-stock-comparing/package.json +1 -1
  92. package/examples/typescript/flow-arc-horizontal/package.json +1 -1
  93. package/examples/typescript/flow-arc-vertical/package.json +1 -1
  94. package/examples/typescript/flow-chord/package.json +1 -1
  95. package/examples/typescript/flow-chord-directed/package.json +1 -1
  96. package/examples/typescript/flow-chord-non-ribbon/package.json +1 -1
  97. package/examples/typescript/flow-sankey/package.json +1 -1
  98. package/examples/typescript/gauge/package.json +1 -1
  99. package/examples/typescript/gauge-bands/package.json +1 -1
  100. package/examples/typescript/hierarchy-force-directed/package.json +1 -1
  101. package/examples/typescript/hierarchy-pack/package.json +1 -1
  102. package/examples/typescript/hierarchy-partition/package.json +1 -1
  103. package/examples/typescript/hierarchy-sunburst/package.json +1 -1
  104. package/examples/typescript/hierarchy-tree/package.json +1 -1
  105. package/examples/typescript/hierarchy-treemap/package.json +1 -1
  106. package/examples/typescript/hierarchy-voronoi-treemap/package.json +1 -1
  107. package/examples/typescript/jest/package.json +1 -1
  108. package/examples/typescript/json-pie/package.json +1 -1
  109. package/examples/typescript/json-xy/package.json +1 -1
  110. package/examples/typescript/map-animating-along-lines/package.json +1 -1
  111. package/examples/typescript/map-clustered-points/package.json +1 -1
  112. package/examples/typescript/map-day-and-night/package.json +1 -1
  113. package/examples/typescript/map-globe-rotate-to-country/package.json +1 -1
  114. package/examples/typescript/map-globe-with-projected-circles/package.json +1 -1
  115. package/examples/typescript/map-with-bubbles/package.json +1 -1
  116. package/examples/typescript/map-zoom-to-country/package.json +1 -1
  117. package/examples/typescript/misc-40-charts/package.json +1 -1
  118. package/examples/typescript/misc-microchart-grid/package.json +1 -1
  119. package/examples/typescript/pie-chart/package.json +1 -1
  120. package/examples/typescript/pie-donut-chart/package.json +1 -1
  121. package/examples/typescript/pie-variable-radius/package.json +1 -1
  122. package/examples/typescript/radar-column-iwatch-style/package.json +1 -1
  123. package/examples/typescript/radar-heat-map/package.json +1 -1
  124. package/examples/typescript/radar-line/package.json +1 -1
  125. package/examples/typescript/radar-time-line/package.json +1 -1
  126. package/examples/typescript/sliced-funnel/package.json +1 -1
  127. package/examples/typescript/sliced-pictorial-stacked/package.json +1 -1
  128. package/examples/typescript/sliced-pyramid/package.json +1 -1
  129. package/examples/typescript/stock-chart/package.json +1 -1
  130. package/examples/typescript/stock-chart-comparing-stocks/package.json +1 -1
  131. package/examples/typescript/stock-chart-data-granularity/package.json +1 -1
  132. package/examples/typescript/stock-chart-data-grouping/package.json +1 -1
  133. package/examples/typescript/stock-chart-intraday/package.json +1 -1
  134. package/examples/typescript/stock-chart-live/package.json +1 -1
  135. package/examples/typescript/stock-chart-volume-separate-panel/package.json +1 -1
  136. package/examples/typescript/venn-diagram/package.json +1 -1
  137. package/examples/typescript/wordcloud-with-data/package.json +1 -1
  138. package/examples/typescript/wordcloud-with-text/package.json +1 -1
  139. package/examples/typescript/xy-100-percent-stacked-column/package.json +1 -1
  140. package/examples/typescript/xy-animated-bullet-at-the-end-of-the-series/package.json +1 -1
  141. package/examples/typescript/xy-bubble/package.json +1 -1
  142. package/examples/typescript/xy-candlestick/package.json +1 -1
  143. package/examples/typescript/xy-clustered-column/package.json +1 -1
  144. package/examples/typescript/xy-column/package.json +1 -1
  145. package/examples/typescript/xy-comparing-series-google-analytics-style/package.json +1 -1
  146. package/examples/typescript/xy-data-grouping/package.json +1 -1
  147. package/examples/typescript/xy-draggable-range/package.json +1 -1
  148. package/examples/typescript/xy-drawing-series-with-mouse-or-touch/package.json +1 -1
  149. package/examples/typescript/xy-dumbbell plot/package.json +1 -1
  150. package/examples/typescript/xy-evenly-spaced-date-axis/package.json +1 -1
  151. package/examples/typescript/xy-line/package.json +1 -1
  152. package/examples/typescript/xy-line-highlight-on-legend-hover/package.json +1 -1
  153. package/examples/typescript/xy-live-data/package.json +1 -1
  154. package/examples/typescript/xy-multiple-synced-value-axes/package.json +1 -1
  155. package/examples/typescript/xy-ohlc/package.json +1 -1
  156. package/examples/typescript/xy-real-time-data-sorting/package.json +1 -1
  157. package/examples/typescript/xy-smoothed-line/package.json +1 -1
  158. package/examples/typescript/xy-stacked-and-clustered-column/package.json +1 -1
  159. package/examples/typescript/xy-stacked-column/package.json +1 -1
  160. package/examples/typescript/xy-stacked-step/package.json +1 -1
  161. package/examples/typescript/xy-stock/package.json +1 -1
  162. package/examples/typescript/xy-stock-comparing/package.json +1 -1
  163. package/package.json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qBAChB;iBACD;qBACI;oBACJ,QAAQ,CAAC,GAAG,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC;iBAC5B;gBACD,IAAI,UAAU,IAAI,QAAQ,EAAE;oBAC3B,MAAM,CAAC,GAAG,CAAC,cAAc,EAAE,QAAQ,CAAC,CAAC;iBACrC;aACD;SACD;QAED,IAAI,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,IAAI,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,EAAE;YAC5D,UAAU,CAAC,GAAG,CAAC,MAAM,EAAE,IAAI,CAAC,GAAG,CAAC,WAAW,EAAE,IAAI,CAAC,kBAAkB,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,YAAY,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;SAC3G;QAED,IAAI,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,IAAI,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE;YACxD,QAAQ,CAAC,GAAG,CAAC,MAAM,EAAE,IAAI,CAAC,GAAG,CAAC,SAAS,EAAE,IAAI,CAAC,kBAAkB,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;SACpG;IACF,CAAC;;AArKD;;;;WAAkC,YAAY;GAAC;AAC/C;;;;WAA0C,SAAS,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC;GAAC","sourcesContent":["import type { IPoint } from \"../../core/util/IPoint\";\n\nimport { Container, IContainerSettings, IContainerPrivate } from \"./Container\";\nimport { Label } from \"../../core/render/Label\";\nimport { p100 } from \"../../core/util/Percent\";\nimport { RoundedRectangle } from \"../../core/render/RoundedRectangle\";\nimport { Template } from \"../../core/util/Template\";\nimport { ListTemplate } from \"../../core/util/List\";\nimport { Color } from \"../../core/util/Color\";\nimport { Tooltip } from \"../../core/render/Tooltip\";\nimport { LinearGradient } from \"../../core/render/gradients/LinearGradient\";\n\nimport * as $utils from \"../../core/util/Utils\";\nimport * as $type from \"../../core/util/Type\";\n\nexport interface IHeatLegendSettings extends IContainerSettings {\n\n\t/**\n\t * Starting (lowest value) color.\n\t */\n\tstartColor: Color;\n\n\t/**\n\t * Ending (highest value) color.\n\t */\n\tendColor: Color;\n\n\t/**\n\t * Start (lowest) value.\n\t */\n\tstartValue?: number;\n\n\t/**\n\t * End (highest) value.\n\t */\n\tendValue?: number;\n\n\t/**\n\t * Text for start label.\n\t */\n\tstartText?: string;\n\n\t/**\n\t * Text for end label.\n\t */\n\tendText?: string;\n\n\t/**\n\t * Number of steps\n\t *\n\t * @default 1\n\t * @see {@link https://www.amcharts.com/docs/v5/concepts/legend/heat-legend/#Gradient_or_steps} for more info\n\t */\n\tstepCount?: number;\n\n\t/**\n\t * Orientation of the heat legend.\n\t *\n\t * @see {@link https://www.amcharts.com/docs/v5/concepts/legend/heat-legend/#Orientation} for more info\n\t */\n\torientation: \"horizontal\" | \"vertical\";\n\n}\n\nexport interface IHeatLegendPrivate extends IContainerPrivate {\n}\n\n/**\n * Heat legend.\n *\n * @see {@link https://www.amcharts.com/docs/v5/concepts/legend/heat-legend/} for more info\n */\nexport class HeatLegend extends Container {\n\n\t/**\n\t * A [[Container]] that all labels are placed in.\n\t *\n\t * @default Container.new()\n\t */\n\tpublic readonly labelContainer: Container = this.children.push(Container.new(this._root, {}));\n\n\t/**\n\t * A [[Container]] that all markers are placed in.\n\t *\n\t * @default Container.new()\n\t */\n\tpublic readonly markerContainer: Container = this.children.push(Container.new(this._root, {}));\n\n\t/**\n\t * A start [[Label]].\n\t *\n\t * @default Label.new()\n\t */\n\tpublic readonly startLabel: Label = this.labelContainer.children.push(Label.new(this._root, { themeTags: [\"start\"] }));\n\n\t/**\n\t * An end [[Label]].\n\t *\n\t * @default Label.new()\n\t */\n\tpublic readonly endLabel: Label = this.labelContainer.children.push(Label.new(this._root, { themeTags: [\"end\"] }));\n\n\tpublic static className: string = \"HeatLegend\";\n\tpublic static classNames: Array<string> = Container.classNames.concat([HeatLegend.className]);\n\n\tdeclare public _settings: IHeatLegendSettings;\n\tdeclare public _privateSettings: IHeatLegendPrivate;\n\n\n\tprotected _afterNew() {\n\t\tthis._settings.themeTags = $utils.mergeTags(this._settings.themeTags, [\"heatlegend\", this._settings.orientation]);\n\t\tsuper._afterNew();\n\t\tthis.set(\"tooltip\", Tooltip.new(this._root, {\n\t\t\tthemeTags: [\"heatlegend\"]\n\t\t}));\n\t}\n\n\t/**\n\t * @ignore\n\t */\n\tpublic makeMarker(): RoundedRectangle {\n\t\tconst marker = this.markers.make();\n\t\tmarker.states.create(\"disabled\", {});\n\t\treturn marker;\n\t}\n\n\t/**\n\t * List of rectangle elements used for default legend markers.\n\t *\n\t * @default new ListTemplate<RoundedRectangle>\n\t */\n\tpublic readonly markers: ListTemplate<RoundedRectangle> = new ListTemplate(\n\t\tTemplate.new({}),\n\t\t() => RoundedRectangle._new(this._root, {\n\t\t\tthemeTags: $utils.mergeTags(this.markers.template.get(\"themeTags\", []), [this.get(\"orientation\"), \"heatlegend\", \"marker\"])\n\t\t}, [this.markers.template])\n\t);\n\n\n\t/**\n\t * Moves and shows tooltip at specific value.\n\t *\n\t * Can also specify optional text to show in tooltip, as well as the color.\n\t *\n\t * @param value Value\n\t * @param text Text\n\t * @param color Color\n\t */\n\tpublic showValue(value: number, text?: string, color?: Color) {\n\t\tconst tooltip = this.getTooltip();\n\t\tif (tooltip && $type.isNumber(value)) {\n\n\t\t\tconst startValue = this.get(\"startValue\", 0);\n\t\t\tconst endValue = this.get(\"endValue\", 1);\n\n\t\t\tconst c = (value - startValue) / (endValue - startValue);\n\t\t\tconst startColor = this.get(\"startColor\")!;\n\t\t\tconst endColor = this.get(\"endColor\")!;\n\n\t\t\tif (!text) {\n\t\t\t\ttext = this.getNumberFormatter().format(value);\n\t\t\t}\n\n\t\t\tif (!color) {\n\t\t\t\tcolor = Color.interpolate(c, startColor, endColor);\n\t\t\t}\n\n\t\t\ttooltip.label.set(\"text\", text);\n\t\t\tlet p:IPoint;\n\n\t\t\tif (this.get(\"orientation\") == \"vertical\") {\n\t\t\t\tp = this.markerContainer.toGlobal({ x: 0, y: this.innerHeight() * (1 - c) });\n\t\t\t}\n\t\t\telse {\n\t\t\t\tp = this.markerContainer.toGlobal({ x: this.innerWidth() * c, y: 0 });\n\t\t\t}\n\n\t\t\tlet background = tooltip.get(\"background\");\n\t\t\tif (background) {\n\t\t\t\tbackground.set(\"fill\", color)\n\t\t\t}\n\t\t\ttooltip.set(\"pointTo\", p);\n\t\t\ttooltip.show();\n\t\t}\n\t}\n\n\tpublic _prepareChildren() {\n\t\tsuper._prepareChildren();\n\n\t\tconst labelContainer = this.labelContainer;\n\t\tconst orientation = this.get(\"orientation\");\n\t\tconst startLabel = this.startLabel;\n\t\tconst endLabel = this.endLabel;\n\t\tconst tooltip = this.getTooltip();\n\n\t\tif (this.isDirty(\"orientation\")) {\n\t\t\tif (orientation == \"vertical\") {\n\t\t\t\tthis.markerContainer.setAll({ layout: this._root.verticalLayout, height: p100 });\n\t\t\t\tthis.set(\"layout\", this._root.horizontalLayout);\n\t\t\t\tstartLabel.setAll({ y: p100, x: undefined, centerY: p100, centerX: p100 });\n\t\t\t\tendLabel.setAll({ y: 0, x: undefined, centerY: 0, centerX: p100 });\n\t\t\t\tlabelContainer.setAll({ height: p100, width: undefined });\n\t\t\t\tif (tooltip) {\n\t\t\t\t\ttooltip.set(\"pointerOrientation\", \"horizontal\");\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\tthis.markerContainer.setAll({ layout: this._root.horizontalLayout, width: p100 });\n\t\t\t\tthis.set(\"layout\", this._root.verticalLayout);\n\t\t\t\tstartLabel.setAll({ x: 0, y: undefined, centerX: 0, centerY: 0 });\n\t\t\t\tendLabel.setAll({ x: p100, y: undefined, centerX: p100, centerY: 0 });\n\t\t\t\tlabelContainer.setAll({ width: p100, height: undefined });\n\t\t\t\tif (tooltip) {\n\t\t\t\t\ttooltip.set(\"pointerOrientation\", \"vertical\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (this.isDirty(\"stepCount\")) {\n\t\t\tconst stepCount = this.get(\"stepCount\", 1);\n\t\t\tconst startColor = this.get(\"startColor\")!;\n\t\t\tconst endColor = this.get(\"endColor\")!;\n\t\t\tthis.markerContainer.children.clear();\n\t\t\tif (stepCount > 1) {\n\t\t\t\tfor (let i = 0; i < stepCount; i++) {\n\t\t\t\t\tconst marker = this.makeMarker();\n\n\t\t\t\t\tif (orientation == \"vertical\") {\n\t\t\t\t\t\tthis.markerContainer.children.moveValue(marker, 0);\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tthis.markerContainer.children.push(marker);\n\t\t\t\t\t}\n\n\t\t\t\t\tif (startColor && endColor) {\n\t\t\t\t\t\tmarker.set(\"fill\", Color.interpolate(i / stepCount, startColor, endColor));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if (stepCount == 1) {\n\t\t\t\tconst marker = this.makeMarker();\n\t\t\t\tthis.markerContainer.children.push(marker);\n\t\t\t\tconst gradient = LinearGradient.new(this._root, { stops: [{ color: startColor }, { color: endColor }] });\n\n\t\t\t\tif (orientation == \"vertical\") {\n\t\t\t\t\tgradient.set(\"rotation\", 90);\n\t\t\t\t\tlet stops = gradient.get(\"stops\");\n\t\t\t\t\tif (stops) {\n\t\t\t\t\t\tstops.reverse();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tgradient.set(\"rotation\", 0);\n\t\t\t\t}\n\t\t\t\tif (startColor && endColor) {\n\t\t\t\t\tmarker.set(\"fillGradient\", gradient);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (this.isDirty(\"startText\") || this.isDirty(\"startValue\")) {\n\t\t\tstartLabel.set(\"text\", this.get(\"startText\", this.getNumberFormatter().format(this.get(\"startValue\", 0))));\n\t\t}\n\n\t\tif (this.isDirty(\"endText\") || this.isDirty(\"endValue\")) {\n\t\t\tendLabel.set(\"text\", this.get(\"endText\", this.getNumberFormatter().format(this.get(\"endValue\", 1))))\n\t\t}\n\t}\n}\n"]}
1
+ {"version":3,"file":"HeatLegend.js","sourceRoot":"","sources":["../../../../../src/.internal/core/render/HeatLegend.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAyC,MAAM,aAAa,CAAC;AAC/E,OAAO,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAChD,OAAO,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAC/C,OAAO,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AACtE,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,4CAA4C,CAAC;AAE5E,OAAO,KAAK,MAAM,MAAM,uBAAuB,CAAC;AAChD,OAAO,KAAK,KAAK,MAAM,sBAAsB,CAAC;AAsD9C;;;;GAIG;AACH,MAAM,OAAO,UAAW,SAAQ,SAAS;IAAzC;;QAEC;;;;WAIG;QACH;;;;mBAA4C,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;WAAC;QAE9F;;;;WAIG;QACH;;;;mBAA6C,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;WAAC;QAE/F;;;;WAIG;QACH;;;;mBAAoC,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,GAA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/IPoint\";\n\nimport { Container, IContainerSettings, IContainerPrivate } from \"./Container\";\nimport { Label } from \"../../core/render/Label\";\nimport { p100 } from \"../../core/util/Percent\";\nimport { RoundedRectangle } from \"../../core/render/RoundedRectangle\";\nimport { Template } from \"../../core/util/Template\";\nimport { ListTemplate } from \"../../core/util/List\";\nimport { Color } from \"../../core/util/Color\";\nimport { Tooltip } from \"../../core/render/Tooltip\";\nimport { LinearGradient } from \"../../core/render/gradients/LinearGradient\";\n\nimport * as $utils from \"../../core/util/Utils\";\nimport * as $type from \"../../core/util/Type\";\n\nexport interface IHeatLegendSettings extends IContainerSettings {\n\n\t/**\n\t * Starting (lowest value) color.\n\t */\n\tstartColor: Color;\n\n\t/**\n\t * Ending (highest value) color.\n\t */\n\tendColor: Color;\n\n\t/**\n\t * Start (lowest) value.\n\t */\n\tstartValue?: number;\n\n\t/**\n\t * End (highest) value.\n\t */\n\tendValue?: number;\n\n\t/**\n\t * Text for start label.\n\t */\n\tstartText?: string;\n\n\t/**\n\t * Text for end label.\n\t */\n\tendText?: string;\n\n\t/**\n\t * Number of steps\n\t *\n\t * @default 1\n\t * @see {@link https://www.amcharts.com/docs/v5/concepts/legend/heat-legend/#Gradient_or_steps} for more info\n\t */\n\tstepCount?: number;\n\n\t/**\n\t * Orientation of the heat legend.\n\t *\n\t * @see {@link https://www.amcharts.com/docs/v5/concepts/legend/heat-legend/#Orientation} for more info\n\t */\n\torientation: \"horizontal\" | \"vertical\";\n\n}\n\nexport interface IHeatLegendPrivate extends IContainerPrivate {\n}\n\n/**\n * Heat legend.\n *\n * @see {@link https://www.amcharts.com/docs/v5/concepts/legend/heat-legend/} for more info\n */\nexport class HeatLegend extends Container {\n\n\t/**\n\t * A [[Container]] that all labels are placed in.\n\t *\n\t * @default Container.new()\n\t */\n\tpublic readonly labelContainer: Container = this.children.push(Container.new(this._root, {}));\n\n\t/**\n\t * A [[Container]] that all markers are placed in.\n\t *\n\t * @default Container.new()\n\t */\n\tpublic readonly markerContainer: Container = this.children.push(Container.new(this._root, {}));\n\n\t/**\n\t * A start [[Label]].\n\t *\n\t * @default Label.new()\n\t */\n\tpublic readonly startLabel: Label = this.labelContainer.children.push(Label.new(this._root, { themeTags: [\"start\"] }));\n\n\t/**\n\t * An end [[Label]].\n\t *\n\t * @default Label.new()\n\t */\n\tpublic readonly endLabel: Label = this.labelContainer.children.push(Label.new(this._root, { themeTags: [\"end\"] }));\n\n\tpublic static className: string = \"HeatLegend\";\n\tpublic static classNames: Array<string> = Container.classNames.concat([HeatLegend.className]);\n\n\tdeclare public _settings: IHeatLegendSettings;\n\tdeclare public _privateSettings: IHeatLegendPrivate;\n\n\n\tprotected _afterNew() {\n\t\tthis._settings.themeTags = $utils.mergeTags(this._settings.themeTags, [\"heatlegend\", this._settings.orientation]);\n\t\tsuper._afterNew();\n\t\tthis.set(\"tooltip\", Tooltip.new(this._root, {\n\t\t\tthemeTags: [\"heatlegend\"]\n\t\t}));\n\t}\n\n\t/**\n\t * @ignore\n\t */\n\tpublic makeMarker(): RoundedRectangle {\n\t\tconst marker = this.markers.make();\n\t\tmarker.states.create(\"disabled\", {});\n\t\treturn marker;\n\t}\n\n\t/**\n\t * List of rectangle elements used for default legend markers.\n\t *\n\t * @default new ListTemplate<RoundedRectangle>\n\t */\n\tpublic readonly markers: ListTemplate<RoundedRectangle> = new ListTemplate(\n\t\tTemplate.new({}),\n\t\t() => RoundedRectangle._new(this._root, {\n\t\t\tthemeTags: $utils.mergeTags(this.markers.template.get(\"themeTags\", []), [this.get(\"orientation\"), \"heatlegend\", \"marker\"])\n\t\t}, [this.markers.template])\n\t);\n\n\n\t/**\n\t * Moves and shows tooltip at specific value.\n\t *\n\t * Can also specify optional text to show in tooltip, as well as the color.\n\t *\n\t * @param value Value\n\t * @param text Text\n\t * @param color Color\n\t */\n\tpublic showValue(value: number, text?: string, color?: Color) {\n\t\tconst tooltip = this.getTooltip();\n\t\tif (tooltip && $type.isNumber(value)) {\n\n\t\t\tconst startValue = this.get(\"startValue\", 0);\n\t\t\tconst endValue = this.get(\"endValue\", 1);\n\n\t\t\tlet c = (value - startValue) / (endValue - startValue);\n\n\t\t\tif(c == Infinity || c == -Infinity || isNaN(c)) {\n\t\t\t\tc = 0.5;\n\t\t\t}\n\n\t\t\tconst startColor = this.get(\"startColor\")!;\n\t\t\tconst endColor = this.get(\"endColor\")!;\n\n\t\t\tif (!text) {\n\t\t\t\ttext = this.getNumberFormatter().format(value);\n\t\t\t}\n\n\t\t\tif (!color) {\n\t\t\t\tcolor = Color.interpolate(c, startColor, endColor);\n\t\t\t}\n\n\t\t\ttooltip.label.set(\"text\", text);\n\t\t\tlet p:IPoint;\n\n\t\t\tif (this.get(\"orientation\") == \"vertical\") {\n\t\t\t\tp = this.markerContainer.toGlobal({ x: 0, y: this.innerHeight() * (1 - c) });\n\t\t\t}\n\t\t\telse {\n\t\t\t\tp = this.markerContainer.toGlobal({ x: this.innerWidth() * c, y: 0 });\n\t\t\t}\n\n\t\t\tlet background = tooltip.get(\"background\");\n\t\t\tif (background) {\n\t\t\t\tbackground.set(\"fill\", color)\n\t\t\t}\n\t\t\ttooltip.set(\"pointTo\", p);\n\t\t\ttooltip.show();\n\t\t}\n\t}\n\n\tpublic _prepareChildren() {\n\t\tsuper._prepareChildren();\n\n\t\tconst labelContainer = this.labelContainer;\n\t\tconst orientation = this.get(\"orientation\");\n\t\tconst startLabel = this.startLabel;\n\t\tconst endLabel = this.endLabel;\n\t\tconst tooltip = this.getTooltip();\n\n\t\tif (this.isDirty(\"orientation\")) {\n\t\t\tif (orientation == \"vertical\") {\n\t\t\t\tthis.markerContainer.setAll({ layout: this._root.verticalLayout, height: p100 });\n\t\t\t\tthis.set(\"layout\", this._root.horizontalLayout);\n\t\t\t\tstartLabel.setAll({ y: p100, x: undefined, centerY: p100, centerX: p100 });\n\t\t\t\tendLabel.setAll({ y: 0, x: undefined, centerY: 0, centerX: p100 });\n\t\t\t\tlabelContainer.setAll({ height: p100, width: undefined });\n\t\t\t\tif (tooltip) {\n\t\t\t\t\ttooltip.set(\"pointerOrientation\", \"horizontal\");\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\tthis.markerContainer.setAll({ layout: this._root.horizontalLayout, width: p100 });\n\t\t\t\tthis.set(\"layout\", this._root.verticalLayout);\n\t\t\t\tstartLabel.setAll({ x: 0, y: undefined, centerX: 0, centerY: 0 });\n\t\t\t\tendLabel.setAll({ x: p100, y: undefined, centerX: p100, centerY: 0 });\n\t\t\t\tlabelContainer.setAll({ width: p100, height: undefined });\n\t\t\t\tif (tooltip) {\n\t\t\t\t\ttooltip.set(\"pointerOrientation\", \"vertical\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (this.isDirty(\"stepCount\")) {\n\t\t\tconst stepCount = this.get(\"stepCount\", 1);\n\t\t\tconst startColor = this.get(\"startColor\")!;\n\t\t\tconst endColor = this.get(\"endColor\")!;\n\t\t\tthis.markerContainer.children.clear();\n\t\t\tif (stepCount > 1) {\n\t\t\t\tfor (let i = 0; i < stepCount; i++) {\n\t\t\t\t\tconst marker = this.makeMarker();\n\n\t\t\t\t\tif (orientation == \"vertical\") {\n\t\t\t\t\t\tthis.markerContainer.children.moveValue(marker, 0);\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tthis.markerContainer.children.push(marker);\n\t\t\t\t\t}\n\n\t\t\t\t\tif (startColor && endColor) {\n\t\t\t\t\t\tmarker.set(\"fill\", Color.interpolate(i / stepCount, startColor, endColor));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if (stepCount == 1) {\n\t\t\t\tconst marker = this.makeMarker();\n\t\t\t\tthis.markerContainer.children.push(marker);\n\t\t\t\tconst gradient = LinearGradient.new(this._root, { stops: [{ color: startColor }, { color: endColor }] });\n\n\t\t\t\tif (orientation == \"vertical\") {\n\t\t\t\t\tgradient.set(\"rotation\", 90);\n\t\t\t\t\tlet stops = gradient.get(\"stops\");\n\t\t\t\t\tif (stops) {\n\t\t\t\t\t\tstops.reverse();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tgradient.set(\"rotation\", 0);\n\t\t\t\t}\n\t\t\t\tif (startColor && endColor) {\n\t\t\t\t\tmarker.set(\"fillGradient\", gradient);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (this.isDirty(\"startText\") || this.isDirty(\"startValue\")) {\n\t\t\tstartLabel.set(\"text\", this.get(\"startText\", this.getNumberFormatter().format(this.get(\"startValue\", 0))));\n\t\t}\n\n\t\tif (this.isDirty(\"endText\") || this.isDirty(\"endValue\")) {\n\t\t\tendLabel.set(\"text\", this.get(\"endText\", this.getNumberFormatter().format(this.get(\"endValue\", 1))))\n\t\t}\n\t}\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"ZoomableContainer.d.ts","sourceRoot":"","sources":["../../../../../src/.internal/core/render/ZoomableContainer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,2BAA2B,CAAC;AACtD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAEpE,OAAO,EAAE,SAAS,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AASjH,MAAM,WAAW,0BAA2B,SAAQ,kBAAkB;IAErE;;;;OAIG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;;;OAIG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;;;OAIG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB;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AAC,MAAM,EAAE,MAAM,CAAK;IAE7B,SAAS,CAAC,QAAQ,CAAC,EAAE,SAAS,CAAC;IAE/B;;;;;OAKG;IACI,QAAQ,YAUZ;IAEH,SAAS,CAAC,QAAQ,EAAE,SAAS,GAAG,SAAS,CAAC;IAE1C,SAAS,CAAC,SAAS,IAAI,IAAI;IAkCpB,gBAAgB;IAUvB,SAAS,CAAC,eAAe;IAkCzB,SAAS,CAAC,gBAAgB,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM;IAiBvD;;;;;;OAMG;IACI,WAAW,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,OAAO,CAAC,CAAC,GAAG,SAAS;IA0BnG;;;;OAIG;IACI,MAAM,IAAI,SAAS,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,OAAO,CAAC,CAAC,GAAG,SAAS;IAIlE;;;;OAIG;IACI,OAAO,IAAI,SAAS,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,OAAO,CAAC,CAAC,GAAG,SAAS;IAInE;;;;OAIG;IACI,MAAM;IAIb,SAAS,CAAC,UAAU,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM;IAWxD,SAAS,CAAC,aAAa,CAAC,MAAM,EAAE,mBAAmB;IAInD,SAAS,CAAC,eAAe,CAAC,KAAK,EAAE,mBAAmB;IAoCpD,SAAS,CAAC,eAAe,CAAC,KAAK,EAAE,mBAAmB;IAiBpD,SAAS,CAAC,YAAY;CAsDtB"}
@@ -104,6 +104,21 @@ export class ZoomableContainer extends Container {
104
104
  this._disposers.push(events.on("globalpointermove", (event) => {
105
105
  this._handleThisMove(event);
106
106
  }));
107
+ const bg = this.contents.get("background");
108
+ if (bg) {
109
+ bg.adapters.add("width", (width) => {
110
+ return Number(width) * 5;
111
+ });
112
+ bg.adapters.add("height", (height) => {
113
+ return Number(height) * 5;
114
+ });
115
+ bg.adapters.add("x", (x) => {
116
+ return Number(x) - bg.width() / 5 * 2;
117
+ });
118
+ bg.adapters.add("y", (y) => {
119
+ return Number(y) - bg.height() / 5 * 2;
120
+ });
121
+ }
107
122
  }
108
123
  _prepareChildren() {
109
124
  super._prepareChildren();
@@ -1 +1 @@
1
- {"version":3,"file":"ZoomableContainer.js","sourceRoot":"","sources":["../../../../../src/.internal/core/render/ZoomableContainer.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,SAAS,EAA2D,MAAM,6BAA6B,CAAC;AACjH,OAAO,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AACxD,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAE9C,OAAO,KAAK,MAAM,MAAM,uBAAuB,CAAC;AAChD,OAAO,KAAK,KAAK,MAAM,sBAAsB,CAAC;AAC9C,OAAO,KAAK,OAAO,MAAM,wBAAwB,CAAC;AAsDlD;;;;;;GAMG;AACH,MAAM,OAAO,iBAAkB,SAAQ,SAAS;IAAhD;;QAQC;;;;;WAAsD;QACtD;;;;;WAAmD;QACnD;;;;;WAAmD;QAGnD;;;;mBAAqD,EAAE;WAAC;QACxD;;;;mBAA+B,CAAC;WAAC;QACjC;;;;mBAA2B,CAAC;WAAC;QAC7B;;;;mBAA2B,CAAC;WAAC;QAE7B;;;;;WAA+B;QAE/B;;;;;WAKG;QACH;;;;mBAAkB,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,EAAE;gBAC9D,KAAK,EAAE,IAAI;gBACX,MAAM,EAAE,IAAI;gBACZ,CAAC,EAAE,CAAC;gBACJ,CAAC,EAAE,CAAC;gBACJ,SAAS,EAAE,IAAI;gBACf,UAAU,EAAE,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,EAAE;oBACrC,IA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CAAC,GAAG,UAAU,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC;gBAE9H,IAAI,EAAE,GAAG,IAAI,CAAC,MAAM,IAAI,CAAC,CAAC;gBAC1B,IAAI,EAAE,GAAG,IAAI,CAAC,MAAM,IAAI,CAAC,CAAC;gBAE1B,IAAI,SAAS,GAAG,IAAI,CAAC,UAAU,CAAC;gBAEhC,IAAI,EAAE,GAAG,UAAU,CAAC,CAAC,GAAG,CAAC,CAAE,EAAE,GAAG,UAAU,CAAC,CAAC,CAAC,GAAG,SAAS,GAAG,KAAK,CAAC;gBAClE,IAAI,EAAE,GAAG,UAAU,CAAC,CAAC,GAAG,CAAC,CAAE,EAAE,GAAG,UAAU,CAAC,CAAC,CAAC,GAAG,SAAS,GAAG,KAAK,CAAC;gBAElE,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC;oBACpB,CAAC,EAAE,EAAE;oBACL,CAAC,EAAE,EAAE;oBACL,KAAK,EAAE,KAAK;iBACZ,CAAC,CAAC;aACH;SACD;IACF,CAAC;;AA3SD;;;;WAAkC,mBAAmB;GAAC;AACtD;;;;WAA0C,SAAS,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,iBAAiB,CAAC,SAAS,CAAC,CAAC;GAAC","sourcesContent":["import type { Time } from \"../../core/util/Animation\";\r\nimport type { Animation } from \"../../core/util/Entity\";\r\nimport type { IDisposer } from \"../../core/util/Disposer\";\r\nimport type { IPoint } from \"../../core/util/IPoint\";\r\nimport type { ISpritePointerEvent } from \"../../core/render/Sprite\";\r\n\r\nimport { Container, IContainerSettings, IContainerPrivate, IContainerEvents } from \"../../core/render/Container\";\r\nimport { p100 } from \"../../core/util/Percent\";\r\nimport { Rectangle } from \"../../core/render/Rectangle\";\r\nimport { color } from \"../../core/util/Color\";\r\n\r\nimport * as $utils from \"../../core/util/Utils\";\r\nimport * as $math from \"../../core/util/Math\";\r\nimport * as $object from \"../../core/util/Object\";\r\n\r\nexport interface IZoomableContainerSettings extends IContainerSettings {\r\n\r\n\t/**\r\n\t * Maximum zoom-in level.\r\n\t * \r\n\t * @default 32\r\n\t */\r\n\tmaxZoomLevel?: number;\r\n\r\n\t/**\r\n\t * Maximum zoom-out level.\r\n\t * \r\n\t * @default 1\r\n\t */\r\n\tminZoomLevel?: number;\r\n\r\n\t/**\r\n\t * Zoom level increase/decrease factor with each zoom action.\r\n\t * \r\n\t * @defult 2\r\n\t */\r\n\tzoomStep?: number;\r\n\r\n\t/**\r\n\t * Pinch-zooming is enabled on touch devices.\r\n\t *\r\n\t * @default true\r\n\t */\r\n\tpinchZoom?: boolean;\r\n\r\n\t/**\r\n\t * Animation duration (ms) for zoom animations.\r\n\t *\r\n\t * @default 600\r\n\t */\r\n\tanimationDuration?: number;\r\n\r\n\t/**\r\n\t * Easing function to use for zoom animations.\r\n\t * \r\n\t * @default am5.ease.out(am5.ease.cubic)\r\n\t */\r\n\tanimationEasing?: (t: Time) => Time;\r\n\r\n}\r\n\r\nexport interface IZoomableContainerPrivate extends IContainerPrivate {\r\n}\r\n\r\nexport interface IZoomableContainerEvents extends IContainerEvents {\r\n}\r\n\r\n/**\r\n * A version of [[Container]] which adds zooming capabilities.\r\n *\r\n * @see {@link https://www.amcharts.com/docs/v5/concepts/common-elements/containers/#Zoomable_container} for more info\r\n * @since 5.8.0\r\n * @important\r\n */\r\nexport class ZoomableContainer extends Container {\r\n\tpublic static className: string = \"ZoomableContainer\";\r\n\tpublic static classNames: Array<string> = Container.classNames.concat([ZoomableContainer.className]);\r\n\r\n\tdeclare public _settings: IZoomableContainerSettings;\r\n\tdeclare public _privateSettings: IZoomableContainerPrivate;\r\n\tdeclare public _events: IZoomableContainerEvents;\r\n\r\n\tprotected _za?: Animation<this[\"_settings\"][\"scale\"]>;\r\n\tprotected _txa?: Animation<this[\"_settings\"][\"x\"]>;\r\n\tprotected _tya?: Animation<this[\"_settings\"][\"y\"]>;\r\n\r\n\r\n\tprotected _movePoints: { [index: number]: IPoint } = {};\r\n\tprotected _downScale: number = 1;\r\n\tprotected _downX: number = 0;\r\n\tprotected _downY: number = 0;\r\n\r\n\tprotected _pinchDP?: IDisposer;\r\n\r\n\t/**\r\n\t * All elements must be added to `contents.children` instead of `children` of\r\n\t * [[ZoomableContainer]].\r\n\t *\r\n\t * @see {@link https://www.amcharts.com/docs/v5/concepts/common-elements/containers/#Zoomable_container} for more info\r\n\t */\r\n\tpublic contents = this.children.push(Container.new(this._root, {\r\n\t\twidth: p100,\r\n\t\theight: p100,\r\n\t\tx: 0,\r\n\t\ty: 0,\r\n\t\tdraggable: true,\r\n\t\tbackground: Rectangle.new(this._root, {\r\n\t\t\tfill: color(0xffffff),\r\n\t\t\tfillOpacity: 0\r\n\t\t})\r\n\t}))\r\n\r\n\tprotected _wheelDp: IDisposer | undefined;\r\n\r\n\tprotected _afterNew(): void {\r\n\t\tsuper._afterNew();\r\n\r\n\t\tconst events = this.contents.events;\r\n\r\n\t\tthis._disposers.push(events.on(\"pointerdown\", (event) => {\r\n\t\t\tthis._handleThisDown(event);\r\n\t\t}));\r\n\r\n\t\tthis._disposers.push(events.on(\"globalpointerup\", (event) => {\r\n\t\t\tthis._handleThisUp(event);\r\n\t\t}));\r\n\r\n\t\tthis._disposers.push(events.on(\"globalpointermove\", (event) => {\r\n\t\t\tthis._handleThisMove(event);\r\n\t\t}));\r\n\t}\r\n\r\n\tpublic _prepareChildren() {\r\n\t\tsuper._prepareChildren();\r\n\t\tif (this.isDirty(\"wheelable\")) {\r\n\t\t\tthis._handleSetWheel();\r\n\t\t}\r\n\r\n\t\tthis.contents._display.cancelTouch = this.get(\"pinchZoom\", false);\r\n\t}\r\n\r\n\r\n\tprotected _handleSetWheel() {\r\n\t\t// const contents = this.contents;\r\n\r\n\t\tif (this.get(\"wheelable\")) {\r\n\t\t\tif (this._wheelDp) {\r\n\t\t\t\tthis._wheelDp.dispose();\r\n\t\t\t}\r\n\r\n\t\t\tthis._wheelDp = this.events.on(\"wheel\", (event) => {\r\n\t\t\t\tconst wheelEvent = event.originalEvent;\r\n\r\n\t\t\t\t// Ignore wheel event if it is happening on a non-ZoomableContainer element, e.g. if\r\n\t\t\t\t// some page element is over the ZoomableContainer.\r\n\t\t\t\tif ($utils.isLocalEvent(wheelEvent, this)) {\r\n\t\t\t\t\twheelEvent.preventDefault();\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tconst point = this.toLocal(event.point);\r\n\r\n\t\t\t\tthis._handleWheelZoom(wheelEvent.deltaY, point);\r\n\t\t\t});\r\n\r\n\t\t\tthis._disposers.push(this._wheelDp);\r\n\t\t}\r\n\t\telse {\r\n\t\t\tif (this._wheelDp) {\r\n\t\t\t\tthis._wheelDp.dispose();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tprotected _handleWheelZoom(delta: number, point: IPoint) {\r\n\t\tlet step = this.get(\"zoomStep\", 2);\r\n\t\tlet zoomLevel = this.contents.get(\"scale\", 1);\r\n\r\n\t\tlet newZoomLevel = zoomLevel;\r\n\t\tif (delta > 0) {\r\n\t\t\tnewZoomLevel = zoomLevel / step;\r\n\t\t}\r\n\t\telse if (delta < 0) {\r\n\t\t\tnewZoomLevel = zoomLevel * step;\r\n\t\t}\r\n\r\n\t\tif (newZoomLevel != zoomLevel) {\r\n\t\t\tthis.zoomToPoint(point, newZoomLevel)\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Zooms to specific X/Y point.\r\n\t * \r\n\t * @param point Center point\r\n\t * @param level Zoom level\r\n\t * @return Zoom Animation object\r\n\t */\r\n\tpublic zoomToPoint(point: IPoint, level: number): Animation<this[\"_settings\"][\"scale\"]> | undefined {\r\n\t\tif (level) {\r\n\t\t\tlevel = $math.fitToRange(level, this.get(\"minZoomLevel\", 1), this.get(\"maxZoomLevel\", 32));\r\n\t\t}\r\n\r\n\t\tconst zoomLevel = this.contents.get(\"scale\", 1);\r\n\r\n\t\tlet x = point.x;\r\n\t\tlet y = point.y;\r\n\r\n\t\tlet cx = x;\r\n\t\tlet cy = y;\r\n\r\n\t\tconst contents = this.contents;\r\n\r\n\t\tlet tx = contents.x();\r\n\t\tlet ty = contents.y();\r\n\r\n\t\tlet xx = cx - ((x - tx) / zoomLevel * level);\r\n\t\tlet yy = cy - ((y - ty) / zoomLevel * level);\r\n\r\n\t\tthis._animateTo(xx, yy, level);\r\n\r\n\t\treturn this._za;\r\n\t}\r\n\r\n\t/**\r\n\t * Zooms the container contents in by `zoomStep`.\r\n\t * \r\n\t * @return Zoom Animation object\r\n\t */\r\n\tpublic zoomIn(): Animation<this[\"_settings\"][\"scale\"]> | undefined {\r\n\t\treturn this.zoomToPoint({ x: this.width() / 2, y: this.height() / 2 }, this.contents.get(\"scale\", 1) * this.get(\"zoomStep\", 2));\r\n\t}\r\n\r\n\t/**\r\n\t * Zooms the container contents out by `zoomStep`.\r\n\t * \r\n\t * @return Zoom Animation object\r\n\t */\r\n\tpublic zoomOut(): Animation<this[\"_settings\"][\"scale\"]> | undefined {\r\n\t\treturn this.zoomToPoint({ x: this.width() / 2, y: this.height() / 2 }, this.contents.get(\"scale\", 1) / this.get(\"zoomStep\", 2));\r\n\t}\r\n\r\n\t/**\r\n\t * Fully zooms out the container contents.\r\n\t * \r\n\t * @return Zoom Animation object\r\n\t */\r\n\tpublic goHome() {\r\n\t\treturn this._animateTo(0, 0, 1);\r\n\t}\r\n\r\n\tprotected _animateTo(x: number, y: number, scale: number) {\r\n\t\tconst duration = this.get(\"animationDuration\", 0);\r\n\t\tconst easing = this.get(\"animationEasing\");\r\n\r\n\t\tconst contents = this.contents;\r\n\t\tthis._txa = contents.animate({ key: \"x\", to: x, duration: duration, easing: easing });\r\n\t\tthis._tya = contents.animate({ key: \"y\", to: y, duration: duration, easing: easing });\r\n\t\tthis._za = contents.animate({ key: \"scale\", to: scale, duration: duration, easing: easing });\r\n\t}\r\n\r\n\r\n\tprotected _handleThisUp(_event: ISpritePointerEvent) {\r\n\t\tthis._downPoints = {}\r\n\t}\r\n\r\n\tprotected _handleThisDown(event: ISpritePointerEvent) {\r\n\r\n\t\tconst contents = this.contents;\r\n\r\n\t\tthis._downScale = contents.get(\"scale\", 1);\r\n\t\tconst downPoints = contents._downPoints;\r\n\r\n\t\tlet count = $object.keys(downPoints).length;\r\n\r\n\t\tif (count == 1) {\r\n\t\t\t// workaround to solve a problem when events are added to some children of chart container (rotation stops working)\r\n\t\t\tlet downPoint = downPoints[1];\r\n\t\t\tif (!downPoint) {\r\n\t\t\t\tdownPoint = downPoints[0];\r\n\t\t\t}\r\n\r\n\t\t\tif (downPoint && (downPoint.x == event.point.x && downPoint.y == event.point.y)) {\r\n\t\t\t\tcount = 0;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (count > 0) {\r\n\t\t\tthis._downX = contents.x();\r\n\t\t\tthis._downY = contents.y();\r\n\r\n\t\t\tconst downId = contents._getDownPointId();\r\n\t\t\tif (downId) {\r\n\t\t\t\tlet movePoint = this._movePoints[downId];\r\n\t\t\t\tif (movePoint) {\r\n\t\t\t\t\tcontents._downPoints[downId] = movePoint;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\r\n\tprotected _handleThisMove(event: ISpritePointerEvent) {\r\n\t\tconst originalEvent = event.originalEvent as any;\r\n\r\n\t\tconst pointerId = originalEvent.pointerId;\r\n\r\n\t\tif (this.get(\"pinchZoom\")) {\r\n\t\t\tif (pointerId) {\r\n\t\t\t\tthis._movePoints[pointerId] = event.point;\r\n\r\n\t\t\t\tif ($object.keys(this.contents._downPoints).length > 1) {\r\n\t\t\t\t\tthis._handlePinch();\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tprotected _handlePinch() {\r\n\t\tlet i = 0;\r\n\t\tlet downPoints: Array<IPoint> = [];\r\n\t\tlet movePoints: Array<IPoint> = [];\r\n\r\n\t\t$object.each(this.contents._downPoints, (k, point) => {\r\n\t\t\tdownPoints[i] = point;\r\n\t\t\tlet movePoint = this._movePoints[k];\r\n\t\t\tif (movePoint) {\r\n\t\t\t\tmovePoints[i] = movePoint;\r\n\t\t\t}\r\n\t\t\ti++;\r\n\t\t});\r\n\r\n\t\tif (downPoints.length > 1 && movePoints.length > 1) {\r\n\r\n\t\t\tthis.contents._isDragging = false;\r\n\r\n\t\t\tlet downPoint0 = downPoints[0];\r\n\t\t\tlet downPoint1 = downPoints[1];\r\n\r\n\t\t\tlet movePoint0 = movePoints[0];\r\n\t\t\tlet movePoint1 = movePoints[1];\r\n\r\n\t\t\tif (downPoint0 && downPoint1 && movePoint0 && movePoint1) {\r\n\t\t\t\tdownPoint0 = this.toLocal(downPoint0);\r\n\t\t\t\tdownPoint1 = this.toLocal(downPoint1);\r\n\r\n\t\t\t\tmovePoint0 = this.toLocal(movePoint0);\r\n\t\t\t\tmovePoint1 = this.toLocal(movePoint1);\r\n\r\n\t\t\t\tlet initialDistance = Math.hypot(downPoint1.x - downPoint0.x, downPoint1.y - downPoint0.y);\r\n\t\t\t\tlet currentDistance = Math.hypot(movePoint1.x - movePoint0.x, movePoint1.y - movePoint0.y);\r\n\r\n\t\t\t\tlet level = currentDistance / initialDistance * this._downScale;\r\n\t\t\t\tlet moveCenter = { x: movePoint0.x + (movePoint1.x - movePoint0.x) / 2, y: movePoint0.y + (movePoint1.y - movePoint0.y) / 2 };\r\n\t\t\t\tlet downCenter = { x: downPoint0.x + (downPoint1.x - downPoint0.x) / 2, y: downPoint0.y + (downPoint1.y - downPoint0.y) / 2 };\r\n\r\n\t\t\t\tlet tx = this._downX || 0;\r\n\t\t\t\tlet ty = this._downY || 0;\r\n\r\n\t\t\t\tlet zoomLevel = this._downScale;\r\n\r\n\t\t\t\tlet xx = moveCenter.x - (- tx + downCenter.x) / zoomLevel * level;\r\n\t\t\t\tlet yy = moveCenter.y - (- ty + downCenter.y) / zoomLevel * level;\r\n\r\n\t\t\t\tthis.contents.setAll({\r\n\t\t\t\t\tx: xx,\r\n\t\t\t\t\ty: yy,\r\n\t\t\t\t\tscale: level\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}"]}
1
+ {"version":3,"file":"ZoomableContainer.js","sourceRoot":"","sources":["../../../../../src/.internal/core/render/ZoomableContainer.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,SAAS,EAA2D,MAAM,6BAA6B,CAAC;AACjH,OAAO,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AACxD,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAE9C,OAAO,KAAK,MAAM,MAAM,uBAAuB,CAAC;AAChD,OAAO,KAAK,KAAK,MAAM,sBAAsB,CAAC;AAC9C,OAAO,KAAK,OAAO,MAAM,wBAAwB,CAAC;AAsDlD;;;;;;GAMG;AACH,MAAM,OAAO,iBAAkB,SAAQ,SAAS;IAAhD;;QAQC;;;;;WAAsD;QACtD;;;;;WAAmD;QACnD;;;;;WAAmD;QAGnD;;;;mBAAqD,EAAE;WAAC;QACxD;;;;mBAA+B,CAAC;WAAC;QACjC;;;;mBAA2B,CAAC;WAAC;QAC7B;;;;mBAA2B,CAAC;WAAC;QAE7B;;;;;WAA+B;QAE/B;;;;;WAKG;QACH;;;;mBAAkB,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,EAAE;gBAC9D,KAAK,EAAE,IAAI;gBACX,MAAM,EAAE,IAAI;gBACZ,CAAC,EAAE,CAAC;gBACJ,CAAC,EAAE,CAAC;gBACJ,SAAS,EAAE,IAAI;gBACf,UAAU,EAAE,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,EAAE;oBACrC,IAAI,EAAE,KAAK,CAAC,QAAQ,CAAC;oBACrB,WAAW,EAAE,CAAC;iBACd,CAAC;aACF,CAAC,CAAC;WAAA;QA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IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC;oBACpB,CAAC,EAAE,EAAE;oBACL,CAAC,EAAE,EAAE;oBACL,KAAK,EAAE,KAAK;iBACZ,CAAC,CAAC;aACH;SACD;IACF,CAAC;;AA3TD;;;;WAAkC,mBAAmB;GAAC;AACtD;;;;WAA0C,SAAS,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,iBAAiB,CAAC,SAAS,CAAC,CAAC;GAAC","sourcesContent":["import type { Time } from \"../../core/util/Animation\";\r\nimport type { Animation } from \"../../core/util/Entity\";\r\nimport type { IDisposer } from \"../../core/util/Disposer\";\r\nimport type { IPoint } from \"../../core/util/IPoint\";\r\nimport type { ISpritePointerEvent } from \"../../core/render/Sprite\";\r\n\r\nimport { Container, IContainerSettings, IContainerPrivate, IContainerEvents } from \"../../core/render/Container\";\r\nimport { p100 } from \"../../core/util/Percent\";\r\nimport { Rectangle } from \"../../core/render/Rectangle\";\r\nimport { color } from \"../../core/util/Color\";\r\n\r\nimport * as $utils from \"../../core/util/Utils\";\r\nimport * as $math from \"../../core/util/Math\";\r\nimport * as $object from \"../../core/util/Object\";\r\n\r\nexport interface IZoomableContainerSettings extends IContainerSettings {\r\n\r\n\t/**\r\n\t * Maximum zoom-in level.\r\n\t * \r\n\t * @default 32\r\n\t */\r\n\tmaxZoomLevel?: number;\r\n\r\n\t/**\r\n\t * Maximum zoom-out level.\r\n\t * \r\n\t * @default 1\r\n\t */\r\n\tminZoomLevel?: number;\r\n\r\n\t/**\r\n\t * Zoom level increase/decrease factor with each zoom action.\r\n\t * \r\n\t * @defult 2\r\n\t */\r\n\tzoomStep?: number;\r\n\r\n\t/**\r\n\t * Pinch-zooming is enabled on touch devices.\r\n\t *\r\n\t * @default true\r\n\t */\r\n\tpinchZoom?: boolean;\r\n\r\n\t/**\r\n\t * Animation duration (ms) for zoom animations.\r\n\t *\r\n\t * @default 600\r\n\t */\r\n\tanimationDuration?: number;\r\n\r\n\t/**\r\n\t * Easing function to use for zoom animations.\r\n\t * \r\n\t * @default am5.ease.out(am5.ease.cubic)\r\n\t */\r\n\tanimationEasing?: (t: Time) => Time;\r\n\r\n}\r\n\r\nexport interface IZoomableContainerPrivate extends IContainerPrivate {\r\n}\r\n\r\nexport interface IZoomableContainerEvents extends IContainerEvents {\r\n}\r\n\r\n/**\r\n * A version of [[Container]] which adds zooming capabilities.\r\n *\r\n * @see {@link https://www.amcharts.com/docs/v5/concepts/common-elements/containers/#Zoomable_container} for more info\r\n * @since 5.8.0\r\n * @important\r\n */\r\nexport class ZoomableContainer extends Container {\r\n\tpublic static className: string = \"ZoomableContainer\";\r\n\tpublic static classNames: Array<string> = Container.classNames.concat([ZoomableContainer.className]);\r\n\r\n\tdeclare public _settings: IZoomableContainerSettings;\r\n\tdeclare public _privateSettings: IZoomableContainerPrivate;\r\n\tdeclare public _events: IZoomableContainerEvents;\r\n\r\n\tprotected _za?: Animation<this[\"_settings\"][\"scale\"]>;\r\n\tprotected _txa?: Animation<this[\"_settings\"][\"x\"]>;\r\n\tprotected _tya?: Animation<this[\"_settings\"][\"y\"]>;\r\n\r\n\r\n\tprotected _movePoints: { [index: number]: IPoint } = {};\r\n\tprotected _downScale: number = 1;\r\n\tprotected _downX: number = 0;\r\n\tprotected _downY: number = 0;\r\n\r\n\tprotected _pinchDP?: IDisposer;\r\n\r\n\t/**\r\n\t * All elements must be added to `contents.children` instead of `children` of\r\n\t * [[ZoomableContainer]].\r\n\t *\r\n\t * @see {@link https://www.amcharts.com/docs/v5/concepts/common-elements/containers/#Zoomable_container} for more info\r\n\t */\r\n\tpublic contents = this.children.push(Container.new(this._root, {\r\n\t\twidth: p100,\r\n\t\theight: p100,\r\n\t\tx: 0,\r\n\t\ty: 0,\r\n\t\tdraggable: true,\r\n\t\tbackground: Rectangle.new(this._root, {\r\n\t\t\tfill: color(0xffffff),\r\n\t\t\tfillOpacity: 0\r\n\t\t})\r\n\t}))\r\n\r\n\tprotected _wheelDp: IDisposer | undefined;\r\n\r\n\tprotected _afterNew(): void {\r\n\t\tsuper._afterNew();\r\n\r\n\t\tconst events = this.contents.events;\r\n\r\n\t\tthis._disposers.push(events.on(\"pointerdown\", (event) => {\r\n\t\t\tthis._handleThisDown(event);\r\n\t\t}));\r\n\r\n\t\tthis._disposers.push(events.on(\"globalpointerup\", (event) => {\r\n\t\t\tthis._handleThisUp(event);\r\n\t\t}));\r\n\r\n\t\tthis._disposers.push(events.on(\"globalpointermove\", (event) => {\r\n\t\t\tthis._handleThisMove(event);\r\n\t\t}));\r\n\r\n\t\tconst bg = this.contents.get(\"background\");\r\n\t\tif(bg){\r\n\t\t\tbg.adapters.add(\"width\", (width) => {\r\n\t\t\t\treturn Number(width) * 5;\r\n\t\t\t})\r\n\t\t\tbg.adapters.add(\"height\", (height) => {\r\n\t\t\t\treturn Number(height) * 5;\r\n\t\t\t})\r\n\t\t\tbg.adapters.add(\"x\", (x) => {\r\n\t\t\t\treturn Number(x) - bg.width() / 5 * 2;\r\n\t\t\t})\r\n\t\t\tbg.adapters.add(\"y\", (y) => {\r\n\t\t\t\treturn Number(y) - bg.height() / 5 * 2;\r\n\t\t\t})\t\t\t\t\t\t\t\t\r\n\t\t}\r\n\t}\r\n\r\n\tpublic _prepareChildren() {\r\n\t\tsuper._prepareChildren();\r\n\t\tif (this.isDirty(\"wheelable\")) {\r\n\t\t\tthis._handleSetWheel();\r\n\t\t}\r\n\r\n\t\tthis.contents._display.cancelTouch = this.get(\"pinchZoom\", false);\r\n\t}\r\n\r\n\r\n\tprotected _handleSetWheel() {\r\n\t\t// const contents = this.contents;\r\n\r\n\t\tif (this.get(\"wheelable\")) {\r\n\t\t\tif (this._wheelDp) {\r\n\t\t\t\tthis._wheelDp.dispose();\r\n\t\t\t}\r\n\r\n\t\t\tthis._wheelDp = this.events.on(\"wheel\", (event) => {\r\n\t\t\t\tconst wheelEvent = event.originalEvent;\r\n\r\n\t\t\t\t// Ignore wheel event if it is happening on a non-ZoomableContainer element, e.g. if\r\n\t\t\t\t// some page element is over the ZoomableContainer.\r\n\t\t\t\tif ($utils.isLocalEvent(wheelEvent, this)) {\r\n\t\t\t\t\twheelEvent.preventDefault();\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tconst point = this.toLocal(event.point);\r\n\r\n\t\t\t\tthis._handleWheelZoom(wheelEvent.deltaY, point);\r\n\t\t\t});\r\n\r\n\t\t\tthis._disposers.push(this._wheelDp);\r\n\t\t}\r\n\t\telse {\r\n\t\t\tif (this._wheelDp) {\r\n\t\t\t\tthis._wheelDp.dispose();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tprotected _handleWheelZoom(delta: number, point: IPoint) {\r\n\t\tlet step = this.get(\"zoomStep\", 2);\r\n\t\tlet zoomLevel = this.contents.get(\"scale\", 1);\r\n\r\n\t\tlet newZoomLevel = zoomLevel;\r\n\t\tif (delta > 0) {\r\n\t\t\tnewZoomLevel = zoomLevel / step;\r\n\t\t}\r\n\t\telse if (delta < 0) {\r\n\t\t\tnewZoomLevel = zoomLevel * step;\r\n\t\t}\r\n\r\n\t\tif (newZoomLevel != zoomLevel) {\r\n\t\t\tthis.zoomToPoint(point, newZoomLevel)\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Zooms to specific X/Y point.\r\n\t * \r\n\t * @param point Center point\r\n\t * @param level Zoom level\r\n\t * @return Zoom Animation object\r\n\t */\r\n\tpublic zoomToPoint(point: IPoint, level: number): Animation<this[\"_settings\"][\"scale\"]> | undefined {\r\n\t\tif (level) {\r\n\t\t\tlevel = $math.fitToRange(level, this.get(\"minZoomLevel\", 1), this.get(\"maxZoomLevel\", 32));\r\n\t\t}\r\n\r\n\t\tconst zoomLevel = this.contents.get(\"scale\", 1);\r\n\r\n\t\tlet x = point.x;\r\n\t\tlet y = point.y;\r\n\r\n\t\tlet cx = x;\r\n\t\tlet cy = y;\r\n\r\n\t\tconst contents = this.contents;\r\n\r\n\t\tlet tx = contents.x();\r\n\t\tlet ty = contents.y();\r\n\r\n\t\tlet xx = cx - ((x - tx) / zoomLevel * level);\r\n\t\tlet yy = cy - ((y - ty) / zoomLevel * level);\r\n\r\n\t\tthis._animateTo(xx, yy, level);\r\n\r\n\t\treturn this._za;\r\n\t}\r\n\r\n\t/**\r\n\t * Zooms the container contents in by `zoomStep`.\r\n\t * \r\n\t * @return Zoom Animation object\r\n\t */\r\n\tpublic zoomIn(): Animation<this[\"_settings\"][\"scale\"]> | undefined {\r\n\t\treturn this.zoomToPoint({ x: this.width() / 2, y: this.height() / 2 }, this.contents.get(\"scale\", 1) * this.get(\"zoomStep\", 2));\r\n\t}\r\n\r\n\t/**\r\n\t * Zooms the container contents out by `zoomStep`.\r\n\t * \r\n\t * @return Zoom Animation object\r\n\t */\r\n\tpublic zoomOut(): Animation<this[\"_settings\"][\"scale\"]> | undefined {\r\n\t\treturn this.zoomToPoint({ x: this.width() / 2, y: this.height() / 2 }, this.contents.get(\"scale\", 1) / this.get(\"zoomStep\", 2));\r\n\t}\r\n\r\n\t/**\r\n\t * Fully zooms out the container contents.\r\n\t * \r\n\t * @return Zoom Animation object\r\n\t */\r\n\tpublic goHome() {\r\n\t\treturn this._animateTo(0, 0, 1);\r\n\t}\r\n\r\n\tprotected _animateTo(x: number, y: number, scale: number) {\r\n\t\tconst duration = this.get(\"animationDuration\", 0);\r\n\t\tconst easing = this.get(\"animationEasing\");\r\n\r\n\t\tconst contents = this.contents;\r\n\t\tthis._txa = contents.animate({ key: \"x\", to: x, duration: duration, easing: easing });\r\n\t\tthis._tya = contents.animate({ key: \"y\", to: y, duration: duration, easing: easing });\r\n\t\tthis._za = contents.animate({ key: \"scale\", to: scale, duration: duration, easing: easing });\r\n\t}\r\n\r\n\r\n\tprotected _handleThisUp(_event: ISpritePointerEvent) {\r\n\t\tthis._downPoints = {}\r\n\t}\r\n\r\n\tprotected _handleThisDown(event: ISpritePointerEvent) {\r\n\r\n\t\tconst contents = this.contents;\r\n\r\n\t\tthis._downScale = contents.get(\"scale\", 1);\r\n\t\tconst downPoints = contents._downPoints;\r\n\r\n\t\tlet count = $object.keys(downPoints).length;\r\n\r\n\t\tif (count == 1) {\r\n\t\t\t// workaround to solve a problem when events are added to some children of chart container (rotation stops working)\r\n\t\t\tlet downPoint = downPoints[1];\r\n\t\t\tif (!downPoint) {\r\n\t\t\t\tdownPoint = downPoints[0];\r\n\t\t\t}\r\n\r\n\t\t\tif (downPoint && (downPoint.x == event.point.x && downPoint.y == event.point.y)) {\r\n\t\t\t\tcount = 0;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (count > 0) {\r\n\t\t\tthis._downX = contents.x();\r\n\t\t\tthis._downY = contents.y();\r\n\r\n\t\t\tconst downId = contents._getDownPointId();\r\n\t\t\tif (downId) {\r\n\t\t\t\tlet movePoint = this._movePoints[downId];\r\n\t\t\t\tif (movePoint) {\r\n\t\t\t\t\tcontents._downPoints[downId] = movePoint;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\r\n\tprotected _handleThisMove(event: ISpritePointerEvent) {\r\n\t\tconst originalEvent = event.originalEvent as any;\r\n\r\n\t\tconst pointerId = originalEvent.pointerId;\r\n\r\n\t\tif (this.get(\"pinchZoom\")) {\r\n\t\t\tif (pointerId) {\r\n\t\t\t\tthis._movePoints[pointerId] = event.point;\r\n\r\n\t\t\t\tif ($object.keys(this.contents._downPoints).length > 1) {\r\n\t\t\t\t\tthis._handlePinch();\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tprotected _handlePinch() {\r\n\t\tlet i = 0;\r\n\t\tlet downPoints: Array<IPoint> = [];\r\n\t\tlet movePoints: Array<IPoint> = [];\r\n\r\n\t\t$object.each(this.contents._downPoints, (k, point) => {\r\n\t\t\tdownPoints[i] = point;\r\n\t\t\tlet movePoint = this._movePoints[k];\r\n\t\t\tif (movePoint) {\r\n\t\t\t\tmovePoints[i] = movePoint;\r\n\t\t\t}\r\n\t\t\ti++;\r\n\t\t});\r\n\r\n\t\tif (downPoints.length > 1 && movePoints.length > 1) {\r\n\r\n\t\t\tthis.contents._isDragging = false;\r\n\r\n\t\t\tlet downPoint0 = downPoints[0];\r\n\t\t\tlet downPoint1 = downPoints[1];\r\n\r\n\t\t\tlet movePoint0 = movePoints[0];\r\n\t\t\tlet movePoint1 = movePoints[1];\r\n\r\n\t\t\tif (downPoint0 && downPoint1 && movePoint0 && movePoint1) {\r\n\t\t\t\tdownPoint0 = this.toLocal(downPoint0);\r\n\t\t\t\tdownPoint1 = this.toLocal(downPoint1);\r\n\r\n\t\t\t\tmovePoint0 = this.toLocal(movePoint0);\r\n\t\t\t\tmovePoint1 = this.toLocal(movePoint1);\r\n\r\n\t\t\t\tlet initialDistance = Math.hypot(downPoint1.x - downPoint0.x, downPoint1.y - downPoint0.y);\r\n\t\t\t\tlet currentDistance = Math.hypot(movePoint1.x - movePoint0.x, movePoint1.y - movePoint0.y);\r\n\r\n\t\t\t\tlet level = currentDistance / initialDistance * this._downScale;\r\n\t\t\t\tlet moveCenter = { x: movePoint0.x + (movePoint1.x - movePoint0.x) / 2, y: movePoint0.y + (movePoint1.y - movePoint0.y) / 2 };\r\n\t\t\t\tlet downCenter = { x: downPoint0.x + (downPoint1.x - downPoint0.x) / 2, y: downPoint0.y + (downPoint1.y - downPoint0.y) / 2 };\r\n\r\n\t\t\t\tlet tx = this._downX || 0;\r\n\t\t\t\tlet ty = this._downY || 0;\r\n\r\n\t\t\t\tlet zoomLevel = this._downScale;\r\n\r\n\t\t\t\tlet xx = moveCenter.x - (- tx + downCenter.x) / zoomLevel * level;\r\n\t\t\t\tlet yy = moveCenter.y - (- ty + downCenter.y) / zoomLevel * level;\r\n\r\n\t\t\t\tthis.contents.setAll({\r\n\t\t\t\t\tx: xx,\r\n\t\t\t\t\ty: yy,\r\n\t\t\t\t\tscale: level\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}"]}
package/CHANGELOG.md CHANGED
@@ -5,6 +5,15 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
5
5
  Please note, that this project, while following numbering syntax, it DOES NOT
6
6
  adhere to [Semantic Versioning](http://semver.org/spec/v2.0.0.html) rules.
7
7
 
8
+ ## [5.9.13] - 2024-07-03
9
+
10
+ ### Fixed
11
+ - If start and end values of a `HeatLegend` were the same, the tooltip was shown in the top/left corner of the chart.
12
+ - If a linked hierarchy had bullets on links, they remained visible when nodes and links were hidden.
13
+ - Zoom-out button could be visibile initially with some specific setups.
14
+ - `ZoomableContainer` would not react to pans in some of its sections if its contents was panned outside the its bounds.
15
+
16
+
8
17
  ## [5.9.12] - 2024-06-12
9
18
 
10
19
  ### Changed
@@ -3,7 +3,7 @@
3
3
  "name": "amcharts5-example-flow-arc-horizontal",
4
4
  "version": "0.1.0",
5
5
  "devDependencies": {
6
- "@amcharts/amcharts5": "^5.9.12",
6
+ "@amcharts/amcharts5": "^5.9.13",
7
7
  "source-map-loader": "^4.0.1",
8
8
  "webpack": "^5.1.3",
9
9
  "webpack-cli": "^5.1.1",
@@ -3,7 +3,7 @@
3
3
  "name": "amcharts5-example-flow-arc-vertical",
4
4
  "version": "0.1.0",
5
5
  "devDependencies": {
6
- "@amcharts/amcharts5": "^5.9.12",
6
+ "@amcharts/amcharts5": "^5.9.13",
7
7
  "source-map-loader": "^4.0.1",
8
8
  "webpack": "^5.1.3",
9
9
  "webpack-cli": "^5.1.1",
@@ -3,7 +3,7 @@
3
3
  "name": "amcharts5-example-flow-chord",
4
4
  "version": "0.1.0",
5
5
  "devDependencies": {
6
- "@amcharts/amcharts5": "^5.9.12",
6
+ "@amcharts/amcharts5": "^5.9.13",
7
7
  "source-map-loader": "^4.0.1",
8
8
  "webpack": "^5.1.3",
9
9
  "webpack-cli": "^5.1.1",
@@ -3,7 +3,7 @@
3
3
  "name": "amcharts5-example-flow-chord-directed",
4
4
  "version": "0.1.0",
5
5
  "devDependencies": {
6
- "@amcharts/amcharts5": "^5.9.12",
6
+ "@amcharts/amcharts5": "^5.9.13",
7
7
  "source-map-loader": "^4.0.1",
8
8
  "webpack": "^5.1.3",
9
9
  "webpack-cli": "^5.1.1",
@@ -3,7 +3,7 @@
3
3
  "name": "amcharts5-example-flow-chord-non-ribbon",
4
4
  "version": "0.1.0",
5
5
  "devDependencies": {
6
- "@amcharts/amcharts5": "^5.9.12",
6
+ "@amcharts/amcharts5": "^5.9.13",
7
7
  "source-map-loader": "^4.0.1",
8
8
  "webpack": "^5.1.3",
9
9
  "webpack-cli": "^5.1.1",
@@ -3,7 +3,7 @@
3
3
  "name": "amcharts5-example-flow-sankey",
4
4
  "version": "0.1.0",
5
5
  "devDependencies": {
6
- "@amcharts/amcharts5": "^5.9.12",
6
+ "@amcharts/amcharts5": "^5.9.13",
7
7
  "source-map-loader": "^4.0.1",
8
8
  "webpack": "^5.1.3",
9
9
  "webpack-cli": "^5.1.1",
@@ -3,7 +3,7 @@
3
3
  "name": "amcharts5-example-gauge",
4
4
  "version": "0.1.0",
5
5
  "devDependencies": {
6
- "@amcharts/amcharts5": "^5.9.12",
6
+ "@amcharts/amcharts5": "^5.9.13",
7
7
  "source-map-loader": "^4.0.1",
8
8
  "webpack": "^5.1.3",
9
9
  "webpack-cli": "^5.1.1",
@@ -3,7 +3,7 @@
3
3
  "name": "amcharts5-example-gauge-bands",
4
4
  "version": "0.1.0",
5
5
  "devDependencies": {
6
- "@amcharts/amcharts5": "^5.9.12",
6
+ "@amcharts/amcharts5": "^5.9.13",
7
7
  "source-map-loader": "^4.0.1",
8
8
  "webpack": "^5.1.3",
9
9
  "webpack-cli": "^5.1.1",
@@ -3,7 +3,7 @@
3
3
  "name": "amcharts5-example-hierarchy-force-directed",
4
4
  "version": "0.1.0",
5
5
  "devDependencies": {
6
- "@amcharts/amcharts5": "^5.9.12",
6
+ "@amcharts/amcharts5": "^5.9.13",
7
7
  "source-map-loader": "^4.0.1",
8
8
  "webpack": "^5.1.3",
9
9
  "webpack-cli": "^5.1.1",
@@ -3,7 +3,7 @@
3
3
  "name": "amcharts5-example-hierarchy-pack",
4
4
  "version": "0.1.0",
5
5
  "devDependencies": {
6
- "@amcharts/amcharts5": "^5.9.12",
6
+ "@amcharts/amcharts5": "^5.9.13",
7
7
  "source-map-loader": "^4.0.1",
8
8
  "webpack": "^5.1.3",
9
9
  "webpack-cli": "^5.1.1",
@@ -3,7 +3,7 @@
3
3
  "name": "amcharts5-example-hierarchy-partition",
4
4
  "version": "0.1.0",
5
5
  "devDependencies": {
6
- "@amcharts/amcharts5": "^5.9.12",
6
+ "@amcharts/amcharts5": "^5.9.13",
7
7
  "source-map-loader": "^4.0.1",
8
8
  "webpack": "^5.1.3",
9
9
  "webpack-cli": "^5.1.1",
@@ -3,7 +3,7 @@
3
3
  "name": "amcharts5-example-hierarchy-sunburst",
4
4
  "version": "0.1.0",
5
5
  "devDependencies": {
6
- "@amcharts/amcharts5": "^5.9.12",
6
+ "@amcharts/amcharts5": "^5.9.13",
7
7
  "source-map-loader": "^4.0.1",
8
8
  "webpack": "^5.1.3",
9
9
  "webpack-cli": "^5.1.1",
@@ -3,7 +3,7 @@
3
3
  "name": "amcharts5-example-hierarchy-tree",
4
4
  "version": "0.1.0",
5
5
  "devDependencies": {
6
- "@amcharts/amcharts5": "^5.9.12",
6
+ "@amcharts/amcharts5": "^5.9.13",
7
7
  "source-map-loader": "^4.0.1",
8
8
  "webpack": "^5.1.3",
9
9
  "webpack-cli": "^5.1.1",
@@ -3,7 +3,7 @@
3
3
  "name": "amcharts5-example-hierarchy-treemap",
4
4
  "version": "0.1.0",
5
5
  "devDependencies": {
6
- "@amcharts/amcharts5": "^5.9.12",
6
+ "@amcharts/amcharts5": "^5.9.13",
7
7
  "source-map-loader": "^4.0.1",
8
8
  "webpack": "^5.1.3",
9
9
  "webpack-cli": "^5.1.1",
@@ -3,7 +3,7 @@
3
3
  "name": "amcharts5-example-hierarchy-voronoi-treemap",
4
4
  "version": "0.1.0",
5
5
  "devDependencies": {
6
- "@amcharts/amcharts5": "^5.9.12",
6
+ "@amcharts/amcharts5": "^5.9.13",
7
7
  "source-map-loader": "^4.0.1",
8
8
  "webpack": "^5.1.3",
9
9
  "webpack-cli": "^5.1.1",
@@ -3,7 +3,7 @@
3
3
  "name": "amcharts5-example-jest",
4
4
  "version": "0.1.0",
5
5
  "devDependencies": {
6
- "@amcharts/amcharts5": "^5.9.12",
6
+ "@amcharts/amcharts5": "^5.9.13",
7
7
  "source-map-loader": "^4.0.1",
8
8
  "webpack": "^5.1.3",
9
9
  "webpack-cli": "^5.1.1",
@@ -3,7 +3,7 @@
3
3
  "name": "amcharts5-example-json-pie",
4
4
  "version": "0.1.0",
5
5
  "devDependencies": {
6
- "@amcharts/amcharts5": "^5.9.12",
6
+ "@amcharts/amcharts5": "^5.9.13",
7
7
  "source-map-loader": "^4.0.1",
8
8
  "webpack": "^5.1.3",
9
9
  "webpack-cli": "^5.1.1",
@@ -3,7 +3,7 @@
3
3
  "name": "amcharts5-example-json-xy",
4
4
  "version": "0.1.0",
5
5
  "devDependencies": {
6
- "@amcharts/amcharts5": "^5.9.12",
6
+ "@amcharts/amcharts5": "^5.9.13",
7
7
  "source-map-loader": "^4.0.1",
8
8
  "webpack": "^5.1.3",
9
9
  "webpack-cli": "^5.1.1",
@@ -3,7 +3,7 @@
3
3
  "name": "amcharts5-example-map-animating-along-lines",
4
4
  "version": "0.1.0",
5
5
  "devDependencies": {
6
- "@amcharts/amcharts5": "^5.9.12",
6
+ "@amcharts/amcharts5": "^5.9.13",
7
7
  "source-map-loader": "^4.0.1",
8
8
  "webpack": "^5.1.3",
9
9
  "webpack-cli": "^5.1.1",
@@ -3,7 +3,7 @@
3
3
  "name": "amcharts5-example-map-clustered-points",
4
4
  "version": "0.1.0",
5
5
  "devDependencies": {
6
- "@amcharts/amcharts5": "^5.9.12",
6
+ "@amcharts/amcharts5": "^5.9.13",
7
7
  "source-map-loader": "^4.0.1",
8
8
  "webpack": "^5.1.3",
9
9
  "webpack-cli": "^5.1.1",
@@ -3,7 +3,7 @@
3
3
  "name": "amcharts5-example-map-day-and-night",
4
4
  "version": "0.1.0",
5
5
  "devDependencies": {
6
- "@amcharts/amcharts5": "^5.9.12",
6
+ "@amcharts/amcharts5": "^5.9.13",
7
7
  "source-map-loader": "^4.0.1",
8
8
  "webpack": "^5.1.3",
9
9
  "webpack-cli": "^5.1.1",
@@ -3,7 +3,7 @@
3
3
  "name": "amcharts5-example-map-globe-rotate-to-country",
4
4
  "version": "0.1.0",
5
5
  "devDependencies": {
6
- "@amcharts/amcharts5": "^5.9.12",
6
+ "@amcharts/amcharts5": "^5.9.13",
7
7
  "source-map-loader": "^4.0.1",
8
8
  "webpack": "^5.1.3",
9
9
  "webpack-cli": "^5.1.1",
@@ -3,7 +3,7 @@
3
3
  "name": "amcharts5-example-map-globe-with-projected-circles",
4
4
  "version": "0.1.0",
5
5
  "devDependencies": {
6
- "@amcharts/amcharts5": "^5.9.12",
6
+ "@amcharts/amcharts5": "^5.9.13",
7
7
  "source-map-loader": "^4.0.1",
8
8
  "webpack": "^5.1.3",
9
9
  "webpack-cli": "^5.1.1",
@@ -3,7 +3,7 @@
3
3
  "name": "amcharts5-example-map-with-bubbles",
4
4
  "version": "0.1.0",
5
5
  "devDependencies": {
6
- "@amcharts/amcharts5": "^5.9.12",
6
+ "@amcharts/amcharts5": "^5.9.13",
7
7
  "source-map-loader": "^4.0.1",
8
8
  "webpack": "^5.1.3",
9
9
  "webpack-cli": "^5.1.1",
@@ -3,7 +3,7 @@
3
3
  "name": "amcharts5-example-map-zoom-to-country",
4
4
  "version": "0.1.0",
5
5
  "devDependencies": {
6
- "@amcharts/amcharts5": "^5.9.12",
6
+ "@amcharts/amcharts5": "^5.9.13",
7
7
  "source-map-loader": "^4.0.1",
8
8
  "webpack": "^5.1.3",
9
9
  "webpack-cli": "^5.1.1",
@@ -3,7 +3,7 @@
3
3
  "name": "amcharts5-example-misc-40-charts",
4
4
  "version": "0.1.0",
5
5
  "devDependencies": {
6
- "@amcharts/amcharts5": "^5.9.12",
6
+ "@amcharts/amcharts5": "^5.9.13",
7
7
  "source-map-loader": "^4.0.1",
8
8
  "webpack": "^5.1.3",
9
9
  "webpack-cli": "^5.1.1",
@@ -3,7 +3,7 @@
3
3
  "name": "amcharts5-example-misc-microchart-grid",
4
4
  "version": "0.1.0",
5
5
  "devDependencies": {
6
- "@amcharts/amcharts5": "^5.9.12",
6
+ "@amcharts/amcharts5": "^5.9.13",
7
7
  "source-map-loader": "^4.0.1",
8
8
  "webpack": "^5.1.3",
9
9
  "webpack-cli": "^5.1.1",
@@ -3,7 +3,7 @@
3
3
  "name": "amcharts5-example-pie-chart",
4
4
  "version": "0.1.0",
5
5
  "devDependencies": {
6
- "@amcharts/amcharts5": "^5.9.12",
6
+ "@amcharts/amcharts5": "^5.9.13",
7
7
  "source-map-loader": "^4.0.1",
8
8
  "webpack": "^5.1.3",
9
9
  "webpack-cli": "^5.1.1",
@@ -3,7 +3,7 @@
3
3
  "name": "amcharts5-example-pie-donut-chart",
4
4
  "version": "0.1.0",
5
5
  "devDependencies": {
6
- "@amcharts/amcharts5": "^5.9.12",
6
+ "@amcharts/amcharts5": "^5.9.13",
7
7
  "source-map-loader": "^4.0.1",
8
8
  "webpack": "^5.1.3",
9
9
  "webpack-cli": "^5.1.1",
@@ -3,7 +3,7 @@
3
3
  "name": "amcharts5-example-pie-variable-radius",
4
4
  "version": "0.1.0",
5
5
  "devDependencies": {
6
- "@amcharts/amcharts5": "^5.9.12",
6
+ "@amcharts/amcharts5": "^5.9.13",
7
7
  "source-map-loader": "^4.0.1",
8
8
  "webpack": "^5.1.3",
9
9
  "webpack-cli": "^5.1.1",
@@ -3,7 +3,7 @@
3
3
  "name": "amcharts5-example-radar-column-iwatch-style",
4
4
  "version": "0.1.0",
5
5
  "devDependencies": {
6
- "@amcharts/amcharts5": "^5.9.12",
6
+ "@amcharts/amcharts5": "^5.9.13",
7
7
  "source-map-loader": "^4.0.1",
8
8
  "webpack": "^5.1.3",
9
9
  "webpack-cli": "^5.1.1",
@@ -3,7 +3,7 @@
3
3
  "name": "amcharts5-example-radar-heat-map",
4
4
  "version": "0.1.0",
5
5
  "devDependencies": {
6
- "@amcharts/amcharts5": "^5.9.12",
6
+ "@amcharts/amcharts5": "^5.9.13",
7
7
  "source-map-loader": "^4.0.1",
8
8
  "webpack": "^5.1.3",
9
9
  "webpack-cli": "^5.1.1",
@@ -3,7 +3,7 @@
3
3
  "name": "amcharts5-example-radar-line",
4
4
  "version": "0.1.0",
5
5
  "devDependencies": {
6
- "@amcharts/amcharts5": "^5.9.12",
6
+ "@amcharts/amcharts5": "^5.9.13",
7
7
  "source-map-loader": "^4.0.1",
8
8
  "webpack": "^5.1.3",
9
9
  "webpack-cli": "^5.1.1",
@@ -3,7 +3,7 @@
3
3
  "name": "amcharts5-example-radar-time-line",
4
4
  "version": "0.1.0",
5
5
  "devDependencies": {
6
- "@amcharts/amcharts5": "^5.9.12",
6
+ "@amcharts/amcharts5": "^5.9.13",
7
7
  "source-map-loader": "^4.0.1",
8
8
  "webpack": "^5.1.3",
9
9
  "webpack-cli": "^5.1.1",
@@ -3,7 +3,7 @@
3
3
  "name": "amcharts5-example-sliced-funnel",
4
4
  "version": "0.1.0",
5
5
  "devDependencies": {
6
- "@amcharts/amcharts5": "^5.9.12",
6
+ "@amcharts/amcharts5": "^5.9.13",
7
7
  "source-map-loader": "^4.0.1",
8
8
  "webpack": "^5.1.3",
9
9
  "webpack-cli": "^5.1.1",
@@ -3,7 +3,7 @@
3
3
  "name": "amcharts5-example-sliced-pictorial-stacked",
4
4
  "version": "0.1.0",
5
5
  "devDependencies": {
6
- "@amcharts/amcharts5": "^5.9.12",
6
+ "@amcharts/amcharts5": "^5.9.13",
7
7
  "source-map-loader": "^4.0.1",
8
8
  "webpack": "^5.1.3",
9
9
  "webpack-cli": "^5.1.1",