@amcharts/amcharts5 5.9.5 → 5.9.7
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/stock/drawing/DoodleSeries.d.ts.map +1 -1
- package/.internal/charts/stock/drawing/DoodleSeries.js +0 -6
- package/.internal/charts/stock/drawing/DoodleSeries.js.map +1 -1
- package/.internal/charts/stock/drawing/DrawingSeries.d.ts +1 -1
- package/.internal/charts/stock/drawing/DrawingSeries.d.ts.map +1 -1
- package/.internal/charts/stock/drawing/DrawingSeries.js +8 -36
- package/.internal/charts/stock/drawing/DrawingSeries.js.map +1 -1
- package/.internal/charts/stock/drawing/LabelSeries.d.ts.map +1 -1
- package/.internal/charts/stock/drawing/LabelSeries.js +3 -1
- package/.internal/charts/stock/drawing/LabelSeries.js.map +1 -1
- package/.internal/charts/stock/drawing/PolylineSeries.js +0 -1
- package/.internal/charts/stock/drawing/PolylineSeries.js.map +1 -1
- package/.internal/charts/stock/toolbar/StockIcons.js +1 -1
- package/.internal/charts/stock/toolbar/StockIcons.js.map +1 -1
- package/.internal/charts/xy/XYChartDefaultTheme.d.ts.map +1 -1
- package/.internal/charts/xy/XYChartDefaultTheme.js +2 -0
- package/.internal/charts/xy/XYChartDefaultTheme.js.map +1 -1
- package/.internal/charts/xy/axes/ValueAxis.d.ts.map +1 -1
- package/.internal/charts/xy/axes/ValueAxis.js +6 -0
- package/.internal/charts/xy/axes/ValueAxis.js.map +1 -1
- package/.internal/core/Registry.js +1 -1
- package/.internal/core/Registry.js.map +1 -1
- package/.internal/core/render/EditableLabel.d.ts +7 -0
- package/.internal/core/render/EditableLabel.d.ts.map +1 -1
- package/.internal/core/render/EditableLabel.js +54 -1
- package/.internal/core/render/EditableLabel.js.map +1 -1
- package/.internal/core/render/Graphics.d.ts.map +1 -1
- package/.internal/core/render/Graphics.js +1 -19
- package/.internal/core/render/Graphics.js.map +1 -1
- package/.internal/core/util/Utils.d.ts +29 -7
- package/.internal/core/util/Utils.d.ts.map +1 -1
- package/.internal/core/util/Utils.js +43 -8
- package/.internal/core/util/Utils.js.map +1 -1
- package/.internal/themes/DefaultTheme.d.ts.map +1 -1
- package/.internal/themes/DefaultTheme.js +2 -1
- package/.internal/themes/DefaultTheme.js.map +1 -1
- package/CHANGELOG.md +23 -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 +2 -0
- package/index.d.ts.map +1 -1
- package/index.js +2 -0
- package/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -5,6 +5,7 @@ import { Percent } from "../util/Percent";
|
|
|
5
5
|
import { color } from "../util/Color";
|
|
6
6
|
import * as $utils from "../util/Utils";
|
|
7
7
|
import * as $type from "../util/Type";
|
|
8
|
+
import * as $array from "../util/Array";
|
|
8
9
|
/**
|
|
9
10
|
* Editable label.
|
|
10
11
|
*
|
|
@@ -72,6 +73,10 @@ export class EditableLabel extends Label {
|
|
|
72
73
|
this.setPrivate("textarea", textarea);
|
|
73
74
|
// Resize textarea on keypress
|
|
74
75
|
textarea.addEventListener("input", _ev => {
|
|
76
|
+
if (this.get("multiLine") === false) {
|
|
77
|
+
// replace line breaks with spaces for single-line labels
|
|
78
|
+
textarea.value = textarea.value.replace(/\n/g, " ");
|
|
79
|
+
}
|
|
75
80
|
this.set("text", textarea.value);
|
|
76
81
|
this._syncStyle();
|
|
77
82
|
});
|
|
@@ -85,6 +90,14 @@ export class EditableLabel extends Label {
|
|
|
85
90
|
}
|
|
86
91
|
}));
|
|
87
92
|
}
|
|
93
|
+
// Intercept ENTER if necessary
|
|
94
|
+
this._disposers.push($utils.addEventListener(document, "keydown", (ev) => {
|
|
95
|
+
if ($utils.getEventKey(ev) == "Enter" && this.get("multiLine") === false) {
|
|
96
|
+
// Single-line label, save instead of breaking into new line
|
|
97
|
+
ev.preventDefault();
|
|
98
|
+
this.set("active", false);
|
|
99
|
+
}
|
|
100
|
+
}));
|
|
88
101
|
this.events.dispatch("inited", {
|
|
89
102
|
type: "inited",
|
|
90
103
|
target: this
|
|
@@ -137,6 +150,13 @@ export class EditableLabel extends Label {
|
|
|
137
150
|
const input = this.getPrivate("input");
|
|
138
151
|
const textarea = this.getPrivate("textarea");
|
|
139
152
|
if (textarea) {
|
|
153
|
+
// Set up HTML
|
|
154
|
+
const el = input.getPrivate("htmlElement");
|
|
155
|
+
// Reset all styles
|
|
156
|
+
const computedStyles = window.getComputedStyle(textarea);
|
|
157
|
+
$array.each(computedStyles, (style) => {
|
|
158
|
+
textarea.style[style] = "initial";
|
|
159
|
+
});
|
|
140
160
|
// Remove textarea attributes
|
|
141
161
|
textarea.style.color = this.get("fill", color(0x000000)).toCSS(this.get("fillOpacity", 1));
|
|
142
162
|
textarea.style.backgroundColor = "rgba(0, 0, 0, 0)";
|
|
@@ -149,8 +169,15 @@ export class EditableLabel extends Label {
|
|
|
149
169
|
// Place carret under mouse cursor
|
|
150
170
|
// @todo
|
|
151
171
|
// Size
|
|
172
|
+
// Handle maxWidth
|
|
152
173
|
textarea.style.overflow = "hidden";
|
|
153
|
-
|
|
174
|
+
const maxWidth = this.get("maxWidth", 0) - this.get("paddingLeft", 0) - this.get("paddingRight", 0);
|
|
175
|
+
if (maxWidth > 0) {
|
|
176
|
+
textarea.style.maxWidth = maxWidth + "px";
|
|
177
|
+
}
|
|
178
|
+
else {
|
|
179
|
+
textarea.style.minWidth = textarea.scrollWidth + "px";
|
|
180
|
+
}
|
|
154
181
|
textarea.style.height = "auto";
|
|
155
182
|
textarea.style.minHeight = textarea.scrollHeight + "px";
|
|
156
183
|
// Line height
|
|
@@ -197,6 +224,32 @@ export class EditableLabel extends Label {
|
|
|
197
224
|
fontStyle = fontStyle;
|
|
198
225
|
}
|
|
199
226
|
textarea.style.fontStyle = fontStyle;
|
|
227
|
+
const oversizeBehavior = this.get("oversizedBehavior");
|
|
228
|
+
if (oversizeBehavior == "wrap") {
|
|
229
|
+
textarea.style.whiteSpace = "pre-wrap";
|
|
230
|
+
}
|
|
231
|
+
else {
|
|
232
|
+
textarea.style.whiteSpace = "nowrap";
|
|
233
|
+
}
|
|
234
|
+
// Adjust textarea postion based on textAlign setting
|
|
235
|
+
this._root.events.on("frameended", () => {
|
|
236
|
+
const textAlign = this.get("textAlign", "start");
|
|
237
|
+
if (textAlign == "center") {
|
|
238
|
+
textarea.style.textAlign = "center";
|
|
239
|
+
if (!el.style.transform.match(/translateX/)) {
|
|
240
|
+
el.style.transform += " translateX(-50%)";
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
else if (textAlign == "end") {
|
|
244
|
+
textarea.style.textAlign = "right";
|
|
245
|
+
if (!el.style.transform.match(/translateX/)) {
|
|
246
|
+
el.style.transform += "translateX(-100%)";
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
else {
|
|
250
|
+
textarea.style.textAlign = textAlign;
|
|
251
|
+
}
|
|
252
|
+
});
|
|
200
253
|
}
|
|
201
254
|
}
|
|
202
255
|
_syncText() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EditableLabel.js","sourceRoot":"","sources":["../../../../../src/.internal/core/render/EditableLabel.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAA+C,MAAM,SAAS,CAAC;AAC7E,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAA;AACzC,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAGtC,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AACvC,OAAO,KAAK,KAAK,MAAM,cAAc,CAAA;AA8BrC;;;;GAIG;AACH,MAAM,OAAO,aAAc,SAAQ,KAAK;IAS7B,SAAS;QAClB,KAAK,CAAC,SAAS,EAAE,CAAC;QAElB,MAAM,KAAK,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,EAAE;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G,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC;QAC7C,IAAI,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;QAChC,IAAI,IAAI,IAAI,GAAG,EAAE;YAChB,IAAI,GAAG,EAAE,CAAC;SACV;QACD,IAAI,QAAQ,EAAE;YACb,QAAQ,CAAC,KAAK,GAAG,IAAI,CAAC;SACtB;IACF,CAAC;;AAzOD;;;;WAAkC,eAAe;GAAC;AAClD;;;;WAA0C,KAAK,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,aAAa,CAAC,SAAS,CAAC,CAAC;GAAC","sourcesContent":["import { Label, ILabelPrivate, ILabelSettings, ILabelEvents } from \"./Label\";\nimport { Container } from \"./Container\";\nimport { RoundedRectangle } from \"./RoundedRectangle\";\nimport { Percent } from \"../util/Percent\"\nimport { color } from \"../util/Color\";\n\n\nimport * as $utils from \"../util/Utils\"\nimport * as $type from \"../util/Type\"\n\nexport interface IEditableLabelSettings extends ILabelSettings {\n\n\t/**\n\t * Start editing on click (`\"click\"`; default) or double-click ('\"dblclick\"').\n\t *\n\t * All available options:\n\t *\n\t * *`\"click\"` (default)\n\t * *`\"dblclick\"`\n\t * *`\"rightclick\"`\n\t * *`\"middleclick\"`\n\t * *`\"none\"`\n\t *\n\t * @default \"click\"\n\t */\n\teditOn?: \"click\" | \"dblclick\" | \"rightclick\" | \"middleclick\" | \"none\";\n\n}\n\nexport interface IEditableLabelPrivate extends ILabelPrivate {\n\tinput: Container;\n\ttextarea: HTMLTextAreaElement;\n}\n\nexport interface IEditableLabelEvents extends ILabelEvents {\n\tinited: {};\n}\n\n/**\n * Editable label.\n *\n * @since 5.9.5\n */\nexport class EditableLabel extends Label {\n\n\tdeclare public _settings: IEditableLabelSettings;\n\tdeclare public _privateSettings: IEditableLabelPrivate;\n\tdeclare public _events: IEditableLabelEvents;\n\n\tpublic static className: string = \"EditableLabel\";\n\tpublic static classNames: Array<string> = Label.classNames.concat([EditableLabel.className]);\n\n\tprotected _afterNew() {\n\t\tsuper._afterNew();\n\n\t\tconst input = this.children.push(Container.new(this._root, {\n\t\t\thtml: \"<textarea class=\\\"am5-editable-label\\\"></textarea>\",\n\t\t\tisMeasured: false\n\t\t}));\n\n\t\tinput.hide();\n\n\t\tconst editOn: any = this.get(\"editOn\", \"click\");\n\n\t\tif (editOn != \"none\") {\n\t\t\tinput.events.on(editOn, (_ev) => {\n\t\t\t\t// this is here just to make it interactive\n\t\t\t});\n\n\t\t\tthis.events.on(editOn, (_ev) => {\n\t\t\t\tthis.set(\"active\", true);\n\t\t\t});\n\t\t}\n\n\t\tthis.setPrivate(\"input\", input);\n\n\t\t// Set background\n\t\tlet background = this.get(\"background\");\n\n\t\tif (!background) {\n\t\t\tbackground = this.set(\"background\", RoundedRectangle.new(this._root, {\n\t\t\t\tthemeTags: [\"editablelabel\", \"background\"]\n\t\t\t}));\n\t\t}\n\t\telse {\n\t\t\tbackground.set(\"themeTags\", [\"editablelabel\", \"background\"]);\n\t\t}\n\n\t}\n\n\tpublic _prepareChildren() {\n\t\tsuper._prepareChildren();\n\t\tthis._maybeInitTextarea();\n\t}\n\n\tpublic _updateChildren() {\n\t\tsuper._updateChildren();\n\n\t\tif (this.isDirty(\"active\")) {\n\n\t\t\tconst editing = this.get(\"active\", false);\n\t\t\tif (editing) {\n\t\t\t\tthis._startEditing();\n\t\t\t}\n\t\t\telse {\n\t\t\t\tthis._stopEditing();\n\t\t\t}\n\n\t\t\tconst bg = this.get(\"background\");\n\t\t\tif (bg) {\n\t\t\t\tbg.set(\"active\", editing);\n\t\t\t}\n\t\t};\n\n\t\tthis._syncText();\n\t\tthis._syncStyle();\n\t}\n\n\tprotected _maybeInitTextarea() {\n\t\tif (!this._isInited()) {\n\t\t\tconst input = this.getPrivate(\"input\");\n\t\t\tif (input && input.getPrivate(\"htmlElement\")) {\n\t\t\t\tconst el = input.getPrivate(\"htmlElement\")!;\n\t\t\t\tconst textarea = el.querySelector(\".am5-editable-label\") as HTMLTextAreaElement;\n\t\t\t\tif (textarea) {\n\t\t\t\t\tthis.setPrivate(\"textarea\", textarea as HTMLTextAreaElement);\n\n\t\t\t\t\t// Resize textarea on keypress\n\t\t\t\t\ttextarea.addEventListener(\"input\", _ev => {\n\t\t\t\t\t\tthis.set(\"text\", textarea.value);\n\t\t\t\t\t\tthis._syncStyle();\n\t\t\t\t\t});\n\n\t\t\t\t\t// Finish editing on blur\n\t\t\t\t\ttextarea.addEventListener(\"blur\", _ev => this.set(\"active\", false));\n\n\t\t\t\t\t// Finish editing on ESC press\n\t\t\t\t\tif ($utils.supports(\"keyboardevents\")) {\n\t\t\t\t\t\tthis._disposers.push($utils.addEventListener(document, \"keydown\", (ev: KeyboardEvent) => {\n\t\t\t\t\t\t\tif ($utils.getEventKey(ev) == \"Escape\") {\n\t\t\t\t\t\t\t\tthis.set(\"active\", false);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}));\n\t\t\t\t\t}\n\n\t\t\t\t\tthis.events.dispatch(\"inited\", {\n\t\t\t\t\t\ttype: \"inited\",\n\t\t\t\t\t\ttarget: this\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tprotected _isInited(): boolean {\n\t\treturn this.getPrivate(\"textarea\") ? true : false;\n\t}\n\n\tprotected _startEditing() {\n\t\tif (!this._isInited()) {\n\t\t\tthis.events.once(\"inited\", () => {\n\t\t\t\tthis._startEditing();\n\t\t\t});\n\t\t\treturn;\n\t\t}\n\t\tthis._text.set(\"opacity\", 0);\n\t\tconst input = this.getPrivate(\"input\");\n\t\tconst textarea = this.getPrivate(\"textarea\");\n\t\tif (textarea) {\n\t\t\tif (this.get(\"text\", \"\") == \"\") {\n\t\t\t\tthis.set(\"text\", \" \");\n\t\t\t}\n\t\t\tinput.show(0);\n\t\t\tthis.setTimeout(() => {\n\t\t\t\t// size textarea to fit its actual content\n\t\t\t\tthis._syncStyle();\n\t\t\t\ttextarea.focus();\n\t\t\t}, 100);\n\t\t}\n\t}\n\n\tprotected _stopEditing() {\n\t\tif (!this._isInited()) {\n\t\t\tthis.events.once(\"inited\", () => {\n\t\t\t\tthis._stopEditing();\n\t\t\t});\n\t\t\treturn;\n\t\t}\n\t\tconst input = this.getPrivate(\"input\");\n\t\tconst textarea = this.getPrivate(\"textarea\");\n\t\tif (textarea) {\n\t\t\tthis.set(\"text\", textarea.value);\n\t\t\tinput.hide(0);\n\t\t\tthis._text.set(\"opacity\", 1);\n\t\t}\n\t}\n\n\tprotected _syncStyle() {\n\t\tconst input = this.getPrivate(\"input\");\n\t\tconst textarea = this.getPrivate(\"textarea\");\n\t\tif (textarea) {\n\t\t\t// Remove textarea attributes\n\t\t\ttextarea.style.color = this.get(\"fill\", color(0x000000)).toCSS(this.get(\"fillOpacity\", 1));\n\t\t\ttextarea.style.backgroundColor = \"rgba(0, 0, 0, 0)\";\n\t\t\ttextarea.style.border = \"none\";\n\t\t\ttextarea.style.outline = \"none\";\n\t\t\ttextarea.style.padding = \"0\";\n\n\t\t\t// Wrapping\n\t\t\ttextarea.wrap = \"off\";\n\t\t\ttextarea.style.resize = \"none\";\n\n\t\t\t// Place carret under mouse cursor\n\t\t\t// @todo\n\n\t\t\t// Size\n\t\t\ttextarea.style.overflow = \"hidden\";\n\t\t\ttextarea.style.minWidth = textarea.scrollWidth + \"px\";\n\n\t\t\ttextarea.style.height = \"auto\";\n\t\t\ttextarea.style.minHeight = textarea.scrollHeight + \"px\";\n\n\t\t\t// Line height\n\t\t\tconst lineHeight = this.get(\"lineHeight\");\n\t\t\tif (!lineHeight) {\n\t\t\t\ttextarea.style.lineHeight = \"1.2\";\n\t\t\t}\n\t\t\telse if (lineHeight instanceof Percent) {\n\t\t\t\ttextarea.style.lineHeight = lineHeight.value + \"\";\n\t\t\t}\n\t\t\telse if ($type.isNumber(lineHeight)) {\n\t\t\t\ttextarea.style.lineHeight = lineHeight + \"\";\n\t\t\t}\n\n\t\t\t// Font stuff\n\t\t\tlet fontFamily: any = this.get(\"fontFamily\");\n\t\t\tif (!fontFamily) {\n\t\t\t\tfontFamily = getComputedStyle(input.getPrivate(\"htmlElement\")!, \"font-family\").getPropertyValue(\"font-family\");\n\t\t\t}\n\t\t\ttextarea.style.fontFamily = fontFamily;\n\n\t\t\tlet fontSize: any = this.get(\"fontSize\");\n\t\t\tif (!fontSize) {\n\t\t\t\tfontSize = getComputedStyle(input.getPrivate(\"htmlElement\")!, \"font-size\").getPropertyValue(\"font-size\");\n\t\t\t}\n\t\t\telse if ($type.isNumber(fontSize)) {\n\t\t\t\tfontSize = fontSize + \"px\";\n\t\t\t}\n\t\t\telse {\n\t\t\t\tfontSize = fontSize;\n\t\t\t}\n\t\t\ttextarea.style.fontSize = fontSize;\n\n\t\t\tlet fontWeight: any = this.get(\"fontWeight\");\n\t\t\tif (!fontWeight) {\n\t\t\t\tfontWeight = getComputedStyle(input.getPrivate(\"htmlElement\")!, \"font-weight\").getPropertyValue(\"font-weight\");\n\t\t\t}\n\t\t\telse {\n\t\t\t\tfontWeight = fontWeight;\n\t\t\t}\n\t\t\ttextarea.style.fontWeight = fontWeight;\n\n\t\t\tlet fontStyle: any = this.get(\"fontStyle\");\n\t\t\tif (!fontStyle) {\n\t\t\t\tfontStyle = getComputedStyle(input.getPrivate(\"htmlElement\")!, \"font-style\").getPropertyValue(\"font-style\");\n\t\t\t}\n\t\t\telse {\n\t\t\t\tfontStyle = fontStyle;\n\t\t\t}\n\t\t\ttextarea.style.fontStyle = fontStyle;\n\t\t}\n\t}\n\n\tprotected _syncText() {\n\t\tconst textarea = this.getPrivate(\"textarea\");\n\t\tlet text = this.get(\"text\", \"\");\n\t\tif (text == \" \") {\n\t\t\ttext = \"\";\n\t\t}\n\t\tif (textarea) {\n\t\t\ttextarea.value = text;\n\t\t}\n\t}\n\n}"]}
|
|
1
|
+
{"version":3,"file":"EditableLabel.js","sourceRoot":"","sources":["../../../../../src/.internal/core/render/EditableLabel.ts"],"names":[],"mappings":"AAAA,O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SAAS,IAAI,KAAK,EAAE;oBAC5B,QAAQ,CAAC,KAAK,CAAC,SAAS,GAAG,OAAO,CAAC;oBACnC,IAAI,CAAC,EAAE,CAAC,KAAK,CAAC,SAAS,CAAC,KAAK,CAAC,YAAY,CAAC,EAAE;wBAC5C,EAAE,CAAC,KAAK,CAAC,SAAS,IAAI,mBAAmB,CAAC;qBAC1C;iBACD;qBACI;oBACJ,QAAQ,CAAC,KAAK,CAAC,SAAS,GAAG,SAAS,CAAC;iBACrC;YACF,CAAC,CAAC,CAAC;SAEH;IACF,CAAC;IAES,SAAS;QAClB,MAAM,QAAQ,GAAG,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC;QAC7C,IAAI,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;QAChC,IAAI,IAAI,IAAI,GAAG,EAAE;YAChB,IAAI,GAAG,EAAE,CAAC;SACV;QACD,IAAI,QAAQ,EAAE;YACb,QAAQ,CAAC,KAAK,GAAG,IAAI,CAAC;SACtB;IACF,CAAC;;AAnSD;;;;WAAkC,eAAe;GAAC;AAClD;;;;WAA0C,KAAK,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,aAAa,CAAC,SAAS,CAAC,CAAC;GAAC","sourcesContent":["import { Label, ILabelPrivate, ILabelSettings, ILabelEvents } from \"./Label\";\nimport { Container } from \"./Container\";\nimport { RoundedRectangle } from \"./RoundedRectangle\";\nimport { Percent } from \"../util/Percent\"\nimport { color } from \"../util/Color\";\n\n\nimport * as $utils from \"../util/Utils\"\nimport * as $type from \"../util/Type\"\nimport * as $array from \"../util/Array\"\n\nexport interface IEditableLabelSettings extends ILabelSettings {\n\n\t/**\n\t * Start editing on click (`\"click\"`; default) or double-click ('\"dblclick\"').\n\t *\n\t * All available options:\n\t *\n\t * *`\"click\"` (default)\n\t * *`\"dblclick\"`\n\t * *`\"rightclick\"`\n\t * *`\"middleclick\"`\n\t * *`\"none\"`\n\t *\n\t * @default \"click\"\n\t */\n\teditOn?: \"click\" | \"dblclick\" | \"rightclick\" | \"middleclick\" | \"none\";\n\n\t/**\n\t * Allow multiple lines (`true` - dfault) or no (`false`).\n\t *\n\t * @default true\n\t * @since 5.9.6\n\t */\n\tmultiLine?: boolean;\n\n}\n\nexport interface IEditableLabelPrivate extends ILabelPrivate {\n\tinput: Container;\n\ttextarea: HTMLTextAreaElement;\n}\n\nexport interface IEditableLabelEvents extends ILabelEvents {\n\tinited: {};\n}\n\n/**\n * Editable label.\n *\n * @since 5.9.5\n */\nexport class EditableLabel extends Label {\n\n\tdeclare public _settings: IEditableLabelSettings;\n\tdeclare public _privateSettings: IEditableLabelPrivate;\n\tdeclare public _events: IEditableLabelEvents;\n\n\tpublic static className: string = \"EditableLabel\";\n\tpublic static classNames: Array<string> = Label.classNames.concat([EditableLabel.className]);\n\n\tprotected _afterNew() {\n\t\tsuper._afterNew();\n\n\t\tconst input = this.children.push(Container.new(this._root, {\n\t\t\thtml: \"<textarea class=\\\"am5-editable-label\\\"></textarea>\",\n\t\t\tisMeasured: false\n\t\t}));\n\n\t\tinput.hide();\n\n\t\tconst editOn: any = this.get(\"editOn\", \"click\");\n\n\t\tif (editOn != \"none\") {\n\t\t\tinput.events.on(editOn, (_ev) => {\n\t\t\t\t// this is here just to make it interactive\n\t\t\t});\n\n\t\t\tthis.events.on(editOn, (_ev) => {\n\t\t\t\tthis.set(\"active\", true);\n\t\t\t});\n\t\t}\n\n\t\tthis.setPrivate(\"input\", input);\n\n\t\t// Set background\n\t\tlet background = this.get(\"background\");\n\n\t\tif (!background) {\n\t\t\tbackground = this.set(\"background\", RoundedRectangle.new(this._root, {\n\t\t\t\tthemeTags: [\"editablelabel\", \"background\"]\n\t\t\t}));\n\t\t}\n\t\telse {\n\t\t\tbackground.set(\"themeTags\", [\"editablelabel\", \"background\"]);\n\t\t}\n\n\t}\n\n\tpublic _prepareChildren() {\n\t\tsuper._prepareChildren();\n\t\tthis._maybeInitTextarea();\n\t}\n\n\tpublic _updateChildren() {\n\t\tsuper._updateChildren();\n\n\t\tif (this.isDirty(\"active\")) {\n\n\t\t\tconst editing = this.get(\"active\", false);\n\t\t\tif (editing) {\n\t\t\t\tthis._startEditing();\n\t\t\t}\n\t\t\telse {\n\t\t\t\tthis._stopEditing();\n\t\t\t}\n\n\t\t\tconst bg = this.get(\"background\");\n\t\t\tif (bg) {\n\t\t\t\tbg.set(\"active\", editing);\n\t\t\t}\n\t\t};\n\n\t\tthis._syncText();\n\t\tthis._syncStyle();\n\t}\n\n\tprotected _maybeInitTextarea() {\n\t\tif (!this._isInited()) {\n\t\t\tconst input = this.getPrivate(\"input\");\n\t\t\tif (input && input.getPrivate(\"htmlElement\")) {\n\t\t\t\tconst el = input.getPrivate(\"htmlElement\")!;\n\t\t\t\tconst textarea = el.querySelector(\".am5-editable-label\") as HTMLTextAreaElement;\n\t\t\t\tif (textarea) {\n\t\t\t\t\tthis.setPrivate(\"textarea\", textarea as HTMLTextAreaElement);\n\n\t\t\t\t\t// Resize textarea on keypress\n\t\t\t\t\ttextarea.addEventListener(\"input\", _ev => {\n\t\t\t\t\t\tif (this.get(\"multiLine\") === false) {\n\t\t\t\t\t\t\t// replace line breaks with spaces for single-line labels\n\t\t\t\t\t\t\ttextarea.value = textarea.value.replace(/\\n/g, \" \");\n\t\t\t\t\t\t}\n\t\t\t\t\t\tthis.set(\"text\", textarea.value);\n\t\t\t\t\t\tthis._syncStyle();\n\t\t\t\t\t});\n\n\t\t\t\t\t// Finish editing on blur\n\t\t\t\t\ttextarea.addEventListener(\"blur\", _ev => this.set(\"active\", false));\n\n\t\t\t\t\t// Finish editing on ESC press\n\t\t\t\t\tif ($utils.supports(\"keyboardevents\")) {\n\t\t\t\t\t\tthis._disposers.push($utils.addEventListener(document, \"keydown\", (ev: KeyboardEvent) => {\n\t\t\t\t\t\t\tif ($utils.getEventKey(ev) == \"Escape\") {\n\t\t\t\t\t\t\t\tthis.set(\"active\", false);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}));\n\t\t\t\t\t}\n\n\t\t\t\t\t// Intercept ENTER if necessary\n\t\t\t\t\tthis._disposers.push($utils.addEventListener(document, \"keydown\", (ev: KeyboardEvent) => {\n\t\t\t\t\t\tif ($utils.getEventKey(ev) == \"Enter\" && this.get(\"multiLine\") === false) {\n\t\t\t\t\t\t\t// Single-line label, save instead of breaking into new line\n\t\t\t\t\t\t\tev.preventDefault();\n\t\t\t\t\t\t\tthis.set(\"active\", false);\n\t\t\t\t\t\t}\n\t\t\t\t\t}));\n\n\t\t\t\t\tthis.events.dispatch(\"inited\", {\n\t\t\t\t\t\ttype: \"inited\",\n\t\t\t\t\t\ttarget: this\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tprotected _isInited(): boolean {\n\t\treturn this.getPrivate(\"textarea\") ? true : false;\n\t}\n\n\tprotected _startEditing() {\n\t\tif (!this._isInited()) {\n\t\t\tthis.events.once(\"inited\", () => {\n\t\t\t\tthis._startEditing();\n\t\t\t});\n\t\t\treturn;\n\t\t}\n\t\tthis._text.set(\"opacity\", 0);\n\t\tconst input = this.getPrivate(\"input\");\n\t\tconst textarea = this.getPrivate(\"textarea\");\n\t\tif (textarea) {\n\t\t\tif (this.get(\"text\", \"\") == \"\") {\n\t\t\t\tthis.set(\"text\", \" \");\n\t\t\t}\n\t\t\tinput.show(0);\n\t\t\tthis.setTimeout(() => {\n\t\t\t\t// size textarea to fit its actual content\n\t\t\t\tthis._syncStyle();\n\t\t\t\ttextarea.focus();\n\t\t\t}, 100);\n\t\t}\n\t}\n\n\tprotected _stopEditing() {\n\t\tif (!this._isInited()) {\n\t\t\tthis.events.once(\"inited\", () => {\n\t\t\t\tthis._stopEditing();\n\t\t\t});\n\t\t\treturn;\n\t\t}\n\t\tconst input = this.getPrivate(\"input\");\n\t\tconst textarea = this.getPrivate(\"textarea\");\n\t\tif (textarea) {\n\t\t\tthis.set(\"text\", textarea.value);\n\t\t\tinput.hide(0);\n\t\t\tthis._text.set(\"opacity\", 1);\n\t\t}\n\t}\n\n\tprotected _syncStyle() {\n\t\tconst input = this.getPrivate(\"input\");\n\t\tconst textarea = this.getPrivate(\"textarea\");\n\t\tif (textarea) {\n\t\t\t// Set up HTML\n\t\t\tconst el = input.getPrivate(\"htmlElement\")!;\n\n\t\t\t// Reset all styles\n\t\t\tconst computedStyles = window.getComputedStyle(textarea);\n\t\t\t$array.each(computedStyles, (style: any) => {\n\t\t\t\ttextarea.style[style] = \"initial\";\n\t\t\t});\n\n\t\t\t// Remove textarea attributes\n\t\t\ttextarea.style.color = this.get(\"fill\", color(0x000000)).toCSS(this.get(\"fillOpacity\", 1));\n\t\t\ttextarea.style.backgroundColor = \"rgba(0, 0, 0, 0)\";\n\t\t\ttextarea.style.border = \"none\";\n\t\t\ttextarea.style.outline = \"none\";\n\t\t\ttextarea.style.padding = \"0\";\n\n\t\t\t// Wrapping\n\t\t\ttextarea.wrap = \"off\";\n\t\t\ttextarea.style.resize = \"none\";\n\n\t\t\t// Place carret under mouse cursor\n\t\t\t// @todo\n\n\t\t\t// Size\n\t\t\t// Handle maxWidth\n\t\t\ttextarea.style.overflow = \"hidden\";\n\t\t\tconst maxWidth = this.get(\"maxWidth\", 0) - this.get(\"paddingLeft\", 0) - this.get(\"paddingRight\", 0);\n\t\t\tif (maxWidth > 0) {\n\t\t\t\ttextarea.style.maxWidth = maxWidth + \"px\";\n\t\t\t}\n\t\t\telse {\n\t\t\t\ttextarea.style.minWidth = textarea.scrollWidth + \"px\";\n\t\t\t}\n\n\t\t\ttextarea.style.height = \"auto\";\n\t\t\ttextarea.style.minHeight = textarea.scrollHeight + \"px\";\n\n\t\t\t// Line height\n\t\t\tconst lineHeight = this.get(\"lineHeight\");\n\t\t\tif (!lineHeight) {\n\t\t\t\ttextarea.style.lineHeight = \"1.2\";\n\t\t\t}\n\t\t\telse if (lineHeight instanceof Percent) {\n\t\t\t\ttextarea.style.lineHeight = lineHeight.value + \"\";\n\t\t\t}\n\t\t\telse if ($type.isNumber(lineHeight)) {\n\t\t\t\ttextarea.style.lineHeight = lineHeight + \"\";\n\t\t\t}\n\n\t\t\t// Font stuff\n\t\t\tlet fontFamily: any = this.get(\"fontFamily\");\n\t\t\tif (!fontFamily) {\n\t\t\t\tfontFamily = getComputedStyle(input.getPrivate(\"htmlElement\")!, \"font-family\").getPropertyValue(\"font-family\");\n\t\t\t}\n\t\t\ttextarea.style.fontFamily = fontFamily;\n\n\t\t\tlet fontSize: any = this.get(\"fontSize\");\n\t\t\tif (!fontSize) {\n\t\t\t\tfontSize = getComputedStyle(input.getPrivate(\"htmlElement\")!, \"font-size\").getPropertyValue(\"font-size\");\n\t\t\t}\n\t\t\telse if ($type.isNumber(fontSize)) {\n\t\t\t\tfontSize = fontSize + \"px\";\n\t\t\t}\n\t\t\telse {\n\t\t\t\tfontSize = fontSize;\n\t\t\t}\n\t\t\ttextarea.style.fontSize = fontSize;\n\n\t\t\tlet fontWeight: any = this.get(\"fontWeight\");\n\t\t\tif (!fontWeight) {\n\t\t\t\tfontWeight = getComputedStyle(input.getPrivate(\"htmlElement\")!, \"font-weight\").getPropertyValue(\"font-weight\");\n\t\t\t}\n\t\t\telse {\n\t\t\t\tfontWeight = fontWeight;\n\t\t\t}\n\t\t\ttextarea.style.fontWeight = fontWeight;\n\n\t\t\tlet fontStyle: any = this.get(\"fontStyle\");\n\t\t\tif (!fontStyle) {\n\t\t\t\tfontStyle = getComputedStyle(input.getPrivate(\"htmlElement\")!, \"font-style\").getPropertyValue(\"font-style\");\n\t\t\t}\n\t\t\telse {\n\t\t\t\tfontStyle = fontStyle;\n\t\t\t}\n\t\t\ttextarea.style.fontStyle = fontStyle;\n\n\t\t\tconst oversizeBehavior = this.get(\"oversizedBehavior\");\n\t\t\tif (oversizeBehavior == \"wrap\") {\n\t\t\t\ttextarea.style.whiteSpace = \"pre-wrap\";\n\t\t\t}\n\t\t\telse {\n\t\t\t\ttextarea.style.whiteSpace = \"nowrap\";\n\t\t\t}\n\n\t\t\t// Adjust textarea postion based on textAlign setting\n\t\t\tthis._root.events.on(\"frameended\", () => {\n\t\t\t\tconst textAlign = this.get(\"textAlign\", \"start\");\n\t\t\t\tif (textAlign == \"center\") {\n\t\t\t\t\ttextarea.style.textAlign = \"center\";\n\t\t\t\t\tif (!el.style.transform.match(/translateX/)) {\n\t\t\t\t\t\tel.style.transform += \" translateX(-50%)\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if (textAlign == \"end\") {\n\t\t\t\t\ttextarea.style.textAlign = \"right\";\n\t\t\t\t\tif (!el.style.transform.match(/translateX/)) {\n\t\t\t\t\t\tel.style.transform += \"translateX(-100%)\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\ttextarea.style.textAlign = textAlign;\n\t\t\t\t}\n\t\t\t});\n\n\t\t}\n\t}\n\n\tprotected _syncText() {\n\t\tconst textarea = this.getPrivate(\"textarea\");\n\t\tlet text = this.get(\"text\", \"\");\n\t\tif (text == \" \") {\n\t\t\ttext = \"\";\n\t\t}\n\t\tif (textarea) {\n\t\t\ttextarea.value = text;\n\t\t}\n\t}\n\n}"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Graphics.d.ts","sourceRoot":"","sources":["../../../../../src/.internal/core/render/Graphics.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AAG7D,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClF,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAM1D,eAAO,MAAM,cAAc,UAAqU,CAAC;AAEjW,MAAM,WAAW,iBAAkB,SAAQ,eA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EAAE,KAAK,CAAC,MAAM,CAAC,CAAkD;IAElF,cAAc;IAiDd,QAAQ;IAwCR,aAAa;CAoJpB"}
|
|
@@ -89,7 +89,7 @@ export class Graphics extends Sprite {
|
|
|
89
89
|
const blendMode = this.get("blendMode", BlendMode.NORMAL);
|
|
90
90
|
this._display.blendMode = blendMode;
|
|
91
91
|
const draw = this.get("draw");
|
|
92
|
-
if (draw) {
|
|
92
|
+
if (draw && typeof draw === "function") {
|
|
93
93
|
draw(this._display, this);
|
|
94
94
|
}
|
|
95
95
|
const svgPath = this.get("svgPath");
|
|
@@ -113,7 +113,6 @@ export class Graphics extends Sprite {
|
|
|
113
113
|
const shadowOffsetX = this.get("shadowOffsetX");
|
|
114
114
|
const shadowOffsetY = this.get("shadowOffsetY");
|
|
115
115
|
const shadowOpacity = this.get("shadowOpacity");
|
|
116
|
-
//const bounds = this._display.getLocalBounds();
|
|
117
116
|
if (shadowColor && (shadowBlur || shadowOffsetX || shadowOffsetY)) {
|
|
118
117
|
this._display.shadow(shadowColor, shadowBlur, shadowOffsetX, shadowOffsetY, shadowOpacity);
|
|
119
118
|
}
|
|
@@ -144,23 +143,6 @@ export class Graphics extends Sprite {
|
|
|
144
143
|
}
|
|
145
144
|
}
|
|
146
145
|
if (fillPattern) {
|
|
147
|
-
/*
|
|
148
|
-
let changed = false;
|
|
149
|
-
if (fill && (!fillPattern.get("fill") || fillPattern.get("fillInherited"))) {
|
|
150
|
-
fillPattern.set("fill", fill);
|
|
151
|
-
fillPattern.set("fillInherited", true)
|
|
152
|
-
changed = true;
|
|
153
|
-
}
|
|
154
|
-
if (stroke && (!fillPattern.get("color") || fillPattern.get("colorInherited"))) {
|
|
155
|
-
fillPattern.set("color", stroke);
|
|
156
|
-
fillPattern.set("colorInherited", true)
|
|
157
|
-
changed = true;
|
|
158
|
-
}
|
|
159
|
-
if (changed) {
|
|
160
|
-
// @todo: is this OK?
|
|
161
|
-
fillPattern._changed();
|
|
162
|
-
}
|
|
163
|
-
*/
|
|
164
146
|
const pattern = fillPattern.pattern;
|
|
165
147
|
if (pattern) {
|
|
166
148
|
this._display.beginFill(pattern, fillOpacity);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Graphics.js","sourceRoot":"","sources":["../../../../../src/.internal/core/render/Graphics.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AACnE,OAAO,EAAkD,MAAM,EAAE,MAAM,UAAU,CAAC;AAClF,OAAO,EAAa,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAE1D,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AACtC,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAGxC,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,MAAM,EAAE,aAAa,EAAE,QAAQ,EAAE,aAAa,EAAE,eAAe,EAAE,aAAa,EAAE,eAAe,EAAE,cAAc,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,YAAY,EAAE,aAAa,EAAE,eAAe,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,KAAK,EAAE,UAAU,EAAE,UAAU,CAAC,CAAC;AAsKjW;;;;;GAKG;AACH,MAAM,OAAO,QAAS,SAAQ,MAAM;IAApC;;QAMC;;;;mBAA6B,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,YAAY,EAAE;WAAC;QAEjE;;;;mBAAmB,KAAK;WAAC;IAoQ1B,CAAC;IA/PO,cAAc;QACpB,KAAK,CAAC,cAAc,EAAE,CAAC;QAEvB,IAAI,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE;YACpD,IAAI,CAAC,eAAe,EAAE,CAAC;SACvB;QAED,IAAI,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,IAAI,CAAC,OAAO,CAAC,QAAQ,CAA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C,CAAC;GAAC","sourcesContent":["import type { Color } from \"../util/Color\";\nimport type { Pattern } from \"../render/patterns/Pattern\";\nimport type { Gradient } from \"../render/gradients/Gradient\";\n\nimport { PicturePattern } from \"../render/patterns/PicturePattern\";\nimport { ISpriteSettings, ISpritePrivate, ISpriteEvents, Sprite } from \"./Sprite\";\nimport { IGraphics, BlendMode } from \"./backend/Renderer\";\n\nimport * as $type from \"../util/Type\";\nimport * as $array from \"../util/Array\";\n\n\nexport const visualSettings = [\"fill\", \"fillOpacity\", \"stroke\", \"strokeWidth\", \"strokeOpacity\", \"fillPattern\", \"strokePattern\", \"fillGradient\", \"strokeGradient\", \"strokeDasharray\", \"strokeDashoffset\", \"shadowBlur\", \"shadowColor\", \"shadowOpacity\", \"shadowOffsetX\", \"shadowOffsetY\", \"blur\", \"sepia\", \"invert\", \"brightness\", \"hue\", \"contrast\", \"saturate\"];\n\nexport interface IGraphicsSettings extends ISpriteSettings {\n\n\t/**\n\t * Fill color.\n\t *\n\t * @see {@link https://www.amcharts.com/docs/v5/concepts/colors-gradients-and-patterns/} for more information\n\t */\n\tfill?: Color;\n\n\t/**\n\t * Stroke (border or line) color.\n\t *\n\t * @see {@link https://www.amcharts.com/docs/v5/concepts/colors-gradients-and-patterns/} for more information\n\t */\n\tstroke?: Color;\n\n\t/**\n\t * Fill pattern.\n\t *\n\t * @see {@link https://www.amcharts.com/docs/v5/concepts/colors-gradients-and-patterns/patterns/} for more information\n\t */\n\tfillPattern?: Pattern;\n\n\t/**\n\t * Stroke (border or line) pattern.\n\t *\n\t * @see {@link https://www.amcharts.com/docs/v5/concepts/colors-gradients-and-patterns/patterns/} for more information\n\t */\n\tstrokePattern?: Pattern;\n\n\t/**\n\t * Fill gradient.\n\t *\n\t * @see {@link https://www.amcharts.com/docs/v5/concepts/colors-gradients-and-patterns/gradients/} for more information\n\t */\n\tfillGradient?: Gradient;\n\n\t/**\n\t * Stroke (border or line) gradient.\n\t *\n\t * @see {@link https://www.amcharts.com/docs/v5/concepts/colors-gradients-and-patterns/gradients/} for more information\n\t */\n\tstrokeGradient?: Gradient;\n\n\t/**\n\t * Stroke (border or line) dash settings.\n\t *\n\t * @see {@link https://www.amcharts.com/docs/v5/concepts/colors-gradients-and-patterns/#Dashed_lines} for more information\n\t */\n\tstrokeDasharray?: number[] | number;\n\n\t/**\n\t * Stroke (border or line) dash offset.\n\t *\n\t * @see {@link https://www.amcharts.com/docs/v5/concepts/colors-gradients-and-patterns/#Dashed_lines} for more information\n\t */\n\tstrokeDashoffset?: number;\n\n\t/**\n\t * Opacity of the fill. 0 - fully transparent; 1 - fully opaque.\n\t */\n\tfillOpacity?: number;\n\n\t/**\n\t * Opacity of the stroke (border or line). 0 - fully transparent; 1 - fully opaque.\n\t */\n\tstrokeOpacity?: number;\n\n\t/**\n\t * Width of the stroke (border or line) in pixels.\n\t */\n\tstrokeWidth?: number;\n\n\t/**\n\t * Indicates if stroke of a Graphics should stay the same when it's scale changes. Note, this doesn't take into account parent container scale changes.\n\t * @default false\n\t */\n\tnonScalingStroke?: boolean;\n\n\t/**\n\t * Drawing function.\n\t *\n\t * Must use renderer (`display` parameter) methods to draw.\n\t *\n\t * @see {@link https://www.amcharts.com/docs/v5/concepts/common-elements/graphics/#Custom_draw_functions} for more info\n\t */\n\tdraw?: (display: IGraphics, graphics: Graphics) => void;\n\n\t/**\n\t * Rendering mode.\n\t *\n\t * @default BlendMode.NORMAL (\"source-over\")\n\t * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/globalCompositeOperation} for more information\n\t * @ignore\n\t */\n\tblendMode?: BlendMode;\n\n\t/**\n\t * Draw a shape using an SVG path.\n\t *\n\t * @see {@link https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/Paths} for more information\n\t */\n\tsvgPath?: string;\n\n\t/**\n\t * Color of the element's shadow.\n\t *\n\t * For this to work at least one of the following needs to be set as well:\n\t * `shadowBlur`, `shadowOffsetX`, `shadowOffsetY`.\n\t *\n\t * @see {@link https://www.amcharts.com/docs/v5/concepts/colors-gradients-and-patterns/shadows/} for more info\n\t */\n\tshadowColor?: Color | null;\n\n\t/**\n\t * Blurriness of the the shadow.\n\t *\n\t * The bigger the number, the more blurry shadow will be.\n\t *\n\t * @see {@link https://www.amcharts.com/docs/v5/concepts/colors-gradients-and-patterns/shadows/} for more info\n\t */\n\tshadowBlur?: number;\n\n\t/**\n\t * Horizontal shadow offset in pixels.\n\t *\n\t * @see {@link https://www.amcharts.com/docs/v5/concepts/colors-gradients-and-patterns/shadows/} for more info\n\t */\n\tshadowOffsetX?: number;\n\n\t/**\n\t * Vertical shadow offset in pixels.\n\t *\n\t * @see {@link https://www.amcharts.com/docs/v5/concepts/colors-gradients-and-patterns/shadows/} for more info\n\t */\n\tshadowOffsetY?: number;\n\n\t/**\n\t * Opacity of the shadow (0-1).\n\t *\n\t * If not set, will use the same as `fillOpacity` of the element.\n\t *\n\t * @see {@link https://www.amcharts.com/docs/v5/concepts/colors-gradients-and-patterns/shadows/} for more info\n\t */\n\tshadowOpacity?: number;\n\n\t/**\n\t * A method to be used on anchor points (joints) of the multi-point line.\n\t *\n\t * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/lineJoin} for more info\n\t * @default \"miter\"\n\t * @since 5.2.10\n\t */\n\tlineJoin?: \"miter\" | \"round\" | \"bevel\";\n}\n\nexport interface IGraphicsPrivate extends ISpritePrivate {\n\n}\n\nexport interface IGraphicsEvents extends ISpriteEvents {\n\n}\n\n/**\n * Base class used for drawing shapes.\n *\n * @see {@link https://www.amcharts.com/docs/v5/concepts/common-elements/graphics/} for more info\n * @important\n */\nexport class Graphics extends Sprite {\n\n\tdeclare public _settings: IGraphicsSettings;\n\tdeclare public _privateSettings: IGraphicsPrivate;\n\tdeclare public _events: IGraphicsEvents;\n\n\tpublic _display: IGraphics = this._root._renderer.makeGraphics();\n\n\tprotected _clear = false;\n\n\tpublic static className: string = \"Graphics\";\n\tpublic static classNames: Array<string> = Sprite.classNames.concat([Graphics.className]);\n\n\tpublic _beforeChanged() {\n\t\tsuper._beforeChanged();\n\n\t\tif (this.isDirty(\"draw\") || this.isDirty(\"svgPath\")) {\n\t\t\tthis.markDirtyBounds();\n\t\t}\n\n\t\tif (this.isDirty(\"fill\") || this.isDirty(\"stroke\") || this.isDirty(\"visible\") || this.isDirty(\"forceHidden\") || this.isDirty(\"scale\") || this.isDirty(\"fillGradient\") || this.isDirty(\"strokeGradient\") || this.isDirty(\"fillPattern\") || this.isDirty(\"strokePattern\") || this.isDirty(\"fillOpacity\") || this.isDirty(\"strokeOpacity\") || this.isDirty(\"strokeWidth\") || this.isDirty(\"draw\") || this.isDirty(\"blendMode\") || this.isDirty(\"strokeDasharray\") || this.isDirty(\"strokeDashoffset\") || this.isDirty(\"svgPath\") || this.isDirty(\"lineJoin\") || this.isDirty(\"shadowColor\") || this.isDirty(\"shadowBlur\") || this.isDirty(\"shadowOffsetX\") || this.isDirty(\"shadowOffsetY\")) {\n\t\t\tthis._clear = true;\n\t\t}\n\n\t\tthis._display.crisp = this.get(\"crisp\", false);\n\n\t\tif (this.isDirty(\"fillGradient\")) {\n\t\t\tconst gradient = this.get(\"fillGradient\");\n\t\t\tif (gradient) {\n\t\t\t\tthis._display.isMeasured = true;\n\t\t\t\tconst gradientTarget = gradient.get(\"target\");\n\t\t\t\tif (gradientTarget) {\n\t\t\t\t\tthis._disposers.push(gradientTarget.events.on(\"boundschanged\", () => {\n\t\t\t\t\t\tthis._markDirtyKey(\"fill\");\n\t\t\t\t\t}))\n\t\t\t\t\tthis._disposers.push(\n\t\t\t\t\t\tgradientTarget.events.on(\"positionchanged\", () => {\n\t\t\t\t\t\t\tthis._markDirtyKey(\"fill\");\n\t\t\t\t\t\t}))\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (this.isDirty(\"strokeGradient\")) {\n\t\t\tconst gradient = this.get(\"strokeGradient\");\n\t\t\tif (gradient) {\n\t\t\t\tthis._display.isMeasured = true;\n\t\t\t\tconst gradientTarget = gradient.get(\"target\");\n\t\t\t\tif (gradientTarget) {\n\t\t\t\t\tthis._disposers.push(\n\t\t\t\t\t\tgradientTarget.events.on(\"boundschanged\", () => {\n\t\t\t\t\t\t\tthis._markDirtyKey(\"stroke\");\n\t\t\t\t\t\t}))\n\t\t\t\t\tthis._disposers.push(\n\t\t\t\t\t\tgradientTarget.events.on(\"positionchanged\", () => {\n\t\t\t\t\t\t\tthis._markDirtyKey(\"stroke\");\n\t\t\t\t\t\t}))\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic _changed() {\n\t\tsuper._changed();\n\n\t\tif (this._clear) {\n\t\t\tthis.markDirtyBounds();\n\t\t\tthis.markDirtyLayer();\n\t\t\tthis._display.clear();\n\n\t\t\tlet strokeDasharray = this.get(\"strokeDasharray\");\n\t\t\tif ($type.isNumber(strokeDasharray)) {\n\t\t\t\tif (strokeDasharray < 0.5) {\n\t\t\t\t\tstrokeDasharray = [0];\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tstrokeDasharray = [strokeDasharray]\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis._display.setLineDash(strokeDasharray as number[]);\n\n\t\t\tconst strokeDashoffset = this.get(\"strokeDashoffset\");\n\t\t\tif (strokeDashoffset) {\n\t\t\t\tthis._display.setLineDashOffset(strokeDashoffset);\n\t\t\t}\n\n\t\t\tconst blendMode = this.get(\"blendMode\", BlendMode.NORMAL);\n\t\t\tthis._display.blendMode = blendMode;\n\n\t\t\tconst draw = this.get(\"draw\");\n\t\t\tif (draw) {\n\t\t\t\tdraw(this._display, this);\n\t\t\t}\n\n\t\t\tconst svgPath = this.get(\"svgPath\");\n\t\t\tif (svgPath != null) {\n\t\t\t\tthis._display.svgPath(svgPath!);\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic _afterChanged() {\n\t\tsuper._afterChanged();\n\n\t\tif (this._clear) {\n\t\t\tconst fill = this.get(\"fill\");\n\t\t\tconst fillGradient = this.get(\"fillGradient\");\n\t\t\tconst fillPattern = this.get(\"fillPattern\");\n\t\t\tconst fillOpacity = this.get(\"fillOpacity\");\n\n\t\t\tconst stroke = this.get(\"stroke\");\n\t\t\tconst strokeGradient = this.get(\"strokeGradient\");\n\t\t\tconst strokePattern = this.get(\"strokePattern\");\n\n\t\t\tconst shadowColor = this.get(\"shadowColor\");\n\t\t\tconst shadowBlur = this.get(\"shadowBlur\");\n\t\t\tconst shadowOffsetX = this.get(\"shadowOffsetX\");\n\t\t\tconst shadowOffsetY = this.get(\"shadowOffsetY\");\n\t\t\tconst shadowOpacity = this.get(\"shadowOpacity\");\n\n\t\t\t//const bounds = this._display.getLocalBounds();\n\n\t\t\tif (shadowColor && (shadowBlur || shadowOffsetX || shadowOffsetY)) {\n\t\t\t\tthis._display.shadow(shadowColor, shadowBlur, shadowOffsetX, shadowOffsetY, shadowOpacity);\n\t\t\t}\n\n\t\t\tif (fill && !fillGradient) {\n\t\t\t\tthis._display.beginFill(fill, fillOpacity);\n\t\t\t\tthis._display.endFill();\n\t\t\t}\n\n\t\t\tif (fillGradient) {\n\t\t\t\tif (fill) {\n\t\t\t\t\tconst stops = fillGradient.get(\"stops\", []);\n\t\t\t\t\tif (stops.length) {\n\t\t\t\t\t\t$array.each(stops, (stop: any) => {\n\t\t\t\t\t\t\tif ((!stop.color || stop.colorInherited) && fill) {\n\t\t\t\t\t\t\t\tstop.color = fill;\n\t\t\t\t\t\t\t\tstop.colorInherited = true;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif (stop.opacity == null || stop.opacityInherited) {\n\t\t\t\t\t\t\t\tstop.opacity = fillOpacity;\n\t\t\t\t\t\t\t\tstop.opacityInherited = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t})\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tconst gradient = fillGradient.getFill(this);\n\t\t\t\tif (gradient) {\n\t\t\t\t\tthis._display.beginFill(gradient, fillOpacity);\n\t\t\t\t\tthis._display.endFill();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (fillPattern) {\n\t\t\t\t/*\n\t\t\t\tlet changed = false;\n\t\t\t\tif (fill && (!fillPattern.get(\"fill\") || fillPattern.get(\"fillInherited\"))) {\n\t\t\t\t\tfillPattern.set(\"fill\", fill);\n\t\t\t\t\tfillPattern.set(\"fillInherited\", true)\n\t\t\t\t\tchanged = true;\n\t\t\t\t}\n\t\t\t\tif (stroke && (!fillPattern.get(\"color\") || fillPattern.get(\"colorInherited\"))) {\n\t\t\t\t\tfillPattern.set(\"color\", stroke);\n\t\t\t\t\tfillPattern.set(\"colorInherited\", true)\n\t\t\t\t\tchanged = true;\n\t\t\t\t}\n\t\t\t\tif (changed) {\n\t\t\t\t\t// @todo: is this OK?\n\t\t\t\t\tfillPattern._changed();\n\t\t\t\t}\n\t\t\t\t*/\n\t\t\t\tconst pattern = fillPattern.pattern;\n\t\t\t\tif (pattern) {\n\t\t\t\t\tthis._display.beginFill(pattern, fillOpacity);\n\t\t\t\t\tthis._display.endFill();\n\n\t\t\t\t\tif (fillPattern instanceof PicturePattern) {\n\t\t\t\t\t\tfillPattern.events.once(\"loaded\", () => {\n\t\t\t\t\t\t\tthis._clear = true;\n\t\t\t\t\t\t\tthis.markDirty();\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (stroke || strokeGradient || strokePattern) {\n\t\t\t\tconst strokeOpacity = this.get(\"strokeOpacity\");\n\t\t\t\tlet strokeWidth = this.get(\"strokeWidth\", 1);\n\n\t\t\t\tif (this.get(\"nonScalingStroke\")) {\n\t\t\t\t\tstrokeWidth = strokeWidth / this.get(\"scale\", 1)\n\t\t\t\t}\n\n\t\t\t\tif (this.get(\"crisp\")) {\n\t\t\t\t\tstrokeWidth /= this._root._renderer.resolution;\n\t\t\t\t}\n\n\t\t\t\tconst lineJoin = this.get(\"lineJoin\");\n\n\t\t\t\tif (stroke && !strokeGradient) {\n\t\t\t\t\tthis._display.lineStyle(strokeWidth, stroke, strokeOpacity, lineJoin);\n\t\t\t\t\tthis._display.endStroke();\n\t\t\t\t}\n\n\n\t\t\t\tif (strokeGradient) {\n\t\t\t\t\tconst stops = strokeGradient.get(\"stops\", []);\n\t\t\t\t\tif (stops.length) {\n\t\t\t\t\t\t$array.each(stops, (stop: any) => {\n\t\t\t\t\t\t\tif ((!stop.color || stop.colorInherited) && stroke) {\n\t\t\t\t\t\t\t\tstop.color = stroke;\n\t\t\t\t\t\t\t\tstop.colorInherited = true;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif (stop.opacity == null || stop.opacityInherited) {\n\t\t\t\t\t\t\t\tstop.opacity = strokeOpacity;\n\t\t\t\t\t\t\t\tstop.opacityInherited = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t})\n\t\t\t\t\t}\n\n\t\t\t\t\tconst gradient = strokeGradient.getFill(this);\n\t\t\t\t\tif (gradient) {\n\t\t\t\t\t\tthis._display.lineStyle(strokeWidth, gradient, strokeOpacity, lineJoin);\n\t\t\t\t\t\tthis._display.endStroke();\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (strokePattern) {\n\t\t\t\t\t/*\n\t\t\t\t\tlet changed = false;\n\t\t\t\t\t\n\t\t\t\t\tif (stroke && (!strokePattern.get(\"color\") || strokePattern.get(\"colorInherited\"))) {\n\t\t\t\t\t\tstrokePattern.set(\"color\", stroke);\n\t\t\t\t\t\tstrokePattern.set(\"colorInherited\", true);\n\t\t\t\t\t\tchanged = true;\n\t\t\t\t\t}\n\t\t\t\t\tif (changed) {\n\t\t\t\t\t\t// @todo: is this OK?\n\t\t\t\t\t\tstrokePattern._changed();\n\t\t\t\t\t}\n\t\t\t\t\t*/\n\t\t\t\t\tlet pattern = strokePattern.pattern;\n\n\t\t\t\t\tif (pattern) {\n\t\t\t\t\t\tthis._display.lineStyle(strokeWidth, pattern, strokeOpacity, lineJoin);\n\t\t\t\t\t\tthis._display.endStroke();\n\n\t\t\t\t\t\tif (strokePattern instanceof PicturePattern) {\n\t\t\t\t\t\t\tstrokePattern.events.once(\"loaded\", () => {\n\t\t\t\t\t\t\t\tthis._clear = true;\n\t\t\t\t\t\t\t\tthis.markDirty();\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (this.getPrivate(\"showingTooltip\")) {\n\t\t\t\tthis.showTooltip();\n\t\t\t}\n\t\t}\n\n\t\tthis._clear = false;\n\t}\n\n}\n"]}
|
|
1
|
+
{"version":3,"file":"Graphics.js","sourceRoot":"","sources":["../../../../../src/.internal/core/render/Graphics.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AACnE,OAAO,EAAkD,MAAM,EAAE,MAAM,UAAU,CAAC;AAClF,OAAO,EAAa,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAE1D,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AACtC,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAGxC,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,MAAM,EAAE,aAAa,EAAE,QAAQ,EAAE,aAAa,EAAE,eAAe,EAAE,aAAa,EAAE,eAAe,EAAE,cAAc,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,YAAY,EAAE,aAAa,EAAE,eAAe,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,KAAK,EAAE,UAAU,EAAE,UAAU,CAAC,CAAC;AAsKjW;;;;;GAKG;AACH,MAAM,OAAO,QAAS,SAAQ,MAAM;IAApC;;QAMC;;;;mBAA6B,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,YAAY,EAAE;WAAC;QAEjE;;;;mBAAmB,KAAK;WAAC;IAkP1B,CAAC;IA7OO,cAAc;QACpB,KAAK,CAAC,cAAc,EAAE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E;gBACtC,IAAI,CAAC,WAAW,EAAE,CAAC;aACnB;SACD;QAED,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;IACrB,CAAC;;AA9OD;;;;WAAkC,UAAU;GAAC;AAC7C;;;;WAA0C,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;GAAC","sourcesContent":["import type { Color } from \"../util/Color\";\nimport type { Pattern } from \"../render/patterns/Pattern\";\nimport type { Gradient } from \"../render/gradients/Gradient\";\n\nimport { PicturePattern } from \"../render/patterns/PicturePattern\";\nimport { ISpriteSettings, ISpritePrivate, ISpriteEvents, Sprite } from \"./Sprite\";\nimport { IGraphics, BlendMode } from \"./backend/Renderer\";\n\nimport * as $type from \"../util/Type\";\nimport * as $array from \"../util/Array\";\n\n\nexport const visualSettings = [\"fill\", \"fillOpacity\", \"stroke\", \"strokeWidth\", \"strokeOpacity\", \"fillPattern\", \"strokePattern\", \"fillGradient\", \"strokeGradient\", \"strokeDasharray\", \"strokeDashoffset\", \"shadowBlur\", \"shadowColor\", \"shadowOpacity\", \"shadowOffsetX\", \"shadowOffsetY\", \"blur\", \"sepia\", \"invert\", \"brightness\", \"hue\", \"contrast\", \"saturate\"];\n\nexport interface IGraphicsSettings extends ISpriteSettings {\n\n\t/**\n\t * Fill color.\n\t *\n\t * @see {@link https://www.amcharts.com/docs/v5/concepts/colors-gradients-and-patterns/} for more information\n\t */\n\tfill?: Color;\n\n\t/**\n\t * Stroke (border or line) color.\n\t *\n\t * @see {@link https://www.amcharts.com/docs/v5/concepts/colors-gradients-and-patterns/} for more information\n\t */\n\tstroke?: Color;\n\n\t/**\n\t * Fill pattern.\n\t *\n\t * @see {@link https://www.amcharts.com/docs/v5/concepts/colors-gradients-and-patterns/patterns/} for more information\n\t */\n\tfillPattern?: Pattern;\n\n\t/**\n\t * Stroke (border or line) pattern.\n\t *\n\t * @see {@link https://www.amcharts.com/docs/v5/concepts/colors-gradients-and-patterns/patterns/} for more information\n\t */\n\tstrokePattern?: Pattern;\n\n\t/**\n\t * Fill gradient.\n\t *\n\t * @see {@link https://www.amcharts.com/docs/v5/concepts/colors-gradients-and-patterns/gradients/} for more information\n\t */\n\tfillGradient?: Gradient;\n\n\t/**\n\t * Stroke (border or line) gradient.\n\t *\n\t * @see {@link https://www.amcharts.com/docs/v5/concepts/colors-gradients-and-patterns/gradients/} for more information\n\t */\n\tstrokeGradient?: Gradient;\n\n\t/**\n\t * Stroke (border or line) dash settings.\n\t *\n\t * @see {@link https://www.amcharts.com/docs/v5/concepts/colors-gradients-and-patterns/#Dashed_lines} for more information\n\t */\n\tstrokeDasharray?: number[] | number;\n\n\t/**\n\t * Stroke (border or line) dash offset.\n\t *\n\t * @see {@link https://www.amcharts.com/docs/v5/concepts/colors-gradients-and-patterns/#Dashed_lines} for more information\n\t */\n\tstrokeDashoffset?: number;\n\n\t/**\n\t * Opacity of the fill. 0 - fully transparent; 1 - fully opaque.\n\t */\n\tfillOpacity?: number;\n\n\t/**\n\t * Opacity of the stroke (border or line). 0 - fully transparent; 1 - fully opaque.\n\t */\n\tstrokeOpacity?: number;\n\n\t/**\n\t * Width of the stroke (border or line) in pixels.\n\t */\n\tstrokeWidth?: number;\n\n\t/**\n\t * Indicates if stroke of a Graphics should stay the same when it's scale changes. Note, this doesn't take into account parent container scale changes.\n\t * @default false\n\t */\n\tnonScalingStroke?: boolean;\n\n\t/**\n\t * Drawing function.\n\t *\n\t * Must use renderer (`display` parameter) methods to draw.\n\t *\n\t * @see {@link https://www.amcharts.com/docs/v5/concepts/common-elements/graphics/#Custom_draw_functions} for more info\n\t */\n\tdraw?: (display: IGraphics, graphics: Graphics) => void;\n\n\t/**\n\t * Rendering mode.\n\t *\n\t * @default BlendMode.NORMAL (\"source-over\")\n\t * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/globalCompositeOperation} for more information\n\t * @ignore\n\t */\n\tblendMode?: BlendMode;\n\n\t/**\n\t * Draw a shape using an SVG path.\n\t *\n\t * @see {@link https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/Paths} for more information\n\t */\n\tsvgPath?: string;\n\n\t/**\n\t * Color of the element's shadow.\n\t *\n\t * For this to work at least one of the following needs to be set as well:\n\t * `shadowBlur`, `shadowOffsetX`, `shadowOffsetY`.\n\t *\n\t * @see {@link https://www.amcharts.com/docs/v5/concepts/colors-gradients-and-patterns/shadows/} for more info\n\t */\n\tshadowColor?: Color | null;\n\n\t/**\n\t * Blurriness of the the shadow.\n\t *\n\t * The bigger the number, the more blurry shadow will be.\n\t *\n\t * @see {@link https://www.amcharts.com/docs/v5/concepts/colors-gradients-and-patterns/shadows/} for more info\n\t */\n\tshadowBlur?: number;\n\n\t/**\n\t * Horizontal shadow offset in pixels.\n\t *\n\t * @see {@link https://www.amcharts.com/docs/v5/concepts/colors-gradients-and-patterns/shadows/} for more info\n\t */\n\tshadowOffsetX?: number;\n\n\t/**\n\t * Vertical shadow offset in pixels.\n\t *\n\t * @see {@link https://www.amcharts.com/docs/v5/concepts/colors-gradients-and-patterns/shadows/} for more info\n\t */\n\tshadowOffsetY?: number;\n\n\t/**\n\t * Opacity of the shadow (0-1).\n\t *\n\t * If not set, will use the same as `fillOpacity` of the element.\n\t *\n\t * @see {@link https://www.amcharts.com/docs/v5/concepts/colors-gradients-and-patterns/shadows/} for more info\n\t */\n\tshadowOpacity?: number;\n\n\t/**\n\t * A method to be used on anchor points (joints) of the multi-point line.\n\t *\n\t * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/lineJoin} for more info\n\t * @default \"miter\"\n\t * @since 5.2.10\n\t */\n\tlineJoin?: \"miter\" | \"round\" | \"bevel\";\n}\n\nexport interface IGraphicsPrivate extends ISpritePrivate {\n\n}\n\nexport interface IGraphicsEvents extends ISpriteEvents {\n\n}\n\n/**\n * Base class used for drawing shapes.\n *\n * @see {@link https://www.amcharts.com/docs/v5/concepts/common-elements/graphics/} for more info\n * @important\n */\nexport class Graphics extends Sprite {\n\n\tdeclare public _settings: IGraphicsSettings;\n\tdeclare public _privateSettings: IGraphicsPrivate;\n\tdeclare public _events: IGraphicsEvents;\n\n\tpublic _display: IGraphics = this._root._renderer.makeGraphics();\n\n\tprotected _clear = false;\n\n\tpublic static className: string = \"Graphics\";\n\tpublic static classNames: Array<string> = Sprite.classNames.concat([Graphics.className]);\n\n\tpublic _beforeChanged() {\n\t\tsuper._beforeChanged();\n\n\t\tif (this.isDirty(\"draw\") || this.isDirty(\"svgPath\")) {\n\t\t\tthis.markDirtyBounds();\n\t\t}\n\n\t\tif (this.isDirty(\"fill\") || this.isDirty(\"stroke\") || this.isDirty(\"visible\") || this.isDirty(\"forceHidden\") || this.isDirty(\"scale\") || this.isDirty(\"fillGradient\") || this.isDirty(\"strokeGradient\") || this.isDirty(\"fillPattern\") || this.isDirty(\"strokePattern\") || this.isDirty(\"fillOpacity\") || this.isDirty(\"strokeOpacity\") || this.isDirty(\"strokeWidth\") || this.isDirty(\"draw\") || this.isDirty(\"blendMode\") || this.isDirty(\"strokeDasharray\") || this.isDirty(\"strokeDashoffset\") || this.isDirty(\"svgPath\") || this.isDirty(\"lineJoin\") || this.isDirty(\"shadowColor\") || this.isDirty(\"shadowBlur\") || this.isDirty(\"shadowOffsetX\") || this.isDirty(\"shadowOffsetY\")) {\n\t\t\tthis._clear = true;\n\t\t}\n\n\t\tthis._display.crisp = this.get(\"crisp\", false);\n\n\t\tif (this.isDirty(\"fillGradient\")) {\n\t\t\tconst gradient = this.get(\"fillGradient\");\n\t\t\tif (gradient) {\n\t\t\t\tthis._display.isMeasured = true;\n\t\t\t\tconst gradientTarget = gradient.get(\"target\");\n\t\t\t\tif (gradientTarget) {\n\t\t\t\t\tthis._disposers.push(gradientTarget.events.on(\"boundschanged\", () => {\n\t\t\t\t\t\tthis._markDirtyKey(\"fill\");\n\t\t\t\t\t}))\n\t\t\t\t\tthis._disposers.push(\n\t\t\t\t\t\tgradientTarget.events.on(\"positionchanged\", () => {\n\t\t\t\t\t\t\tthis._markDirtyKey(\"fill\");\n\t\t\t\t\t\t}))\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (this.isDirty(\"strokeGradient\")) {\n\t\t\tconst gradient = this.get(\"strokeGradient\");\n\t\t\tif (gradient) {\n\t\t\t\tthis._display.isMeasured = true;\n\t\t\t\tconst gradientTarget = gradient.get(\"target\");\n\t\t\t\tif (gradientTarget) {\n\t\t\t\t\tthis._disposers.push(\n\t\t\t\t\t\tgradientTarget.events.on(\"boundschanged\", () => {\n\t\t\t\t\t\t\tthis._markDirtyKey(\"stroke\");\n\t\t\t\t\t\t}))\n\t\t\t\t\tthis._disposers.push(\n\t\t\t\t\t\tgradientTarget.events.on(\"positionchanged\", () => {\n\t\t\t\t\t\t\tthis._markDirtyKey(\"stroke\");\n\t\t\t\t\t\t}))\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic _changed() {\n\t\tsuper._changed();\n\n\t\tif (this._clear) {\n\t\t\tthis.markDirtyBounds();\n\t\t\tthis.markDirtyLayer();\n\t\t\tthis._display.clear();\n\n\t\t\tlet strokeDasharray = this.get(\"strokeDasharray\");\n\t\t\tif ($type.isNumber(strokeDasharray)) {\n\t\t\t\tif (strokeDasharray < 0.5) {\n\t\t\t\t\tstrokeDasharray = [0];\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tstrokeDasharray = [strokeDasharray]\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis._display.setLineDash(strokeDasharray as number[]);\n\n\t\t\tconst strokeDashoffset = this.get(\"strokeDashoffset\");\n\t\t\tif (strokeDashoffset) {\n\t\t\t\tthis._display.setLineDashOffset(strokeDashoffset);\n\t\t\t}\n\n\t\t\tconst blendMode = this.get(\"blendMode\", BlendMode.NORMAL);\n\t\t\tthis._display.blendMode = blendMode;\n\n\t\t\tconst draw = this.get(\"draw\");\n\n\t\t\tif (draw && typeof draw === \"function\") {\n\t\t\t\tdraw(this._display, this);\n\t\t\t}\n\n\t\t\tconst svgPath = this.get(\"svgPath\");\n\t\t\tif (svgPath != null) {\n\t\t\t\tthis._display.svgPath(svgPath!);\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic _afterChanged() {\n\t\tsuper._afterChanged();\n\n\t\tif (this._clear) {\n\t\t\tconst fill = this.get(\"fill\");\n\t\t\tconst fillGradient = this.get(\"fillGradient\");\n\t\t\tconst fillPattern = this.get(\"fillPattern\");\n\t\t\tconst fillOpacity = this.get(\"fillOpacity\");\n\n\t\t\tconst stroke = this.get(\"stroke\");\n\t\t\tconst strokeGradient = this.get(\"strokeGradient\");\n\t\t\tconst strokePattern = this.get(\"strokePattern\");\n\n\t\t\tconst shadowColor = this.get(\"shadowColor\");\n\t\t\tconst shadowBlur = this.get(\"shadowBlur\");\n\t\t\tconst shadowOffsetX = this.get(\"shadowOffsetX\");\n\t\t\tconst shadowOffsetY = this.get(\"shadowOffsetY\");\n\t\t\tconst shadowOpacity = this.get(\"shadowOpacity\");\n\n\t\t\tif (shadowColor && (shadowBlur || shadowOffsetX || shadowOffsetY)) {\n\t\t\t\tthis._display.shadow(shadowColor, shadowBlur, shadowOffsetX, shadowOffsetY, shadowOpacity);\n\t\t\t}\n\n\t\t\tif (fill && !fillGradient) {\n\t\t\t\tthis._display.beginFill(fill, fillOpacity);\n\t\t\t\tthis._display.endFill();\n\t\t\t}\n\n\t\t\tif (fillGradient) {\n\t\t\t\tif (fill) {\n\t\t\t\t\tconst stops = fillGradient.get(\"stops\", []);\n\t\t\t\t\tif (stops.length) {\n\t\t\t\t\t\t$array.each(stops, (stop: any) => {\n\t\t\t\t\t\t\tif ((!stop.color || stop.colorInherited) && fill) {\n\t\t\t\t\t\t\t\tstop.color = fill;\n\t\t\t\t\t\t\t\tstop.colorInherited = true;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif (stop.opacity == null || stop.opacityInherited) {\n\t\t\t\t\t\t\t\tstop.opacity = fillOpacity;\n\t\t\t\t\t\t\t\tstop.opacityInherited = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t})\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tconst gradient = fillGradient.getFill(this);\n\t\t\t\tif (gradient) {\n\t\t\t\t\tthis._display.beginFill(gradient, fillOpacity);\n\t\t\t\t\tthis._display.endFill();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (fillPattern) {\n\t\t\t\tconst pattern = fillPattern.pattern;\n\t\t\t\tif (pattern) {\n\t\t\t\t\tthis._display.beginFill(pattern, fillOpacity);\n\t\t\t\t\tthis._display.endFill();\n\n\t\t\t\t\tif (fillPattern instanceof PicturePattern) {\n\t\t\t\t\t\tfillPattern.events.once(\"loaded\", () => {\n\t\t\t\t\t\t\tthis._clear = true;\n\t\t\t\t\t\t\tthis.markDirty();\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (stroke || strokeGradient || strokePattern) {\n\t\t\t\tconst strokeOpacity = this.get(\"strokeOpacity\");\n\t\t\t\tlet strokeWidth = this.get(\"strokeWidth\", 1);\n\n\t\t\t\tif (this.get(\"nonScalingStroke\")) {\n\t\t\t\t\tstrokeWidth = strokeWidth / this.get(\"scale\", 1)\n\t\t\t\t}\n\n\t\t\t\tif (this.get(\"crisp\")) {\n\t\t\t\t\tstrokeWidth /= this._root._renderer.resolution;\n\t\t\t\t}\n\n\t\t\t\tconst lineJoin = this.get(\"lineJoin\");\n\n\t\t\t\tif (stroke && !strokeGradient) {\n\t\t\t\t\tthis._display.lineStyle(strokeWidth, stroke, strokeOpacity, lineJoin);\n\t\t\t\t\tthis._display.endStroke();\n\t\t\t\t}\n\n\n\t\t\t\tif (strokeGradient) {\n\t\t\t\t\tconst stops = strokeGradient.get(\"stops\", []);\n\t\t\t\t\tif (stops.length) {\n\t\t\t\t\t\t$array.each(stops, (stop: any) => {\n\t\t\t\t\t\t\tif ((!stop.color || stop.colorInherited) && stroke) {\n\t\t\t\t\t\t\t\tstop.color = stroke;\n\t\t\t\t\t\t\t\tstop.colorInherited = true;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif (stop.opacity == null || stop.opacityInherited) {\n\t\t\t\t\t\t\t\tstop.opacity = strokeOpacity;\n\t\t\t\t\t\t\t\tstop.opacityInherited = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t})\n\t\t\t\t\t}\n\n\t\t\t\t\tconst gradient = strokeGradient.getFill(this);\n\t\t\t\t\tif (gradient) {\n\t\t\t\t\t\tthis._display.lineStyle(strokeWidth, gradient, strokeOpacity, lineJoin);\n\t\t\t\t\t\tthis._display.endStroke();\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (strokePattern) {\n\t\t\t\t\t/*\n\t\t\t\t\tlet changed = false;\n\t\t\t\t\t\n\t\t\t\t\tif (stroke && (!strokePattern.get(\"color\") || strokePattern.get(\"colorInherited\"))) {\n\t\t\t\t\t\tstrokePattern.set(\"color\", stroke);\n\t\t\t\t\t\tstrokePattern.set(\"colorInherited\", true);\n\t\t\t\t\t\tchanged = true;\n\t\t\t\t\t}\n\t\t\t\t\tif (changed) {\n\t\t\t\t\t\t// @todo: is this OK?\n\t\t\t\t\t\tstrokePattern._changed();\n\t\t\t\t\t}\n\t\t\t\t\t*/\n\t\t\t\t\tlet pattern = strokePattern.pattern;\n\n\t\t\t\t\tif (pattern) {\n\t\t\t\t\t\tthis._display.lineStyle(strokeWidth, pattern, strokeOpacity, lineJoin);\n\t\t\t\t\t\tthis._display.endStroke();\n\n\t\t\t\t\t\tif (strokePattern instanceof PicturePattern) {\n\t\t\t\t\t\t\tstrokePattern.events.once(\"loaded\", () => {\n\t\t\t\t\t\t\t\tthis._clear = true;\n\t\t\t\t\t\t\t\tthis.markDirty();\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (this.getPrivate(\"showingTooltip\")) {\n\t\t\t\tthis.showTooltip();\n\t\t\t}\n\t\t}\n\n\t\tthis._clear = false;\n\t}\n\n}\n"]}
|
|
@@ -367,6 +367,15 @@ export interface iHSL {
|
|
|
367
367
|
l: number;
|
|
368
368
|
a?: number;
|
|
369
369
|
}
|
|
370
|
+
/**
|
|
371
|
+
* Represents an interface for an object that represents an HSV color.
|
|
372
|
+
*/
|
|
373
|
+
export interface iHSV {
|
|
374
|
+
h: number;
|
|
375
|
+
s: number;
|
|
376
|
+
v: number;
|
|
377
|
+
a?: number;
|
|
378
|
+
}
|
|
370
379
|
/**
|
|
371
380
|
* The functions below are taken and adapted from Garry Tan's blog post:
|
|
372
381
|
* http://axonflux.com/handy-rgb-to-hsl-and-rgb-to-hsv-color-model-c
|
|
@@ -382,7 +391,6 @@ export interface iHSL {
|
|
|
382
391
|
* Function adapted from:
|
|
383
392
|
* http://axonflux.com/handy-rgb-to-hsl-and-rgb-to-hsv-color-model-c
|
|
384
393
|
*
|
|
385
|
-
* @ignore Exclude from docs
|
|
386
394
|
* @param h The hue
|
|
387
395
|
* @param s The saturation
|
|
388
396
|
* @param l The lightness
|
|
@@ -398,17 +406,27 @@ export declare function hslToRgb(color: iHSL): iRGB;
|
|
|
398
406
|
* Function adapted from:
|
|
399
407
|
* http://axonflux.com/handy-rgb-to-hsl-and-rgb-to-hsv-color-model-c
|
|
400
408
|
*
|
|
401
|
-
* @ignore Exclude from docs
|
|
402
409
|
* @param r The red color value
|
|
403
410
|
* @param g The green color value
|
|
404
411
|
* @param b The blue color value
|
|
405
412
|
* @return The HSL representation
|
|
406
413
|
*/
|
|
407
414
|
export declare function rgbToHsl(color: iRGB): iHSL;
|
|
415
|
+
/**
|
|
416
|
+
* Converts HSV to HSL.
|
|
417
|
+
*
|
|
418
|
+
* https://en.wikipedia.org/wiki/HSL_and_HSV#HSV_to_HSL
|
|
419
|
+
*/
|
|
420
|
+
export declare function hsvToHsl(hsv: iHSV): iHSL;
|
|
421
|
+
/**
|
|
422
|
+
* Converts HSL to HSV.
|
|
423
|
+
*
|
|
424
|
+
* https://en.wikipedia.org/wiki/HSL_and_HSV#HSL_to_HSV
|
|
425
|
+
*/
|
|
426
|
+
export declare function hslToHsv(hsl: iHSL): iHSV;
|
|
408
427
|
/**
|
|
409
428
|
* Returns a color that is `percent` brighter than the reference color.
|
|
410
429
|
*
|
|
411
|
-
* @ignore Exclude from docs
|
|
412
430
|
* @param color Reference color
|
|
413
431
|
* @param percent Brightness percent
|
|
414
432
|
* @return Hex code of the new color
|
|
@@ -417,7 +435,6 @@ export declare function lighten(rgb: $type.Optional<iRGB>, percent: number): $ty
|
|
|
417
435
|
/**
|
|
418
436
|
* Gets lightness step.
|
|
419
437
|
*
|
|
420
|
-
* @ignore Exclude from docs
|
|
421
438
|
* @param value Value
|
|
422
439
|
* @param percent Percent
|
|
423
440
|
* @return Step
|
|
@@ -426,7 +443,6 @@ export declare function getLightnessStep(value: number, percent: number): number
|
|
|
426
443
|
/**
|
|
427
444
|
* Returns a color that is `percent` brighter than the source `color`.
|
|
428
445
|
*
|
|
429
|
-
* @ignore Exclude from docs
|
|
430
446
|
* @param color Source color
|
|
431
447
|
* @param percent Brightness percent
|
|
432
448
|
* @return New color
|
|
@@ -446,7 +462,6 @@ export declare function getBrightnessStep(_value: number, percent: number): numb
|
|
|
446
462
|
* color to use for elements over this color. E.g.: you would want to use
|
|
447
463
|
* black text over light background, and vice versa.
|
|
448
464
|
*
|
|
449
|
-
* @ignore Exclude from docs
|
|
450
465
|
* @param color Source color
|
|
451
466
|
* @return Light?
|
|
452
467
|
*/
|
|
@@ -458,12 +473,19 @@ export declare function isLight(color: iRGB): boolean;
|
|
|
458
473
|
* `saturation` can be in the range of 0 (fully desaturated) to 1 (fully
|
|
459
474
|
* saturated).
|
|
460
475
|
*
|
|
461
|
-
* @ignore Exclude from docs
|
|
462
476
|
* @param color Base color
|
|
463
477
|
* @param saturation Saturation (0-1)
|
|
464
478
|
* @return New color
|
|
465
479
|
*/
|
|
466
480
|
export declare function saturate(rgb: $type.Optional<iRGB>, saturation: number): $type.Optional<iRGB>;
|
|
481
|
+
/**
|
|
482
|
+
* Returns a color which contrasts more with the source `color`.
|
|
483
|
+
*
|
|
484
|
+
* @param color Base color
|
|
485
|
+
* @param lightAlternative Light option
|
|
486
|
+
* @param darkAlternative Dark option
|
|
487
|
+
* @return New color
|
|
488
|
+
*/
|
|
467
489
|
export declare function alternativeColor(color: iRGB, lightAlternative?: iRGB, darkAlternative?: iRGB): iRGB;
|
|
468
490
|
/**
|
|
469
491
|
* @ignore
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Utils.d.ts","sourceRoot":"","sources":["../../../../../src/.internal/core/util/Utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAE/C,OAAO,KAAK,KAAK,MAAM,QAAQ,CAAC;AAGhC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC,OAAO,EAAY,aAAa,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAEhE;;;;;GAKG;AAEH;;;;;GAKG;AACH,wBAAgB,KAAK,CAAC,CAAC,EAAE,MAAM,IAAI,GAAG,IAAI,CAczC;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,EAAE,EAAE,WAAW,GAAG,IAAI,CAInD;AAED;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,SAAS,KAAK,EAAE,GAAG,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,IAAI,EAAE,OAAO,CAAC,EAAE,GAAG,GAAG,SAAS,CAOxI;AAED;;;;;GAKG;AACH,wBAAgB,MAAM,CAAC,QAAQ,EAAE,MAA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,KAAK,EAAE,IAAI,EAAE,gBAAgB,GAAE,IAAiC,EAAE,eAAe,GAAE,IAAiC,GAAG,IAAI,CAQ3J;AAED;;GAEG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,CAOhF;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC,EAAE,OAAO,GAAG,OAAO,CAiB3D"}
|
|
@@ -968,7 +968,6 @@ export function capitalizeFirst(text) {
|
|
|
968
968
|
* Function adapted from:
|
|
969
969
|
* http://axonflux.com/handy-rgb-to-hsl-and-rgb-to-hsv-color-model-c
|
|
970
970
|
*
|
|
971
|
-
* @ignore Exclude from docs
|
|
972
971
|
* @param h The hue
|
|
973
972
|
* @param s The saturation
|
|
974
973
|
* @param l The lightness
|
|
@@ -1022,7 +1021,6 @@ export function hslToRgb(color) {
|
|
|
1022
1021
|
* Function adapted from:
|
|
1023
1022
|
* http://axonflux.com/handy-rgb-to-hsl-and-rgb-to-hsv-color-model-c
|
|
1024
1023
|
*
|
|
1025
|
-
* @ignore Exclude from docs
|
|
1026
1024
|
* @param r The red color value
|
|
1027
1025
|
* @param g The green color value
|
|
1028
1026
|
* @param b The blue color value
|
|
@@ -1059,13 +1057,46 @@ export function rgbToHsl(color) {
|
|
|
1059
1057
|
return {
|
|
1060
1058
|
h: h,
|
|
1061
1059
|
s: s,
|
|
1062
|
-
l: l
|
|
1060
|
+
l: l,
|
|
1061
|
+
};
|
|
1062
|
+
}
|
|
1063
|
+
/**
|
|
1064
|
+
* Converts HSV to HSL.
|
|
1065
|
+
*
|
|
1066
|
+
* https://en.wikipedia.org/wiki/HSL_and_HSV#HSV_to_HSL
|
|
1067
|
+
*/
|
|
1068
|
+
export function hsvToHsl(hsv) {
|
|
1069
|
+
const l = hsv.v * (1 - (hsv.s / 2));
|
|
1070
|
+
const s = (l === 0 || l === 1
|
|
1071
|
+
? 0
|
|
1072
|
+
: (hsv.v - l) / Math.min(l, 1 - l));
|
|
1073
|
+
return {
|
|
1074
|
+
h: hsv.h,
|
|
1075
|
+
s,
|
|
1076
|
+
l,
|
|
1077
|
+
a: hsv.a,
|
|
1078
|
+
};
|
|
1079
|
+
}
|
|
1080
|
+
/**
|
|
1081
|
+
* Converts HSL to HSV.
|
|
1082
|
+
*
|
|
1083
|
+
* https://en.wikipedia.org/wiki/HSL_and_HSV#HSL_to_HSV
|
|
1084
|
+
*/
|
|
1085
|
+
export function hslToHsv(hsl) {
|
|
1086
|
+
const v = hsl.l + (hsl.s * Math.min(hsl.l, 1 - hsl.l));
|
|
1087
|
+
const s = (v === 0
|
|
1088
|
+
? 0
|
|
1089
|
+
: 2 * (1 - (hsl.l / v)));
|
|
1090
|
+
return {
|
|
1091
|
+
h: hsl.h,
|
|
1092
|
+
s,
|
|
1093
|
+
v,
|
|
1094
|
+
a: hsl.a,
|
|
1063
1095
|
};
|
|
1064
1096
|
}
|
|
1065
1097
|
/**
|
|
1066
1098
|
* Returns a color that is `percent` brighter than the reference color.
|
|
1067
1099
|
*
|
|
1068
|
-
* @ignore Exclude from docs
|
|
1069
1100
|
* @param color Reference color
|
|
1070
1101
|
* @param percent Brightness percent
|
|
1071
1102
|
* @return Hex code of the new color
|
|
@@ -1088,7 +1119,6 @@ export function lighten(rgb, percent) {
|
|
|
1088
1119
|
/**
|
|
1089
1120
|
* Gets lightness step.
|
|
1090
1121
|
*
|
|
1091
|
-
* @ignore Exclude from docs
|
|
1092
1122
|
* @param value Value
|
|
1093
1123
|
* @param percent Percent
|
|
1094
1124
|
* @return Step
|
|
@@ -1100,7 +1130,6 @@ export function getLightnessStep(value, percent) {
|
|
|
1100
1130
|
/**
|
|
1101
1131
|
* Returns a color that is `percent` brighter than the source `color`.
|
|
1102
1132
|
*
|
|
1103
|
-
* @ignore Exclude from docs
|
|
1104
1133
|
* @param color Source color
|
|
1105
1134
|
* @param percent Brightness percent
|
|
1106
1135
|
* @return New color
|
|
@@ -1140,7 +1169,6 @@ export function getBrightnessStep(_value, percent) {
|
|
|
1140
1169
|
* color to use for elements over this color. E.g.: you would want to use
|
|
1141
1170
|
* black text over light background, and vice versa.
|
|
1142
1171
|
*
|
|
1143
|
-
* @ignore Exclude from docs
|
|
1144
1172
|
* @param color Source color
|
|
1145
1173
|
* @return Light?
|
|
1146
1174
|
*/
|
|
@@ -1154,7 +1182,6 @@ export function isLight(color) {
|
|
|
1154
1182
|
* `saturation` can be in the range of 0 (fully desaturated) to 1 (fully
|
|
1155
1183
|
* saturated).
|
|
1156
1184
|
*
|
|
1157
|
-
* @ignore Exclude from docs
|
|
1158
1185
|
* @param color Base color
|
|
1159
1186
|
* @param saturation Saturation (0-1)
|
|
1160
1187
|
* @return New color
|
|
@@ -1167,6 +1194,14 @@ export function saturate(rgb, saturation) {
|
|
|
1167
1194
|
hsl.s = saturation;
|
|
1168
1195
|
return hslToRgb(hsl);
|
|
1169
1196
|
}
|
|
1197
|
+
/**
|
|
1198
|
+
* Returns a color which contrasts more with the source `color`.
|
|
1199
|
+
*
|
|
1200
|
+
* @param color Base color
|
|
1201
|
+
* @param lightAlternative Light option
|
|
1202
|
+
* @param darkAlternative Dark option
|
|
1203
|
+
* @return New color
|
|
1204
|
+
*/
|
|
1170
1205
|
export function alternativeColor(color, lightAlternative = { r: 255, g: 255, b: 255 }, darkAlternative = { r: 255, g: 255, b: 255 }) {
|
|
1171
1206
|
let light = lightAlternative;
|
|
1172
1207
|
let dark = darkAlternative;
|