@amcharts/amcharts5 5.0.18 → 5.0.19
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/percent/PercentSeries.d.ts +2 -0
- package/.internal/charts/percent/PercentSeries.d.ts.map +1 -1
- package/.internal/charts/percent/PercentSeries.js +21 -0
- package/.internal/charts/percent/PercentSeries.js.map +1 -1
- package/.internal/charts/xy/XYChart.d.ts +4 -0
- package/.internal/charts/xy/XYChart.d.ts.map +1 -1
- package/.internal/charts/xy/XYChart.js +3 -0
- package/.internal/charts/xy/XYChart.js.map +1 -1
- package/.internal/charts/xy/axes/DateAxis.d.ts.map +1 -1
- package/.internal/charts/xy/axes/DateAxis.js +3 -1
- package/.internal/charts/xy/axes/DateAxis.js.map +1 -1
- package/.internal/charts/xy/series/XYSeries.d.ts +4 -0
- package/.internal/charts/xy/series/XYSeries.d.ts.map +1 -1
- package/.internal/charts/xy/series/XYSeries.js.map +1 -1
- package/.internal/core/render/Series.d.ts +1 -1
- package/.internal/core/render/Series.d.ts.map +1 -1
- package/.internal/core/render/Series.js +2 -1
- package/.internal/core/render/Series.js.map +1 -1
- package/.internal/core/render/backend/CanvasRenderer.d.ts.map +1 -1
- package/.internal/core/render/backend/CanvasRenderer.js +1 -3
- package/.internal/core/render/backend/CanvasRenderer.js.map +1 -1
- package/.internal/core/util/ColorSet.d.ts +0 -1
- package/.internal/core/util/ColorSet.d.ts.map +1 -1
- package/.internal/core/util/ColorSet.js +1 -12
- package/.internal/core/util/ColorSet.js.map +1 -1
- package/.internal/core/util/TextFormatter.js +2 -2
- package/.internal/core/util/TextFormatter.js.map +1 -1
- package/.internal/plugins/sliceGrouper/SliceGrouper.d.ts +75 -0
- package/.internal/plugins/sliceGrouper/SliceGrouper.d.ts.map +1 -0
- package/.internal/plugins/sliceGrouper/SliceGrouper.js +229 -0
- package/.internal/plugins/sliceGrouper/SliceGrouper.js.map +1 -0
- package/CHANGELOG.md +14 -0
- 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/map-animating-along-lines/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/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-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/map-animating-along-lines/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/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/package.json +1 -1
- package/plugins/sliceGrouper.d.ts +2 -0
- package/plugins/sliceGrouper.d.ts.map +1 -0
- package/plugins/sliceGrouper.js +2 -0
- package/plugins/sliceGrouper.js.map +1 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ColorSet.d.ts","sourceRoot":"","sources":["../../../../../src/.internal/core/util/ColorSet.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AACnE,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAGhC,MAAM,WAAW,iBAAkB,SAAQ,eAAe;IAEzD;;OAEG;IACH,MAAM,CAAC,EAAE,KAAK,EAAE,CAAC;IAEjB;;;;;;OAMG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;;;;OAKG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;IAEhB;;;OAGG;IACH,SAAS,CAAC,EAAE,KAAK,CAAC;IAElB;;;OAGG;IACH,WAAW,CAAC,EAAE,oBAAoB,CAAC;IAEnC;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;CAGpB;AAED,MAAM,WAAW,gBAAiB,SAAQ,cAAc;IAEvD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CAEnB;AAED,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EpC;;OAEG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CAEnB;AAGD;;;;GAIG;AACH,qBAAa,QAAS,SAAQ,MAAM;IACnC,OAAc,SAAS,EAAE,MAAM,CAAc;IAC7C,OAAc,UAAU,EAAE,KAAK,CAAC,MAAM,CAAC,CAAkD;IAE1E,SAAS,EAAE,iBAAiB,CAAC;IAC7B,gBAAgB,EAAE,gBAAgB,CAAC;IAIlD,SAAS,CAAC,SAAS;IAKnB;;OAEG;IACI,cAAc,IAAI,IAAI;IAmC7B;;;;;;;OAOG;IACI,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,KAAK;IAWrC;;;;OAIG;IACI,IAAI;IAMX;;;OAGG;IACI,KAAK;CAGZ"}
|
|
@@ -21,17 +21,6 @@ var ColorSet = /** @class */ (function (_super) {
|
|
|
21
21
|
_super.prototype._afterNewApplyThemes.call(this);
|
|
22
22
|
}
|
|
23
23
|
});
|
|
24
|
-
Object.defineProperty(ColorSet.prototype, "_beforeChanged", {
|
|
25
|
-
enumerable: false,
|
|
26
|
-
configurable: true,
|
|
27
|
-
writable: true,
|
|
28
|
-
value: function () {
|
|
29
|
-
_super.prototype._beforeChanged.call(this);
|
|
30
|
-
if (this.isDirty("startIndex")) {
|
|
31
|
-
this.setPrivate("currentStep", this.get("startIndex", 0));
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
});
|
|
35
24
|
/**
|
|
36
25
|
* @ignore
|
|
37
26
|
*/
|
|
@@ -108,7 +97,7 @@ var ColorSet = /** @class */ (function (_super) {
|
|
|
108
97
|
configurable: true,
|
|
109
98
|
writable: true,
|
|
110
99
|
value: function () {
|
|
111
|
-
var currentStep = this.getPrivate("currentStep", 0);
|
|
100
|
+
var currentStep = this.getPrivate("currentStep", this.get("startIndex", 0));
|
|
112
101
|
this.setPrivate("currentStep", currentStep + this.get("step", 1));
|
|
113
102
|
return this.getIndex(currentStep);
|
|
114
103
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ColorSet.js","sourceRoot":"","sources":["../../../../../src/.internal/core/util/ColorSet.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAmC,MAAM,UAAU,CAAC;AACnE,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAoFhC;;;;GAIG;AACH;IAA8B,4BAAM;IAApC;;
|
|
1
|
+
{"version":3,"file":"ColorSet.js","sourceRoot":"","sources":["../../../../../src/.internal/core/util/ColorSet.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAmC,MAAM,UAAU,CAAC;AACnE,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAoFhC;;;;GAIG;AACH;IAA8B,4BAAM;IAApC;;IAyFA,CAAC;IAlFA,qCAAqC;;;;;eAErC;YACC,yDAAyD;YACzD,iBAAM,oBAAoB,WAAE,CAAC;QAC9B,CAAC;;IAED;;OAEG;;;;;eACH;YACC,IAAI,CAAC,UAAU,CAAC,aAAa,EAAE,IAAI,CAAC,UAAU,CAAC,aAAa,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAA;YACrE,IAAM,IAAI,GAAG,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC;YAC5C,IAAM,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,WAAW,EAAE,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;YACpF,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC,EAAE;gBAClC,IAAI,CAAC,UAAU,CAAC,WAAW,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC;aAC5C;YACD,4BAA4B;YAC5B,IAAM,GAAG,GAAG,IAAI,CAAC,UAAU,CAAC,W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ettings extends IEntitySettings {\n\n\t/**\n\t * List of colors in the set.\n\t */\n\tcolors?: Color[];\n\n\t/**\n\t * A step size when using `next()`.\n\t *\n\t * E.g. setting to `2` will make it return every second color in the list.\n\t *\n\t * @default 1\n\t */\n\tstep?: number;\n\n\t/**\n\t * Start iterating colors from specific index.\n\t */\n\tstartIndex?: number;\n\n\t/**\n\t * If set to `true`, color set will reuse existing colors from the list\n\t * inestead of generating new ones.\n\t *\n\t * @default false\n\t */\n\treuse?: boolean;\n\n\t/**\n\t * A base color to generate new colors from if `colors` is not specified.\n\t * @type {[type]}\n\t */\n\tbaseColor?: Color;\n\n\t/**\n\t * A set of tranformation to apply to base list of colors when the set runs\n\t * out of colors and generates additional ones.\n\t */\n\tpassOptions?: IColorSetStepOptions;\n\n\t/**\n\t * If set, each returned color will be applied saturation.\n\t */\n\tsaturation?: number;\n\n\t// count?: number;\n}\n\nexport interface IColorSetPrivate extends IEntityPrivate {\n\n\tcurrentStep?: number;\n\tcurrentPass?: number;\n\n\t/**\n\t * @ignore\n\t */\n\tnumColors?: number;\n\n}\n\nexport interface IColorSetStepOptions {\n\n\t/**\n\t * Value to add to \"hue\".\n\t */\n\thue?: number;\n\n\t/**\n\t * Value to add to \"saturation\".\n\t */\n\tsaturation?: number;\n\n\t/**\n\t * Value to add to \"lightness\".\n\t */\n\tlightness?: number;\n\n}\n\n\n/**\n * An object which holds list of colors and can generate new ones.\n *\n * @see {@link https://www.amcharts.com/docs/v5/concepts/colors-gradients-and-patterns/#Color_sets} for more info\n */\nexport class ColorSet extends Entity {\n\tpublic static className: string = \"ColorSet\";\n\tpublic static classNames: Array<string> = Entity.classNames.concat([ColorSet.className]);\n\n\tdeclare public _settings: IColorSetSettings;\n\tdeclare public _privateSettings: IColorSetPrivate;\n\n\t//protected _currentPass: number = 0;\n\n\tprotected _afterNew() {\n\t\t// Applying themes because color set will not have parent\n\t\tsuper._afterNewApplyThemes();\n\t}\n\n\t/**\n\t * @ignore\n\t */\n\tpublic generateColors(): void {\n\t\tthis.setPrivate(\"currentPass\", this.getPrivate(\"currentPass\", 0) + 1)\n\t\tconst pass = this.getPrivate(\"currentPass\");\n\t\tconst colors = this.get(\"colors\", [this.get(\"baseColor\", Color.fromHex(0xff0000))]);\n\t\tif (!this.getPrivate(\"numColors\")) {\n\t\t\tthis.setPrivate(\"numColors\", colors.length);\n\t\t}\n\t\t//const len = colors.length;\n\t\tconst len = this.getPrivate(\"numColors\")!;\n\t\t//const start = len - this.getPrivate(\"numColors\")!;\n\t\tconst start = 0;\n\t\tconst passOptions = this.get(\"passOptions\")!;\n\t\tconst reuse = this.get(\"reuse\");\n\t\tfor (let i = start; i < len; i++) {\n\t\t\tif (reuse) {\n\t\t\t\tcolors.push(colors[i])\n\t\t\t}\n\t\t\telse {\n\t\t\t\tconst hsl = colors[i]!.toHSL();\n\t\t\t\tlet h = hsl.h + (passOptions.hue || 0) * pass!;\n\t\t\t\twhile (h > 1) h -= 1;\n\n\t\t\t\tlet s = hsl.s + (passOptions.saturation || 0) * pass!;\n\t\t\t\t//if (s > 1) s -= Math.floor(s);\n\t\t\t\tif (s > 1) s = 1;\n\t\t\t\tif (s < 0) s = 0;\n\n\t\t\t\tlet l = hsl.l + (passOptions.lightness || 0) * pass!;\n\t\t\t\t//if (l > 1) l -= Math.floor(l);\n\t\t\t\twhile (l > 1) l -= 1;\n\t\t\t\tcolors.push(Color.fromHSL(h, s, l));\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Returns a [[Color]] at specific index.\n\t *\n\t * If there's no color at this index, a new color is generated.\n\t *\n\t * @param index Index\n\t * @return Color\n\t */\n\tpublic getIndex(index: number): Color {\n\t\tconst colors = this.get(\"colors\", []);\n\t\tconst saturation = this.get(\"saturation\");\n\t\tif (index >= colors.length) {\n\t\t\tthis.generateColors();\n\t\t\treturn this.getIndex(index);\n\t\t}\n\n\t\treturn saturation != null ? Color.saturate(colors[index], saturation!) : colors[index];\n\t}\n\n\t/**\n\t * Returns next [[Color]] in the list.\n\t *\n\t * If the list is out of colors, new ones are generated dynamically.\n\t */\n\tpublic next() {\n\t\tlet currentStep = this.getPrivate(\"currentStep\", this.get(\"startIndex\", 0));\n\t\tthis.setPrivate(\"currentStep\", currentStep + this.get(\"step\", 1));\n\t\treturn this.getIndex(currentStep);\n\t}\n\n\t/**\n\t * Resets counter to the start of the list, so the next call for `next()` will\n\t * return the first color.\n\t */\n\tpublic reset() {\n\t\tthis.setPrivate(\"currentStep\", this.get(\"startIndex\", 0));\n\t}\n}\n"]}
|
|
@@ -17,7 +17,7 @@ var TextFormatter = /** @class */ (function () {
|
|
|
17
17
|
value: function (text) {
|
|
18
18
|
return text.
|
|
19
19
|
replace(/\[\[/g, this.prefix + "1").
|
|
20
|
-
replace(/([
|
|
20
|
+
replace(/([^\/\]]{1})\]\]/g, "$1" + this.prefix + "2").
|
|
21
21
|
replace(/\]\]/g, this.prefix + "2").
|
|
22
22
|
replace(/\{\{/g, this.prefix + "3").
|
|
23
23
|
replace(/\}\}/g, this.prefix + "4").
|
|
@@ -41,7 +41,7 @@ var TextFormatter = /** @class */ (function () {
|
|
|
41
41
|
replace(new RegExp(this.prefix + "2", "g"), "]]").
|
|
42
42
|
replace(new RegExp(this.prefix + "3", "g"), "{{").
|
|
43
43
|
replace(new RegExp(this.prefix + "4", "g"), "}}").
|
|
44
|
-
replace(new RegExp(this.prefix + "5", "g"), "'");
|
|
44
|
+
replace(new RegExp(this.prefix + "5", "g"), "''");
|
|
45
45
|
}
|
|
46
46
|
});
|
|
47
47
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextFormatter.js","sourceRoot":"","sources":["../../../../../src/.internal/core/util/TextFormatter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAE/B,OAAO,KAAK,KAAK,MAAM,QAAQ,CAAC;AAmBhC;IAAA;IAyPA,CAAC;IArPA;;;;;;OAMG;;;;;eACH,UAAqB,IAAY;YACh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ACT,IAAI,CAAC,CAAC,EAAE;gBACP,OAAO,EAAE,CAAC;aACV;YAED,gBAAgB;YAEhB,kBAAkB;YAClB,KAAK,IAAI,CAAC,GAAW,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;gBAE1C,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,qEAAqE,CAAC,EAAE;oBAChF,MAAO,CAAC,UAAU,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;iBAChC;qBACI,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,gBAAgB,CAAC,EAAE;oBAChC,MAAO,CAAC,cAAc,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;iBACpC;qBACI,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,GAAG,EAAE;oBACrB,mBAAmB;oBACnB,aAAa;iBACb;qBACI,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE;oBAC1B,QAAQ;oBACR,MAAM,CAAC,IAAI,GAAG,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;iBACrC;qBACI;oBACJ,IAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;oBACxB,MAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;oBAC3B,qDAAqD;oBACrD,kCAAkC;iBAClC;aAED;YAED,cAAc;YACd,8DAA8D;YAE9D,OAAO,MAAM,CAAC;QACf,CAAC;;IArPD;;;;eAAuB,cAAc;OAAC;IAuPvC,oBAAC;CAAA,AAzPD,IAyPC;SAzPY,aAAa","sourcesContent":["import { Color } from \"./Color\"\nimport type { ITextStyle } from \"../render/backend/Renderer\"\nimport * as $type from \"./Type\";\n\n/**\n * Defines an interface for an object that holds a chunk of text.\n */\nexport interface ITextChunk {\n\n\t/**\n\t * Type of the chunk.\n\t */\n\t\"type\": \"value\" | \"text\" | \"format\" | \"image\",\n\n\t/**\n\t * Text.\n\t */\n\t\"text\": string\n\n}\n\nexport class TextFormatter {\n\n\tpublic static prefix = \"__amcharts__\";\n\n\t/**\n\t * Replaces brackets with temporary placeholders.\n\t *\n\t * @ignore Exclude from docs\n\t * @param text Input text\n\t * @return Escaped text\n\t */\n\tpublic static escape(text: string): string {\n\t\treturn text.\n\t\t\treplace(/\\[\\[/g, this.prefix + \"1\").\n\t\t\treplace(/([^\\/]{1})\\]\\]/g, \"$1\" + this.prefix + \"2\").\n\t\t\treplace(/\\]\\]/g, this.prefix + \"2\").\n\t\t\treplace(/\\{\\{/g, this.prefix + \"3\").\n\t\t\treplace(/\\}\\}/g, this.prefix + \"4\").\n\t\t\treplace(/\\'\\'/g, this.prefix + \"5\");\n\t}\n\n\t/**\n\t * Replaces placeholders back to brackets.\n\t *\n\t * @ignore Exclude from docs\n\t * @param text Escaped text\n\t * @return Unescaped text\n\t */\n\tpublic static unescape(text: string): string {\n\t\treturn text.\n\t\t\treplace(new RegExp(this.prefix + \"1\", \"g\"), \"[[\").\n\t\t\treplace(new RegExp(this.prefix + \"2\", \"g\"), \"]]\").\n\t\t\treplace(new RegExp(this.prefix + \"3\", \"g\"), \"{{\").\n\t\t\treplace(new RegExp(this.prefix + \"4\", \"g\"), \"}}\").\n\t\t\treplace(new RegExp(this.prefix + \"5\", \"g\"), \"'\");\n\t}\n\n\t/**\n\t * Cleans up the text text for leftover double square brackets.\n\t *\n\t * @ignore Exclude from docs\n\t * @param text Input text\n\t * @return Cleaned up text\n\t */\n\tpublic static cleanUp(text: string): string {\n\t\treturn text.\n\t\t\treplace(/\\[\\[/g, \"[\").\n\t\t\treplace(/\\]\\]/g, \"]\").\n\t\t\treplace(/\\{\\{/g, \"{\").\n\t\t\treplace(/\\}\\}/g, \"}\").\n\t\t\treplace(/\\'\\'/g, \"'\");\n\t}\n\n\t/**\n\t * Splits string into chunks. (style blocks, quoted blocks, regular blocks)\n\t *\n\t * If the second parameter `quotedBlocks` is set to `true` this method will\n\t * also single out text blocks enclosed within single quotes that no\n\t * formatting should be applied to, and they should be displayed as is.\n\t *\n\t * Default for the above is `false`, so that you can use single quote in text\n\t * without escaping it.\n\t *\n\t * If enabled, single quotes can be escaped by doubling it - adding two\n\t * single quotes, which will be replaced by a one single quote in the final\n\t * output.\n\t *\n\t * @ignore Exclude from docs\n\t * @param text Text to chunk\n\t * @param quotedBlocks Use quoted blocks\n\t * @param noFormatting Formatting blocks will be treated as regular text\n\t * @return Array of string chunks\n\t */\n\tpublic static chunk(text: string, quotedBlocks: boolean = false, noFormatting: boolean = false): ITextChunk[] {\n\n\t\t// Init result\n\t\tlet res: ITextChunk[] = [];\n\n\t\t// Replace double (escaped) square spaces and quotes with temporary codes\n\t\ttext = this.escape(text);\n\n\t\t// Deal with style blocks\n\t\tlet chunks = quotedBlocks ? text.split(\"'\") : [text];\n\t\tfor (let i: number = 0; i < chunks.length; i++) {\n\t\t\tlet chunk = chunks[i];\n\n\t\t\t// Empty?\n\t\t\tif (chunk === \"\") {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif ((i % 2) === 0) {\n\n\t\t\t\t// Text outside quotes\n\t\t\t\t// Parse for style blocks which are \"text\" chunks, the rest chunks are\n\t\t\t\t// \"value\"\n\n\t\t\t\tchunk = chunk.replace(/\\]\\[/g, \"]\" + $type.PLACEHOLDER + \"[\");\n\t\t\t\tchunk = chunk.replace(/\\[\\]/g, \"[ ]\");\n\t\t\t\tlet chunks2 = chunk.split(/[\\[\\]]+/);\n\t\t\t\tfor (let i2: number = 0; i2 < chunks2.length; i2++) {\n\t\t\t\t\tlet chunk2 = this.cleanUp(this.unescape(chunks2[i2]));\n\n\t\t\t\t\t// Placeholder?\n\t\t\t\t\tif (chunk2 === $type.PLACEHOLDER) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Empty?\n\t\t\t\t\tif (chunk2 === \"\") {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Block or value\n\t\t\t\t\tif ((i2 % 2) === 0) {\n\t\t\t\t\t\tres.push({\n\t\t\t\t\t\t\t\"type\": \"value\",\n\t\t\t\t\t\t\t\"text\": chunk2\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tres.push({\n\t\t\t\t\t\t\t\"type\": noFormatting ? \"value\" : \"format\",\n\t\t\t\t\t\t\t\"text\": \"[\" + chunk2 + \"]\"\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t}\n\t\t\telse {\n\n\t\t\t\t// A text within doublequotes\n\t\t\t\t// All chunks are \"text\"\n\n\t\t\t\tlet chunks2 = chunk.split(/[\\[\\]]+/);\n\t\t\t\tfor (let i2: number = 0; i2 < chunks2.length; i2++) {\n\t\t\t\t\tlet chunk2 = this.cleanUp(this.unescape(chunks2[i2]));\n\n\t\t\t\t\t// Empty?\n\t\t\t\t\tif (chunk2 === \"\") {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Block or text\n\t\t\t\t\tif ((i2 % 2) === 0) {\n\t\t\t\t\t\tres.push({\n\t\t\t\t\t\t\t\"type\": \"text\",\n\t\t\t\t\t\t\t\"text\": chunk2\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t\telse if (this.isImage(chunk2)) {\n\t\t\t\t\t\tres.push({\n\t\t\t\t\t\t\t\"type\": \"image\",\n\t\t\t\t\t\t\t\"text\": \"[\" + chunk2 + \"]\"\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tres.push({\n\t\t\t\t\t\t\t\"type\": \"format\",\n\t\t\t\t\t\t\t\"text\": \"[\" + chunk2 + \"]\"\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t}\n\t\t}\n\n\t\treturn res;\n\t}\n\n\t/**\n\t * Checks if supplied format contains image information and should be\n\t * formatted as such.\n\t * I.e.: `[img: myImage.png]`\n\t *\n\t * @ignore\n\t * @param text Format\n\t * @return true if it is an image\n\t */\n\tpublic static isImage(text: string): boolean {\n\t\treturn text.match(/img[ ]?:/) ? true : false;\n\t}\n\n\tpublic static getTextStyle(style: string): ITextStyle {\n\n\t\t// let textStyle: string[] = [];\n\t\t// let textFill: string | undefined;\n\t\tlet format: ITextStyle = {};\n\n\t\tif (style == \"\" || style == \"[ ]\") {\n\t\t\treturn {};\n\t\t}\n\n\t\t// TODO: cache\n\t\t// let cached = registry.getCache(\"translateStyleShortcuts_\" + style);\n\t\t// if (cached) {\n\t\t// \treturn cached;\n\t\t// }\n\n\t\t// Pre-process quoted text\n\t\tconst q = style.match(/('[^']*')|(\"[^\"]*\")/gi);\n\t\tif (q) {\n\t\t\tfor (let i: number = 0; i < q.length; i++) {\n\t\t\t\tstyle = style.replace(q[i], q[i].replace(/['\"]*/g, \"\").replace(/[ ]+/g, \"+\"));\n\t\t\t}\n\t\t}\n\n\t\t// Get style parts\n\t\tlet b: string[] | null = style.match(/([\\w\\-]*:[\\s]?[^;\\s\\]]*)|(\\#[\\w]{1,6})|([\\w]+)|(\\/)/gi);\n\n\t\t// Empty?\n\t\tif (!b) {\n\t\t\treturn {};\n\t\t}\n\n\t\t//console.log(b)\n\n\t\t// Check each part\n\t\tfor (let i: number = 0; i < b.length; i++) {\n\n\t\t\tif (b[i].match(/^(normal|bold|bolder|lighter|100|200|300|400|500|600|700|800|900)$/i)) {\n\t\t\t\t(<any>format).fontWeight = b[i];\n\t\t\t}\n\t\t\telse if (b[i].match(/^(underline)$/i)) {\n\t\t\t\t(<any>format).textDecoration = b[i];\n\t\t\t}\n\t\t\telse if (b[i] == \"/\") {\n\t\t\t\t// Just closing tag\n\t\t\t\t// Do nothing\n\t\t\t}\n\t\t\telse if (!b[i].match(/:/)) {\n\t\t\t\t// Color\n\t\t\t\tformat.fill = Color.fromString(b[i]);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tconst p = b[i].split(/:[ ]*/);\n\t\t\t\t(<any>format)[p[0]] = p[1];\n\t\t\t\t//textStyle.push(b[i].replace(/^[a-zA-Z]:[ ]*/, \"\"));\n\t\t\t\t//b[i] = b[i].replace(/\\+/g, \" \");\n\t\t\t}\n\n\t\t}\n\n\t\t// TODO: cache\n\t\t// registry.setCache(\"translateStyleShortcuts_\" + style, res);\n\n\t\treturn format;\n\t}\n\n}\n"]}
|
|
1
|
+
{"version":3,"file":"TextFormatter.js","sourceRoot":"","sources":["../../../../../src/.internal/core/util/TextFormatter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAE/B,OAAO,KAAK,KAAK,MAAM,QAAQ,CAAC;AAmBhC;IAAA;IAyPA,CAAC;IArPA;;;;;;OAMG;;;;;eACH,UAAqB,IAAY;YAChC,OAAO,IAAI;gBACV,OAAO,CAAC,OAAO,EAAE,IAAI,CAAC,MAAM,GAAG,GAAG,CAAC;gBACnC,OAAO,CAAC,mBAAmB,EAAE,IAAI,GAAG,IAAI,CAAC,MAAM,GAAG,GAAG,CAAC;gBACtD,OAAO,CAAC,OAAO,EAAE,IAAI,CAAC,MAAM,GAAG,GAAG,CAAC;gBACnC,OAAO,CAAC,OAAO,EAAE,IAAI,CAAC,MAAM,GAAG,GAAG,CAAC;gBACnC,OAAO,CAAC,OAAO,EAAE,IAAI,CAAC,MAAM,GAAG,GAAG,CAAC;gBACnC,OAAO,CAAC,OAAO,EAAE,IAAI,CAAC,MAAM,GAAG,GAAG,CAAC,CAAC;QACtC,CAAC;;IAED;;;;;;OAMG;;;;;eACH,UAAuB,IAAY;YAClC,OAAO,IAAI;gBACV,OAAO,CAAC,IAAI,MAAM,CAAC,IAAI,CAAC,MAAM,GAAG,GAAG,EAAE,GAAG,CAAC,EAAE,IAAI,CAAC;gBACjD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C,GAAG,CAAC,EAAE;oBAC1B,QAAQ;oBACR,MAAM,CAAC,IAAI,GAAG,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;iBACrC;qBACI;oBACJ,IAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;oBACxB,MAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;oBAC3B,qDAAqD;oBACrD,kCAAkC;iBAClC;aAED;YAED,cAAc;YACd,8DAA8D;YAE9D,OAAO,MAAM,CAAC;QACf,CAAC;;IArPD;;;;eAAuB,cAAc;OAAC;IAuPvC,oBAAC;CAAA,AAzPD,IAyPC;SAzPY,aAAa","sourcesContent":["import { Color } from \"./Color\"\nimport type { ITextStyle } from \"../render/backend/Renderer\"\nimport * as $type from \"./Type\";\n\n/**\n * Defines an interface for an object that holds a chunk of text.\n */\nexport interface ITextChunk {\n\n\t/**\n\t * Type of the chunk.\n\t */\n\t\"type\": \"value\" | \"text\" | \"format\" | \"image\",\n\n\t/**\n\t * Text.\n\t */\n\t\"text\": string\n\n}\n\nexport class TextFormatter {\n\n\tpublic static prefix = \"__amcharts__\";\n\n\t/**\n\t * Replaces brackets with temporary placeholders.\n\t *\n\t * @ignore Exclude from docs\n\t * @param text Input text\n\t * @return Escaped text\n\t */\n\tpublic static escape(text: string): string {\n\t\treturn text.\n\t\t\treplace(/\\[\\[/g, this.prefix + \"1\").\n\t\t\treplace(/([^\\/\\]]{1})\\]\\]/g, \"$1\" + this.prefix + \"2\").\n\t\t\treplace(/\\]\\]/g, this.prefix + \"2\").\n\t\t\treplace(/\\{\\{/g, this.prefix + \"3\").\n\t\t\treplace(/\\}\\}/g, this.prefix + \"4\").\n\t\t\treplace(/\\'\\'/g, this.prefix + \"5\");\n\t}\n\n\t/**\n\t * Replaces placeholders back to brackets.\n\t *\n\t * @ignore Exclude from docs\n\t * @param text Escaped text\n\t * @return Unescaped text\n\t */\n\tpublic static unescape(text: string): string {\n\t\treturn text.\n\t\t\treplace(new RegExp(this.prefix + \"1\", \"g\"), \"[[\").\n\t\t\treplace(new RegExp(this.prefix + \"2\", \"g\"), \"]]\").\n\t\t\treplace(new RegExp(this.prefix + \"3\", \"g\"), \"{{\").\n\t\t\treplace(new RegExp(this.prefix + \"4\", \"g\"), \"}}\").\n\t\t\treplace(new RegExp(this.prefix + \"5\", \"g\"), \"''\");\n\t}\n\n\t/**\n\t * Cleans up the text text for leftover double square brackets.\n\t *\n\t * @ignore Exclude from docs\n\t * @param text Input text\n\t * @return Cleaned up text\n\t */\n\tpublic static cleanUp(text: string): string {\n\t\treturn text.\n\t\t\treplace(/\\[\\[/g, \"[\").\n\t\t\treplace(/\\]\\]/g, \"]\").\n\t\t\treplace(/\\{\\{/g, \"{\").\n\t\t\treplace(/\\}\\}/g, \"}\").\n\t\t\treplace(/\\'\\'/g, \"'\");\n\t}\n\n\t/**\n\t * Splits string into chunks. (style blocks, quoted blocks, regular blocks)\n\t *\n\t * If the second parameter `quotedBlocks` is set to `true` this method will\n\t * also single out text blocks enclosed within single quotes that no\n\t * formatting should be applied to, and they should be displayed as is.\n\t *\n\t * Default for the above is `false`, so that you can use single quote in text\n\t * without escaping it.\n\t *\n\t * If enabled, single quotes can be escaped by doubling it - adding two\n\t * single quotes, which will be replaced by a one single quote in the final\n\t * output.\n\t *\n\t * @ignore Exclude from docs\n\t * @param text Text to chunk\n\t * @param quotedBlocks Use quoted blocks\n\t * @param noFormatting Formatting blocks will be treated as regular text\n\t * @return Array of string chunks\n\t */\n\tpublic static chunk(text: string, quotedBlocks: boolean = false, noFormatting: boolean = false): ITextChunk[] {\n\n\t\t// Init result\n\t\tlet res: ITextChunk[] = [];\n\n\t\t// Replace double (escaped) square spaces and quotes with temporary codes\n\t\ttext = this.escape(text);\n\n\t\t// Deal with style blocks\n\t\tlet chunks = quotedBlocks ? text.split(\"'\") : [text];\n\t\tfor (let i: number = 0; i < chunks.length; i++) {\n\t\t\tlet chunk = chunks[i];\n\n\t\t\t// Empty?\n\t\t\tif (chunk === \"\") {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif ((i % 2) === 0) {\n\n\t\t\t\t// Text outside quotes\n\t\t\t\t// Parse for style blocks which are \"text\" chunks, the rest chunks are\n\t\t\t\t// \"value\"\n\n\t\t\t\tchunk = chunk.replace(/\\]\\[/g, \"]\" + $type.PLACEHOLDER + \"[\");\n\t\t\t\tchunk = chunk.replace(/\\[\\]/g, \"[ ]\");\n\t\t\t\tlet chunks2 = chunk.split(/[\\[\\]]+/);\n\t\t\t\tfor (let i2: number = 0; i2 < chunks2.length; i2++) {\n\t\t\t\t\tlet chunk2 = this.cleanUp(this.unescape(chunks2[i2]));\n\n\t\t\t\t\t// Placeholder?\n\t\t\t\t\tif (chunk2 === $type.PLACEHOLDER) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Empty?\n\t\t\t\t\tif (chunk2 === \"\") {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Block or value\n\t\t\t\t\tif ((i2 % 2) === 0) {\n\t\t\t\t\t\tres.push({\n\t\t\t\t\t\t\t\"type\": \"value\",\n\t\t\t\t\t\t\t\"text\": chunk2\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tres.push({\n\t\t\t\t\t\t\t\"type\": noFormatting ? \"value\" : \"format\",\n\t\t\t\t\t\t\t\"text\": \"[\" + chunk2 + \"]\"\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t}\n\t\t\telse {\n\n\t\t\t\t// A text within doublequotes\n\t\t\t\t// All chunks are \"text\"\n\n\t\t\t\tlet chunks2 = chunk.split(/[\\[\\]]+/);\n\t\t\t\tfor (let i2: number = 0; i2 < chunks2.length; i2++) {\n\t\t\t\t\tlet chunk2 = this.cleanUp(this.unescape(chunks2[i2]));\n\n\t\t\t\t\t// Empty?\n\t\t\t\t\tif (chunk2 === \"\") {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Block or text\n\t\t\t\t\tif ((i2 % 2) === 0) {\n\t\t\t\t\t\tres.push({\n\t\t\t\t\t\t\t\"type\": \"text\",\n\t\t\t\t\t\t\t\"text\": chunk2\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t\telse if (this.isImage(chunk2)) {\n\t\t\t\t\t\tres.push({\n\t\t\t\t\t\t\t\"type\": \"image\",\n\t\t\t\t\t\t\t\"text\": \"[\" + chunk2 + \"]\"\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tres.push({\n\t\t\t\t\t\t\t\"type\": \"format\",\n\t\t\t\t\t\t\t\"text\": \"[\" + chunk2 + \"]\"\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t}\n\t\t}\n\n\t\treturn res;\n\t}\n\n\t/**\n\t * Checks if supplied format contains image information and should be\n\t * formatted as such.\n\t * I.e.: `[img: myImage.png]`\n\t *\n\t * @ignore\n\t * @param text Format\n\t * @return true if it is an image\n\t */\n\tpublic static isImage(text: string): boolean {\n\t\treturn text.match(/img[ ]?:/) ? true : false;\n\t}\n\n\tpublic static getTextStyle(style: string): ITextStyle {\n\n\t\t// let textStyle: string[] = [];\n\t\t// let textFill: string | undefined;\n\t\tlet format: ITextStyle = {};\n\n\t\tif (style == \"\" || style == \"[ ]\") {\n\t\t\treturn {};\n\t\t}\n\n\t\t// TODO: cache\n\t\t// let cached = registry.getCache(\"translateStyleShortcuts_\" + style);\n\t\t// if (cached) {\n\t\t// \treturn cached;\n\t\t// }\n\n\t\t// Pre-process quoted text\n\t\tconst q = style.match(/('[^']*')|(\"[^\"]*\")/gi);\n\t\tif (q) {\n\t\t\tfor (let i: number = 0; i < q.length; i++) {\n\t\t\t\tstyle = style.replace(q[i], q[i].replace(/['\"]*/g, \"\").replace(/[ ]+/g, \"+\"));\n\t\t\t}\n\t\t}\n\n\t\t// Get style parts\n\t\tlet b: string[] | null = style.match(/([\\w\\-]*:[\\s]?[^;\\s\\]]*)|(\\#[\\w]{1,6})|([\\w]+)|(\\/)/gi);\n\n\t\t// Empty?\n\t\tif (!b) {\n\t\t\treturn {};\n\t\t}\n\n\t\t//console.log(b)\n\n\t\t// Check each part\n\t\tfor (let i: number = 0; i < b.length; i++) {\n\n\t\t\tif (b[i].match(/^(normal|bold|bolder|lighter|100|200|300|400|500|600|700|800|900)$/i)) {\n\t\t\t\t(<any>format).fontWeight = b[i];\n\t\t\t}\n\t\t\telse if (b[i].match(/^(underline)$/i)) {\n\t\t\t\t(<any>format).textDecoration = b[i];\n\t\t\t}\n\t\t\telse if (b[i] == \"/\") {\n\t\t\t\t// Just closing tag\n\t\t\t\t// Do nothing\n\t\t\t}\n\t\t\telse if (!b[i].match(/:/)) {\n\t\t\t\t// Color\n\t\t\t\tformat.fill = Color.fromString(b[i]);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tconst p = b[i].split(/:[ ]*/);\n\t\t\t\t(<any>format)[p[0]] = p[1];\n\t\t\t\t//textStyle.push(b[i].replace(/^[a-zA-Z]:[ ]*/, \"\"));\n\t\t\t\t//b[i] = b[i].replace(/\\+/g, \" \");\n\t\t\t}\n\n\t\t}\n\n\t\t// TODO: cache\n\t\t// registry.setCache(\"translateStyleShortcuts_\" + style, res);\n\n\t\treturn format;\n\t}\n\n}\n"]}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import type { DataItem } from "../../core/render/Component";
|
|
2
|
+
import type { PercentSeries, IPercentSeriesDataItem } from "../../charts/percent/PercentSeries";
|
|
3
|
+
import type { Legend } from "../../core/render/Legend";
|
|
4
|
+
import { Button } from "../../core/render/Button";
|
|
5
|
+
import { Entity, IEntitySettings, IEntityPrivate, IEntityEvents } from "../../core/util/Entity";
|
|
6
|
+
export interface ISliceGrouperSettings extends IEntitySettings {
|
|
7
|
+
/**
|
|
8
|
+
* A series that will be used to group slices on.
|
|
9
|
+
*/
|
|
10
|
+
series?: PercentSeries;
|
|
11
|
+
/**
|
|
12
|
+
* If set, plugin will try to manipulate the items in legend, such as
|
|
13
|
+
* adding group slice, hiding items for small slices, etc.
|
|
14
|
+
*/
|
|
15
|
+
legend?: Legend;
|
|
16
|
+
/**
|
|
17
|
+
* Any slice which has percent value less than this setting will be grouped.
|
|
18
|
+
*
|
|
19
|
+
* @default 5
|
|
20
|
+
*/
|
|
21
|
+
threshold?: number;
|
|
22
|
+
/**
|
|
23
|
+
* If set, only X first slices will be left as they are. The rest of the
|
|
24
|
+
* slices will be grouped.
|
|
25
|
+
*/
|
|
26
|
+
limit?: number;
|
|
27
|
+
/**
|
|
28
|
+
* Name (category) of the group slice.
|
|
29
|
+
*
|
|
30
|
+
* @default "Other"
|
|
31
|
+
*/
|
|
32
|
+
groupName?: string;
|
|
33
|
+
/**
|
|
34
|
+
* What happens when group slice is clicked.
|
|
35
|
+
*
|
|
36
|
+
* * `"none"` (default) - nothing.
|
|
37
|
+
* * `"break"` - underlying small slices are shown.
|
|
38
|
+
* * `"zoom"` - series shows only small slies (big ones are hidden).
|
|
39
|
+
*/
|
|
40
|
+
clickBehavior?: "none" | "break" | "zoom";
|
|
41
|
+
}
|
|
42
|
+
export interface ISliceGrouperPrivate extends IEntityPrivate {
|
|
43
|
+
groupDataItem?: DataItem<IPercentSeriesDataItem>;
|
|
44
|
+
smallDataItems?: DataItem<IPercentSeriesDataItem>[];
|
|
45
|
+
}
|
|
46
|
+
export interface ISliceGrouperEvents extends IEntityEvents {
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* A plugin that can be used to automatically group small slices on percent
|
|
50
|
+
* charts into a single slice.
|
|
51
|
+
*
|
|
52
|
+
* @see {@link https://www.amcharts.com/docs/v5/charts/percent-charts/grouping-slices/} for more info
|
|
53
|
+
*/
|
|
54
|
+
export declare class SliceGrouper extends Entity {
|
|
55
|
+
static className: string;
|
|
56
|
+
static classNames: Array<string>;
|
|
57
|
+
_settings: ISliceGrouperSettings;
|
|
58
|
+
_privateSettings: ISliceGrouperPrivate;
|
|
59
|
+
_events: ISliceGrouperEvents;
|
|
60
|
+
/**
|
|
61
|
+
* A button that is shown when chart small buttons are visible.
|
|
62
|
+
*/
|
|
63
|
+
zoomOutButton?: Button;
|
|
64
|
+
protected _afterNew(): void;
|
|
65
|
+
private initZoomButton;
|
|
66
|
+
private handleData;
|
|
67
|
+
/**
|
|
68
|
+
* Resets slice setup to original grouping state.
|
|
69
|
+
*/
|
|
70
|
+
zoomOut(): void;
|
|
71
|
+
private updateGroupDataItem;
|
|
72
|
+
private handleClick;
|
|
73
|
+
_beforeChanged(): void;
|
|
74
|
+
}
|
|
75
|
+
//# sourceMappingURL=SliceGrouper.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SliceGrouper.d.ts","sourceRoot":"","sources":["../../../../../src/.internal/plugins/sliceGrouper/SliceGrouper.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAC5D,OAAO,KAAK,EAAE,aAAa,EAAE,sBAAsB,EAAE,MAAM,oCAAoC,CAAC;AAChG,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAEvD,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAElD,OAAO,EAAE,MAAM,EAAE,eAAe,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAA;AAK/F,MAAM,WAAW,qBAAsB,SAAQ,eAAe;IAE7D;;OAEG;IACH,MAAM,CAAC,EAAE,aAAa,CAAC;IAEvB;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;;;;;OAMG;IACH,aAAa,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,MAAM,CAAC;CAE1C;AAED,MAAM,WAAW,oBAAqB,SAAQ,cAAc;IAC3D,aAAa,CAAC,EAAE,QAAQ,CAAC,sBAAsB,CAAC,CAAC;IACjD,cAAc,CAAC,EAAE,QAAQ,CAAC,sBAAsB,CAAC,EAAE,CAAC;CACpD;AAED,MAAM,WAAW,mBAAoB,SAAQ,aAAa;CACzD;AAGD;;;;;GAKG;AACH,qBAAa,YAAa,SAAQ,MAAM;IACvC,OAAc,SAAS,EAAE,MAAM,CAAkB;IACjD,OAAc,UAAU,EAAE,KAAK,CAAC,MAAM,CAAC,CAAsD;IAE9E,SAAS,EAAE,qBAAqB,CAAC;IACjC,gBAAgB,EAAE,oBAAoB,CAAC;IACvC,OAAO,EAAE,mBAAmB,CAAC;IAE5C;;OAEG;IACI,aAAa,CAAC,EAAE,MAAM,CAAC;IAG9B,SAAS,CAAC,SAAS,IAAI,IAAI;IAS3B,OAAO,CAAC,cAAc;IAkBtB,OAAO,CAAC,UAAU;IAuElB;;OAEG;IACI,OAAO,IAAI,IAAI;IAgBtB,OAAO,CAAC,mBAAmB;IAyB3B,OAAO,CAAC,WAAW;IA2BZ,cAAc;CAcrB"}
|
|
@@ -0,0 +1,229 @@
|
|
|
1
|
+
import { __extends } from "tslib";
|
|
2
|
+
import { Button } from "../../core/render/Button";
|
|
3
|
+
import { Graphics } from "../../core/render/Graphics";
|
|
4
|
+
import { Entity } from "../../core/util/Entity";
|
|
5
|
+
import * as $array from "../../core/util/Array";
|
|
6
|
+
/**
|
|
7
|
+
* A plugin that can be used to automatically group small slices on percent
|
|
8
|
+
* charts into a single slice.
|
|
9
|
+
*
|
|
10
|
+
* @see {@link https://www.amcharts.com/docs/v5/charts/percent-charts/grouping-slices/} for more info
|
|
11
|
+
*/
|
|
12
|
+
var SliceGrouper = /** @class */ (function (_super) {
|
|
13
|
+
__extends(SliceGrouper, _super);
|
|
14
|
+
function SliceGrouper() {
|
|
15
|
+
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
16
|
+
/**
|
|
17
|
+
* A button that is shown when chart small buttons are visible.
|
|
18
|
+
*/
|
|
19
|
+
Object.defineProperty(_this, "zoomOutButton", {
|
|
20
|
+
enumerable: true,
|
|
21
|
+
configurable: true,
|
|
22
|
+
writable: true,
|
|
23
|
+
value: void 0
|
|
24
|
+
});
|
|
25
|
+
return _this;
|
|
26
|
+
}
|
|
27
|
+
Object.defineProperty(SliceGrouper.prototype, "_afterNew", {
|
|
28
|
+
enumerable: false,
|
|
29
|
+
configurable: true,
|
|
30
|
+
writable: true,
|
|
31
|
+
value: function () {
|
|
32
|
+
_super.prototype._afterNew.call(this);
|
|
33
|
+
this._setRawDefault("threshold", 5);
|
|
34
|
+
this._setRawDefault("groupName", "Other");
|
|
35
|
+
this._setRawDefault("clickBehavior", "none");
|
|
36
|
+
this.initZoomButton();
|
|
37
|
+
this._root.addDisposer(this);
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
Object.defineProperty(SliceGrouper.prototype, "initZoomButton", {
|
|
41
|
+
enumerable: false,
|
|
42
|
+
configurable: true,
|
|
43
|
+
writable: true,
|
|
44
|
+
value: function () {
|
|
45
|
+
var _this = this;
|
|
46
|
+
var clickBehavior = this.get("clickBehavior");
|
|
47
|
+
if (clickBehavior !== "none") {
|
|
48
|
+
var container = this.root.tooltipContainer;
|
|
49
|
+
this.zoomOutButton = container.children.push(Button.new(this._root, {
|
|
50
|
+
themeTags: ["zoom"],
|
|
51
|
+
icon: Graphics.new(this._root, {
|
|
52
|
+
themeTags: ["button", "icon"]
|
|
53
|
+
})
|
|
54
|
+
}));
|
|
55
|
+
this.zoomOutButton.hide();
|
|
56
|
+
this.zoomOutButton.events.on("click", function () {
|
|
57
|
+
_this.zoomOut();
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
Object.defineProperty(SliceGrouper.prototype, "handleData", {
|
|
63
|
+
enumerable: false,
|
|
64
|
+
configurable: true,
|
|
65
|
+
writable: true,
|
|
66
|
+
value: function () {
|
|
67
|
+
var _this = this;
|
|
68
|
+
var series = this.get("series");
|
|
69
|
+
if (series) {
|
|
70
|
+
// Create group data item if not yet available
|
|
71
|
+
var groupDataItem_1 = this.getPrivate("groupDataItem");
|
|
72
|
+
if (!groupDataItem_1) {
|
|
73
|
+
var legend = this.get("legend");
|
|
74
|
+
var categoryField = series.get("categoryField", "category");
|
|
75
|
+
var valueField = series.get("valueField", "value");
|
|
76
|
+
// Add slice
|
|
77
|
+
var groupSliceData = {};
|
|
78
|
+
groupSliceData[categoryField] = this.get("groupName", "");
|
|
79
|
+
groupSliceData[valueField] = 0;
|
|
80
|
+
series.data.push(groupSliceData);
|
|
81
|
+
groupDataItem_1 = series.dataItems[series.dataItems.length - 1];
|
|
82
|
+
groupDataItem_1.get("slice").events.on("click", function () {
|
|
83
|
+
_this.handleClick();
|
|
84
|
+
});
|
|
85
|
+
this.setPrivate("groupDataItem", groupDataItem_1);
|
|
86
|
+
// Add to legend
|
|
87
|
+
if (legend) {
|
|
88
|
+
legend.data.push(groupDataItem_1);
|
|
89
|
+
//const legendDataItem = groupDataItem.get("legendDataItem");
|
|
90
|
+
groupDataItem_1.on("visible", function (visible) {
|
|
91
|
+
if (visible) {
|
|
92
|
+
_this.zoomOut();
|
|
93
|
+
}
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
// Recalculate group value and decorate small slices as necessary
|
|
98
|
+
var threshold_1 = this.get("threshold", 0);
|
|
99
|
+
var limit_1 = this.get("limit", 1000);
|
|
100
|
+
var smallDataItems_1 = [];
|
|
101
|
+
var groupValue_1 = 0;
|
|
102
|
+
if (threshold_1 || limit_1) {
|
|
103
|
+
$array.each(series.dataItems, function (item, index) {
|
|
104
|
+
var legendDataItem = item.get("legendDataItem");
|
|
105
|
+
if (((item.get("valuePercentTotal") <= threshold_1) || (index > (limit_1 - 1))) && groupDataItem_1 !== item) {
|
|
106
|
+
groupValue_1 += item.get("value", 0);
|
|
107
|
+
smallDataItems_1.push(item);
|
|
108
|
+
item.hide(0);
|
|
109
|
+
if (legendDataItem) {
|
|
110
|
+
legendDataItem.get("itemContainer").hide(0);
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
else if (legendDataItem) {
|
|
114
|
+
legendDataItem.get("itemContainer").show(0);
|
|
115
|
+
}
|
|
116
|
+
});
|
|
117
|
+
this.setPrivate("smallDataItems", smallDataItems_1);
|
|
118
|
+
this.updateGroupDataItem(groupValue_1);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
});
|
|
123
|
+
/**
|
|
124
|
+
* Resets slice setup to original grouping state.
|
|
125
|
+
*/
|
|
126
|
+
Object.defineProperty(SliceGrouper.prototype, "zoomOut", {
|
|
127
|
+
enumerable: false,
|
|
128
|
+
configurable: true,
|
|
129
|
+
writable: true,
|
|
130
|
+
value: function () {
|
|
131
|
+
var groupDataItem = this.getPrivate("groupDataItem");
|
|
132
|
+
if (groupDataItem) {
|
|
133
|
+
groupDataItem.show();
|
|
134
|
+
}
|
|
135
|
+
var smallDataItems = this.getPrivate("smallDataItems", []);
|
|
136
|
+
$array.each(smallDataItems, function (item) {
|
|
137
|
+
item.hide();
|
|
138
|
+
});
|
|
139
|
+
if (this.zoomOutButton) {
|
|
140
|
+
this.zoomOutButton.hide();
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
});
|
|
144
|
+
Object.defineProperty(SliceGrouper.prototype, "updateGroupDataItem", {
|
|
145
|
+
enumerable: false,
|
|
146
|
+
configurable: true,
|
|
147
|
+
writable: true,
|
|
148
|
+
value: function (groupValue) {
|
|
149
|
+
var series = this.get("series");
|
|
150
|
+
if (series) {
|
|
151
|
+
var groupSliceData = {};
|
|
152
|
+
var categoryField = series.get("categoryField", "category");
|
|
153
|
+
var valueField = series.get("valueField", "value");
|
|
154
|
+
groupSliceData[categoryField] = this.get("groupName", "");
|
|
155
|
+
groupSliceData[valueField] = groupValue;
|
|
156
|
+
series.data.setIndex(series.data.length - 1, groupSliceData);
|
|
157
|
+
var groupDataItem = this.getPrivate("groupDataItem");
|
|
158
|
+
if (groupValue == 0) {
|
|
159
|
+
groupDataItem.hide(0);
|
|
160
|
+
}
|
|
161
|
+
else if (groupDataItem.isHidden()) {
|
|
162
|
+
groupDataItem.show();
|
|
163
|
+
}
|
|
164
|
+
var clickBehavior = this.get("clickBehavior");
|
|
165
|
+
if (clickBehavior != "none") {
|
|
166
|
+
groupDataItem.get("slice").set("toggleKey", "none");
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
});
|
|
171
|
+
Object.defineProperty(SliceGrouper.prototype, "handleClick", {
|
|
172
|
+
enumerable: false,
|
|
173
|
+
configurable: true,
|
|
174
|
+
writable: true,
|
|
175
|
+
value: function () {
|
|
176
|
+
var clickBehavior = this.get("clickBehavior");
|
|
177
|
+
var smallDataItems = this.getPrivate("smallDataItems");
|
|
178
|
+
if (clickBehavior == "none" || (smallDataItems && smallDataItems.length == 0)) {
|
|
179
|
+
return;
|
|
180
|
+
}
|
|
181
|
+
var series = this.get("series");
|
|
182
|
+
var groupDataItem = this.getPrivate("groupDataItem");
|
|
183
|
+
// Hide group slice
|
|
184
|
+
groupDataItem.hide();
|
|
185
|
+
// Reveal small slices
|
|
186
|
+
$array.each(series.dataItems, function (item) {
|
|
187
|
+
if (smallDataItems.indexOf(item) !== -1) {
|
|
188
|
+
item.show();
|
|
189
|
+
}
|
|
190
|
+
else if (clickBehavior == "zoom") {
|
|
191
|
+
item.hide();
|
|
192
|
+
}
|
|
193
|
+
});
|
|
194
|
+
this.zoomOutButton.show();
|
|
195
|
+
}
|
|
196
|
+
});
|
|
197
|
+
Object.defineProperty(SliceGrouper.prototype, "_beforeChanged", {
|
|
198
|
+
enumerable: false,
|
|
199
|
+
configurable: true,
|
|
200
|
+
writable: true,
|
|
201
|
+
value: function () {
|
|
202
|
+
var _this = this;
|
|
203
|
+
_super.prototype._beforeChanged.call(this);
|
|
204
|
+
if (this.isDirty("series")) {
|
|
205
|
+
var series = this.get("series");
|
|
206
|
+
if (series) {
|
|
207
|
+
series.events.on("datavalidated", function (_ev) {
|
|
208
|
+
_this.handleData();
|
|
209
|
+
});
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
});
|
|
214
|
+
Object.defineProperty(SliceGrouper, "className", {
|
|
215
|
+
enumerable: true,
|
|
216
|
+
configurable: true,
|
|
217
|
+
writable: true,
|
|
218
|
+
value: "SliceGrouper"
|
|
219
|
+
});
|
|
220
|
+
Object.defineProperty(SliceGrouper, "classNames", {
|
|
221
|
+
enumerable: true,
|
|
222
|
+
configurable: true,
|
|
223
|
+
writable: true,
|
|
224
|
+
value: Entity.classNames.concat([SliceGrouper.className])
|
|
225
|
+
});
|
|
226
|
+
return SliceGrouper;
|
|
227
|
+
}(Entity));
|
|
228
|
+
export { SliceGrouper };
|
|
229
|
+
//# sourceMappingURL=SliceGrouper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SliceGrouper.js","sourceRoot":"","sources":["../../../../../src/.internal/plugins/sliceGrouper/SliceGrouper.ts"],"names":[],"mappings":";AAIA,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAClD,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AACtD,OAAO,EAAE,MAAM,EAAkD,MAAM,wBAAwB,CAAA;AAE/F,OAAO,KAAK,MAAM,MAAM,uBAAuB,CAAC;AAwDhD;;;;;GAKG;AACH;IAAkC,gCAAM;IAAxC;QAAA,qEAqMC;QA7LA;;WAEG;QACH;;;;;WAA8B;;IA0L/B,CAAC;;;;;eAvLA;YACC,iBAAM,SAA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,CAAC;;IAlMD;;;;eAAkC,cAAc;OAAC;IACjD;;;;eAA0C,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC;OAAC;IAmM9F,mBAAC;CAAA,AArMD,CAAkC,MAAM,GAqMvC;SArMY,YAAY","sourcesContent":["import type { DataItem } from \"../../core/render/Component\";\nimport type { PercentSeries, IPercentSeriesDataItem } from \"../../charts/percent/PercentSeries\";\nimport type { Legend } from \"../../core/render/Legend\";\n\nimport { Button } from \"../../core/render/Button\";\nimport { Graphics } from \"../../core/render/Graphics\";\nimport { Entity, IEntitySettings, IEntityPrivate, IEntityEvents } from \"../../core/util/Entity\"\n\nimport * as $array from \"../../core/util/Array\";\n\n\nexport interface ISliceGrouperSettings extends IEntitySettings {\n\n\t/**\n\t * A series that will be used to group slices on.\n\t */\n\tseries?: PercentSeries;\n\n\t/**\n\t * If set, plugin will try to manipulate the items in legend, such as\n\t * adding group slice, hiding items for small slices, etc.\n\t */\n\tlegend?: Legend;\n\n\t/**\n\t * Any slice which has percent value less than this setting will be grouped.\n\t * \n\t * @default 5\n\t */\n\tthreshold?: number;\n\n\t/**\n\t * If set, only X first slices will be left as they are. The rest of the\n\t * slices will be grouped.\n\t */\n\tlimit?: number;\n\n\t/**\n\t * Name (category) of the group slice.\n\t *\n\t * @default \"Other\"\n\t */\n\tgroupName?: string;\n\n\t/**\n\t * What happens when group slice is clicked.\n\t *\n\t * * `\"none\"` (default) - nothing.\n\t * * `\"break\"` - underlying small slices are shown.\n\t * * `\"zoom\"` - series shows only small slies (big ones are hidden).\n\t */\n\tclickBehavior?: \"none\" | \"break\" | \"zoom\";\n\n}\n\nexport interface ISliceGrouperPrivate extends IEntityPrivate {\n\tgroupDataItem?: DataItem<IPercentSeriesDataItem>;\n\tsmallDataItems?: DataItem<IPercentSeriesDataItem>[];\n}\n\nexport interface ISliceGrouperEvents extends IEntityEvents {\n}\n\n\n/**\n * A plugin that can be used to automatically group small slices on percent\n * charts into a single slice.\n *\n * @see {@link https://www.amcharts.com/docs/v5/charts/percent-charts/grouping-slices/} for more info\n */\nexport class SliceGrouper extends Entity {\n\tpublic static className: string = \"SliceGrouper\";\n\tpublic static classNames: Array<string> = Entity.classNames.concat([SliceGrouper.className]);\n\n\tdeclare public _settings: ISliceGrouperSettings;\n\tdeclare public _privateSettings: ISliceGrouperPrivate;\n\tdeclare public _events: ISliceGrouperEvents;\n\n\t/**\n\t * A button that is shown when chart small buttons are visible.\n\t */\n\tpublic zoomOutButton?: Button;\n\n\n\tprotected _afterNew(): void {\n\t\tsuper._afterNew();\n\t\tthis._setRawDefault(\"threshold\", 5);\n\t\tthis._setRawDefault(\"groupName\", \"Other\");\n\t\tthis._setRawDefault(\"clickBehavior\", \"none\");\n\t\tthis.initZoomButton();\n\t\tthis._root.addDisposer(this);\n\t}\n\n\tprivate initZoomButton(): void {\n\t\tconst clickBehavior = this.get(\"clickBehavior\");\n\t\tif (clickBehavior !== \"none\") {\n\t\t\tconst container = this.root.tooltipContainer;\n\t\t\tthis.zoomOutButton = container.children.push(Button.new(this._root, {\n\t\t\t\tthemeTags: [\"zoom\"],\n\t\t\t\ticon: Graphics.new(this._root, {\n\t\t\t\t\tthemeTags: [\"button\", \"icon\"]\n\t\t\t\t})\n\t\t\t}));\n\t\t\tthis.zoomOutButton.hide();\n\t\t\tthis.zoomOutButton.events.on(\"click\", () => {\n\t\t\t\tthis.zoomOut();\n\t\t\t});\n\t\t}\n\n\t}\n\n\tprivate handleData(): void {\n\t\tconst series = this.get(\"series\");\n\n\t\tif (series) {\n\n\t\t\t// Create group data item if not yet available\n\t\t\tlet groupDataItem = this.getPrivate(\"groupDataItem\");\n\t\t\tif (!groupDataItem) {\n\n\t\t\t\tconst legend = this.get(\"legend\");\n\t\t\t\tconst categoryField = series.get(\"categoryField\", \"category\");\n\t\t\t\tconst valueField = series.get(\"valueField\", \"value\");\n\n\t\t\t\t// Add slice\n\t\t\t\tconst groupSliceData: any = {};\n\t\t\t\tgroupSliceData[categoryField] = this.get(\"groupName\", \"\");\n\t\t\t\tgroupSliceData[valueField] = 0;\n\t\t\t\tseries.data.push(groupSliceData);\n\n\t\t\t\tgroupDataItem = series.dataItems[series.dataItems.length - 1];\n\n\t\t\t\tgroupDataItem.get(\"slice\").events.on(\"click\", () => {\n\t\t\t\t\tthis.handleClick();\n\t\t\t\t});\n\n\t\t\t\tthis.setPrivate(\"groupDataItem\", groupDataItem);\n\n\t\t\t\t// Add to legend\n\t\t\t\tif (legend) {\n\t\t\t\t\tlegend.data.push(groupDataItem);\n\n\t\t\t\t\t//const legendDataItem = groupDataItem.get(\"legendDataItem\");\n\t\t\t\t\tgroupDataItem.on(\"visible\", (visible) => {\n\t\t\t\t\t\tif (visible) {\n\t\t\t\t\t\t\tthis.zoomOut();\n\t\t\t\t\t\t}\n\t\t\t\t\t})\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t// Recalculate group value and decorate small slices as necessary\n\t\t\tconst threshold = this.get(\"threshold\", 0);\n\t\t\tconst limit = this.get(\"limit\", 1000);\n\t\t\tconst smallDataItems: any = [];\n\t\t\tlet groupValue = 0;\n\t\t\tif (threshold || limit) {\n\n\t\t\t\t$array.each(series.dataItems, (item, index) => {\n\t\t\t\t\tconst legendDataItem = item.get(\"legendDataItem\");\n\t\t\t\t\tif (((item.get(\"valuePercentTotal\") <= threshold) || (index > (limit - 1))) && groupDataItem !== item) {\n\t\t\t\t\t\tgroupValue += item.get(\"value\", 0);\n\t\t\t\t\t\tsmallDataItems.push(item);\n\t\t\t\t\t\titem.hide(0);\n\t\t\t\t\t\tif (legendDataItem) {\n\t\t\t\t\t\t\tlegendDataItem.get(\"itemContainer\").hide(0);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse if (legendDataItem) {\n\t\t\t\t\t\tlegendDataItem.get(\"itemContainer\").show(0);\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\tthis.setPrivate(\"smallDataItems\", smallDataItems);\n\t\t\t\tthis.updateGroupDataItem(groupValue);\n\n\t\t\t}\n\n\t\t}\n\t}\n\n\t/**\n\t * Resets slice setup to original grouping state.\n\t */\n\tpublic zoomOut(): void {\n\t\tconst groupDataItem = this.getPrivate(\"groupDataItem\");\n\t\tif (groupDataItem) {\n\t\t\tgroupDataItem.show();\n\t\t}\n\n\t\tconst smallDataItems = this.getPrivate(\"smallDataItems\", []);\n\t\t$array.each(smallDataItems, (item) => {\n\t\t\titem.hide();\n\t\t});\n\n\t\tif (this.zoomOutButton) {\n\t\t\tthis.zoomOutButton.hide();\n\t\t}\n\t}\n\n\tprivate updateGroupDataItem(groupValue: number): void {\n\t\tconst series = this.get(\"series\");\n\t\tif (series) {\n\t\t\tconst groupSliceData: any = {};\n\t\t\tconst categoryField = series.get(\"categoryField\", \"category\");\n\t\t\tconst valueField = series.get(\"valueField\", \"value\");\n\t\t\tgroupSliceData[categoryField] = this.get(\"groupName\", \"\");\n\t\t\tgroupSliceData[valueField] = groupValue;\n\t\t\tseries.data.setIndex(series.data.length - 1, groupSliceData);\n\n\t\t\tconst groupDataItem = this.getPrivate(\"groupDataItem\");\n\t\t\tif (groupValue == 0) {\n\t\t\t\tgroupDataItem!.hide(0);\n\t\t\t}\n\t\t\telse if (groupDataItem!.isHidden()) {\n\t\t\t\tgroupDataItem!.show();\n\t\t\t}\n\n\t\t\tconst clickBehavior = this.get(\"clickBehavior\");\n\t\t\tif (clickBehavior != \"none\") {\n\t\t\t\tgroupDataItem!.get(\"slice\").set(\"toggleKey\", \"none\");\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate handleClick(): void {\n\t\tconst clickBehavior = this.get(\"clickBehavior\");\n\t\tconst smallDataItems = this.getPrivate(\"smallDataItems\");\n\n\t\tif (clickBehavior == \"none\" || (smallDataItems && smallDataItems.length == 0)) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst series = this.get(\"series\");\n\t\tconst groupDataItem = this.getPrivate(\"groupDataItem\");\n\n\t\t// Hide group slice\n\t\tgroupDataItem!.hide();\n\n\t\t// Reveal small slices\n\t\t$array.each(series!.dataItems, (item) => {\n\t\t\tif (smallDataItems!.indexOf(item) !== -1) {\n\t\t\t\titem.show();\n\t\t\t}\n\t\t\telse if (clickBehavior == \"zoom\") {\n\t\t\t\titem.hide();\n\t\t\t}\n\t\t});\n\n\t\tthis.zoomOutButton!.show();\n\t}\n\n\tpublic _beforeChanged() {\n\t\tsuper._beforeChanged();\n\n\t\tif (this.isDirty(\"series\")) {\n\t\t\tconst series = this.get(\"series\");\n\t\t\tif (series) {\n\t\t\t\tseries.events.on(\"datavalidated\", (_ev) => {\n\t\t\t\t\tthis.handleData();\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\n\t}\n\n}"]}
|
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,20 @@ 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.0.19] - 2021-12-27
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
- `groupDataDisabled` setting added to XYSeries. If set to `false` will exclude series from data grouping mechanism, even if it is enabled on related `DateSeries`.
|
|
12
|
+
- New plugin `SliceGrouper`. Can be used to automatically group small slices on percent charts like Pie, Funnel, etc. [More info](https://www.amcharts.com/docs/v5/charts/percent-charts/grouping-slices/).
|
|
13
|
+
|
|
14
|
+
### Fixed
|
|
15
|
+
- If data was added to percent series after initial data was already processed, the bew slices would get colors from the start of the color set.
|
|
16
|
+
- Multiple square bracket and apostrophe escaping was not working properly.
|
|
17
|
+
- A JS error could occur when changing `XYSeries` data with less data items then there were before.
|
|
18
|
+
- `PieSeries` were not arranging its labels properly in some cases.
|
|
19
|
+
- `XYCursor` taps were not working properly after chart zoom on touch devices.
|
|
20
|
+
|
|
21
|
+
|
|
8
22
|
## [5.0.18] - 2021-12-19
|
|
9
23
|
|
|
10
24
|
### Changed
|