@amcharts/amcharts5 5.9.12 → 5.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.internal/charts/flow/ArcDiagramNodes.d.ts.map +1 -1
- package/.internal/charts/flow/ArcDiagramNodes.js +2 -0
- package/.internal/charts/flow/ArcDiagramNodes.js.map +1 -1
- package/.internal/charts/flow/ChordNodes.d.ts.map +1 -1
- package/.internal/charts/flow/ChordNodes.js +2 -0
- package/.internal/charts/flow/ChordNodes.js.map +1 -1
- package/.internal/charts/flow/FlowNodes.d.ts +17 -1
- package/.internal/charts/flow/FlowNodes.d.ts.map +1 -1
- package/.internal/charts/flow/FlowNodes.js +13 -0
- package/.internal/charts/flow/FlowNodes.js.map +1 -1
- package/.internal/charts/flow/SankeyNodes.d.ts.map +1 -1
- package/.internal/charts/flow/SankeyNodes.js +2 -0
- package/.internal/charts/flow/SankeyNodes.js.map +1 -1
- package/.internal/charts/funnel/FunnelSeries.d.ts.map +1 -1
- package/.internal/charts/funnel/FunnelSeries.js +2 -0
- package/.internal/charts/funnel/FunnelSeries.js.map +1 -1
- package/.internal/charts/hierarchy/Hierarchy.d.ts +16 -0
- package/.internal/charts/hierarchy/Hierarchy.d.ts.map +1 -1
- package/.internal/charts/hierarchy/Hierarchy.js +25 -4
- package/.internal/charts/hierarchy/Hierarchy.js.map +1 -1
- package/.internal/charts/hierarchy/HierarchyLink.d.ts +2 -0
- package/.internal/charts/hierarchy/HierarchyLink.d.ts.map +1 -1
- package/.internal/charts/hierarchy/HierarchyLink.js +22 -0
- package/.internal/charts/hierarchy/HierarchyLink.js.map +1 -1
- package/.internal/charts/hierarchy/LinkedHierarchy.d.ts.map +1 -1
- package/.internal/charts/hierarchy/LinkedHierarchy.js +5 -0
- package/.internal/charts/hierarchy/LinkedHierarchy.js.map +1 -1
- package/.internal/charts/hierarchy/Pack.d.ts.map +1 -1
- package/.internal/charts/hierarchy/Pack.js +2 -0
- package/.internal/charts/hierarchy/Pack.js.map +1 -1
- package/.internal/charts/hierarchy/Partition.d.ts.map +1 -1
- package/.internal/charts/hierarchy/Partition.js +2 -0
- package/.internal/charts/hierarchy/Partition.js.map +1 -1
- package/.internal/charts/hierarchy/Sunburst.d.ts.map +1 -1
- package/.internal/charts/hierarchy/Sunburst.js +2 -0
- package/.internal/charts/hierarchy/Sunburst.js.map +1 -1
- package/.internal/charts/hierarchy/Treemap.d.ts.map +1 -1
- package/.internal/charts/hierarchy/Treemap.js +2 -0
- package/.internal/charts/hierarchy/Treemap.js.map +1 -1
- package/.internal/charts/hierarchy/VoronoiTreemap.d.ts.map +1 -1
- package/.internal/charts/hierarchy/VoronoiTreemap.js +2 -0
- package/.internal/charts/hierarchy/VoronoiTreemap.js.map +1 -1
- package/.internal/charts/percent/PercentSeries.d.ts +16 -0
- package/.internal/charts/percent/PercentSeries.d.ts.map +1 -1
- package/.internal/charts/percent/PercentSeries.js +13 -0
- package/.internal/charts/percent/PercentSeries.js.map +1 -1
- package/.internal/charts/pie/PieSeries.d.ts.map +1 -1
- package/.internal/charts/pie/PieSeries.js +2 -0
- package/.internal/charts/pie/PieSeries.js.map +1 -1
- package/.internal/charts/stock/indicators/ChartIndicator.js +2 -2
- package/.internal/charts/stock/indicators/ChartIndicator.js.map +1 -1
- package/.internal/charts/venn/Venn.d.ts +19 -3
- package/.internal/charts/venn/Venn.d.ts.map +1 -1
- package/.internal/charts/venn/Venn.js +13 -0
- package/.internal/charts/venn/Venn.js.map +1 -1
- package/.internal/charts/xy/XYChart.d.ts +1 -1
- package/.internal/charts/xy/XYChart.d.ts.map +1 -1
- package/.internal/charts/xy/XYChart.js +10 -2
- package/.internal/charts/xy/XYChart.js.map +1 -1
- package/.internal/charts/xy/axes/ValueAxis.d.ts +2 -0
- package/.internal/charts/xy/axes/ValueAxis.d.ts.map +1 -1
- package/.internal/charts/xy/axes/ValueAxis.js +27 -4
- package/.internal/charts/xy/axes/ValueAxis.js.map +1 -1
- package/.internal/charts/xy/series/BaseColumnSeries.d.ts.map +1 -1
- package/.internal/charts/xy/series/BaseColumnSeries.js +5 -0
- package/.internal/charts/xy/series/BaseColumnSeries.js.map +1 -1
- package/.internal/charts/xy/series/LineSeries.d.ts.map +1 -1
- package/.internal/charts/xy/series/LineSeries.js +8 -0
- package/.internal/charts/xy/series/LineSeries.js.map +1 -1
- package/.internal/core/Classes.d.ts +2 -0
- package/.internal/core/Classes.d.ts.map +1 -1
- package/.internal/core/Classes.js.map +1 -1
- package/.internal/core/Registry.js +1 -1
- package/.internal/core/Registry.js.map +1 -1
- package/.internal/core/render/Component.d.ts +12 -4
- package/.internal/core/render/Component.d.ts.map +1 -1
- package/.internal/core/render/Component.js +14 -6
- package/.internal/core/render/Component.js.map +1 -1
- package/.internal/core/render/HeatLegend.d.ts.map +1 -1
- package/.internal/core/render/HeatLegend.js +4 -1
- package/.internal/core/render/HeatLegend.js.map +1 -1
- package/.internal/core/render/SerialChart.d.ts +9 -1
- package/.internal/core/render/SerialChart.d.ts.map +1 -1
- package/.internal/core/render/SerialChart.js +4 -0
- package/.internal/core/render/SerialChart.js.map +1 -1
- package/.internal/core/render/Series.d.ts +12 -4
- package/.internal/core/render/Series.d.ts.map +1 -1
- package/.internal/core/render/Series.js +4 -3
- package/.internal/core/render/Series.js.map +1 -1
- package/.internal/core/render/Sprite.d.ts.map +1 -1
- package/.internal/core/render/Sprite.js +45 -39
- package/.internal/core/render/Sprite.js.map +1 -1
- package/.internal/core/render/ZoomableContainer.d.ts.map +1 -1
- package/.internal/core/render/ZoomableContainer.js +15 -0
- package/.internal/core/render/ZoomableContainer.js.map +1 -1
- package/.internal/core/util/DurationFormatter.d.ts.map +1 -1
- package/.internal/core/util/DurationFormatter.js +9 -2
- package/.internal/core/util/DurationFormatter.js.map +1 -1
- package/.internal/core/util/PatternSet.d.ts +91 -0
- package/.internal/core/util/PatternSet.d.ts.map +1 -0
- package/.internal/core/util/PatternSet.js +236 -0
- package/.internal/core/util/PatternSet.js.map +1 -0
- package/.internal/plugins/json/Classes-script.d.ts +2 -0
- package/.internal/plugins/json/Classes-script.d.ts.map +1 -1
- package/.internal/plugins/json/Classes-script.js +1 -0
- package/.internal/plugins/json/Classes-script.js.map +1 -1
- package/.internal/plugins/json/Classes.d.ts +2 -0
- package/.internal/plugins/json/Classes.d.ts.map +1 -1
- package/.internal/plugins/json/Classes.js +1 -0
- package/.internal/plugins/json/Classes.js.map +1 -1
- package/.internal/themes/DefaultTheme.d.ts.map +1 -1
- package/.internal/themes/DefaultTheme.js +7 -0
- package/.internal/themes/DefaultTheme.js.map +1 -1
- package/CHANGELOG.md +26 -0
- package/examples/javascript/flow-arc-horizontal/package.json +1 -1
- package/examples/javascript/flow-arc-vertical/package.json +1 -1
- package/examples/javascript/flow-chord/package.json +1 -1
- package/examples/javascript/flow-chord-directed/package.json +1 -1
- package/examples/javascript/flow-chord-non-ribbon/package.json +1 -1
- package/examples/javascript/flow-sankey/package.json +1 -1
- package/examples/javascript/gauge/package.json +1 -1
- package/examples/javascript/gauge-bands/package.json +1 -1
- package/examples/javascript/hierarchy-force-directed/package.json +1 -1
- package/examples/javascript/hierarchy-pack/package.json +1 -1
- package/examples/javascript/hierarchy-partition/package.json +1 -1
- package/examples/javascript/hierarchy-sunburst/package.json +1 -1
- package/examples/javascript/hierarchy-tree/package.json +1 -1
- package/examples/javascript/hierarchy-treemap/package.json +1 -1
- package/examples/javascript/hierarchy-voronoi-treemap/package.json +1 -1
- package/examples/javascript/jest/package.json +1 -1
- package/examples/javascript/json-pie/package.json +1 -1
- package/examples/javascript/json-xy/package.json +1 -1
- package/examples/javascript/map-animating-along-lines/package.json +1 -1
- package/examples/javascript/map-clustered-points/package.json +1 -1
- package/examples/javascript/map-day-and-night/package.json +1 -1
- package/examples/javascript/map-globe-rotate-to-country/package.json +1 -1
- package/examples/javascript/map-globe-with-projected-circles/package.json +1 -1
- package/examples/javascript/map-with-bubbles/package.json +1 -1
- package/examples/javascript/map-zoom-to-country/package.json +1 -1
- package/examples/javascript/misc-40-charts/package.json +1 -1
- package/examples/javascript/misc-microchart-grid/package.json +1 -1
- package/examples/javascript/pie-chart/package.json +1 -1
- package/examples/javascript/pie-donut-chart/package.json +1 -1
- package/examples/javascript/pie-variable-radius/package.json +1 -1
- package/examples/javascript/radar-column-iwatch-style/package.json +1 -1
- package/examples/javascript/radar-heat-map/package.json +1 -1
- package/examples/javascript/radar-line/package.json +1 -1
- package/examples/javascript/radar-time-line/package.json +1 -1
- package/examples/javascript/sliced-funnel/package.json +1 -1
- package/examples/javascript/sliced-pictorial-stacked/package.json +1 -1
- package/examples/javascript/sliced-pyramid/package.json +1 -1
- package/examples/javascript/stock-chart/package.json +1 -1
- package/examples/javascript/stock-chart-comparing-stocks/package.json +1 -1
- package/examples/javascript/stock-chart-data-granularity/package.json +1 -1
- package/examples/javascript/stock-chart-data-grouping/package.json +1 -1
- package/examples/javascript/stock-chart-intraday/package.json +1 -1
- package/examples/javascript/stock-chart-live/package.json +1 -1
- package/examples/javascript/stock-chart-volume-separate-panel/package.json +1 -1
- package/examples/javascript/venn-diagram/package.json +1 -1
- package/examples/javascript/wordcloud-with-data/package.json +1 -1
- package/examples/javascript/wordcloud-with-text/package.json +1 -1
- package/examples/javascript/xy-100-percent-stacked-column/package.json +1 -1
- package/examples/javascript/xy-animated-bullet-at-the-end-of-the-series/package.json +1 -1
- package/examples/javascript/xy-bubble/package.json +1 -1
- package/examples/javascript/xy-candlestick/package.json +1 -1
- package/examples/javascript/xy-clustered-column/package.json +1 -1
- package/examples/javascript/xy-column/package.json +1 -1
- package/examples/javascript/xy-comparing-series-google-analytics-style/package.json +1 -1
- package/examples/javascript/xy-data-grouping/package.json +1 -1
- package/examples/javascript/xy-draggable-range/package.json +1 -1
- package/examples/javascript/xy-drawing-series-with-mouse-or-touch/package.json +1 -1
- package/examples/javascript/xy-dumbbell plot/package.json +1 -1
- package/examples/javascript/xy-evenly-spaced-date-axis/package.json +1 -1
- package/examples/javascript/xy-line/package.json +1 -1
- package/examples/javascript/xy-line-highlight-on-legend-hover/package.json +1 -1
- package/examples/javascript/xy-live-data/package.json +1 -1
- package/examples/javascript/xy-multiple-synced-value-axes/package.json +1 -1
- package/examples/javascript/xy-ohlc/package.json +1 -1
- package/examples/javascript/xy-real-time-data-sorting/package.json +1 -1
- package/examples/javascript/xy-smoothed-line/package.json +1 -1
- package/examples/javascript/xy-stacked-and-clustered-column/package.json +1 -1
- package/examples/javascript/xy-stacked-column/package.json +1 -1
- package/examples/javascript/xy-stacked-step/package.json +1 -1
- package/examples/javascript/xy-stock/package.json +1 -1
- package/examples/javascript/xy-stock-comparing/package.json +1 -1
- package/examples/typescript/flow-arc-horizontal/package.json +1 -1
- package/examples/typescript/flow-arc-vertical/package.json +1 -1
- package/examples/typescript/flow-chord/package.json +1 -1
- package/examples/typescript/flow-chord-directed/package.json +1 -1
- package/examples/typescript/flow-chord-non-ribbon/package.json +1 -1
- package/examples/typescript/flow-sankey/package.json +1 -1
- package/examples/typescript/gauge/package.json +1 -1
- package/examples/typescript/gauge-bands/package.json +1 -1
- package/examples/typescript/hierarchy-force-directed/package.json +1 -1
- package/examples/typescript/hierarchy-pack/package.json +1 -1
- package/examples/typescript/hierarchy-partition/package.json +1 -1
- package/examples/typescript/hierarchy-sunburst/package.json +1 -1
- package/examples/typescript/hierarchy-tree/package.json +1 -1
- package/examples/typescript/hierarchy-treemap/package.json +1 -1
- package/examples/typescript/hierarchy-voronoi-treemap/package.json +1 -1
- package/examples/typescript/jest/package.json +1 -1
- package/examples/typescript/json-pie/package.json +1 -1
- package/examples/typescript/json-xy/package.json +1 -1
- package/examples/typescript/map-animating-along-lines/package.json +1 -1
- package/examples/typescript/map-clustered-points/package.json +1 -1
- package/examples/typescript/map-day-and-night/package.json +1 -1
- package/examples/typescript/map-globe-rotate-to-country/package.json +1 -1
- package/examples/typescript/map-globe-with-projected-circles/package.json +1 -1
- package/examples/typescript/map-with-bubbles/package.json +1 -1
- package/examples/typescript/map-zoom-to-country/package.json +1 -1
- package/examples/typescript/misc-40-charts/package.json +1 -1
- package/examples/typescript/misc-microchart-grid/package.json +1 -1
- package/examples/typescript/pie-chart/package.json +1 -1
- package/examples/typescript/pie-donut-chart/package.json +1 -1
- package/examples/typescript/pie-variable-radius/package.json +1 -1
- package/examples/typescript/radar-column-iwatch-style/package.json +1 -1
- package/examples/typescript/radar-heat-map/package.json +1 -1
- package/examples/typescript/radar-line/package.json +1 -1
- package/examples/typescript/radar-time-line/package.json +1 -1
- package/examples/typescript/sliced-funnel/package.json +1 -1
- package/examples/typescript/sliced-pictorial-stacked/package.json +1 -1
- package/examples/typescript/sliced-pyramid/package.json +1 -1
- package/examples/typescript/stock-chart/package.json +1 -1
- package/examples/typescript/stock-chart-comparing-stocks/package.json +1 -1
- package/examples/typescript/stock-chart-data-granularity/package.json +1 -1
- package/examples/typescript/stock-chart-data-grouping/package.json +1 -1
- package/examples/typescript/stock-chart-intraday/package.json +1 -1
- package/examples/typescript/stock-chart-live/package.json +1 -1
- package/examples/typescript/stock-chart-volume-separate-panel/package.json +1 -1
- package/examples/typescript/venn-diagram/package.json +1 -1
- package/examples/typescript/wordcloud-with-data/package.json +1 -1
- package/examples/typescript/wordcloud-with-text/package.json +1 -1
- package/examples/typescript/xy-100-percent-stacked-column/package.json +1 -1
- package/examples/typescript/xy-animated-bullet-at-the-end-of-the-series/package.json +1 -1
- package/examples/typescript/xy-bubble/package.json +1 -1
- package/examples/typescript/xy-candlestick/package.json +1 -1
- package/examples/typescript/xy-clustered-column/package.json +1 -1
- package/examples/typescript/xy-column/package.json +1 -1
- package/examples/typescript/xy-comparing-series-google-analytics-style/package.json +1 -1
- package/examples/typescript/xy-data-grouping/package.json +1 -1
- package/examples/typescript/xy-draggable-range/package.json +1 -1
- package/examples/typescript/xy-drawing-series-with-mouse-or-touch/package.json +1 -1
- package/examples/typescript/xy-dumbbell plot/package.json +1 -1
- package/examples/typescript/xy-evenly-spaced-date-axis/package.json +1 -1
- package/examples/typescript/xy-line/package.json +1 -1
- package/examples/typescript/xy-line-highlight-on-legend-hover/package.json +1 -1
- package/examples/typescript/xy-live-data/package.json +1 -1
- package/examples/typescript/xy-multiple-synced-value-axes/package.json +1 -1
- package/examples/typescript/xy-ohlc/package.json +1 -1
- package/examples/typescript/xy-real-time-data-sorting/package.json +1 -1
- package/examples/typescript/xy-smoothed-line/package.json +1 -1
- package/examples/typescript/xy-stacked-and-clustered-column/package.json +1 -1
- package/examples/typescript/xy-stacked-column/package.json +1 -1
- package/examples/typescript/xy-stacked-step/package.json +1 -1
- package/examples/typescript/xy-stock/package.json +1 -1
- package/examples/typescript/xy-stock-comparing/package.json +1 -1
- package/index.d.ts +1 -0
- package/index.d.ts.map +1 -1
- package/index.js +1 -0
- package/index.js.map +1 -1
- package/package.json +4 -1
|
@@ -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,C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,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,KAA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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;IA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C,UAAU,CAAC,CAAC,GAAG,UAAU,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,UAAU,CAAC,CAAC,GAAG,CAAC,UAAU,CAAC,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;;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}"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DurationFormatter.d.ts","sourceRoot":"","sources":["../../../../../src/.internal/core/util/DurationFormatter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAEvC,OAAO,EAAE,MAAM,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;AAQlE,MAAM,WAAW,0BAA2B,SAAQ,eAAe;IAElE;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB;;;;OAIG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;;;;;;OAOG;IACH,QAAQ,CAAC,EAAE,QAAQ,CAAC;IAEpB;;;;OAIG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,QAAQ,EAAE,OAAO,CAAC,MAAM,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC,CA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I,GAAG;CAa/B"}
|
|
@@ -308,10 +308,17 @@ export class DurationFormatter extends Entity {
|
|
|
308
308
|
let unit = this._toTimeUnit(part.substr(0, 1));
|
|
309
309
|
let digits = part.length;
|
|
310
310
|
// Calculate current unit value
|
|
311
|
-
let ints
|
|
311
|
+
let ints;
|
|
312
|
+
const unitValue = this._getUnitValue(unit);
|
|
313
|
+
if (i < (len - 1)) {
|
|
314
|
+
ints = Math.floor(tstamp / unitValue);
|
|
315
|
+
}
|
|
316
|
+
else {
|
|
317
|
+
ints = Math.round(tstamp / unitValue);
|
|
318
|
+
}
|
|
312
319
|
res = res.replace($type.PLACEHOLDER, $utils.padString(ints, digits, "0"));
|
|
313
320
|
// Reduce timestamp
|
|
314
|
-
tstamp -= ints *
|
|
321
|
+
tstamp -= ints * unitValue;
|
|
315
322
|
}
|
|
316
323
|
// Reapply negative sign
|
|
317
324
|
if (negative) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DurationFormatter.js","sourceRoot":"","sources":["../../../../../src/.internal/core/util/DurationFormatter.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAmC,MAAM,UAAU,CAAA;AAClE,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEhD,OAAO,KAAK,OAAO,MAAM,UAAU,CAAC;AACpC,OAAO,KAAK,MAAM,MAAM,SAAS,CAAC;AAClC,OAAO,KAAK,KAAK,MAAM,QAAQ,CAAC;AAgDhC;;;;GAIG;AACH,MAAM,OAAO,iBAAkB,SAAQ,MAAM;IAA7C;;QAoFC;;WAEG;QACH;;;;mBAAsD;gBACrD,GAAG,EAAE,GAAG;gBACR,GAAG,EAAE,GAAG;gBACR,GAAG,EAAE,GAAG;gBACR,GAAG,EAAE,GAAG;gBACR,GAAG,EAAE,GAAG;gBACR,GAAG,EAAE,GAAG;aACR;WAAC;IA2ZH,CAAC;IArfU,YAAY;QACrB,MAAM,YAAY,GAAG,uBAAuB,CAAC;QAC7C,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AG,CAAC;gBACnB,IAAI,GAAG,IAAI,CAAC,EAAE;oBACb,IAAI,CAAC,WAAW,EAAE;wBACjB,WAAW,GAAG,GAAG,CAAC;qBAClB;oBACD,OAAO,KAAK,CAAC;iBACb;gBACD,WAAW,GAAG,GAAG,CAAC;aAClB;YACD,OAAO,IAAI,CAAC;QACb,CAAC,CAAC,CAAC;QAEH,OAAO,WAAW,CAAC;IACpB,CAAC;IAED;;;;;;OAMG;IACI,eAAe,CAAC,KAAa,EAAE,QAAmB;QAExD,gBAAgB;QAChB,IAAI,CAAC,QAAQ,EAAE;YACd,QAAQ,GAAG,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;SAChC;QAED,OAAO,KAAK,GAAG,IAAI,CAAC,aAAa,CAAC,QAAS,CAAC,CAAC;IAC9C,CAAC;IAES,aAAa,CAAC,QAAkB;QACzC,OAAO,IAAI,CAAC,cAAc,EAAE,CAAC,QAAQ,CAAC,CAAC;IACxC,CAAC;IAES,cAAc;QACvB,OAAO;YACN,aAAa,EAAE,CAAC;YAChB,QAAQ,EAAE,IAAI;YACd,QAAQ,EAAE,KAAK;YACf,MAAM,EAAE,OAAO;YACf,KAAK,EAAE,QAAQ;YACf,MAAM,EAAE,SAAS;YACjB,OAAO,EAAE,UAAU;YACnB,MAAM,EAAE,WAAW;SACnB,CAAC;IACH,CAAC;CAED","sourcesContent":["import type { TimeUnit } from \"./Time\";\r\n\r\nimport { Entity, IEntitySettings, IEntityPrivate } from \"./Entity\"\r\nimport { TextFormatter } from \"./TextFormatter\";\r\n\r\nimport * as $object from \"./Object\";\r\nimport * as $utils from \"./Utils\";\r\nimport * as $type from \"./Type\";\r\n\r\n\r\nexport interface IDurationFormatterSettings extends IEntitySettings {\r\n\r\n\t/**\r\n\t * A universal duration format to use wherever number needs to be formatted\r\n\t * as a duration.\r\n\t */\r\n\tdurationFormat?: string;\r\n\r\n\t/**\r\n\t * A base value. Any number below it will be considered \"negative\".\r\n\t *\r\n\t * @default 0\r\n\t */\r\n\tnegativeBase?: number;\r\n\r\n\t/**\r\n\t * Identifies what values are used in duration.\r\n\t *\r\n\t * Available options: `\"millisecond\"`, `\"second\"` (default), `\"minute\"`, `\"hour\"`, `\"day\"`, `\"week\"`, `\"month\"`, and `\"year\"`.\r\n\t *\r\n\t * @see {@link https://www.amcharts.com/docs/v5/concepts/formatters/formatting-durations/#Base_unit} for more info\r\n\t * @default \"second\"\r\n\t */\r\n\tbaseUnit?: TimeUnit;\r\n\r\n\t/**\r\n\t * Time unit dependent duration formats.\r\n\t *\r\n\t * Used be [[DurationAxis]].\r\n\t */\r\n\tdurationFormats?: Partial<Record<TimeUnit, Partial<Record<TimeUnit, string>>>>;\r\n\r\n\t/**\r\n\t * An array of data fields that hold duration values and should be formatted\r\n\t * with a [[DurationFormatter]].\r\n\t *\r\n\t * @see {@link https://www.amcharts.com/docs/v5/concepts/formatters/data-placeholders/#Formatting_placeholders} for more info\r\n\t */\r\n\tdurationFields?: string[];\r\n\r\n}\r\n\r\nexport interface IDurationFormatterPrivate extends IEntityPrivate {\r\n}\r\n\r\n/**\r\n * A class used to format numberic values as time duration.\r\n *\r\n * @see {@link https://www.amcharts.com/docs/v5/concepts/formatters/formatting-durations/} for more info\r\n */\r\nexport class DurationFormatter extends Entity {\r\n\tdeclare public _settings: IDurationFormatterSettings;\r\n\tdeclare public _privateSettings: IDurationFormatterPrivate;\r\n\r\n\tprotected _setDefaults() {\r\n\t\tconst dmillisecond = \"_duration_millisecond\";\r\n\t\tconst dsecond = \"_duration_second\";\r\n\t\tconst dminute = \"_duration_minute\";\r\n\t\tconst dhour = \"_duration_hour\";\r\n\t\tconst dday = \"_duration_day\";\r\n\t\tconst dweek = \"_duration_week\";\r\n\t\tconst dmonth = \"_duration_month\";\r\n\t\tconst dyear = \"_duration_year\";\r\n\r\n\t\tconst asecond = \"_second\";\r\n\t\tconst aminute = \"_minute\";\r\n\t\tconst ahour = \"_hour\";\r\n\t\tconst aday = \"_day\";\r\n\t\tconst aweek = \"_week\";\r\n\t\tconst amonth = \"_week\";\r\n\t\tconst ayear = \"_year\";\r\n\r\n\t\t// Defaults\r\n\t\tthis._setDefault(\"negativeBase\", 0);\r\n\t\tthis._setDefault(\"baseUnit\", \"second\");\r\n\t\tthis._setDefault(\"durationFormats\", {\r\n\t\t\t\"millisecond\": {\r\n\t\t\t\t\"millisecond\": this._t(dmillisecond),\r\n\t\t\t\t\"second\": this._t((dmillisecond + asecond) as any),\r\n\t\t\t\t\"minute\": this._t((dmillisecond + aminute) as any),\r\n\t\t\t\t\"hour\": this._t((dmillisecond + ahour) as any),\r\n\t\t\t\t\"day\": this._t((dmillisecond + aday) as any),\r\n\t\t\t\t\"week\": this._t((dmillisecond + aweek) as any),\r\n\t\t\t\t\"month\": this._t((dmillisecond + amonth) as any),\r\n\t\t\t\t\"year\": this._t((dmillisecond + ayear) as any)\r\n\t\t\t},\r\n\t\t\t\"second\": {\r\n\t\t\t\t\"second\": this._t((dsecond) as any),\r\n\t\t\t\t\"minute\": this._t((dsecond + aminute) as any),\r\n\t\t\t\t\"hour\": this._t((dsecond + ahour) as any),\r\n\t\t\t\t\"day\": this._t((dsecond + aday) as any),\r\n\t\t\t\t\"week\": this._t((dsecond + aweek) as any),\r\n\t\t\t\t\"month\": this._t((dsecond + amonth) as any),\r\n\t\t\t\t\"year\": this._t((dsecond + ayear) as any)\r\n\t\t\t},\r\n\t\t\t\"minute\": {\r\n\t\t\t\t\"minute\": this._t((dminute) as any),\r\n\t\t\t\t\"hour\": this._t((dminute + ahour) as any),\r\n\t\t\t\t\"day\": this._t((dminute + aday) as any),\r\n\t\t\t\t\"week\": this._t((dminute + aweek) as any),\r\n\t\t\t\t\"month\": this._t((dminute + amonth) as any),\r\n\t\t\t\t\"year\": this._t((dminute + ayear) as any)\r\n\t\t\t},\r\n\t\t\t\"hour\": {\r\n\t\t\t\t\"hour\": this._t((dhour) as any),\r\n\t\t\t\t\"day\": this._t((dhour + aday) as any),\r\n\t\t\t\t\"week\": this._t((dhour + aweek) as any),\r\n\t\t\t\t\"month\": this._t((dhour + amonth) as any),\r\n\t\t\t\t\"year\": this._t((dhour + ayear) as any)\r\n\t\t\t},\r\n\t\t\t\"day\": {\r\n\t\t\t\t\"day\": this._t((dday) as any),\r\n\t\t\t\t\"week\": this._t((dday + aweek) as any),\r\n\t\t\t\t\"month\": this._t((dday + amonth) as any),\r\n\t\t\t\t\"year\": this._t((dday + ayear) as any)\r\n\t\t\t},\r\n\t\t\t\"week\": {\r\n\t\t\t\t\"week\": this._t((dweek) as any),\r\n\t\t\t\t\"month\": this._t((dweek + amonth) as any),\r\n\t\t\t\t\"year\": this._t((dweek + ayear) as any)\r\n\t\t\t},\r\n\t\t\t\"month\": {\r\n\t\t\t\t\"month\": this._t((dmonth) as any),\r\n\t\t\t\t\"year\": this._t((dmonth + ayear) as any)\r\n\t\t\t},\r\n\t\t\t\"year\": {\r\n\t\t\t\t\"year\": this._t(dyear)\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tsuper._setDefaults();\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * Collection of aliases for units.\r\n\t */\r\n\tprotected _unitAliases: { [index: string]: string } = {\r\n\t\t\"Y\": \"y\",\r\n\t\t\"D\": \"d\",\r\n\t\t\"H\": \"h\",\r\n\t\t\"K\": \"h\",\r\n\t\t\"k\": \"h\",\r\n\t\t\"n\": \"S\"\r\n\t};\r\n\r\n\tpublic _beforeChanged() {\r\n\t\tsuper._beforeChanged();\r\n\t}\r\n\r\n\t/**\r\n\t * Formats the number as duration.\r\n\t *\r\n\t * For example `1000` (base unit seconds) would be converted to `16:40` as in\r\n\t * 16 minutes and 40 seconds.\r\n\t *\r\n\t * @param value Value to format\r\n\t * @param format Format to apply\r\n\t * @param base Override base unit\r\n\t * @return Formatted number\r\n\t */\r\n\tpublic format(value: number | string, format?: string, base?: TimeUnit): string {\r\n\r\n\t\t// no base unit?\r\n\t\tlet baseUnit = base || this.get(\"baseUnit\");\r\n\r\n\t\t// no format passed in or empty\r\n\t\tif (typeof format === \"undefined\" || format === \"\") {\r\n\t\t\tif (this.get(\"durationFormat\") != null) {\r\n\t\t\t\tformat = this.get(\"durationFormat\");\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tformat = this.getFormat($type.toNumber(value), undefined, baseUnit);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// Clean format\r\n\t\tformat = $utils.cleanFormat(format!);\r\n\r\n\t\t// get format info (it will also deal with parser caching)\r\n\t\tlet info = this.parseFormat(format, baseUnit);\r\n\r\n\t\t// cast to number just in case\r\n\t\t// TODO: maybe use better casting\r\n\t\tlet source: number = Number(value);\r\n\r\n\t\t// format and replace the number\r\n\t\tlet details;\r\n\t\tif (source > this.get(\"negativeBase\")) {\r\n\t\t\tdetails = info.positive;\r\n\t\t}\r\n\t\telse if (source < this.get(\"negativeBase\")) {\r\n\t\t\tdetails = info.negative;\r\n\t\t}\r\n\t\telse {\r\n\t\t\tdetails = info.zero;\r\n\t\t}\r\n\r\n\r\n\t\t// Format\r\n\t\tlet formatted = this.applyFormat(source, details);\r\n\r\n\t\t// Apply color?\r\n\t\tif (details.color !== \"\") {\r\n\t\t\tformatted = \"[\" + details.color + \"]\" + formatted + \"[/]\";\r\n\t\t}\r\n\r\n\t\treturn formatted;\r\n\t}\r\n\r\n\t/**\r\n\t * Parses supplied format into structured object which can be used to format\r\n\t * the number.\r\n\t *\r\n\t * @param format Format string, i.e. \"#,###.00\"\r\n\t * @param base Override base unit\r\n\t * @return Parsed information\r\n\t */\r\n\tprotected parseFormat(format: string, base?: TimeUnit): any {\r\n\r\n\t\t// Check cache\r\n\t\t// TODO\r\n\t\t// let cached = this.getCache(format);\r\n\t\t// if (cached != null) {\r\n\t\t// \treturn cached;\r\n\t\t// }\r\n\r\n\t\t// no base unit?\r\n\t\tlet baseUnit = base || this.get(\"baseUnit\");\r\n\r\n\t\t// Initialize duration parsing info\r\n\t\tlet info = {\r\n\t\t\t\"positive\": {\r\n\t\t\t\t\"color\": \"\",\r\n\t\t\t\t\"template\": \"\",\r\n\t\t\t\t\"parts\": <any>[],\r\n\t\t\t\t\"source\": \"\",\r\n\t\t\t\t\"baseUnit\": baseUnit,\r\n\t\t\t\t\"parsed\": false,\r\n\t\t\t\t\"absolute\": false\r\n\t\t\t},\r\n\t\t\t\"negative\": {\r\n\t\t\t\t\"color\": \"\",\r\n\t\t\t\t\"template\": \"\",\r\n\t\t\t\t\"parts\": <any>[],\r\n\t\t\t\t\"source\": \"\",\r\n\t\t\t\t\"baseUnit\": baseUnit,\r\n\t\t\t\t\"parsed\": false,\r\n\t\t\t\t\"absolute\": false\r\n\t\t\t},\r\n\t\t\t\"zero\": {\r\n\t\t\t\t\"color\": \"\",\r\n\t\t\t\t\"template\": \"\",\r\n\t\t\t\t\"parts\": <any>[],\r\n\t\t\t\t\"source\": \"\",\r\n\t\t\t\t\"baseUnit\": baseUnit,\r\n\t\t\t\t\"parsed\": false,\r\n\t\t\t\t\"absolute\": false\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\t// Escape double vertical bars (that mean display one vertical bar)\r\n\t\tformat = format.replace(\"||\", $type.PLACEHOLDER2);\r\n\r\n\t\t// Split it up and deal with different formats\r\n\t\tlet parts = format.split(\"|\");\r\n\t\tinfo.positive.source = parts[0];\r\n\r\n\t\tif (typeof parts[2] === \"undefined\") {\r\n\t\t\tinfo.zero = info.positive;\r\n\t\t}\r\n\t\telse {\r\n\t\t\tinfo.zero.source = parts[2];\r\n\t\t}\r\n\r\n\t\tif (typeof parts[1] === \"undefined\") {\r\n\t\t\tinfo.negative = info.positive;\r\n\t\t}\r\n\t\telse {\r\n\t\t\tinfo.negative.source = parts[1];\r\n\t\t}\r\n\r\n\t\t// Parse each\r\n\t\t$object.each(info, (_part, item) => {\r\n\t\t\t// Already parsed\r\n\t\t\tif (item.parsed) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\t// Check cached\r\n\t\t\t// TODO\r\n\t\t\t// if (typeof this.getCache(item.source) !== \"undefined\") {\r\n\t\t\t// \tinfo[part] = this.getCache(item.source);\r\n\t\t\t// \treturn;\r\n\t\t\t// }\r\n\r\n\t\t\t// Begin parsing\r\n\t\t\tlet partFormat: string = item.source;\r\n\r\n\t\t\t// Check for [] directives\r\n\t\t\tlet dirs: string[] | null = [];\r\n\t\t\tdirs = item.source.match(/^\\[([^\\]]*)\\]/);\r\n\t\t\tif (dirs && dirs.length && dirs[0] !== \"\") {\r\n\t\t\t\tpartFormat = item.source.substr(dirs[0].length);\r\n\t\t\t\titem.color = dirs[1];\r\n\t\t\t}\r\n\r\n\r\n\t\t\t// Let TextFormatter split into chunks\r\n\t\t\tlet chunks = TextFormatter.chunk(partFormat, true);\r\n\t\t\tfor (let i: number = 0; i < chunks.length; i++) {\r\n\t\t\t\tlet chunk = chunks[i];\r\n\r\n\t\t\t\t// replace back double vertical bar\r\n\t\t\t\tchunk.text = chunk.text.replace($type.PLACEHOLDER2, \"|\");\r\n\r\n\t\t\t\tif (chunk.type === \"value\") {\r\n\r\n\t\t\t\t\t// Just \"Duration\"?\r\n\t\t\t\t\t// if (chunk.text.toLowerCase() === \"duration\") {\r\n\t\t\t\t\t// \tchunk.text = durationFormat;\r\n\t\t\t\t\t// }\r\n\r\n\t\t\t\t\t// Check for \"a\" (absolute) modifier\r\n\t\t\t\t\tif (chunk.text.match(/[yYMdDwhHKkmsSn]+a/)) {\r\n\t\t\t\t\t\titem.absolute = true;\r\n\t\t\t\t\t\tchunk.text = chunk.text.replace(/([yYMdDwhHKkmsSn]+)a/, \"$1\");\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t// Find all possible parts\r\n\t\t\t\t\tlet matches = chunk.text.match(/y+|Y+|M+|d+|D+|w+|h+|H+|K+|k+|m+|s+|S+|n+/g);\r\n\r\n\t\t\t\t\tif (matches) {\r\n\t\t\t\t\t\t// Populate template\r\n\t\t\t\t\t\tfor (let x = 0; x < matches.length; x++) {\r\n\t\t\t\t\t\t\t// Is it an alias?\r\n\t\t\t\t\t\t\tif (matches[x] == null) {\r\n\t\t\t\t\t\t\t\tmatches[x] = this._unitAliases[matches[x]];\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\titem.parts.push(matches[x]);\r\n\t\t\t\t\t\t\tchunk.text = chunk.text.replace(matches[x], $type.PLACEHOLDER);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// Apply to template\r\n\t\t\t\titem.template += chunk.text;\r\n\t\t\t}\r\n\r\n\t\t\t// Apply style formatting\r\n\t\t\t//item.template = TextFormatter.format(item.template, this.outputFormat);\r\n\r\n\t\t\t// Save cache\r\n\t\t\t// TODO\r\n\t\t\t//this.setCache(item.source, item);\r\n\r\n\t\t\t// Mark this as parsed\r\n\t\t\titem.parsed = true;\r\n\t\t});\r\n\r\n\t\t// Save cache (the whole thing)\r\n\t\t// TODO\r\n\t\t//this.setCache(format, info);\r\n\r\n\t\treturn info;\r\n\t}\r\n\r\n\t/**\r\n\t * Applies parsed format to a numeric value.\r\n\t *\r\n\t * @param value Value\r\n\t * @param details Parsed format as returned by {parseFormat}\r\n\t * @return Formatted duration\r\n\t */\r\n\tprotected applyFormat(value: number, details: any): string {\r\n\r\n\t\t// Use absolute values\r\n\t\tlet negative = !details.absolute && (value < this.get(\"negativeBase\"));\r\n\t\tvalue = Math.abs(value);\r\n\r\n\t\t// Recalculate to milliseconds\r\n\t\tlet tstamp = this.toTimeStamp(value, details.baseUnit);\r\n\r\n\t\t// Init return value\r\n\t\tlet res = details.template;\r\n\r\n\t\t// Iterate through duration parts\r\n\t\tfor (let i = 0, len = details.parts.length; i < len; i++) {\r\n\r\n\t\t\t// Gather the part\r\n\t\t\tlet part = details.parts[i];\r\n\t\t\tlet unit = this._toTimeUnit(part.substr(0, 1));\r\n\t\t\tlet digits = part.length;\r\n\r\n\t\t\t// Calculate current unit value\r\n\t\t\tlet ints = Math.floor(tstamp / this._getUnitValue(unit!));\r\n\t\t\tres = res.replace($type.PLACEHOLDER, $utils.padString(ints, digits, \"0\"));\r\n\r\n\t\t\t// Reduce timestamp\r\n\t\t\ttstamp -= ints * this._getUnitValue(unit!);\r\n\t\t}\r\n\r\n\t\t// Reapply negative sign\r\n\t\tif (negative) {\r\n\t\t\tres = \"-\" + res;\r\n\t\t}\r\n\r\n\t\treturn res;\r\n\t}\r\n\r\n\t/**\r\n\t * Converts numeric value to timestamp in milliseconds.\r\n\t *\r\n\t * @param value A source value\r\n\t * @param baseUnit Base unit the source value is in: \"q\", \"s\", \"i\", \"h\", \"d\", \"w\", \"m\", \"y\"\r\n\t * @return Value representation as a timestamp in milliseconds\r\n\t */\r\n\tpublic toTimeStamp(value: number, baseUnit: TimeUnit): number {\r\n\t\treturn value * this._getUnitValue(baseUnit);\r\n\t}\r\n\r\n\tprotected _toTimeUnit(code: string): TimeUnit | undefined {\r\n\t\tswitch (code) {\r\n\t\t\tcase \"S\":\r\n\t\t\t\treturn \"millisecond\";\r\n\t\t\tcase \"s\":\r\n\t\t\t\treturn \"second\";\r\n\t\t\tcase \"m\":\r\n\t\t\t\treturn \"minute\";\r\n\t\t\tcase \"h\":\r\n\t\t\t\treturn \"hour\";\r\n\t\t\tcase \"d\":\r\n\t\t\t\treturn \"day\";\r\n\t\t\tcase \"w\":\r\n\t\t\t\treturn \"week\";\r\n\t\t\tcase \"M\":\r\n\t\t\t\treturn \"month\";\r\n\t\t\tcase \"y\":\r\n\t\t\t\treturn \"year\";\r\n\t\t};\r\n\t}\r\n\r\n\t/**\r\n\t * Returns appropriate default format for the value.\r\n\t *\r\n\t * If `maxValue` is sepcified, it will use that value to determine the time\r\n\t * unit for the format.\r\n\t *\r\n\t * For example if your `baseUnit` is `\"second\"` and you pass in `10`, you\r\n\t * will get `\"10\"`.\r\n\t *\r\n\t * However, you might want it to be formatted in the context of bigger scale,\r\n\t * say 10 minutes (600 seconds). If you pass in `600` as `maxValue`, all\r\n\t * values, including small ones will use format with minutes, e.g.:\r\n\t * `00:10`, `00:50`, `12: 30`, etc.\r\n\t *\r\n\t * @param value Value to format\r\n\t * @param maxValue Maximum value to be used to determine format\r\n\t * @param baseUnit Base unit of the value\r\n\t * @return Format\r\n\t */\r\n\tpublic getFormat(value: number, maxValue?: number, baseUnit?: TimeUnit): string {\r\n\r\n\t\t// Is format override set?\r\n\t\tif (this.get(\"durationFormat\") != null) {\r\n\t\t\treturn this.get(\"durationFormat\")!;\r\n\t\t}\r\n\r\n\t\t// Get base unit\r\n\t\tif (!baseUnit) {\r\n\t\t\tbaseUnit = this.get(\"baseUnit\");\r\n\t\t}\r\n\r\n\t\tif (maxValue != null && value != maxValue) {\r\n\t\t\tvalue = Math.abs(value);\r\n\t\t\tmaxValue = Math.abs(maxValue);\r\n\t\t\tlet maxUnit = this.getValueUnit(Math.max(value, maxValue), baseUnit);\r\n\t\t\treturn (<any>this.get(\"durationFormats\"))[baseUnit!][maxUnit!];\r\n\t\t}\r\n\t\telse {\r\n\t\t\tlet unit = this.getValueUnit(value, baseUnit);\r\n\t\t\treturn (<any>this.get(\"durationFormats\"))[baseUnit!][unit!];\r\n\t\t}\r\n\r\n\t}\r\n\r\n\t/**\r\n\t * Returns value's closest denominator time unit, e.g 100 seconds is\r\n\t * `\"minute\"`, while 59 seconds would still be `second`.\r\n\t *\r\n\t * @param value Source duration value\r\n\t * @param baseUnit Base unit\r\n\t * @return Denominator\r\n\t */\r\n\tpublic getValueUnit(value: number, baseUnit?: TimeUnit): TimeUnit | undefined {\r\n\r\n\t\t// Get base unit\r\n\t\tif (!baseUnit) {\r\n\t\t\tbaseUnit = this.get(\"baseUnit\");\r\n\t\t}\r\n\r\n\t\t// Convert to milliseconds\r\n\t\tlet currentUnit: any;\r\n\t\tlet ms = this.getMilliseconds(value, baseUnit);\r\n\t\t$object.eachContinue(this._getUnitValues(), (key, val) => {\r\n\t\t\tif (key == baseUnit || currentUnit) {\r\n\t\t\t\tlet num = ms / val;\r\n\t\t\t\tif (num <= 1) {\r\n\t\t\t\t\tif (!currentUnit) {\r\n\t\t\t\t\t\tcurrentUnit = key;\r\n\t\t\t\t\t}\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t\tcurrentUnit = key;\r\n\t\t\t}\r\n\t\t\treturn true;\r\n\t\t});\r\n\r\n\t\treturn currentUnit;\r\n\t}\r\n\r\n\t/**\r\n\t * Converts value to milliseconds according to `baseUnit`.\r\n\t *\r\n\t * @param value Source duration value\r\n\t * @param baseUnit Base unit\r\n\t * @return Value in milliseconds\r\n\t */\r\n\tpublic getMilliseconds(value: number, baseUnit?: TimeUnit): number {\r\n\r\n\t\t// Get base unit\r\n\t\tif (!baseUnit) {\r\n\t\t\tbaseUnit = this.get(\"baseUnit\");\r\n\t\t}\r\n\r\n\t\treturn value * this._getUnitValue(baseUnit!);\r\n\t}\r\n\r\n\tprotected _getUnitValue(timeUnit: TimeUnit): number {\r\n\t\treturn this._getUnitValues()[timeUnit];\r\n\t}\r\n\r\n\tprotected _getUnitValues(): any {\r\n\t\treturn {\r\n\t\t\t\"millisecond\": 1,\r\n\t\t\t\"second\": 1000,\r\n\t\t\t\"minute\": 60000,\r\n\t\t\t\"hour\": 3600000,\r\n\t\t\t\"day\": 86400000,\r\n\t\t\t\"week\": 604800000,\r\n\t\t\t\"month\": 2592000000,\r\n\t\t\t\"year\": 31536000000,\r\n\t\t};\r\n\t}\r\n\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"DurationFormatter.js","sourceRoot":"","sources":["../../../../../src/.internal/core/util/DurationFormatter.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAmC,MAAM,UAAU,CAAA;AAClE,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEhD,OAAO,KAAK,OAAO,MAAM,UAAU,CAAC;AACpC,OAAO,KAAK,MAAM,MAAM,SAAS,CAAC;AAClC,OAAO,KAAK,KAAK,MAAM,QAAQ,CAAC;AAgDhC;;;;GAIG;AACH,MA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AAE,SAAS;YACjB,OAAO,EAAE,UAAU;YACnB,MAAM,EAAE,WAAW;SACnB,CAAC;IACH,CAAC;CAED","sourcesContent":["import type { TimeUnit } from \"./Time\";\r\n\r\nimport { Entity, IEntitySettings, IEntityPrivate } from \"./Entity\"\r\nimport { TextFormatter } from \"./TextFormatter\";\r\n\r\nimport * as $object from \"./Object\";\r\nimport * as $utils from \"./Utils\";\r\nimport * as $type from \"./Type\";\r\n\r\n\r\nexport interface IDurationFormatterSettings extends IEntitySettings {\r\n\r\n\t/**\r\n\t * A universal duration format to use wherever number needs to be formatted\r\n\t * as a duration.\r\n\t */\r\n\tdurationFormat?: string;\r\n\r\n\t/**\r\n\t * A base value. Any number below it will be considered \"negative\".\r\n\t *\r\n\t * @default 0\r\n\t */\r\n\tnegativeBase?: number;\r\n\r\n\t/**\r\n\t * Identifies what values are used in duration.\r\n\t *\r\n\t * Available options: `\"millisecond\"`, `\"second\"` (default), `\"minute\"`, `\"hour\"`, `\"day\"`, `\"week\"`, `\"month\"`, and `\"year\"`.\r\n\t *\r\n\t * @see {@link https://www.amcharts.com/docs/v5/concepts/formatters/formatting-durations/#Base_unit} for more info\r\n\t * @default \"second\"\r\n\t */\r\n\tbaseUnit?: TimeUnit;\r\n\r\n\t/**\r\n\t * Time unit dependent duration formats.\r\n\t *\r\n\t * Used be [[DurationAxis]].\r\n\t */\r\n\tdurationFormats?: Partial<Record<TimeUnit, Partial<Record<TimeUnit, string>>>>;\r\n\r\n\t/**\r\n\t * An array of data fields that hold duration values and should be formatted\r\n\t * with a [[DurationFormatter]].\r\n\t *\r\n\t * @see {@link https://www.amcharts.com/docs/v5/concepts/formatters/data-placeholders/#Formatting_placeholders} for more info\r\n\t */\r\n\tdurationFields?: string[];\r\n\r\n}\r\n\r\nexport interface IDurationFormatterPrivate extends IEntityPrivate {\r\n}\r\n\r\n/**\r\n * A class used to format numberic values as time duration.\r\n *\r\n * @see {@link https://www.amcharts.com/docs/v5/concepts/formatters/formatting-durations/} for more info\r\n */\r\nexport class DurationFormatter extends Entity {\r\n\tdeclare public _settings: IDurationFormatterSettings;\r\n\tdeclare public _privateSettings: IDurationFormatterPrivate;\r\n\r\n\tprotected _setDefaults() {\r\n\t\tconst dmillisecond = \"_duration_millisecond\";\r\n\t\tconst dsecond = \"_duration_second\";\r\n\t\tconst dminute = \"_duration_minute\";\r\n\t\tconst dhour = \"_duration_hour\";\r\n\t\tconst dday = \"_duration_day\";\r\n\t\tconst dweek = \"_duration_week\";\r\n\t\tconst dmonth = \"_duration_month\";\r\n\t\tconst dyear = \"_duration_year\";\r\n\r\n\t\tconst asecond = \"_second\";\r\n\t\tconst aminute = \"_minute\";\r\n\t\tconst ahour = \"_hour\";\r\n\t\tconst aday = \"_day\";\r\n\t\tconst aweek = \"_week\";\r\n\t\tconst amonth = \"_week\";\r\n\t\tconst ayear = \"_year\";\r\n\r\n\t\t// Defaults\r\n\t\tthis._setDefault(\"negativeBase\", 0);\r\n\t\tthis._setDefault(\"baseUnit\", \"second\");\r\n\t\tthis._setDefault(\"durationFormats\", {\r\n\t\t\t\"millisecond\": {\r\n\t\t\t\t\"millisecond\": this._t(dmillisecond),\r\n\t\t\t\t\"second\": this._t((dmillisecond + asecond) as any),\r\n\t\t\t\t\"minute\": this._t((dmillisecond + aminute) as any),\r\n\t\t\t\t\"hour\": this._t((dmillisecond + ahour) as any),\r\n\t\t\t\t\"day\": this._t((dmillisecond + aday) as any),\r\n\t\t\t\t\"week\": this._t((dmillisecond + aweek) as any),\r\n\t\t\t\t\"month\": this._t((dmillisecond + amonth) as any),\r\n\t\t\t\t\"year\": this._t((dmillisecond + ayear) as any)\r\n\t\t\t},\r\n\t\t\t\"second\": {\r\n\t\t\t\t\"second\": this._t((dsecond) as any),\r\n\t\t\t\t\"minute\": this._t((dsecond + aminute) as any),\r\n\t\t\t\t\"hour\": this._t((dsecond + ahour) as any),\r\n\t\t\t\t\"day\": this._t((dsecond + aday) as any),\r\n\t\t\t\t\"week\": this._t((dsecond + aweek) as any),\r\n\t\t\t\t\"month\": this._t((dsecond + amonth) as any),\r\n\t\t\t\t\"year\": this._t((dsecond + ayear) as any)\r\n\t\t\t},\r\n\t\t\t\"minute\": {\r\n\t\t\t\t\"minute\": this._t((dminute) as any),\r\n\t\t\t\t\"hour\": this._t((dminute + ahour) as any),\r\n\t\t\t\t\"day\": this._t((dminute + aday) as any),\r\n\t\t\t\t\"week\": this._t((dminute + aweek) as any),\r\n\t\t\t\t\"month\": this._t((dminute + amonth) as any),\r\n\t\t\t\t\"year\": this._t((dminute + ayear) as any)\r\n\t\t\t},\r\n\t\t\t\"hour\": {\r\n\t\t\t\t\"hour\": this._t((dhour) as any),\r\n\t\t\t\t\"day\": this._t((dhour + aday) as any),\r\n\t\t\t\t\"week\": this._t((dhour + aweek) as any),\r\n\t\t\t\t\"month\": this._t((dhour + amonth) as any),\r\n\t\t\t\t\"year\": this._t((dhour + ayear) as any)\r\n\t\t\t},\r\n\t\t\t\"day\": {\r\n\t\t\t\t\"day\": this._t((dday) as any),\r\n\t\t\t\t\"week\": this._t((dday + aweek) as any),\r\n\t\t\t\t\"month\": this._t((dday + amonth) as any),\r\n\t\t\t\t\"year\": this._t((dday + ayear) as any)\r\n\t\t\t},\r\n\t\t\t\"week\": {\r\n\t\t\t\t\"week\": this._t((dweek) as any),\r\n\t\t\t\t\"month\": this._t((dweek + amonth) as any),\r\n\t\t\t\t\"year\": this._t((dweek + ayear) as any)\r\n\t\t\t},\r\n\t\t\t\"month\": {\r\n\t\t\t\t\"month\": this._t((dmonth) as any),\r\n\t\t\t\t\"year\": this._t((dmonth + ayear) as any)\r\n\t\t\t},\r\n\t\t\t\"year\": {\r\n\t\t\t\t\"year\": this._t(dyear)\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tsuper._setDefaults();\r\n\t}\r\n\r\n\r\n\t/**\r\n\t * Collection of aliases for units.\r\n\t */\r\n\tprotected _unitAliases: { [index: string]: string } = {\r\n\t\t\"Y\": \"y\",\r\n\t\t\"D\": \"d\",\r\n\t\t\"H\": \"h\",\r\n\t\t\"K\": \"h\",\r\n\t\t\"k\": \"h\",\r\n\t\t\"n\": \"S\"\r\n\t};\r\n\r\n\tpublic _beforeChanged() {\r\n\t\tsuper._beforeChanged();\r\n\t}\r\n\r\n\t/**\r\n\t * Formats the number as duration.\r\n\t *\r\n\t * For example `1000` (base unit seconds) would be converted to `16:40` as in\r\n\t * 16 minutes and 40 seconds.\r\n\t *\r\n\t * @param value Value to format\r\n\t * @param format Format to apply\r\n\t * @param base Override base unit\r\n\t * @return Formatted number\r\n\t */\r\n\tpublic format(value: number | string, format?: string, base?: TimeUnit): string {\r\n\r\n\t\t// no base unit?\r\n\t\tlet baseUnit = base || this.get(\"baseUnit\");\r\n\r\n\t\t// no format passed in or empty\r\n\t\tif (typeof format === \"undefined\" || format === \"\") {\r\n\t\t\tif (this.get(\"durationFormat\") != null) {\r\n\t\t\t\tformat = this.get(\"durationFormat\");\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tformat = this.getFormat($type.toNumber(value), undefined, baseUnit);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// Clean format\r\n\t\tformat = $utils.cleanFormat(format!);\r\n\r\n\t\t// get format info (it will also deal with parser caching)\r\n\t\tlet info = this.parseFormat(format, baseUnit);\r\n\r\n\t\t// cast to number just in case\r\n\t\t// TODO: maybe use better casting\r\n\t\tlet source: number = Number(value);\r\n\r\n\t\t// format and replace the number\r\n\t\tlet details;\r\n\t\tif (source > this.get(\"negativeBase\")) {\r\n\t\t\tdetails = info.positive;\r\n\t\t}\r\n\t\telse if (source < this.get(\"negativeBase\")) {\r\n\t\t\tdetails = info.negative;\r\n\t\t}\r\n\t\telse {\r\n\t\t\tdetails = info.zero;\r\n\t\t}\r\n\r\n\t\t// Format\r\n\t\tlet formatted = this.applyFormat(source, details);\r\n\r\n\t\t// Apply color?\r\n\t\tif (details.color !== \"\") {\r\n\t\t\tformatted = \"[\" + details.color + \"]\" + formatted + \"[/]\";\r\n\t\t}\r\n\r\n\t\treturn formatted;\r\n\t}\r\n\r\n\t/**\r\n\t * Parses supplied format into structured object which can be used to format\r\n\t * the number.\r\n\t *\r\n\t * @param format Format string, i.e. \"#,###.00\"\r\n\t * @param base Override base unit\r\n\t * @return Parsed information\r\n\t */\r\n\tprotected parseFormat(format: string, base?: TimeUnit): any {\r\n\r\n\t\t// Check cache\r\n\t\t// TODO\r\n\t\t// let cached = this.getCache(format);\r\n\t\t// if (cached != null) {\r\n\t\t// \treturn cached;\r\n\t\t// }\r\n\r\n\t\t// no base unit?\r\n\t\tlet baseUnit = base || this.get(\"baseUnit\");\r\n\r\n\t\t// Initialize duration parsing info\r\n\t\tlet info = {\r\n\t\t\t\"positive\": {\r\n\t\t\t\t\"color\": \"\",\r\n\t\t\t\t\"template\": \"\",\r\n\t\t\t\t\"parts\": <any>[],\r\n\t\t\t\t\"source\": \"\",\r\n\t\t\t\t\"baseUnit\": baseUnit,\r\n\t\t\t\t\"parsed\": false,\r\n\t\t\t\t\"absolute\": false\r\n\t\t\t},\r\n\t\t\t\"negative\": {\r\n\t\t\t\t\"color\": \"\",\r\n\t\t\t\t\"template\": \"\",\r\n\t\t\t\t\"parts\": <any>[],\r\n\t\t\t\t\"source\": \"\",\r\n\t\t\t\t\"baseUnit\": baseUnit,\r\n\t\t\t\t\"parsed\": false,\r\n\t\t\t\t\"absolute\": false\r\n\t\t\t},\r\n\t\t\t\"zero\": {\r\n\t\t\t\t\"color\": \"\",\r\n\t\t\t\t\"template\": \"\",\r\n\t\t\t\t\"parts\": <any>[],\r\n\t\t\t\t\"source\": \"\",\r\n\t\t\t\t\"baseUnit\": baseUnit,\r\n\t\t\t\t\"parsed\": false,\r\n\t\t\t\t\"absolute\": false\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\t// Escape double vertical bars (that mean display one vertical bar)\r\n\t\tformat = format.replace(\"||\", $type.PLACEHOLDER2);\r\n\r\n\t\t// Split it up and deal with different formats\r\n\t\tlet parts = format.split(\"|\");\r\n\t\tinfo.positive.source = parts[0];\r\n\r\n\t\tif (typeof parts[2] === \"undefined\") {\r\n\t\t\tinfo.zero = info.positive;\r\n\t\t}\r\n\t\telse {\r\n\t\t\tinfo.zero.source = parts[2];\r\n\t\t}\r\n\r\n\t\tif (typeof parts[1] === \"undefined\") {\r\n\t\t\tinfo.negative = info.positive;\r\n\t\t}\r\n\t\telse {\r\n\t\t\tinfo.negative.source = parts[1];\r\n\t\t}\r\n\r\n\t\t// Parse each\r\n\t\t$object.each(info, (_part, item) => {\r\n\t\t\t// Already parsed\r\n\t\t\tif (item.parsed) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\t// Check cached\r\n\t\t\t// TODO\r\n\t\t\t// if (typeof this.getCache(item.source) !== \"undefined\") {\r\n\t\t\t// \tinfo[part] = this.getCache(item.source);\r\n\t\t\t// \treturn;\r\n\t\t\t// }\r\n\r\n\t\t\t// Begin parsing\r\n\t\t\tlet partFormat: string = item.source;\r\n\r\n\t\t\t// Check for [] directives\r\n\t\t\tlet dirs: string[] | null = [];\r\n\t\t\tdirs = item.source.match(/^\\[([^\\]]*)\\]/);\r\n\t\t\tif (dirs && dirs.length && dirs[0] !== \"\") {\r\n\t\t\t\tpartFormat = item.source.substr(dirs[0].length);\r\n\t\t\t\titem.color = dirs[1];\r\n\t\t\t}\r\n\r\n\r\n\t\t\t// Let TextFormatter split into chunks\r\n\t\t\tlet chunks = TextFormatter.chunk(partFormat, true);\r\n\t\t\tfor (let i: number = 0; i < chunks.length; i++) {\r\n\t\t\t\tlet chunk = chunks[i];\r\n\r\n\t\t\t\t// replace back double vertical bar\r\n\t\t\t\tchunk.text = chunk.text.replace($type.PLACEHOLDER2, \"|\");\r\n\r\n\t\t\t\tif (chunk.type === \"value\") {\r\n\r\n\t\t\t\t\t// Just \"Duration\"?\r\n\t\t\t\t\t// if (chunk.text.toLowerCase() === \"duration\") {\r\n\t\t\t\t\t// \tchunk.text = durationFormat;\r\n\t\t\t\t\t// }\r\n\r\n\t\t\t\t\t// Check for \"a\" (absolute) modifier\r\n\t\t\t\t\tif (chunk.text.match(/[yYMdDwhHKkmsSn]+a/)) {\r\n\t\t\t\t\t\titem.absolute = true;\r\n\t\t\t\t\t\tchunk.text = chunk.text.replace(/([yYMdDwhHKkmsSn]+)a/, \"$1\");\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t// Find all possible parts\r\n\t\t\t\t\tlet matches = chunk.text.match(/y+|Y+|M+|d+|D+|w+|h+|H+|K+|k+|m+|s+|S+|n+/g);\r\n\r\n\t\t\t\t\tif (matches) {\r\n\t\t\t\t\t\t// Populate template\r\n\t\t\t\t\t\tfor (let x = 0; x < matches.length; x++) {\r\n\t\t\t\t\t\t\t// Is it an alias?\r\n\t\t\t\t\t\t\tif (matches[x] == null) {\r\n\t\t\t\t\t\t\t\tmatches[x] = this._unitAliases[matches[x]];\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\titem.parts.push(matches[x]);\r\n\t\t\t\t\t\t\tchunk.text = chunk.text.replace(matches[x], $type.PLACEHOLDER);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// Apply to template\r\n\t\t\t\titem.template += chunk.text;\r\n\t\t\t}\r\n\r\n\t\t\t// Apply style formatting\r\n\t\t\t//item.template = TextFormatter.format(item.template, this.outputFormat);\r\n\r\n\t\t\t// Save cache\r\n\t\t\t// TODO\r\n\t\t\t//this.setCache(item.source, item);\r\n\r\n\t\t\t// Mark this as parsed\r\n\t\t\titem.parsed = true;\r\n\t\t});\r\n\r\n\t\t// Save cache (the whole thing)\r\n\t\t// TODO\r\n\t\t//this.setCache(format, info);\r\n\r\n\t\treturn info;\r\n\t}\r\n\r\n\t/**\r\n\t * Applies parsed format to a numeric value.\r\n\t *\r\n\t * @param value Value\r\n\t * @param details Parsed format as returned by {parseFormat}\r\n\t * @return Formatted duration\r\n\t */\r\n\tprotected applyFormat(value: number, details: any): string {\r\n\r\n\t\t// Use absolute values\r\n\t\tlet negative = !details.absolute && (value < this.get(\"negativeBase\"));\r\n\t\tvalue = Math.abs(value);\r\n\r\n\t\t// Recalculate to milliseconds\r\n\t\tlet tstamp = this.toTimeStamp(value, details.baseUnit);\r\n\r\n\t\t// Init return value\r\n\t\tlet res = details.template;\r\n\r\n\t\t// Iterate through duration parts\r\n\t\tfor (let i = 0, len = details.parts.length; i < len; i++) {\r\n\r\n\t\t\t// Gather the part\r\n\t\t\tlet part = details.parts[i];\r\n\t\t\tlet unit = this._toTimeUnit(part.substr(0, 1));\r\n\t\t\tlet digits = part.length;\r\n\r\n\t\t\t// Calculate current unit value\r\n\t\t\tlet ints: number;\r\n\t\t\tconst unitValue = this._getUnitValue(unit!);\r\n\t\t\tif (i < (len -1)) {\r\n\t\t\t\tints = Math.floor(tstamp / unitValue);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tints = Math.round(tstamp / unitValue);\r\n\t\t\t}\r\n\t\t\tres = res.replace($type.PLACEHOLDER, $utils.padString(ints, digits, \"0\"));\r\n\r\n\t\t\t// Reduce timestamp\r\n\t\t\ttstamp -= ints * unitValue;\r\n\t\t}\r\n\r\n\t\t// Reapply negative sign\r\n\t\tif (negative) {\r\n\t\t\tres = \"-\" + res;\r\n\t\t}\r\n\r\n\t\treturn res;\r\n\t}\r\n\r\n\t/**\r\n\t * Converts numeric value to timestamp in milliseconds.\r\n\t *\r\n\t * @param value A source value\r\n\t * @param baseUnit Base unit the source value is in: \"q\", \"s\", \"i\", \"h\", \"d\", \"w\", \"m\", \"y\"\r\n\t * @return Value representation as a timestamp in milliseconds\r\n\t */\r\n\tpublic toTimeStamp(value: number, baseUnit: TimeUnit): number {\r\n\t\treturn value * this._getUnitValue(baseUnit);\r\n\t}\r\n\r\n\tprotected _toTimeUnit(code: string): TimeUnit | undefined {\r\n\t\tswitch (code) {\r\n\t\t\tcase \"S\":\r\n\t\t\t\treturn \"millisecond\";\r\n\t\t\tcase \"s\":\r\n\t\t\t\treturn \"second\";\r\n\t\t\tcase \"m\":\r\n\t\t\t\treturn \"minute\";\r\n\t\t\tcase \"h\":\r\n\t\t\t\treturn \"hour\";\r\n\t\t\tcase \"d\":\r\n\t\t\t\treturn \"day\";\r\n\t\t\tcase \"w\":\r\n\t\t\t\treturn \"week\";\r\n\t\t\tcase \"M\":\r\n\t\t\t\treturn \"month\";\r\n\t\t\tcase \"y\":\r\n\t\t\t\treturn \"year\";\r\n\t\t};\r\n\t}\r\n\r\n\t/**\r\n\t * Returns appropriate default format for the value.\r\n\t *\r\n\t * If `maxValue` is sepcified, it will use that value to determine the time\r\n\t * unit for the format.\r\n\t *\r\n\t * For example if your `baseUnit` is `\"second\"` and you pass in `10`, you\r\n\t * will get `\"10\"`.\r\n\t *\r\n\t * However, you might want it to be formatted in the context of bigger scale,\r\n\t * say 10 minutes (600 seconds). If you pass in `600` as `maxValue`, all\r\n\t * values, including small ones will use format with minutes, e.g.:\r\n\t * `00:10`, `00:50`, `12: 30`, etc.\r\n\t *\r\n\t * @param value Value to format\r\n\t * @param maxValue Maximum value to be used to determine format\r\n\t * @param baseUnit Base unit of the value\r\n\t * @return Format\r\n\t */\r\n\tpublic getFormat(value: number, maxValue?: number, baseUnit?: TimeUnit): string {\r\n\r\n\t\t// Is format override set?\r\n\t\tif (this.get(\"durationFormat\") != null) {\r\n\t\t\treturn this.get(\"durationFormat\")!;\r\n\t\t}\r\n\r\n\t\t// Get base unit\r\n\t\tif (!baseUnit) {\r\n\t\t\tbaseUnit = this.get(\"baseUnit\");\r\n\t\t}\r\n\r\n\t\tif (maxValue != null && value != maxValue) {\r\n\t\t\tvalue = Math.abs(value);\r\n\t\t\tmaxValue = Math.abs(maxValue);\r\n\t\t\tlet maxUnit = this.getValueUnit(Math.max(value, maxValue), baseUnit);\r\n\t\t\treturn (<any>this.get(\"durationFormats\"))[baseUnit!][maxUnit!];\r\n\t\t}\r\n\t\telse {\r\n\t\t\tlet unit = this.getValueUnit(value, baseUnit);\r\n\t\t\treturn (<any>this.get(\"durationFormats\"))[baseUnit!][unit!];\r\n\t\t}\r\n\r\n\t}\r\n\r\n\t/**\r\n\t * Returns value's closest denominator time unit, e.g 100 seconds is\r\n\t * `\"minute\"`, while 59 seconds would still be `second`.\r\n\t *\r\n\t * @param value Source duration value\r\n\t * @param baseUnit Base unit\r\n\t * @return Denominator\r\n\t */\r\n\tpublic getValueUnit(value: number, baseUnit?: TimeUnit): TimeUnit | undefined {\r\n\r\n\t\t// Get base unit\r\n\t\tif (!baseUnit) {\r\n\t\t\tbaseUnit = this.get(\"baseUnit\");\r\n\t\t}\r\n\r\n\t\t// Convert to milliseconds\r\n\t\tlet currentUnit: any;\r\n\t\tlet ms = this.getMilliseconds(value, baseUnit);\r\n\t\t$object.eachContinue(this._getUnitValues(), (key, val) => {\r\n\t\t\tif (key == baseUnit || currentUnit) {\r\n\t\t\t\tlet num = ms / val;\r\n\t\t\t\tif (num <= 1) {\r\n\t\t\t\t\tif (!currentUnit) {\r\n\t\t\t\t\t\tcurrentUnit = key;\r\n\t\t\t\t\t}\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t\tcurrentUnit = key;\r\n\t\t\t}\r\n\t\t\treturn true;\r\n\t\t});\r\n\r\n\t\treturn currentUnit;\r\n\t}\r\n\r\n\t/**\r\n\t * Converts value to milliseconds according to `baseUnit`.\r\n\t *\r\n\t * @param value Source duration value\r\n\t * @param baseUnit Base unit\r\n\t * @return Value in milliseconds\r\n\t */\r\n\tpublic getMilliseconds(value: number, baseUnit?: TimeUnit): number {\r\n\r\n\t\t// Get base unit\r\n\t\tif (!baseUnit) {\r\n\t\t\tbaseUnit = this.get(\"baseUnit\");\r\n\t\t}\r\n\r\n\t\treturn value * this._getUnitValue(baseUnit!);\r\n\t}\r\n\r\n\tprotected _getUnitValue(timeUnit: TimeUnit): number {\r\n\t\treturn this._getUnitValues()[timeUnit];\r\n\t}\r\n\r\n\tprotected _getUnitValues(): any {\r\n\t\treturn {\r\n\t\t\t\"millisecond\": 1,\r\n\t\t\t\"second\": 1000,\r\n\t\t\t\"minute\": 60000,\r\n\t\t\t\"hour\": 3600000,\r\n\t\t\t\"day\": 86400000,\r\n\t\t\t\"week\": 604800000,\r\n\t\t\t\"month\": 2592000000,\r\n\t\t\t\"year\": 31536000000,\r\n\t\t};\r\n\t}\r\n\r\n}\r\n"]}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import type { Pattern } from "../render/patterns/Pattern";
|
|
2
|
+
import type { Color } from "./Color";
|
|
3
|
+
import { LinePattern, ILinePatternSettings } from "../render/patterns/LinePattern";
|
|
4
|
+
import { RectanglePattern, IRectanglePatternSettings } from "../render/patterns/RectanglePattern";
|
|
5
|
+
import { CirclePattern, ICirclePatternSettings } from "../render/patterns/CirclePattern";
|
|
6
|
+
import { Entity, IEntitySettings, IEntityPrivate } from "./Entity";
|
|
7
|
+
export interface IPatternSetSettings extends IEntitySettings {
|
|
8
|
+
/**
|
|
9
|
+
* List of colors in the set.
|
|
10
|
+
*/
|
|
11
|
+
patterns?: Pattern[];
|
|
12
|
+
/**
|
|
13
|
+
* A step size when using `next()`.
|
|
14
|
+
*
|
|
15
|
+
* E.g. setting to `2` will make it return every second pattern in the list.
|
|
16
|
+
*
|
|
17
|
+
* @default 1
|
|
18
|
+
*/
|
|
19
|
+
step?: number;
|
|
20
|
+
/**
|
|
21
|
+
* A base color to use for all patterns.
|
|
22
|
+
*
|
|
23
|
+
* @see {@link https://www.amcharts.com/docs/v5/concepts/colors-gradients-and-patterns/patterns/#Colors} for more info
|
|
24
|
+
*/
|
|
25
|
+
color?: Color;
|
|
26
|
+
/**
|
|
27
|
+
* Start iterating patterns from specific index.
|
|
28
|
+
*/
|
|
29
|
+
startIndex?: number;
|
|
30
|
+
}
|
|
31
|
+
export interface IPatternSetPrivate extends IEntityPrivate {
|
|
32
|
+
/**
|
|
33
|
+
* Current step.
|
|
34
|
+
*/
|
|
35
|
+
currentStep?: number;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* An object which holds list of [[Pattern]] objects and can serve them up in
|
|
39
|
+
* an interative way.
|
|
40
|
+
*
|
|
41
|
+
* @see {@link https://www.amcharts.com/docs/v5/concepts/colors-gradients-and-patterns/patterns/#Pattern_sets} for more info
|
|
42
|
+
* @since 5.10.0
|
|
43
|
+
*/
|
|
44
|
+
export declare class PatternSet extends Entity {
|
|
45
|
+
static className: string;
|
|
46
|
+
static classNames: Array<string>;
|
|
47
|
+
_settings: IPatternSetSettings;
|
|
48
|
+
_privateSettings: IPatternSetPrivate;
|
|
49
|
+
protected _afterNew(): void;
|
|
50
|
+
_beforeChanged(): void;
|
|
51
|
+
/**
|
|
52
|
+
* Returns a [[Pattern]] at specific index.
|
|
53
|
+
*
|
|
54
|
+
* @param index Index
|
|
55
|
+
* @return Color
|
|
56
|
+
*/
|
|
57
|
+
getIndex(index: number): Pattern;
|
|
58
|
+
/**
|
|
59
|
+
* Returns next [[Color]] in the list.
|
|
60
|
+
*
|
|
61
|
+
* If the list is out of colors, new ones are generated dynamically.
|
|
62
|
+
*/
|
|
63
|
+
next(): Pattern;
|
|
64
|
+
/**
|
|
65
|
+
* Resets counter to the start of the list, so the next call for `next()` will
|
|
66
|
+
* return the first pattern.
|
|
67
|
+
*/
|
|
68
|
+
reset(): void;
|
|
69
|
+
/**
|
|
70
|
+
* Returns a [[LinePattern].
|
|
71
|
+
*
|
|
72
|
+
* @param settings Pattern settings
|
|
73
|
+
* @return Pattern object
|
|
74
|
+
*/
|
|
75
|
+
getLinePattern(settings: ILinePatternSettings): LinePattern;
|
|
76
|
+
/**
|
|
77
|
+
* Returns a [[RectanglePattern].
|
|
78
|
+
*
|
|
79
|
+
* @param settings Pattern settings
|
|
80
|
+
* @return Pattern object
|
|
81
|
+
*/
|
|
82
|
+
getRectanglePattern(settings: IRectanglePatternSettings): RectanglePattern;
|
|
83
|
+
/**
|
|
84
|
+
* Returns a [[CirclePattern].
|
|
85
|
+
*
|
|
86
|
+
* @param settings Pattern settings
|
|
87
|
+
* @return Pattern object
|
|
88
|
+
*/
|
|
89
|
+
getCirclePattern(settings: ICirclePatternSettings): CirclePattern;
|
|
90
|
+
}
|
|
91
|
+
//# sourceMappingURL=PatternSet.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PatternSet.d.ts","sourceRoot":"","sources":["../../../../../src/.internal/core/util/PatternSet.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAErC,OAAO,EAAE,WAAW,EAAE,oBAAoB,EAAE,MAAM,gCAAgC,CAAC;AACnF,OAAO,EAAE,gBAAgB,EAAE,yBAAyB,EAAE,MAAM,qCAAqC,CAAC;AAClG,OAAO,EAAE,aAAa,EAAE,sBAAsB,EAAE,MAAM,kCAAkC,CAAC;AACzF,OAAO,EAAE,MAAM,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAGnE,MAAM,WAAW,mBAAoB,SAAQ,eAAe;IAE3D;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,EAAE,CAAC;IAErB;;;;;;OAMG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd;;;;OAIG;IACH,KAAK,CAAC,EAAE,KAAK,CAAC;IAEd;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;CAEpB;AAED,MAAM,WAAW,kBAAmB,SAAQ,cAAc;IAEzD;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CAErB;AAGD;;;;;;GAMG;AACH,qBAAa,UAAW,SAAQ,MAAM;IACrC,OAAc,SAAS,EAAE,MAAM,CAAgB;IAC/C,OAAc,UAAU,EAAE,KAAK,CAAC,MAAM,CAAC,CAAoD;IAE5E,SAAS,EAAE,mBAAmB,CAAC;IAC/B,gBAAgB,EAAE,kB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