@circutor/charts 0.2.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bundler/itic-chart.js +1 -1
- package/dist/charts/charts.esm.js +1 -1
- package/dist/charts/p-7d11d611.entry.js +25 -0
- package/dist/cjs/charts.cjs.js +1 -1
- package/dist/cjs/itic-chart.cjs.entry.js +450 -100
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/components/itic-chart/index.js +56 -55
- package/dist/collection/components/itic-chart/itic-chart.i18n.js +26 -0
- package/dist/collection/components/itic-chart/itic-chart.options.js +99 -42
- package/dist/collection/components/itic-chart/itic-chart.phases.js +55 -0
- package/dist/components/itic-chart.js +2 -2
- package/dist/esm/charts.js +1 -1
- package/dist/esm/itic-chart.entry.js +450 -100
- package/dist/esm/loader.js +1 -1
- package/dist/types/components/itic-chart/index.d.ts +18 -14
- 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 +18 -28
- 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
|
+
};
|
|
45281
|
+
|
|
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
|
+
};
|
|
45120
45317
|
|
|
45121
|
-
|
|
45122
|
-
|
|
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);
|
|
45123
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,14 @@ function parseGroups(groups) {
|
|
|
45135
45406
|
}
|
|
45136
45407
|
return parsed;
|
|
45137
45408
|
}
|
|
45409
|
+
function isValidTimeZone(timeZone) {
|
|
45410
|
+
try {
|
|
45411
|
+
return true;
|
|
45412
|
+
}
|
|
45413
|
+
catch (_a) {
|
|
45414
|
+
return false;
|
|
45415
|
+
}
|
|
45416
|
+
}
|
|
45138
45417
|
function escapeHtml(value) {
|
|
45139
45418
|
return value
|
|
45140
45419
|
.replace(/&/g, '&')
|
|
@@ -45143,57 +45422,95 @@ function escapeHtml(value) {
|
|
|
45143
45422
|
.replace(/"/g, '"')
|
|
45144
45423
|
.replace(/'/g, ''');
|
|
45145
45424
|
}
|
|
45146
|
-
|
|
45147
|
-
|
|
45148
|
-
|
|
45149
|
-
|
|
45150
|
-
|
|
45151
|
-
|
|
45152
|
-
|
|
45153
|
-
|
|
45154
|
-
|
|
45155
|
-
|
|
45156
|
-
|
|
45157
|
-
|
|
45158
|
-
|
|
45159
|
-
|
|
45160
|
-
|
|
45161
|
-
|
|
45162
|
-
|
|
45425
|
+
const isBlank = (value) => value == null || value === '';
|
|
45426
|
+
/**
|
|
45427
|
+
* Returns the tooltip HTML of a point: one row per field, in the chart's language. Rows without a value
|
|
45428
|
+
* are left out, and every value is escaped, since it comes from the consumer's data.
|
|
45429
|
+
*/
|
|
45430
|
+
function createTooltipFormatter({ locale, timeZone }) {
|
|
45431
|
+
const messages = getMessages(locale);
|
|
45432
|
+
const dateFormat = new Intl.DateTimeFormat(locale, {
|
|
45433
|
+
day: '2-digit',
|
|
45434
|
+
month: 'short',
|
|
45435
|
+
hour: '2-digit',
|
|
45436
|
+
minute: '2-digit',
|
|
45437
|
+
second: '2-digit',
|
|
45438
|
+
// Short events are milliseconds apart
|
|
45439
|
+
fractionalSecondDigits: 3,
|
|
45440
|
+
hourCycle: 'h23',
|
|
45441
|
+
timeZone,
|
|
45442
|
+
});
|
|
45443
|
+
const durationFormat = new Intl.NumberFormat(locale, { style: 'unit', unit: 'millisecond', maximumFractionDigits: 3 });
|
|
45444
|
+
const voltageFormat = new Intl.NumberFormat(locale, { style: 'percent', maximumFractionDigits: 1 });
|
|
45445
|
+
// `volt` isn't a unit supported by Intl
|
|
45446
|
+
const voltsFormat = new Intl.NumberFormat(locale, { minimumFractionDigits: 2, maximumFractionDigits: 2 });
|
|
45447
|
+
const formatDate = (ts) => {
|
|
45448
|
+
const date = new Date(ts);
|
|
45449
|
+
return Number.isNaN(date.getTime()) ? String(ts !== null && ts !== void 0 ? ts : '') : dateFormat.format(date);
|
|
45450
|
+
};
|
|
45451
|
+
const formatVolts = (value) => (Number(value) ? `${voltsFormat.format(Number(value))} V` : undefined);
|
|
45452
|
+
return (point, group) => {
|
|
45453
|
+
const rows = [
|
|
45454
|
+
['asset', isBlank(group.assetName) ? undefined : String(group.assetName)],
|
|
45455
|
+
['date', formatDate(point.ts)],
|
|
45456
|
+
['eventType', isBlank(point.eventType) ? undefined : translateEventType(messages, String(point.eventType))],
|
|
45457
|
+
['duration', durationFormat.format(Number(point.duration))],
|
|
45458
|
+
// The value is already in %
|
|
45459
|
+
['voltage', voltageFormat.format(Number(point.voltage) / 100)],
|
|
45460
|
+
['status', isBlank(point.status) ? undefined : String(point.status)],
|
|
45461
|
+
['phase', getPhase(group.phase, messages).name || '-'],
|
|
45462
|
+
['min', formatVolts(point.min)],
|
|
45463
|
+
['max', formatVolts(point.max)],
|
|
45464
|
+
];
|
|
45465
|
+
return rows
|
|
45466
|
+
.filter((row) => row[1] !== undefined)
|
|
45467
|
+
.map(([key, value]) => ` <strong>${messages.tooltip[key]}</strong>: ${escapeHtml(value)}`)
|
|
45468
|
+
.join('<br/>');
|
|
45469
|
+
};
|
|
45470
|
+
}
|
|
45471
|
+
/** Formats the axis labels in the chart's language; ECharts always uses English separators. */
|
|
45472
|
+
function createAxisLabelFormatter(locale) {
|
|
45473
|
+
const numberFormat = new Intl.NumberFormat(locale);
|
|
45474
|
+
return value => numberFormat.format(value);
|
|
45475
|
+
}
|
|
45163
45476
|
const isClickable = (point) => point.clickable !== false;
|
|
45164
45477
|
function buildChartOptions(groups, settings = DEFAULT_SETTINGS) {
|
|
45165
|
-
|
|
45478
|
+
const messages = getMessages(settings.locale);
|
|
45479
|
+
const formatTooltip = createTooltipFormatter(settings);
|
|
45480
|
+
const axisLabel = { formatter: createAxisLabelFormatter(settings.locale) };
|
|
45481
|
+
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
45482
|
...CURVE_SERIES,
|
|
45167
|
-
...groups.map((group) =>
|
|
45168
|
-
|
|
45169
|
-
|
|
45170
|
-
|
|
45171
|
-
|
|
45172
|
-
|
|
45173
|
-
|
|
45174
|
-
|
|
45175
|
-
|
|
45176
|
-
|
|
45177
|
-
|
|
45178
|
-
|
|
45179
|
-
|
|
45180
|
-
|
|
45181
|
-
|
|
45182
|
-
|
|
45183
|
-
|
|
45184
|
-
|
|
45483
|
+
...sortGroups(groups).map((group) => {
|
|
45484
|
+
const { name, color } = getPhase(group.phase, messages);
|
|
45485
|
+
return {
|
|
45486
|
+
type: 'scatter',
|
|
45487
|
+
name,
|
|
45488
|
+
// ECharts 6 reads `cursor` per data item, although its types only declare it per series
|
|
45489
|
+
data: group.points.map(point => ({
|
|
45490
|
+
value: [point.duration, point.voltage],
|
|
45491
|
+
cursor: isClickable(point) ? 'pointer' : 'default',
|
|
45492
|
+
})),
|
|
45493
|
+
symbolSize: 12,
|
|
45494
|
+
z: 4,
|
|
45495
|
+
// Phases without a color take the next one of the ECharts palette
|
|
45496
|
+
itemStyle: color ? { color, opacity: 1 } : { opacity: 1 },
|
|
45497
|
+
tooltip: {
|
|
45498
|
+
formatter: params => formatTooltip(group.points[params.dataIndex], group),
|
|
45499
|
+
},
|
|
45500
|
+
};
|
|
45501
|
+
}),
|
|
45185
45502
|
] });
|
|
45186
45503
|
}
|
|
45187
45504
|
/**
|
|
45188
|
-
* Maps an ECharts click back to the original point and group
|
|
45189
|
-
* scatter series after the ITIC curve series,
|
|
45505
|
+
* Maps an ECharts click back to the original point and group. `buildChartOptions` draws the groups as
|
|
45506
|
+
* scatter series after the ITIC curve series, sorted with `sortGroups`.
|
|
45190
45507
|
* Returns `undefined` for clicks outside the points and on points that aren't clickable.
|
|
45191
45508
|
*/
|
|
45192
45509
|
function findClickedPoint(groups, { componentType, seriesIndex, dataIndex }) {
|
|
45193
45510
|
if (componentType !== 'series' || seriesIndex == null || dataIndex == null) {
|
|
45194
45511
|
return undefined;
|
|
45195
45512
|
}
|
|
45196
|
-
const group = groups[seriesIndex - CURVE_SERIES.length];
|
|
45513
|
+
const group = sortGroups(groups)[seriesIndex - CURVE_SERIES.length];
|
|
45197
45514
|
const point = group === null || group === void 0 ? void 0 : group.points[dataIndex];
|
|
45198
45515
|
if (!point || !isClickable(point)) {
|
|
45199
45516
|
return undefined;
|
|
@@ -45218,10 +45535,11 @@ const ITIC_CURVE_NODAMAGE_REGION = [
|
|
|
45218
45535
|
[10000, 90],
|
|
45219
45536
|
[100000, 90],
|
|
45220
45537
|
];
|
|
45538
|
+
// Fixed ranges, as in Scout: ECharts clips points outside them (duration < 1 ms or voltage > 200%)
|
|
45221
45539
|
const BASE_OPTIONS = {
|
|
45222
45540
|
animation: false,
|
|
45223
45541
|
grid: {
|
|
45224
|
-
right: '
|
|
45542
|
+
right: '20px',
|
|
45225
45543
|
left: '60px',
|
|
45226
45544
|
},
|
|
45227
45545
|
// ECharts 6 moved the default legend to the bottom; keep it on top as in previous versions
|
|
@@ -45233,7 +45551,7 @@ const BASE_OPTIONS = {
|
|
|
45233
45551
|
},
|
|
45234
45552
|
xAxis: {
|
|
45235
45553
|
type: 'log',
|
|
45236
|
-
min:
|
|
45554
|
+
min: 1,
|
|
45237
45555
|
max: 100000,
|
|
45238
45556
|
nameGap: 30,
|
|
45239
45557
|
nameLocation: 'middle',
|
|
@@ -45245,7 +45563,7 @@ const BASE_OPTIONS = {
|
|
|
45245
45563
|
yAxis: {
|
|
45246
45564
|
type: 'value',
|
|
45247
45565
|
min: 0,
|
|
45248
|
-
max:
|
|
45566
|
+
max: 200,
|
|
45249
45567
|
nameTextStyle: {
|
|
45250
45568
|
fontSize: 16,
|
|
45251
45569
|
fontWeight: 'bold',
|
|
@@ -45255,6 +45573,7 @@ const BASE_OPTIONS = {
|
|
|
45255
45573
|
nameLocation: 'middle',
|
|
45256
45574
|
},
|
|
45257
45575
|
};
|
|
45576
|
+
// `silent`: the curve doesn't react to the mouse (no tooltip, cursor or click)
|
|
45258
45577
|
const CURVE_SERIES = [
|
|
45259
45578
|
{
|
|
45260
45579
|
type: 'line',
|
|
@@ -45266,6 +45585,7 @@ const CURVE_SERIES = [
|
|
|
45266
45585
|
lineStyle: {
|
|
45267
45586
|
color: '#000',
|
|
45268
45587
|
},
|
|
45588
|
+
silent: true,
|
|
45269
45589
|
showSymbol: false,
|
|
45270
45590
|
emphasis: {
|
|
45271
45591
|
disabled: true,
|
|
@@ -45278,6 +45598,7 @@ const CURVE_SERIES = [
|
|
|
45278
45598
|
origin: 'start',
|
|
45279
45599
|
color: '#FFF5DF',
|
|
45280
45600
|
},
|
|
45601
|
+
silent: true,
|
|
45281
45602
|
showSymbol: false,
|
|
45282
45603
|
lineStyle: {
|
|
45283
45604
|
color: '#000',
|
|
@@ -45293,6 +45614,7 @@ const CURVE_SERIES = [
|
|
|
45293
45614
|
origin: 100,
|
|
45294
45615
|
color: '#DDFAF1',
|
|
45295
45616
|
},
|
|
45617
|
+
silent: true,
|
|
45296
45618
|
showSymbol: false,
|
|
45297
45619
|
lineStyle: {
|
|
45298
45620
|
color: '#000',
|
|
@@ -45308,6 +45630,7 @@ const CURVE_SERIES = [
|
|
|
45308
45630
|
origin: 100,
|
|
45309
45631
|
color: '#DDFAF1',
|
|
45310
45632
|
},
|
|
45633
|
+
silent: true,
|
|
45311
45634
|
showSymbol: false,
|
|
45312
45635
|
lineStyle: {
|
|
45313
45636
|
color: '#000',
|
|
@@ -45326,6 +45649,7 @@ const CURVE_SERIES = [
|
|
|
45326
45649
|
origin: 100,
|
|
45327
45650
|
color: '#DDFAF1',
|
|
45328
45651
|
},
|
|
45652
|
+
silent: true,
|
|
45329
45653
|
showSymbol: false,
|
|
45330
45654
|
lineStyle: {
|
|
45331
45655
|
color: 'transparent',
|
|
@@ -45344,6 +45668,7 @@ const CURVE_SERIES = [
|
|
|
45344
45668
|
origin: 100,
|
|
45345
45669
|
color: '#DDFAF1',
|
|
45346
45670
|
},
|
|
45671
|
+
silent: true,
|
|
45347
45672
|
showSymbol: false,
|
|
45348
45673
|
lineStyle: {
|
|
45349
45674
|
color: 'transparent',
|
|
@@ -45363,16 +45688,21 @@ const IticChart = class {
|
|
|
45363
45688
|
index.registerInstance(this, hostRef);
|
|
45364
45689
|
this.pointClick = index.createEvent(this, "pointClick");
|
|
45365
45690
|
/**
|
|
45366
|
-
*
|
|
45691
|
+
* Language of the texts, dates and numbers: `ca`, `de`, `en`, `es`, `fr` or `pt`. Only the language
|
|
45692
|
+
* is used (`es-ES` → `es`); any other value falls back to `en`.
|
|
45367
45693
|
*/
|
|
45368
|
-
this.
|
|
45369
|
-
/**
|
|
45370
|
-
* Name of the voltage (Y) axis.
|
|
45371
|
-
*/
|
|
45372
|
-
this.yAxisName = DEFAULT_SETTINGS.yAxisName;
|
|
45694
|
+
this.locale = 'en';
|
|
45373
45695
|
this.parsedGroups = [];
|
|
45374
45696
|
}
|
|
45375
|
-
|
|
45697
|
+
onGroupsChange() {
|
|
45698
|
+
this.updateChart();
|
|
45699
|
+
}
|
|
45700
|
+
onLocaleChange() {
|
|
45701
|
+
this.updateAriaLabel();
|
|
45702
|
+
this.updateChart();
|
|
45703
|
+
}
|
|
45704
|
+
onTimeZoneChange() {
|
|
45705
|
+
this.validateTimeZone();
|
|
45376
45706
|
this.updateChart();
|
|
45377
45707
|
}
|
|
45378
45708
|
connectedCallback() {
|
|
@@ -45380,9 +45710,13 @@ const IticChart = class {
|
|
|
45380
45710
|
if (!this.el.hasAttribute('role')) {
|
|
45381
45711
|
this.el.setAttribute('role', 'img');
|
|
45382
45712
|
}
|
|
45713
|
+
this.updateAriaLabel();
|
|
45383
45714
|
// componentDidLoad only fires once, so re-create the chart when the element is re-attached
|
|
45384
45715
|
this.initChart();
|
|
45385
45716
|
}
|
|
45717
|
+
componentWillLoad() {
|
|
45718
|
+
this.validateTimeZone();
|
|
45719
|
+
}
|
|
45386
45720
|
componentDidLoad() {
|
|
45387
45721
|
this.initChart();
|
|
45388
45722
|
}
|
|
@@ -45393,6 +45727,27 @@ const IticChart = class {
|
|
|
45393
45727
|
(_b = this.chart) === null || _b === void 0 ? void 0 : _b.dispose();
|
|
45394
45728
|
this.chart = undefined;
|
|
45395
45729
|
}
|
|
45730
|
+
updateAriaLabel() {
|
|
45731
|
+
const current = this.el.getAttribute('aria-label');
|
|
45732
|
+
if (current !== null && current !== this.defaultAriaLabel) {
|
|
45733
|
+
return;
|
|
45734
|
+
}
|
|
45735
|
+
this.defaultAriaLabel = getMessages(normalizeLocale(this.locale)).ariaLabel;
|
|
45736
|
+
this.el.setAttribute('aria-label', this.defaultAriaLabel);
|
|
45737
|
+
}
|
|
45738
|
+
// Validated when it changes, not on every redraw, so an invalid value is only reported once
|
|
45739
|
+
validateTimeZone() {
|
|
45740
|
+
this.validTimeZone = undefined;
|
|
45741
|
+
if (!this.timeZone) {
|
|
45742
|
+
return;
|
|
45743
|
+
}
|
|
45744
|
+
if (isValidTimeZone()) {
|
|
45745
|
+
this.validTimeZone = this.timeZone;
|
|
45746
|
+
}
|
|
45747
|
+
else {
|
|
45748
|
+
console.error(`[itic-chart] Invalid "timeZone" prop: "${this.timeZone}". Using the browser's time zone.`);
|
|
45749
|
+
}
|
|
45750
|
+
}
|
|
45396
45751
|
initChart() {
|
|
45397
45752
|
if (!this.container || this.chart) {
|
|
45398
45753
|
return;
|
|
@@ -45411,7 +45766,6 @@ const IticChart = class {
|
|
|
45411
45766
|
this.updateChart();
|
|
45412
45767
|
}
|
|
45413
45768
|
updateChart() {
|
|
45414
|
-
var _a;
|
|
45415
45769
|
if (!this.chart) {
|
|
45416
45770
|
return;
|
|
45417
45771
|
}
|
|
@@ -45423,28 +45777,24 @@ const IticChart = class {
|
|
|
45423
45777
|
console.error('[itic-chart] Invalid "groups" prop:', error);
|
|
45424
45778
|
}
|
|
45425
45779
|
const options = buildChartOptions(this.parsedGroups, {
|
|
45426
|
-
|
|
45427
|
-
|
|
45428
|
-
tooltipFormatter: (_a = this.tooltipFormatter) !== null && _a !== void 0 ? _a : DEFAULT_SETTINGS.tooltipFormatter,
|
|
45780
|
+
locale: normalizeLocale(this.locale),
|
|
45781
|
+
timeZone: this.validTimeZone,
|
|
45429
45782
|
});
|
|
45430
45783
|
this.chart.setOption(options, { notMerge: true });
|
|
45431
45784
|
}
|
|
45432
45785
|
render() {
|
|
45433
|
-
return index.h("div", { key: '
|
|
45786
|
+
return index.h("div", { key: '2bb964d590a36c9c9501761c3f848ad364a29030', class: "chart", ref: el => (this.container = el) });
|
|
45434
45787
|
}
|
|
45435
45788
|
get el() { return index.getElement(this); }
|
|
45436
45789
|
static get watchers() { return {
|
|
45437
45790
|
"groups": [{
|
|
45438
|
-
"
|
|
45439
|
-
}],
|
|
45440
|
-
"xAxisName": [{
|
|
45441
|
-
"onOptionsChange": 0
|
|
45791
|
+
"onGroupsChange": 0
|
|
45442
45792
|
}],
|
|
45443
|
-
"
|
|
45444
|
-
"
|
|
45793
|
+
"locale": [{
|
|
45794
|
+
"onLocaleChange": 0
|
|
45445
45795
|
}],
|
|
45446
|
-
"
|
|
45447
|
-
"
|
|
45796
|
+
"timeZone": [{
|
|
45797
|
+
"onTimeZoneChange": 0
|
|
45448
45798
|
}]
|
|
45449
45799
|
}; }
|
|
45450
45800
|
};
|