@circutor/charts 0.2.0 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bundler/itic-chart.js +1 -1
- package/dist/charts/charts.esm.js +1 -1
- package/dist/charts/p-70293967.entry.js +25 -0
- package/dist/cjs/charts.cjs.js +1 -1
- package/dist/cjs/itic-chart.cjs.entry.js +452 -100
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/components/itic-chart/index.js +59 -58
- package/dist/collection/components/itic-chart/itic-chart.i18n.js +26 -0
- package/dist/collection/components/itic-chart/itic-chart.options.js +100 -42
- package/dist/collection/components/itic-chart/itic-chart.phases.js +55 -0
- package/dist/collection/playground/itic-chart.scenarios.js +129 -0
- package/dist/collection/playground/playground.js +170 -0
- package/dist/components/itic-chart.js +2 -2
- package/dist/esm/charts.js +1 -1
- package/dist/esm/itic-chart.entry.js +452 -100
- package/dist/esm/loader.js +1 -1
- package/dist/types/components/itic-chart/index.d.ts +19 -15
- package/dist/types/components/itic-chart/itic-chart.i18n.d.ts +13 -0
- package/dist/types/components/itic-chart/itic-chart.options.d.ts +32 -17
- package/dist/types/components/itic-chart/itic-chart.phases.d.ts +17 -0
- package/dist/types/components.d.ts +19 -29
- package/dist/types/index.d.ts +1 -1
- package/package.json +2 -5
- package/readme.md +138 -73
- package/dist/charts/p-943aa343.entry.js +0 -25
|
@@ -721,7 +721,7 @@ function disableUserSelect(dom) {
|
|
|
721
721
|
domStyle.webkitTapHighlightColor = 'rgba(0,0,0,0)';
|
|
722
722
|
domStyle['-webkit-touch-callout'] = 'none';
|
|
723
723
|
}
|
|
724
|
-
function hasOwn(own, prop) {
|
|
724
|
+
function hasOwn$1(own, prop) {
|
|
725
725
|
return own.hasOwnProperty(prop);
|
|
726
726
|
}
|
|
727
727
|
function noop() { }
|
|
@@ -14810,7 +14810,7 @@ function setTooltipConfig(opt) {
|
|
|
14810
14810
|
var formatterParamsExtra = opt.formatterParamsExtra;
|
|
14811
14811
|
if (formatterParamsExtra) {
|
|
14812
14812
|
each$4(keys(formatterParamsExtra), function (key) {
|
|
14813
|
-
if (!hasOwn(formatterParams, key)) {
|
|
14813
|
+
if (!hasOwn$1(formatterParams, key)) {
|
|
14814
14814
|
formatterParams[key] = formatterParamsExtra[key];
|
|
14815
14815
|
formatterParams.$vars.push(key);
|
|
14816
14816
|
}
|
|
@@ -16140,12 +16140,12 @@ var langZH = {
|
|
|
16140
16140
|
|
|
16141
16141
|
var LOCALE_ZH = 'ZH';
|
|
16142
16142
|
var LOCALE_EN = 'EN';
|
|
16143
|
-
var DEFAULT_LOCALE = LOCALE_EN;
|
|
16143
|
+
var DEFAULT_LOCALE$1 = LOCALE_EN;
|
|
16144
16144
|
var localeStorage = {};
|
|
16145
16145
|
var localeModels = {};
|
|
16146
|
-
var SYSTEM_LANG = !env.domSupported ? DEFAULT_LOCALE : function () {
|
|
16147
|
-
var langStr = (document.documentElement.lang || navigator.language || navigator.browserLanguage || DEFAULT_LOCALE).toUpperCase();
|
|
16148
|
-
return langStr.indexOf(LOCALE_ZH) > -1 ? LOCALE_ZH : DEFAULT_LOCALE;
|
|
16146
|
+
var SYSTEM_LANG = !env.domSupported ? DEFAULT_LOCALE$1 : function () {
|
|
16147
|
+
var langStr = (document.documentElement.lang || navigator.language || navigator.browserLanguage || DEFAULT_LOCALE$1).toUpperCase();
|
|
16148
|
+
return langStr.indexOf(LOCALE_ZH) > -1 ? LOCALE_ZH : DEFAULT_LOCALE$1;
|
|
16149
16149
|
}();
|
|
16150
16150
|
function registerLocale(locale, localeObj) {
|
|
16151
16151
|
locale = locale.toUpperCase();
|
|
@@ -16161,17 +16161,17 @@ function createLocaleObject(locale) {
|
|
|
16161
16161
|
if (locale === LOCALE_ZH || locale === LOCALE_EN) {
|
|
16162
16162
|
return clone$2(localeObj);
|
|
16163
16163
|
} else {
|
|
16164
|
-
return merge(clone$2(localeObj), clone$2(localeStorage[DEFAULT_LOCALE]), false);
|
|
16164
|
+
return merge(clone$2(localeObj), clone$2(localeStorage[DEFAULT_LOCALE$1]), false);
|
|
16165
16165
|
}
|
|
16166
16166
|
} else {
|
|
16167
|
-
return merge(clone$2(locale), clone$2(localeStorage[DEFAULT_LOCALE]), false);
|
|
16167
|
+
return merge(clone$2(locale), clone$2(localeStorage[DEFAULT_LOCALE$1]), false);
|
|
16168
16168
|
}
|
|
16169
16169
|
}
|
|
16170
16170
|
function getLocaleModel(lang) {
|
|
16171
16171
|
return localeModels[lang];
|
|
16172
16172
|
}
|
|
16173
16173
|
function getDefaultLocaleModel() {
|
|
16174
|
-
return localeModels[DEFAULT_LOCALE];
|
|
16174
|
+
return localeModels[DEFAULT_LOCALE$1];
|
|
16175
16175
|
}
|
|
16176
16176
|
// Default locale
|
|
16177
16177
|
registerLocale(LOCALE_EN, langEN);
|
|
@@ -17207,7 +17207,7 @@ function mergeLayoutParam(targetOption, newOption, opt) {
|
|
|
17207
17207
|
each$3(names, function (name) {
|
|
17208
17208
|
// Consider case: newOption.width is null, which is
|
|
17209
17209
|
// set by user for removing width setting.
|
|
17210
|
-
hasOwn(newOption, name) && (newParams[name] = merged[name] = newOption[name]);
|
|
17210
|
+
hasOwn$1(newOption, name) && (newParams[name] = merged[name] = newOption[name]);
|
|
17211
17211
|
hasValue(newParams, name) && newValueCount++;
|
|
17212
17212
|
hasValue(merged, name) && mergedValueCount++;
|
|
17213
17213
|
});
|
|
@@ -17236,7 +17236,7 @@ function mergeLayoutParam(targetOption, newOption, opt) {
|
|
|
17236
17236
|
// Chose another param from targetOption by priority.
|
|
17237
17237
|
for (var i = 0; i < names.length; i++) {
|
|
17238
17238
|
var name_1 = names[i];
|
|
17239
|
-
if (!hasOwn(newParams, name_1) && hasOwn(targetOption, name_1)) {
|
|
17239
|
+
if (!hasOwn$1(newParams, name_1) && hasOwn$1(targetOption, name_1)) {
|
|
17240
17240
|
newParams[name_1] = targetOption[name_1];
|
|
17241
17241
|
break;
|
|
17242
17242
|
}
|
|
@@ -17266,7 +17266,7 @@ function getLayoutParams(source) {
|
|
|
17266
17266
|
*/
|
|
17267
17267
|
function copyLayoutParams(target, source) {
|
|
17268
17268
|
source && target && each$3(LOCATION_PARAMS, function (name) {
|
|
17269
|
-
hasOwn(source, name) && (target[name] = source[name]);
|
|
17269
|
+
hasOwn$1(source, name) && (target[name] = source[name]);
|
|
17270
17270
|
});
|
|
17271
17271
|
return target;
|
|
17272
17272
|
}
|
|
@@ -18833,13 +18833,13 @@ function applyMediaQuery(query, ecWidth, ecHeight) {
|
|
|
18833
18833
|
}
|
|
18834
18834
|
var operator = matched[1];
|
|
18835
18835
|
var realAttr = matched[2].toLowerCase();
|
|
18836
|
-
if (!compare(realMap[realAttr], value, operator)) {
|
|
18836
|
+
if (!compare$1(realMap[realAttr], value, operator)) {
|
|
18837
18837
|
applicable = false;
|
|
18838
18838
|
}
|
|
18839
18839
|
});
|
|
18840
18840
|
return applicable;
|
|
18841
18841
|
}
|
|
18842
|
-
function compare(real, expect, operator) {
|
|
18842
|
+
function compare$1(real, expect, operator) {
|
|
18843
18843
|
if (operator === 'min') {
|
|
18844
18844
|
return real >= expect;
|
|
18845
18845
|
} else if (operator === 'max') {
|
|
@@ -19487,7 +19487,7 @@ function detectSourceFormat(data) {
|
|
|
19487
19487
|
}
|
|
19488
19488
|
} else if (isObject$2(data)) {
|
|
19489
19489
|
for (var key in data) {
|
|
19490
|
-
if (hasOwn(data, key) && isArrayLike(data[key])) {
|
|
19490
|
+
if (hasOwn$1(data, key) && isArrayLike(data[key])) {
|
|
19491
19491
|
sourceFormat = SOURCE_FORMAT_KEYED_COLUMNS;
|
|
19492
19492
|
break;
|
|
19493
19493
|
}
|
|
@@ -20599,7 +20599,7 @@ function createExternalSource(internalSource, externalTransform) {
|
|
|
20599
20599
|
// For simplicity, data transform forbids name duplication, do not generate
|
|
20600
20600
|
// new name like module `completeDimensions.ts` did, but just tell users.
|
|
20601
20601
|
var errMsg_1 = '';
|
|
20602
|
-
if (hasOwn(dimsByName, name)) {
|
|
20602
|
+
if (hasOwn$1(dimsByName, name)) {
|
|
20603
20603
|
throwError(errMsg_1);
|
|
20604
20604
|
}
|
|
20605
20605
|
dimsByName[name] = dimDefExt;
|
|
@@ -20685,9 +20685,9 @@ function getDimensionInfo(dimensions, dimsByName, dim) {
|
|
|
20685
20685
|
// Keep the same logic as `List::getDimension` did.
|
|
20686
20686
|
if (isNumber(dim)
|
|
20687
20687
|
// If being a number-like string but not being defined a dimension name.
|
|
20688
|
-
|| !isNaN(dim) && !hasOwn(dimsByName, dim)) {
|
|
20688
|
+
|| !isNaN(dim) && !hasOwn$1(dimsByName, dim)) {
|
|
20689
20689
|
return dimensions[dim];
|
|
20690
|
-
} else if (hasOwn(dimsByName, dim)) {
|
|
20690
|
+
} else if (hasOwn$1(dimsByName, dim)) {
|
|
20691
20691
|
return dimsByName[dim];
|
|
20692
20692
|
}
|
|
20693
20693
|
}
|
|
@@ -22219,7 +22219,7 @@ function buildSection(ctx, fragment, topMarginForOuterGap, toolTipTextStyle) {
|
|
|
22219
22219
|
valueAsc: 'asc',
|
|
22220
22220
|
valueDesc: 'desc'
|
|
22221
22221
|
};
|
|
22222
|
-
if (hasOwn(orderMap, orderMode)) {
|
|
22222
|
+
if (hasOwn$1(orderMap, orderMode)) {
|
|
22223
22223
|
var comparator_1 = new SortOrderComparator(orderMap[orderMode], null);
|
|
22224
22224
|
subBlocks.sort(function (a, b) {
|
|
22225
22225
|
return comparator_1.evaluate(a.sortParam, b.sortParam);
|
|
@@ -31938,7 +31938,7 @@ function determineAxisType(model) {
|
|
|
31938
31938
|
// PENDING: Theoretically, a customized `Scale` is probably impossible, since
|
|
31939
31939
|
// the interface of `Scale` does not guarantee stability. But we still literally
|
|
31940
31940
|
// support it for backward compat, though type incorrect.
|
|
31941
|
-
|| !hasOwn(AXIS_TYPES, type) && !Scale.getClass(type)) {
|
|
31941
|
+
|| !hasOwn$1(AXIS_TYPES, type) && !Scale.getClass(type)) {
|
|
31942
31942
|
type = 'value';
|
|
31943
31943
|
}
|
|
31944
31944
|
return type;
|
|
@@ -39093,7 +39093,7 @@ onZeroRecords) {
|
|
|
39093
39093
|
} else {
|
|
39094
39094
|
// Find the first available other axis.
|
|
39095
39095
|
for (var idx in otherAxes) {
|
|
39096
|
-
if (hasOwn(otherAxes, idx) && canOnZeroToAxis(onZero, otherAxes[idx])
|
|
39096
|
+
if (hasOwn$1(otherAxes, idx) && canOnZeroToAxis(onZero, otherAxes[idx])
|
|
39097
39097
|
// Consider that two Y axes on one value axis,
|
|
39098
39098
|
// if both onZero, the two Y axes overlap.
|
|
39099
39099
|
&& !onZeroRecords[getOnZeroRecordKey(otherAxes[idx])]) {
|
|
@@ -43537,7 +43537,7 @@ function makeSelectedMap(legendModel, out) {
|
|
|
43537
43537
|
return;
|
|
43538
43538
|
}
|
|
43539
43539
|
var isItemSelected = legendModel.isSelected(name);
|
|
43540
|
-
if (hasOwn(selectedMap, name)) {
|
|
43540
|
+
if (hasOwn$1(selectedMap, name)) {
|
|
43541
43541
|
// Unselected if any legend is unselected
|
|
43542
43542
|
selectedMap[name] = selectedMap[name] && isItemSelected;
|
|
43543
43543
|
} else {
|
|
@@ -45099,28 +45099,299 @@ function install(registers) {
|
|
|
45099
45099
|
registers.registerPainter('canvas', CanvasPainter);
|
|
45100
45100
|
}
|
|
45101
45101
|
|
|
45102
|
-
|
|
45103
|
-
|
|
45104
|
-
|
|
45102
|
+
const ariaLabel$5 = "Corba ITIC";
|
|
45103
|
+
const xAxisName$5 = "Durada (ms)";
|
|
45104
|
+
const yAxisName$5 = "Voltatge (% del voltatge nominal)";
|
|
45105
|
+
const tooltip$5 = {
|
|
45106
|
+
asset: "Actiu",
|
|
45107
|
+
date: "Data",
|
|
45108
|
+
eventType: "Esdeveniment",
|
|
45109
|
+
duration: "Durada",
|
|
45110
|
+
voltage: "Voltatge",
|
|
45111
|
+
status: "Estat",
|
|
45112
|
+
phase: "Fase",
|
|
45113
|
+
min: "Mín.",
|
|
45114
|
+
max: "Màx."
|
|
45115
|
+
};
|
|
45116
|
+
const eventTypes$5 = {
|
|
45117
|
+
VOLTAGE_DIP: "Buit de tensió",
|
|
45118
|
+
VOLTAGE_SWELL: "Augment de tensió",
|
|
45119
|
+
POWER_INTERRUPT: "Interrupció",
|
|
45120
|
+
VOLTAGE_TRANSIENT: "Transitori de voltatge",
|
|
45121
|
+
VOLTAGE_VARIATION: "Variació de voltatge",
|
|
45122
|
+
OVER_VOLTAGE: "Sobretensió",
|
|
45123
|
+
SUB_VOLTAGE: "Subtensió"
|
|
45124
|
+
};
|
|
45125
|
+
const phases$5 = {
|
|
45126
|
+
ALL: "Totes",
|
|
45127
|
+
NONE: ""
|
|
45128
|
+
};
|
|
45129
|
+
var ca = {
|
|
45130
|
+
ariaLabel: ariaLabel$5,
|
|
45131
|
+
xAxisName: xAxisName$5,
|
|
45132
|
+
yAxisName: yAxisName$5,
|
|
45133
|
+
tooltip: tooltip$5,
|
|
45134
|
+
eventTypes: eventTypes$5,
|
|
45135
|
+
phases: phases$5
|
|
45136
|
+
};
|
|
45105
45137
|
|
|
45106
|
-
|
|
45138
|
+
const ariaLabel$4 = "ITIC-Diagramm";
|
|
45139
|
+
const xAxisName$4 = "Dauer (ms)";
|
|
45140
|
+
const yAxisName$4 = "Spannung (% der Nennspannung)";
|
|
45141
|
+
const tooltip$4 = {
|
|
45142
|
+
asset: "Vermögenswert",
|
|
45143
|
+
date: "Datum",
|
|
45144
|
+
eventType: "Ereignis",
|
|
45145
|
+
duration: "Dauer",
|
|
45146
|
+
voltage: "Spannung",
|
|
45147
|
+
status: "Status",
|
|
45148
|
+
phase: "Phase",
|
|
45149
|
+
min: "Min.",
|
|
45150
|
+
max: "Max."
|
|
45151
|
+
};
|
|
45152
|
+
const eventTypes$4 = {
|
|
45153
|
+
VOLTAGE_DIP: "Spannungseinbruch",
|
|
45154
|
+
VOLTAGE_SWELL: "Spannungserhöhung",
|
|
45155
|
+
POWER_INTERRUPT: "Stromunterbrechung",
|
|
45156
|
+
VOLTAGE_TRANSIENT: "Spannungstransient",
|
|
45157
|
+
VOLTAGE_VARIATION: "Spannungsschwankung",
|
|
45158
|
+
OVER_VOLTAGE: "Überspannung",
|
|
45159
|
+
SUB_VOLTAGE: "Unterspannung"
|
|
45160
|
+
};
|
|
45161
|
+
const phases$4 = {
|
|
45162
|
+
ALL: "Alle",
|
|
45163
|
+
NONE: ""
|
|
45164
|
+
};
|
|
45165
|
+
var de = {
|
|
45166
|
+
ariaLabel: ariaLabel$4,
|
|
45167
|
+
xAxisName: xAxisName$4,
|
|
45168
|
+
yAxisName: yAxisName$4,
|
|
45169
|
+
tooltip: tooltip$4,
|
|
45170
|
+
eventTypes: eventTypes$4,
|
|
45171
|
+
phases: phases$4
|
|
45172
|
+
};
|
|
45107
45173
|
|
|
45108
|
-
|
|
45174
|
+
const ariaLabel$3 = "ITIC chart";
|
|
45175
|
+
const xAxisName$3 = "Duration (ms)";
|
|
45176
|
+
const yAxisName$3 = "Voltage (% of nominal voltage)";
|
|
45177
|
+
const tooltip$3 = {
|
|
45178
|
+
asset: "Asset",
|
|
45179
|
+
date: "Date",
|
|
45180
|
+
eventType: "Event",
|
|
45181
|
+
duration: "Duration",
|
|
45182
|
+
voltage: "Voltage",
|
|
45183
|
+
status: "Status",
|
|
45184
|
+
phase: "Phase",
|
|
45185
|
+
min: "Min",
|
|
45186
|
+
max: "Max"
|
|
45187
|
+
};
|
|
45188
|
+
const eventTypes$3 = {
|
|
45189
|
+
VOLTAGE_DIP: "Voltage dip",
|
|
45190
|
+
VOLTAGE_SWELL: "Voltage swell",
|
|
45191
|
+
POWER_INTERRUPT: "Power interruption",
|
|
45192
|
+
VOLTAGE_TRANSIENT: "Voltage transient",
|
|
45193
|
+
VOLTAGE_VARIATION: "Voltage variation",
|
|
45194
|
+
OVER_VOLTAGE: "Overvoltage",
|
|
45195
|
+
SUB_VOLTAGE: "Subvoltage"
|
|
45196
|
+
};
|
|
45197
|
+
const phases$3 = {
|
|
45198
|
+
ALL: "All",
|
|
45199
|
+
NONE: ""
|
|
45200
|
+
};
|
|
45201
|
+
var en = {
|
|
45202
|
+
ariaLabel: ariaLabel$3,
|
|
45203
|
+
xAxisName: xAxisName$3,
|
|
45204
|
+
yAxisName: yAxisName$3,
|
|
45205
|
+
tooltip: tooltip$3,
|
|
45206
|
+
eventTypes: eventTypes$3,
|
|
45207
|
+
phases: phases$3
|
|
45208
|
+
};
|
|
45109
45209
|
|
|
45110
|
-
|
|
45210
|
+
const ariaLabel$2 = "Curva ITIC";
|
|
45211
|
+
const xAxisName$2 = "Duración (ms)";
|
|
45212
|
+
const yAxisName$2 = "Voltaje (% del voltaje nominal)";
|
|
45213
|
+
const tooltip$2 = {
|
|
45214
|
+
asset: "Activo",
|
|
45215
|
+
date: "Fecha",
|
|
45216
|
+
eventType: "Evento",
|
|
45217
|
+
duration: "Duración",
|
|
45218
|
+
voltage: "Voltaje",
|
|
45219
|
+
status: "Estado",
|
|
45220
|
+
phase: "Fase",
|
|
45221
|
+
min: "Mín.",
|
|
45222
|
+
max: "Máx."
|
|
45223
|
+
};
|
|
45224
|
+
const eventTypes$2 = {
|
|
45225
|
+
VOLTAGE_DIP: "Hueco de tensión",
|
|
45226
|
+
VOLTAGE_SWELL: "Aumento de tensión",
|
|
45227
|
+
POWER_INTERRUPT: "Interrupción",
|
|
45228
|
+
VOLTAGE_TRANSIENT: "Transitorio de voltaje",
|
|
45229
|
+
VOLTAGE_VARIATION: "Variación de voltaje",
|
|
45230
|
+
OVER_VOLTAGE: "Sobretensión",
|
|
45231
|
+
SUB_VOLTAGE: "Subtensión"
|
|
45232
|
+
};
|
|
45233
|
+
const phases$2 = {
|
|
45234
|
+
ALL: "Todas",
|
|
45235
|
+
NONE: ""
|
|
45236
|
+
};
|
|
45237
|
+
var es = {
|
|
45238
|
+
ariaLabel: ariaLabel$2,
|
|
45239
|
+
xAxisName: xAxisName$2,
|
|
45240
|
+
yAxisName: yAxisName$2,
|
|
45241
|
+
tooltip: tooltip$2,
|
|
45242
|
+
eventTypes: eventTypes$2,
|
|
45243
|
+
phases: phases$2
|
|
45244
|
+
};
|
|
45111
45245
|
|
|
45112
|
-
|
|
45113
|
-
|
|
45114
|
-
|
|
45115
|
-
|
|
45116
|
-
|
|
45117
|
-
|
|
45118
|
-
|
|
45119
|
-
|
|
45246
|
+
const ariaLabel$1 = "Courbe ITIC";
|
|
45247
|
+
const xAxisName$1 = "Durée (ms)";
|
|
45248
|
+
const yAxisName$1 = "Tension (% de la tension nominale)";
|
|
45249
|
+
const tooltip$1 = {
|
|
45250
|
+
asset: "Dispositif",
|
|
45251
|
+
date: "Date",
|
|
45252
|
+
eventType: "Événement",
|
|
45253
|
+
duration: "Durée",
|
|
45254
|
+
voltage: "Tension",
|
|
45255
|
+
status: "Statut",
|
|
45256
|
+
phase: "Phase",
|
|
45257
|
+
min: "Min.",
|
|
45258
|
+
max: "Max."
|
|
45259
|
+
};
|
|
45260
|
+
const eventTypes$1 = {
|
|
45261
|
+
VOLTAGE_DIP: "Creux de tension",
|
|
45262
|
+
VOLTAGE_SWELL: "Augmentation de tension",
|
|
45263
|
+
POWER_INTERRUPT: "Interruption",
|
|
45264
|
+
VOLTAGE_TRANSIENT: "Tension transitoire",
|
|
45265
|
+
VOLTAGE_VARIATION: "Variation de tension",
|
|
45266
|
+
OVER_VOLTAGE: "Surtension",
|
|
45267
|
+
SUB_VOLTAGE: "Sous-tension"
|
|
45268
|
+
};
|
|
45269
|
+
const phases$1 = {
|
|
45270
|
+
ALL: "Toutes",
|
|
45271
|
+
NONE: ""
|
|
45272
|
+
};
|
|
45273
|
+
var fr = {
|
|
45274
|
+
ariaLabel: ariaLabel$1,
|
|
45275
|
+
xAxisName: xAxisName$1,
|
|
45276
|
+
yAxisName: yAxisName$1,
|
|
45277
|
+
tooltip: tooltip$1,
|
|
45278
|
+
eventTypes: eventTypes$1,
|
|
45279
|
+
phases: phases$1
|
|
45280
|
+
};
|
|
45120
45281
|
|
|
45121
|
-
|
|
45122
|
-
|
|
45282
|
+
const ariaLabel = "Curva ITIC";
|
|
45283
|
+
const xAxisName = "Duração (ms)";
|
|
45284
|
+
const yAxisName = "Tensão (% da tensão nominal)";
|
|
45285
|
+
const tooltip = {
|
|
45286
|
+
asset: "Ativo",
|
|
45287
|
+
date: "Data",
|
|
45288
|
+
eventType: "Evento",
|
|
45289
|
+
duration: "Duração",
|
|
45290
|
+
voltage: "Tensão",
|
|
45291
|
+
status: "Status",
|
|
45292
|
+
phase: "Fase",
|
|
45293
|
+
min: "Mín.",
|
|
45294
|
+
max: "Máx."
|
|
45295
|
+
};
|
|
45296
|
+
const eventTypes = {
|
|
45297
|
+
VOLTAGE_DIP: "Queda de tensão",
|
|
45298
|
+
VOLTAGE_SWELL: "Aumento de tensão",
|
|
45299
|
+
POWER_INTERRUPT: "Interrupção",
|
|
45300
|
+
VOLTAGE_TRANSIENT: "Tensão transitória",
|
|
45301
|
+
VOLTAGE_VARIATION: "Variação de tensão",
|
|
45302
|
+
OVER_VOLTAGE: "Sobretensão",
|
|
45303
|
+
SUB_VOLTAGE: "Subtensão"
|
|
45304
|
+
};
|
|
45305
|
+
const phases = {
|
|
45306
|
+
ALL: "Todas",
|
|
45307
|
+
NONE: ""
|
|
45308
|
+
};
|
|
45309
|
+
var pt = {
|
|
45310
|
+
ariaLabel: ariaLabel,
|
|
45311
|
+
xAxisName: xAxisName,
|
|
45312
|
+
yAxisName: yAxisName,
|
|
45313
|
+
tooltip: tooltip,
|
|
45314
|
+
eventTypes: eventTypes,
|
|
45315
|
+
phases: phases
|
|
45316
|
+
};
|
|
45123
45317
|
|
|
45318
|
+
const LOCALES = ['ca', 'de', 'en', 'es', 'fr', 'pt'];
|
|
45319
|
+
const DEFAULT_LOCALE = 'en';
|
|
45320
|
+
const MESSAGES = { ca, de, en, es, fr, pt };
|
|
45321
|
+
/** Keeps the language of a locale (`es-ES` → `es`), falling back to `en` when it isn't translated. */
|
|
45322
|
+
function normalizeLocale(locale) {
|
|
45323
|
+
const language = String(locale !== null && locale !== void 0 ? locale : '')
|
|
45324
|
+
.split(/[-_]/)[0]
|
|
45325
|
+
.toLowerCase();
|
|
45326
|
+
return LOCALES.includes(language) ? language : DEFAULT_LOCALE;
|
|
45327
|
+
}
|
|
45328
|
+
const getMessages = (locale) => MESSAGES[locale];
|
|
45329
|
+
const hasOwn = (object, key) => Object.prototype.hasOwnProperty.call(object, key);
|
|
45330
|
+
/** Translated event type, or the code as is when it isn't in the catalog. */
|
|
45331
|
+
function translateEventType(messages, code) {
|
|
45332
|
+
return hasOwn(messages.eventTypes, code) ? messages.eventTypes[code] : code;
|
|
45333
|
+
}
|
|
45334
|
+
/** Translated name of a phase code that has one (`ALL`, `NONE`), or `undefined`. */
|
|
45335
|
+
function translatePhase(messages, code) {
|
|
45336
|
+
return hasOwn(messages.phases, code) ? messages.phases[code] : undefined;
|
|
45337
|
+
}
|
|
45338
|
+
|
|
45339
|
+
const L1 = '#a67c52';
|
|
45340
|
+
const L2 = '#20262C';
|
|
45341
|
+
const L3 = '#B9BDC0';
|
|
45342
|
+
const THREE_PHASE = '#00B388';
|
|
45343
|
+
// Same catalog as Scout. Names that change with the language (`ALL`, `NONE`) are in the i18n JSON files.
|
|
45344
|
+
const PHASES = {
|
|
45345
|
+
AN: { name: 'L1', color: L1 },
|
|
45346
|
+
BN: { name: 'L2', color: L2 },
|
|
45347
|
+
CN: { name: 'L3', color: L3 },
|
|
45348
|
+
AB: { name: 'L1', color: L1 },
|
|
45349
|
+
BC: { name: 'L2', color: L2 },
|
|
45350
|
+
CA: { name: 'L3', color: L3 },
|
|
45351
|
+
'AN,BN,CN': { name: 'L1,L2,L3', color: THREE_PHASE },
|
|
45352
|
+
'AB,BC,CA': { name: 'L1,L2,L3', color: THREE_PHASE },
|
|
45353
|
+
ALL: { name: '', color: '#4C5CC5' },
|
|
45354
|
+
A: { name: 'L1' },
|
|
45355
|
+
B: { name: 'L2' },
|
|
45356
|
+
C: { name: 'L3' },
|
|
45357
|
+
'AN,BN': { name: 'L1,L2' },
|
|
45358
|
+
'AN,CN': { name: 'L1,L3' },
|
|
45359
|
+
'BN,CN': { name: 'L2,L3' },
|
|
45360
|
+
'AB,BC': { name: 'L1,L2' },
|
|
45361
|
+
'AB,CA': { name: 'L1,L3' },
|
|
45362
|
+
'BC,CA': { name: 'L2,L3' },
|
|
45363
|
+
NONE: { name: '' },
|
|
45364
|
+
};
|
|
45365
|
+
const phaseCode = (phase) => (phase == null ? '' : String(phase));
|
|
45366
|
+
// Unknown codes keep the code as name and have no color
|
|
45367
|
+
const catalogPhase = (code) => Object.prototype.hasOwnProperty.call(PHASES, code) ? PHASES[code] : { name: code };
|
|
45368
|
+
/** Name, in the given language, and color of a phase code. */
|
|
45369
|
+
function getPhase(phase, messages) {
|
|
45370
|
+
var _a;
|
|
45371
|
+
const code = phaseCode(phase);
|
|
45372
|
+
const known = catalogPhase(code);
|
|
45373
|
+
return Object.assign(Object.assign({}, known), { name: (_a = translatePhase(messages, code)) !== null && _a !== void 0 ? _a : known.name });
|
|
45374
|
+
}
|
|
45375
|
+
// `NONE` (no name) goes after the named phases and `ALL` always last. Only these two names are translated,
|
|
45376
|
+
// so ranking them by code keeps the order the same in every language.
|
|
45377
|
+
const rank = (code) => (code === 'ALL' ? 2 : code === 'NONE' ? 1 : 0);
|
|
45378
|
+
/**
|
|
45379
|
+
* Sorts groups by phase name, then by code (e.g. `AN` and `AB` are both "L1"), with `NONE` and `ALL` last.
|
|
45380
|
+
* Compares characters, not with a locale's rules, so the legend is the same in every language.
|
|
45381
|
+
* Returns a new array with the same group objects; groups with the same code keep their order.
|
|
45382
|
+
*/
|
|
45383
|
+
function sortGroups(groups) {
|
|
45384
|
+
const keyed = groups.map(group => {
|
|
45385
|
+
const code = phaseCode(group.phase);
|
|
45386
|
+
return { group, code, rank: rank(code), name: catalogPhase(code).name };
|
|
45387
|
+
});
|
|
45388
|
+
return keyed
|
|
45389
|
+
.sort((a, b) => a.rank - b.rank || compare(a.name, b.name) || compare(a.code, b.code))
|
|
45390
|
+
.map(({ group }) => group);
|
|
45391
|
+
}
|
|
45392
|
+
const compare = (a, b) => (a < b ? -1 : a > b ? 1 : 0);
|
|
45393
|
+
|
|
45394
|
+
const DEFAULT_SETTINGS = { locale: DEFAULT_LOCALE };
|
|
45124
45395
|
/**
|
|
45125
45396
|
* Normalizes the `groups` prop, which arrives as an array from JS/React
|
|
45126
45397
|
* or as a JSON string when set as an HTML attribute.
|
|
@@ -45135,6 +45406,16 @@ function parseGroups(groups) {
|
|
|
45135
45406
|
}
|
|
45136
45407
|
return parsed;
|
|
45137
45408
|
}
|
|
45409
|
+
function isValidTimeZone(timeZone) {
|
|
45410
|
+
try {
|
|
45411
|
+
// The result must be used: Rollup and terser drop an unused `new Intl.DateTimeFormat()` as side-effect free,
|
|
45412
|
+
// which turned this check into `return true` in the built packages
|
|
45413
|
+
return Boolean(new Intl.DateTimeFormat('en', { timeZone }).resolvedOptions().timeZone);
|
|
45414
|
+
}
|
|
45415
|
+
catch (_a) {
|
|
45416
|
+
return false;
|
|
45417
|
+
}
|
|
45418
|
+
}
|
|
45138
45419
|
function escapeHtml(value) {
|
|
45139
45420
|
return value
|
|
45140
45421
|
.replace(/&/g, '&')
|
|
@@ -45143,57 +45424,95 @@ function escapeHtml(value) {
|
|
|
45143
45424
|
.replace(/"/g, '"')
|
|
45144
45425
|
.replace(/'/g, ''');
|
|
45145
45426
|
}
|
|
45146
|
-
|
|
45147
|
-
|
|
45148
|
-
|
|
45149
|
-
|
|
45150
|
-
|
|
45151
|
-
|
|
45152
|
-
|
|
45153
|
-
|
|
45154
|
-
|
|
45155
|
-
|
|
45156
|
-
|
|
45157
|
-
|
|
45158
|
-
|
|
45159
|
-
|
|
45160
|
-
|
|
45161
|
-
|
|
45162
|
-
|
|
45427
|
+
const isBlank = (value) => value == null || value === '';
|
|
45428
|
+
/**
|
|
45429
|
+
* Returns the tooltip HTML of a point: one row per field, in the chart's language. Rows without a value
|
|
45430
|
+
* are left out, and every value is escaped, since it comes from the consumer's data.
|
|
45431
|
+
*/
|
|
45432
|
+
function createTooltipFormatter({ locale, timeZone }) {
|
|
45433
|
+
const messages = getMessages(locale);
|
|
45434
|
+
const dateFormat = new Intl.DateTimeFormat(locale, {
|
|
45435
|
+
day: '2-digit',
|
|
45436
|
+
month: 'short',
|
|
45437
|
+
hour: '2-digit',
|
|
45438
|
+
minute: '2-digit',
|
|
45439
|
+
second: '2-digit',
|
|
45440
|
+
// Short events are milliseconds apart
|
|
45441
|
+
fractionalSecondDigits: 3,
|
|
45442
|
+
hourCycle: 'h23',
|
|
45443
|
+
timeZone,
|
|
45444
|
+
});
|
|
45445
|
+
const durationFormat = new Intl.NumberFormat(locale, { style: 'unit', unit: 'millisecond', maximumFractionDigits: 3 });
|
|
45446
|
+
const voltageFormat = new Intl.NumberFormat(locale, { style: 'percent', maximumFractionDigits: 1 });
|
|
45447
|
+
// `volt` isn't a unit supported by Intl
|
|
45448
|
+
const voltsFormat = new Intl.NumberFormat(locale, { minimumFractionDigits: 2, maximumFractionDigits: 2 });
|
|
45449
|
+
const formatDate = (ts) => {
|
|
45450
|
+
const date = new Date(ts);
|
|
45451
|
+
return Number.isNaN(date.getTime()) ? String(ts !== null && ts !== void 0 ? ts : '') : dateFormat.format(date);
|
|
45452
|
+
};
|
|
45453
|
+
const formatVolts = (value) => (Number(value) ? `${voltsFormat.format(Number(value))} V` : undefined);
|
|
45454
|
+
return (point, group) => {
|
|
45455
|
+
const rows = [
|
|
45456
|
+
['asset', isBlank(group.assetName) ? undefined : String(group.assetName)],
|
|
45457
|
+
['date', formatDate(point.ts)],
|
|
45458
|
+
['eventType', isBlank(point.eventType) ? undefined : translateEventType(messages, String(point.eventType))],
|
|
45459
|
+
['duration', durationFormat.format(Number(point.duration))],
|
|
45460
|
+
// The value is already in %
|
|
45461
|
+
['voltage', voltageFormat.format(Number(point.voltage) / 100)],
|
|
45462
|
+
['status', isBlank(point.status) ? undefined : String(point.status)],
|
|
45463
|
+
['phase', getPhase(group.phase, messages).name || '-'],
|
|
45464
|
+
['min', formatVolts(point.min)],
|
|
45465
|
+
['max', formatVolts(point.max)],
|
|
45466
|
+
];
|
|
45467
|
+
return rows
|
|
45468
|
+
.filter((row) => row[1] !== undefined)
|
|
45469
|
+
.map(([key, value]) => ` <strong>${messages.tooltip[key]}</strong>: ${escapeHtml(value)}`)
|
|
45470
|
+
.join('<br/>');
|
|
45471
|
+
};
|
|
45472
|
+
}
|
|
45473
|
+
/** Formats the axis labels in the chart's language; ECharts always uses English separators. */
|
|
45474
|
+
function createAxisLabelFormatter(locale) {
|
|
45475
|
+
const numberFormat = new Intl.NumberFormat(locale);
|
|
45476
|
+
return value => numberFormat.format(value);
|
|
45477
|
+
}
|
|
45163
45478
|
const isClickable = (point) => point.clickable !== false;
|
|
45164
45479
|
function buildChartOptions(groups, settings = DEFAULT_SETTINGS) {
|
|
45165
|
-
|
|
45480
|
+
const messages = getMessages(settings.locale);
|
|
45481
|
+
const formatTooltip = createTooltipFormatter(settings);
|
|
45482
|
+
const axisLabel = { formatter: createAxisLabelFormatter(settings.locale) };
|
|
45483
|
+
return Object.assign(Object.assign({}, BASE_OPTIONS), { xAxis: Object.assign(Object.assign({}, BASE_OPTIONS.xAxis), { name: messages.xAxisName, axisLabel }), yAxis: Object.assign(Object.assign({}, BASE_OPTIONS.yAxis), { name: messages.yAxisName, axisLabel }), series: [
|
|
45166
45484
|
...CURVE_SERIES,
|
|
45167
|
-
...groups.map((group) =>
|
|
45168
|
-
|
|
45169
|
-
|
|
45170
|
-
|
|
45171
|
-
|
|
45172
|
-
|
|
45173
|
-
|
|
45174
|
-
|
|
45175
|
-
|
|
45176
|
-
|
|
45177
|
-
|
|
45178
|
-
|
|
45179
|
-
|
|
45180
|
-
|
|
45181
|
-
|
|
45182
|
-
|
|
45183
|
-
|
|
45184
|
-
|
|
45485
|
+
...sortGroups(groups).map((group) => {
|
|
45486
|
+
const { name, color } = getPhase(group.phase, messages);
|
|
45487
|
+
return {
|
|
45488
|
+
type: 'scatter',
|
|
45489
|
+
name,
|
|
45490
|
+
// ECharts 6 reads `cursor` per data item, although its types only declare it per series
|
|
45491
|
+
data: group.points.map(point => ({
|
|
45492
|
+
value: [point.duration, point.voltage],
|
|
45493
|
+
cursor: isClickable(point) ? 'pointer' : 'default',
|
|
45494
|
+
})),
|
|
45495
|
+
symbolSize: 12,
|
|
45496
|
+
z: 4,
|
|
45497
|
+
// Phases without a color take the next one of the ECharts palette
|
|
45498
|
+
itemStyle: color ? { color, opacity: 1 } : { opacity: 1 },
|
|
45499
|
+
tooltip: {
|
|
45500
|
+
formatter: params => formatTooltip(group.points[params.dataIndex], group),
|
|
45501
|
+
},
|
|
45502
|
+
};
|
|
45503
|
+
}),
|
|
45185
45504
|
] });
|
|
45186
45505
|
}
|
|
45187
45506
|
/**
|
|
45188
|
-
* Maps an ECharts click back to the original point and group
|
|
45189
|
-
* scatter series after the ITIC curve series,
|
|
45507
|
+
* Maps an ECharts click back to the original point and group. `buildChartOptions` draws the groups as
|
|
45508
|
+
* scatter series after the ITIC curve series, sorted with `sortGroups`.
|
|
45190
45509
|
* Returns `undefined` for clicks outside the points and on points that aren't clickable.
|
|
45191
45510
|
*/
|
|
45192
45511
|
function findClickedPoint(groups, { componentType, seriesIndex, dataIndex }) {
|
|
45193
45512
|
if (componentType !== 'series' || seriesIndex == null || dataIndex == null) {
|
|
45194
45513
|
return undefined;
|
|
45195
45514
|
}
|
|
45196
|
-
const group = groups[seriesIndex - CURVE_SERIES.length];
|
|
45515
|
+
const group = sortGroups(groups)[seriesIndex - CURVE_SERIES.length];
|
|
45197
45516
|
const point = group === null || group === void 0 ? void 0 : group.points[dataIndex];
|
|
45198
45517
|
if (!point || !isClickable(point)) {
|
|
45199
45518
|
return undefined;
|
|
@@ -45218,10 +45537,11 @@ const ITIC_CURVE_NODAMAGE_REGION = [
|
|
|
45218
45537
|
[10000, 90],
|
|
45219
45538
|
[100000, 90],
|
|
45220
45539
|
];
|
|
45540
|
+
// Fixed ranges, as in Scout: ECharts clips points outside them (duration < 1 ms or voltage > 200%)
|
|
45221
45541
|
const BASE_OPTIONS = {
|
|
45222
45542
|
animation: false,
|
|
45223
45543
|
grid: {
|
|
45224
|
-
right: '
|
|
45544
|
+
right: '20px',
|
|
45225
45545
|
left: '60px',
|
|
45226
45546
|
},
|
|
45227
45547
|
// ECharts 6 moved the default legend to the bottom; keep it on top as in previous versions
|
|
@@ -45233,7 +45553,7 @@ const BASE_OPTIONS = {
|
|
|
45233
45553
|
},
|
|
45234
45554
|
xAxis: {
|
|
45235
45555
|
type: 'log',
|
|
45236
|
-
min:
|
|
45556
|
+
min: 1,
|
|
45237
45557
|
max: 100000,
|
|
45238
45558
|
nameGap: 30,
|
|
45239
45559
|
nameLocation: 'middle',
|
|
@@ -45245,7 +45565,7 @@ const BASE_OPTIONS = {
|
|
|
45245
45565
|
yAxis: {
|
|
45246
45566
|
type: 'value',
|
|
45247
45567
|
min: 0,
|
|
45248
|
-
max:
|
|
45568
|
+
max: 200,
|
|
45249
45569
|
nameTextStyle: {
|
|
45250
45570
|
fontSize: 16,
|
|
45251
45571
|
fontWeight: 'bold',
|
|
@@ -45255,6 +45575,7 @@ const BASE_OPTIONS = {
|
|
|
45255
45575
|
nameLocation: 'middle',
|
|
45256
45576
|
},
|
|
45257
45577
|
};
|
|
45578
|
+
// `silent`: the curve doesn't react to the mouse (no tooltip, cursor or click)
|
|
45258
45579
|
const CURVE_SERIES = [
|
|
45259
45580
|
{
|
|
45260
45581
|
type: 'line',
|
|
@@ -45266,6 +45587,7 @@ const CURVE_SERIES = [
|
|
|
45266
45587
|
lineStyle: {
|
|
45267
45588
|
color: '#000',
|
|
45268
45589
|
},
|
|
45590
|
+
silent: true,
|
|
45269
45591
|
showSymbol: false,
|
|
45270
45592
|
emphasis: {
|
|
45271
45593
|
disabled: true,
|
|
@@ -45278,6 +45600,7 @@ const CURVE_SERIES = [
|
|
|
45278
45600
|
origin: 'start',
|
|
45279
45601
|
color: '#FFF5DF',
|
|
45280
45602
|
},
|
|
45603
|
+
silent: true,
|
|
45281
45604
|
showSymbol: false,
|
|
45282
45605
|
lineStyle: {
|
|
45283
45606
|
color: '#000',
|
|
@@ -45293,6 +45616,7 @@ const CURVE_SERIES = [
|
|
|
45293
45616
|
origin: 100,
|
|
45294
45617
|
color: '#DDFAF1',
|
|
45295
45618
|
},
|
|
45619
|
+
silent: true,
|
|
45296
45620
|
showSymbol: false,
|
|
45297
45621
|
lineStyle: {
|
|
45298
45622
|
color: '#000',
|
|
@@ -45308,6 +45632,7 @@ const CURVE_SERIES = [
|
|
|
45308
45632
|
origin: 100,
|
|
45309
45633
|
color: '#DDFAF1',
|
|
45310
45634
|
},
|
|
45635
|
+
silent: true,
|
|
45311
45636
|
showSymbol: false,
|
|
45312
45637
|
lineStyle: {
|
|
45313
45638
|
color: '#000',
|
|
@@ -45326,6 +45651,7 @@ const CURVE_SERIES = [
|
|
|
45326
45651
|
origin: 100,
|
|
45327
45652
|
color: '#DDFAF1',
|
|
45328
45653
|
},
|
|
45654
|
+
silent: true,
|
|
45329
45655
|
showSymbol: false,
|
|
45330
45656
|
lineStyle: {
|
|
45331
45657
|
color: 'transparent',
|
|
@@ -45344,6 +45670,7 @@ const CURVE_SERIES = [
|
|
|
45344
45670
|
origin: 100,
|
|
45345
45671
|
color: '#DDFAF1',
|
|
45346
45672
|
},
|
|
45673
|
+
silent: true,
|
|
45347
45674
|
showSymbol: false,
|
|
45348
45675
|
lineStyle: {
|
|
45349
45676
|
color: 'transparent',
|
|
@@ -45363,16 +45690,21 @@ const IticChart = class {
|
|
|
45363
45690
|
index.registerInstance(this, hostRef);
|
|
45364
45691
|
this.pointClick = index.createEvent(this, "pointClick");
|
|
45365
45692
|
/**
|
|
45366
|
-
*
|
|
45693
|
+
* Language of the texts, dates and numbers: `ca`, `de`, `en`, `es`, `fr` or `pt`. Only the language
|
|
45694
|
+
* is used (`es-ES` → `es`); any other value falls back to `en`.
|
|
45367
45695
|
*/
|
|
45368
|
-
this.
|
|
45369
|
-
/**
|
|
45370
|
-
* Name of the voltage (Y) axis.
|
|
45371
|
-
*/
|
|
45372
|
-
this.yAxisName = DEFAULT_SETTINGS.yAxisName;
|
|
45696
|
+
this.locale = 'en';
|
|
45373
45697
|
this.parsedGroups = [];
|
|
45374
45698
|
}
|
|
45375
|
-
|
|
45699
|
+
onGroupsChange() {
|
|
45700
|
+
this.updateChart();
|
|
45701
|
+
}
|
|
45702
|
+
onLocaleChange() {
|
|
45703
|
+
this.updateAriaLabel();
|
|
45704
|
+
this.updateChart();
|
|
45705
|
+
}
|
|
45706
|
+
onTimeZoneChange() {
|
|
45707
|
+
this.validateTimeZone();
|
|
45376
45708
|
this.updateChart();
|
|
45377
45709
|
}
|
|
45378
45710
|
connectedCallback() {
|
|
@@ -45380,9 +45712,13 @@ const IticChart = class {
|
|
|
45380
45712
|
if (!this.el.hasAttribute('role')) {
|
|
45381
45713
|
this.el.setAttribute('role', 'img');
|
|
45382
45714
|
}
|
|
45715
|
+
this.updateAriaLabel();
|
|
45383
45716
|
// componentDidLoad only fires once, so re-create the chart when the element is re-attached
|
|
45384
45717
|
this.initChart();
|
|
45385
45718
|
}
|
|
45719
|
+
componentWillLoad() {
|
|
45720
|
+
this.validateTimeZone();
|
|
45721
|
+
}
|
|
45386
45722
|
componentDidLoad() {
|
|
45387
45723
|
this.initChart();
|
|
45388
45724
|
}
|
|
@@ -45393,6 +45729,27 @@ const IticChart = class {
|
|
|
45393
45729
|
(_b = this.chart) === null || _b === void 0 ? void 0 : _b.dispose();
|
|
45394
45730
|
this.chart = undefined;
|
|
45395
45731
|
}
|
|
45732
|
+
updateAriaLabel() {
|
|
45733
|
+
const current = this.el.getAttribute('aria-label');
|
|
45734
|
+
if (current !== null && current !== this.defaultAriaLabel) {
|
|
45735
|
+
return;
|
|
45736
|
+
}
|
|
45737
|
+
this.defaultAriaLabel = getMessages(normalizeLocale(this.locale)).ariaLabel;
|
|
45738
|
+
this.el.setAttribute('aria-label', this.defaultAriaLabel);
|
|
45739
|
+
}
|
|
45740
|
+
// Validated when it changes, not on every redraw, so an invalid value is only reported once
|
|
45741
|
+
validateTimeZone() {
|
|
45742
|
+
this.validTimeZone = undefined;
|
|
45743
|
+
if (!this.timeZone) {
|
|
45744
|
+
return;
|
|
45745
|
+
}
|
|
45746
|
+
if (isValidTimeZone(this.timeZone)) {
|
|
45747
|
+
this.validTimeZone = this.timeZone;
|
|
45748
|
+
}
|
|
45749
|
+
else {
|
|
45750
|
+
console.error(`[itic-chart] Invalid "timeZone" prop: "${this.timeZone}". Using the browser's time zone.`);
|
|
45751
|
+
}
|
|
45752
|
+
}
|
|
45396
45753
|
initChart() {
|
|
45397
45754
|
if (!this.container || this.chart) {
|
|
45398
45755
|
return;
|
|
@@ -45411,7 +45768,6 @@ const IticChart = class {
|
|
|
45411
45768
|
this.updateChart();
|
|
45412
45769
|
}
|
|
45413
45770
|
updateChart() {
|
|
45414
|
-
var _a;
|
|
45415
45771
|
if (!this.chart) {
|
|
45416
45772
|
return;
|
|
45417
45773
|
}
|
|
@@ -45423,28 +45779,24 @@ const IticChart = class {
|
|
|
45423
45779
|
console.error('[itic-chart] Invalid "groups" prop:', error);
|
|
45424
45780
|
}
|
|
45425
45781
|
const options = buildChartOptions(this.parsedGroups, {
|
|
45426
|
-
|
|
45427
|
-
|
|
45428
|
-
tooltipFormatter: (_a = this.tooltipFormatter) !== null && _a !== void 0 ? _a : DEFAULT_SETTINGS.tooltipFormatter,
|
|
45782
|
+
locale: normalizeLocale(this.locale),
|
|
45783
|
+
timeZone: this.validTimeZone,
|
|
45429
45784
|
});
|
|
45430
45785
|
this.chart.setOption(options, { notMerge: true });
|
|
45431
45786
|
}
|
|
45432
45787
|
render() {
|
|
45433
|
-
return index.h("div", { key: '
|
|
45788
|
+
return index.h("div", { key: 'e202bbf61ad19502fd76a42f37a8ea69f2d8c58b', class: "chart", ref: el => (this.container = el) });
|
|
45434
45789
|
}
|
|
45435
45790
|
get el() { return index.getElement(this); }
|
|
45436
45791
|
static get watchers() { return {
|
|
45437
45792
|
"groups": [{
|
|
45438
|
-
"
|
|
45439
|
-
}],
|
|
45440
|
-
"xAxisName": [{
|
|
45441
|
-
"onOptionsChange": 0
|
|
45793
|
+
"onGroupsChange": 0
|
|
45442
45794
|
}],
|
|
45443
|
-
"
|
|
45444
|
-
"
|
|
45795
|
+
"locale": [{
|
|
45796
|
+
"onLocaleChange": 0
|
|
45445
45797
|
}],
|
|
45446
|
-
"
|
|
45447
|
-
"
|
|
45798
|
+
"timeZone": [{
|
|
45799
|
+
"onTimeZoneChange": 0
|
|
45448
45800
|
}]
|
|
45449
45801
|
}; }
|
|
45450
45802
|
};
|