@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
|
@@ -719,7 +719,7 @@ function disableUserSelect(dom) {
|
|
|
719
719
|
domStyle.webkitTapHighlightColor = 'rgba(0,0,0,0)';
|
|
720
720
|
domStyle['-webkit-touch-callout'] = 'none';
|
|
721
721
|
}
|
|
722
|
-
function hasOwn(own, prop) {
|
|
722
|
+
function hasOwn$1(own, prop) {
|
|
723
723
|
return own.hasOwnProperty(prop);
|
|
724
724
|
}
|
|
725
725
|
function noop() { }
|
|
@@ -14808,7 +14808,7 @@ function setTooltipConfig(opt) {
|
|
|
14808
14808
|
var formatterParamsExtra = opt.formatterParamsExtra;
|
|
14809
14809
|
if (formatterParamsExtra) {
|
|
14810
14810
|
each$4(keys(formatterParamsExtra), function (key) {
|
|
14811
|
-
if (!hasOwn(formatterParams, key)) {
|
|
14811
|
+
if (!hasOwn$1(formatterParams, key)) {
|
|
14812
14812
|
formatterParams[key] = formatterParamsExtra[key];
|
|
14813
14813
|
formatterParams.$vars.push(key);
|
|
14814
14814
|
}
|
|
@@ -16138,12 +16138,12 @@ var langZH = {
|
|
|
16138
16138
|
|
|
16139
16139
|
var LOCALE_ZH = 'ZH';
|
|
16140
16140
|
var LOCALE_EN = 'EN';
|
|
16141
|
-
var DEFAULT_LOCALE = LOCALE_EN;
|
|
16141
|
+
var DEFAULT_LOCALE$1 = LOCALE_EN;
|
|
16142
16142
|
var localeStorage = {};
|
|
16143
16143
|
var localeModels = {};
|
|
16144
|
-
var SYSTEM_LANG = !env.domSupported ? DEFAULT_LOCALE : function () {
|
|
16145
|
-
var langStr = (document.documentElement.lang || navigator.language || navigator.browserLanguage || DEFAULT_LOCALE).toUpperCase();
|
|
16146
|
-
return langStr.indexOf(LOCALE_ZH) > -1 ? LOCALE_ZH : DEFAULT_LOCALE;
|
|
16144
|
+
var SYSTEM_LANG = !env.domSupported ? DEFAULT_LOCALE$1 : function () {
|
|
16145
|
+
var langStr = (document.documentElement.lang || navigator.language || navigator.browserLanguage || DEFAULT_LOCALE$1).toUpperCase();
|
|
16146
|
+
return langStr.indexOf(LOCALE_ZH) > -1 ? LOCALE_ZH : DEFAULT_LOCALE$1;
|
|
16147
16147
|
}();
|
|
16148
16148
|
function registerLocale(locale, localeObj) {
|
|
16149
16149
|
locale = locale.toUpperCase();
|
|
@@ -16159,17 +16159,17 @@ function createLocaleObject(locale) {
|
|
|
16159
16159
|
if (locale === LOCALE_ZH || locale === LOCALE_EN) {
|
|
16160
16160
|
return clone$2(localeObj);
|
|
16161
16161
|
} else {
|
|
16162
|
-
return merge(clone$2(localeObj), clone$2(localeStorage[DEFAULT_LOCALE]), false);
|
|
16162
|
+
return merge(clone$2(localeObj), clone$2(localeStorage[DEFAULT_LOCALE$1]), false);
|
|
16163
16163
|
}
|
|
16164
16164
|
} else {
|
|
16165
|
-
return merge(clone$2(locale), clone$2(localeStorage[DEFAULT_LOCALE]), false);
|
|
16165
|
+
return merge(clone$2(locale), clone$2(localeStorage[DEFAULT_LOCALE$1]), false);
|
|
16166
16166
|
}
|
|
16167
16167
|
}
|
|
16168
16168
|
function getLocaleModel(lang) {
|
|
16169
16169
|
return localeModels[lang];
|
|
16170
16170
|
}
|
|
16171
16171
|
function getDefaultLocaleModel() {
|
|
16172
|
-
return localeModels[DEFAULT_LOCALE];
|
|
16172
|
+
return localeModels[DEFAULT_LOCALE$1];
|
|
16173
16173
|
}
|
|
16174
16174
|
// Default locale
|
|
16175
16175
|
registerLocale(LOCALE_EN, langEN);
|
|
@@ -17205,7 +17205,7 @@ function mergeLayoutParam(targetOption, newOption, opt) {
|
|
|
17205
17205
|
each$3(names, function (name) {
|
|
17206
17206
|
// Consider case: newOption.width is null, which is
|
|
17207
17207
|
// set by user for removing width setting.
|
|
17208
|
-
hasOwn(newOption, name) && (newParams[name] = merged[name] = newOption[name]);
|
|
17208
|
+
hasOwn$1(newOption, name) && (newParams[name] = merged[name] = newOption[name]);
|
|
17209
17209
|
hasValue(newParams, name) && newValueCount++;
|
|
17210
17210
|
hasValue(merged, name) && mergedValueCount++;
|
|
17211
17211
|
});
|
|
@@ -17234,7 +17234,7 @@ function mergeLayoutParam(targetOption, newOption, opt) {
|
|
|
17234
17234
|
// Chose another param from targetOption by priority.
|
|
17235
17235
|
for (var i = 0; i < names.length; i++) {
|
|
17236
17236
|
var name_1 = names[i];
|
|
17237
|
-
if (!hasOwn(newParams, name_1) && hasOwn(targetOption, name_1)) {
|
|
17237
|
+
if (!hasOwn$1(newParams, name_1) && hasOwn$1(targetOption, name_1)) {
|
|
17238
17238
|
newParams[name_1] = targetOption[name_1];
|
|
17239
17239
|
break;
|
|
17240
17240
|
}
|
|
@@ -17264,7 +17264,7 @@ function getLayoutParams(source) {
|
|
|
17264
17264
|
*/
|
|
17265
17265
|
function copyLayoutParams(target, source) {
|
|
17266
17266
|
source && target && each$3(LOCATION_PARAMS, function (name) {
|
|
17267
|
-
hasOwn(source, name) && (target[name] = source[name]);
|
|
17267
|
+
hasOwn$1(source, name) && (target[name] = source[name]);
|
|
17268
17268
|
});
|
|
17269
17269
|
return target;
|
|
17270
17270
|
}
|
|
@@ -18831,13 +18831,13 @@ function applyMediaQuery(query, ecWidth, ecHeight) {
|
|
|
18831
18831
|
}
|
|
18832
18832
|
var operator = matched[1];
|
|
18833
18833
|
var realAttr = matched[2].toLowerCase();
|
|
18834
|
-
if (!compare(realMap[realAttr], value, operator)) {
|
|
18834
|
+
if (!compare$1(realMap[realAttr], value, operator)) {
|
|
18835
18835
|
applicable = false;
|
|
18836
18836
|
}
|
|
18837
18837
|
});
|
|
18838
18838
|
return applicable;
|
|
18839
18839
|
}
|
|
18840
|
-
function compare(real, expect, operator) {
|
|
18840
|
+
function compare$1(real, expect, operator) {
|
|
18841
18841
|
if (operator === 'min') {
|
|
18842
18842
|
return real >= expect;
|
|
18843
18843
|
} else if (operator === 'max') {
|
|
@@ -19485,7 +19485,7 @@ function detectSourceFormat(data) {
|
|
|
19485
19485
|
}
|
|
19486
19486
|
} else if (isObject$2(data)) {
|
|
19487
19487
|
for (var key in data) {
|
|
19488
|
-
if (hasOwn(data, key) && isArrayLike(data[key])) {
|
|
19488
|
+
if (hasOwn$1(data, key) && isArrayLike(data[key])) {
|
|
19489
19489
|
sourceFormat = SOURCE_FORMAT_KEYED_COLUMNS;
|
|
19490
19490
|
break;
|
|
19491
19491
|
}
|
|
@@ -20597,7 +20597,7 @@ function createExternalSource(internalSource, externalTransform) {
|
|
|
20597
20597
|
// For simplicity, data transform forbids name duplication, do not generate
|
|
20598
20598
|
// new name like module `completeDimensions.ts` did, but just tell users.
|
|
20599
20599
|
var errMsg_1 = '';
|
|
20600
|
-
if (hasOwn(dimsByName, name)) {
|
|
20600
|
+
if (hasOwn$1(dimsByName, name)) {
|
|
20601
20601
|
throwError(errMsg_1);
|
|
20602
20602
|
}
|
|
20603
20603
|
dimsByName[name] = dimDefExt;
|
|
@@ -20683,9 +20683,9 @@ function getDimensionInfo(dimensions, dimsByName, dim) {
|
|
|
20683
20683
|
// Keep the same logic as `List::getDimension` did.
|
|
20684
20684
|
if (isNumber(dim)
|
|
20685
20685
|
// If being a number-like string but not being defined a dimension name.
|
|
20686
|
-
|| !isNaN(dim) && !hasOwn(dimsByName, dim)) {
|
|
20686
|
+
|| !isNaN(dim) && !hasOwn$1(dimsByName, dim)) {
|
|
20687
20687
|
return dimensions[dim];
|
|
20688
|
-
} else if (hasOwn(dimsByName, dim)) {
|
|
20688
|
+
} else if (hasOwn$1(dimsByName, dim)) {
|
|
20689
20689
|
return dimsByName[dim];
|
|
20690
20690
|
}
|
|
20691
20691
|
}
|
|
@@ -22217,7 +22217,7 @@ function buildSection(ctx, fragment, topMarginForOuterGap, toolTipTextStyle) {
|
|
|
22217
22217
|
valueAsc: 'asc',
|
|
22218
22218
|
valueDesc: 'desc'
|
|
22219
22219
|
};
|
|
22220
|
-
if (hasOwn(orderMap, orderMode)) {
|
|
22220
|
+
if (hasOwn$1(orderMap, orderMode)) {
|
|
22221
22221
|
var comparator_1 = new SortOrderComparator(orderMap[orderMode], null);
|
|
22222
22222
|
subBlocks.sort(function (a, b) {
|
|
22223
22223
|
return comparator_1.evaluate(a.sortParam, b.sortParam);
|
|
@@ -31936,7 +31936,7 @@ function determineAxisType(model) {
|
|
|
31936
31936
|
// PENDING: Theoretically, a customized `Scale` is probably impossible, since
|
|
31937
31937
|
// the interface of `Scale` does not guarantee stability. But we still literally
|
|
31938
31938
|
// support it for backward compat, though type incorrect.
|
|
31939
|
-
|| !hasOwn(AXIS_TYPES, type) && !Scale.getClass(type)) {
|
|
31939
|
+
|| !hasOwn$1(AXIS_TYPES, type) && !Scale.getClass(type)) {
|
|
31940
31940
|
type = 'value';
|
|
31941
31941
|
}
|
|
31942
31942
|
return type;
|
|
@@ -39091,7 +39091,7 @@ onZeroRecords) {
|
|
|
39091
39091
|
} else {
|
|
39092
39092
|
// Find the first available other axis.
|
|
39093
39093
|
for (var idx in otherAxes) {
|
|
39094
|
-
if (hasOwn(otherAxes, idx) && canOnZeroToAxis(onZero, otherAxes[idx])
|
|
39094
|
+
if (hasOwn$1(otherAxes, idx) && canOnZeroToAxis(onZero, otherAxes[idx])
|
|
39095
39095
|
// Consider that two Y axes on one value axis,
|
|
39096
39096
|
// if both onZero, the two Y axes overlap.
|
|
39097
39097
|
&& !onZeroRecords[getOnZeroRecordKey(otherAxes[idx])]) {
|
|
@@ -43535,7 +43535,7 @@ function makeSelectedMap(legendModel, out) {
|
|
|
43535
43535
|
return;
|
|
43536
43536
|
}
|
|
43537
43537
|
var isItemSelected = legendModel.isSelected(name);
|
|
43538
|
-
if (hasOwn(selectedMap, name)) {
|
|
43538
|
+
if (hasOwn$1(selectedMap, name)) {
|
|
43539
43539
|
// Unselected if any legend is unselected
|
|
43540
43540
|
selectedMap[name] = selectedMap[name] && isItemSelected;
|
|
43541
43541
|
} else {
|
|
@@ -45097,28 +45097,299 @@ function install(registers) {
|
|
|
45097
45097
|
registers.registerPainter('canvas', CanvasPainter);
|
|
45098
45098
|
}
|
|
45099
45099
|
|
|
45100
|
-
|
|
45101
|
-
|
|
45102
|
-
|
|
45100
|
+
const ariaLabel$5 = "Corba ITIC";
|
|
45101
|
+
const xAxisName$5 = "Durada (ms)";
|
|
45102
|
+
const yAxisName$5 = "Voltatge (% del voltatge nominal)";
|
|
45103
|
+
const tooltip$5 = {
|
|
45104
|
+
asset: "Actiu",
|
|
45105
|
+
date: "Data",
|
|
45106
|
+
eventType: "Esdeveniment",
|
|
45107
|
+
duration: "Durada",
|
|
45108
|
+
voltage: "Voltatge",
|
|
45109
|
+
status: "Estat",
|
|
45110
|
+
phase: "Fase",
|
|
45111
|
+
min: "Mín.",
|
|
45112
|
+
max: "Màx."
|
|
45113
|
+
};
|
|
45114
|
+
const eventTypes$5 = {
|
|
45115
|
+
VOLTAGE_DIP: "Buit de tensió",
|
|
45116
|
+
VOLTAGE_SWELL: "Augment de tensió",
|
|
45117
|
+
POWER_INTERRUPT: "Interrupció",
|
|
45118
|
+
VOLTAGE_TRANSIENT: "Transitori de voltatge",
|
|
45119
|
+
VOLTAGE_VARIATION: "Variació de voltatge",
|
|
45120
|
+
OVER_VOLTAGE: "Sobretensió",
|
|
45121
|
+
SUB_VOLTAGE: "Subtensió"
|
|
45122
|
+
};
|
|
45123
|
+
const phases$5 = {
|
|
45124
|
+
ALL: "Totes",
|
|
45125
|
+
NONE: ""
|
|
45126
|
+
};
|
|
45127
|
+
var ca = {
|
|
45128
|
+
ariaLabel: ariaLabel$5,
|
|
45129
|
+
xAxisName: xAxisName$5,
|
|
45130
|
+
yAxisName: yAxisName$5,
|
|
45131
|
+
tooltip: tooltip$5,
|
|
45132
|
+
eventTypes: eventTypes$5,
|
|
45133
|
+
phases: phases$5
|
|
45134
|
+
};
|
|
45103
45135
|
|
|
45104
|
-
|
|
45136
|
+
const ariaLabel$4 = "ITIC-Diagramm";
|
|
45137
|
+
const xAxisName$4 = "Dauer (ms)";
|
|
45138
|
+
const yAxisName$4 = "Spannung (% der Nennspannung)";
|
|
45139
|
+
const tooltip$4 = {
|
|
45140
|
+
asset: "Vermögenswert",
|
|
45141
|
+
date: "Datum",
|
|
45142
|
+
eventType: "Ereignis",
|
|
45143
|
+
duration: "Dauer",
|
|
45144
|
+
voltage: "Spannung",
|
|
45145
|
+
status: "Status",
|
|
45146
|
+
phase: "Phase",
|
|
45147
|
+
min: "Min.",
|
|
45148
|
+
max: "Max."
|
|
45149
|
+
};
|
|
45150
|
+
const eventTypes$4 = {
|
|
45151
|
+
VOLTAGE_DIP: "Spannungseinbruch",
|
|
45152
|
+
VOLTAGE_SWELL: "Spannungserhöhung",
|
|
45153
|
+
POWER_INTERRUPT: "Stromunterbrechung",
|
|
45154
|
+
VOLTAGE_TRANSIENT: "Spannungstransient",
|
|
45155
|
+
VOLTAGE_VARIATION: "Spannungsschwankung",
|
|
45156
|
+
OVER_VOLTAGE: "Überspannung",
|
|
45157
|
+
SUB_VOLTAGE: "Unterspannung"
|
|
45158
|
+
};
|
|
45159
|
+
const phases$4 = {
|
|
45160
|
+
ALL: "Alle",
|
|
45161
|
+
NONE: ""
|
|
45162
|
+
};
|
|
45163
|
+
var de = {
|
|
45164
|
+
ariaLabel: ariaLabel$4,
|
|
45165
|
+
xAxisName: xAxisName$4,
|
|
45166
|
+
yAxisName: yAxisName$4,
|
|
45167
|
+
tooltip: tooltip$4,
|
|
45168
|
+
eventTypes: eventTypes$4,
|
|
45169
|
+
phases: phases$4
|
|
45170
|
+
};
|
|
45105
45171
|
|
|
45106
|
-
|
|
45172
|
+
const ariaLabel$3 = "ITIC chart";
|
|
45173
|
+
const xAxisName$3 = "Duration (ms)";
|
|
45174
|
+
const yAxisName$3 = "Voltage (% of nominal voltage)";
|
|
45175
|
+
const tooltip$3 = {
|
|
45176
|
+
asset: "Asset",
|
|
45177
|
+
date: "Date",
|
|
45178
|
+
eventType: "Event",
|
|
45179
|
+
duration: "Duration",
|
|
45180
|
+
voltage: "Voltage",
|
|
45181
|
+
status: "Status",
|
|
45182
|
+
phase: "Phase",
|
|
45183
|
+
min: "Min",
|
|
45184
|
+
max: "Max"
|
|
45185
|
+
};
|
|
45186
|
+
const eventTypes$3 = {
|
|
45187
|
+
VOLTAGE_DIP: "Voltage dip",
|
|
45188
|
+
VOLTAGE_SWELL: "Voltage swell",
|
|
45189
|
+
POWER_INTERRUPT: "Power interruption",
|
|
45190
|
+
VOLTAGE_TRANSIENT: "Voltage transient",
|
|
45191
|
+
VOLTAGE_VARIATION: "Voltage variation",
|
|
45192
|
+
OVER_VOLTAGE: "Overvoltage",
|
|
45193
|
+
SUB_VOLTAGE: "Subvoltage"
|
|
45194
|
+
};
|
|
45195
|
+
const phases$3 = {
|
|
45196
|
+
ALL: "All",
|
|
45197
|
+
NONE: ""
|
|
45198
|
+
};
|
|
45199
|
+
var en = {
|
|
45200
|
+
ariaLabel: ariaLabel$3,
|
|
45201
|
+
xAxisName: xAxisName$3,
|
|
45202
|
+
yAxisName: yAxisName$3,
|
|
45203
|
+
tooltip: tooltip$3,
|
|
45204
|
+
eventTypes: eventTypes$3,
|
|
45205
|
+
phases: phases$3
|
|
45206
|
+
};
|
|
45107
45207
|
|
|
45108
|
-
|
|
45208
|
+
const ariaLabel$2 = "Curva ITIC";
|
|
45209
|
+
const xAxisName$2 = "Duración (ms)";
|
|
45210
|
+
const yAxisName$2 = "Voltaje (% del voltaje nominal)";
|
|
45211
|
+
const tooltip$2 = {
|
|
45212
|
+
asset: "Activo",
|
|
45213
|
+
date: "Fecha",
|
|
45214
|
+
eventType: "Evento",
|
|
45215
|
+
duration: "Duración",
|
|
45216
|
+
voltage: "Voltaje",
|
|
45217
|
+
status: "Estado",
|
|
45218
|
+
phase: "Fase",
|
|
45219
|
+
min: "Mín.",
|
|
45220
|
+
max: "Máx."
|
|
45221
|
+
};
|
|
45222
|
+
const eventTypes$2 = {
|
|
45223
|
+
VOLTAGE_DIP: "Hueco de tensión",
|
|
45224
|
+
VOLTAGE_SWELL: "Aumento de tensión",
|
|
45225
|
+
POWER_INTERRUPT: "Interrupción",
|
|
45226
|
+
VOLTAGE_TRANSIENT: "Transitorio de voltaje",
|
|
45227
|
+
VOLTAGE_VARIATION: "Variación de voltaje",
|
|
45228
|
+
OVER_VOLTAGE: "Sobretensión",
|
|
45229
|
+
SUB_VOLTAGE: "Subtensión"
|
|
45230
|
+
};
|
|
45231
|
+
const phases$2 = {
|
|
45232
|
+
ALL: "Todas",
|
|
45233
|
+
NONE: ""
|
|
45234
|
+
};
|
|
45235
|
+
var es = {
|
|
45236
|
+
ariaLabel: ariaLabel$2,
|
|
45237
|
+
xAxisName: xAxisName$2,
|
|
45238
|
+
yAxisName: yAxisName$2,
|
|
45239
|
+
tooltip: tooltip$2,
|
|
45240
|
+
eventTypes: eventTypes$2,
|
|
45241
|
+
phases: phases$2
|
|
45242
|
+
};
|
|
45109
45243
|
|
|
45110
|
-
|
|
45111
|
-
|
|
45112
|
-
|
|
45113
|
-
|
|
45114
|
-
|
|
45115
|
-
|
|
45116
|
-
|
|
45117
|
-
|
|
45244
|
+
const ariaLabel$1 = "Courbe ITIC";
|
|
45245
|
+
const xAxisName$1 = "Durée (ms)";
|
|
45246
|
+
const yAxisName$1 = "Tension (% de la tension nominale)";
|
|
45247
|
+
const tooltip$1 = {
|
|
45248
|
+
asset: "Dispositif",
|
|
45249
|
+
date: "Date",
|
|
45250
|
+
eventType: "Événement",
|
|
45251
|
+
duration: "Durée",
|
|
45252
|
+
voltage: "Tension",
|
|
45253
|
+
status: "Statut",
|
|
45254
|
+
phase: "Phase",
|
|
45255
|
+
min: "Min.",
|
|
45256
|
+
max: "Max."
|
|
45257
|
+
};
|
|
45258
|
+
const eventTypes$1 = {
|
|
45259
|
+
VOLTAGE_DIP: "Creux de tension",
|
|
45260
|
+
VOLTAGE_SWELL: "Augmentation de tension",
|
|
45261
|
+
POWER_INTERRUPT: "Interruption",
|
|
45262
|
+
VOLTAGE_TRANSIENT: "Tension transitoire",
|
|
45263
|
+
VOLTAGE_VARIATION: "Variation de tension",
|
|
45264
|
+
OVER_VOLTAGE: "Surtension",
|
|
45265
|
+
SUB_VOLTAGE: "Sous-tension"
|
|
45266
|
+
};
|
|
45267
|
+
const phases$1 = {
|
|
45268
|
+
ALL: "Toutes",
|
|
45269
|
+
NONE: ""
|
|
45270
|
+
};
|
|
45271
|
+
var fr = {
|
|
45272
|
+
ariaLabel: ariaLabel$1,
|
|
45273
|
+
xAxisName: xAxisName$1,
|
|
45274
|
+
yAxisName: yAxisName$1,
|
|
45275
|
+
tooltip: tooltip$1,
|
|
45276
|
+
eventTypes: eventTypes$1,
|
|
45277
|
+
phases: phases$1
|
|
45278
|
+
};
|
|
45118
45279
|
|
|
45119
|
-
|
|
45120
|
-
|
|
45280
|
+
const ariaLabel = "Curva ITIC";
|
|
45281
|
+
const xAxisName = "Duração (ms)";
|
|
45282
|
+
const yAxisName = "Tensão (% da tensão nominal)";
|
|
45283
|
+
const tooltip = {
|
|
45284
|
+
asset: "Ativo",
|
|
45285
|
+
date: "Data",
|
|
45286
|
+
eventType: "Evento",
|
|
45287
|
+
duration: "Duração",
|
|
45288
|
+
voltage: "Tensão",
|
|
45289
|
+
status: "Status",
|
|
45290
|
+
phase: "Fase",
|
|
45291
|
+
min: "Mín.",
|
|
45292
|
+
max: "Máx."
|
|
45293
|
+
};
|
|
45294
|
+
const eventTypes = {
|
|
45295
|
+
VOLTAGE_DIP: "Queda de tensão",
|
|
45296
|
+
VOLTAGE_SWELL: "Aumento de tensão",
|
|
45297
|
+
POWER_INTERRUPT: "Interrupção",
|
|
45298
|
+
VOLTAGE_TRANSIENT: "Tensão transitória",
|
|
45299
|
+
VOLTAGE_VARIATION: "Variação de tensão",
|
|
45300
|
+
OVER_VOLTAGE: "Sobretensão",
|
|
45301
|
+
SUB_VOLTAGE: "Subtensão"
|
|
45302
|
+
};
|
|
45303
|
+
const phases = {
|
|
45304
|
+
ALL: "Todas",
|
|
45305
|
+
NONE: ""
|
|
45306
|
+
};
|
|
45307
|
+
var pt = {
|
|
45308
|
+
ariaLabel: ariaLabel,
|
|
45309
|
+
xAxisName: xAxisName,
|
|
45310
|
+
yAxisName: yAxisName,
|
|
45311
|
+
tooltip: tooltip,
|
|
45312
|
+
eventTypes: eventTypes,
|
|
45313
|
+
phases: phases
|
|
45314
|
+
};
|
|
45121
45315
|
|
|
45316
|
+
const LOCALES = ['ca', 'de', 'en', 'es', 'fr', 'pt'];
|
|
45317
|
+
const DEFAULT_LOCALE = 'en';
|
|
45318
|
+
const MESSAGES = { ca, de, en, es, fr, pt };
|
|
45319
|
+
/** Keeps the language of a locale (`es-ES` → `es`), falling back to `en` when it isn't translated. */
|
|
45320
|
+
function normalizeLocale(locale) {
|
|
45321
|
+
const language = String(locale !== null && locale !== void 0 ? locale : '')
|
|
45322
|
+
.split(/[-_]/)[0]
|
|
45323
|
+
.toLowerCase();
|
|
45324
|
+
return LOCALES.includes(language) ? language : DEFAULT_LOCALE;
|
|
45325
|
+
}
|
|
45326
|
+
const getMessages = (locale) => MESSAGES[locale];
|
|
45327
|
+
const hasOwn = (object, key) => Object.prototype.hasOwnProperty.call(object, key);
|
|
45328
|
+
/** Translated event type, or the code as is when it isn't in the catalog. */
|
|
45329
|
+
function translateEventType(messages, code) {
|
|
45330
|
+
return hasOwn(messages.eventTypes, code) ? messages.eventTypes[code] : code;
|
|
45331
|
+
}
|
|
45332
|
+
/** Translated name of a phase code that has one (`ALL`, `NONE`), or `undefined`. */
|
|
45333
|
+
function translatePhase(messages, code) {
|
|
45334
|
+
return hasOwn(messages.phases, code) ? messages.phases[code] : undefined;
|
|
45335
|
+
}
|
|
45336
|
+
|
|
45337
|
+
const L1 = '#a67c52';
|
|
45338
|
+
const L2 = '#20262C';
|
|
45339
|
+
const L3 = '#B9BDC0';
|
|
45340
|
+
const THREE_PHASE = '#00B388';
|
|
45341
|
+
// Same catalog as Scout. Names that change with the language (`ALL`, `NONE`) are in the i18n JSON files.
|
|
45342
|
+
const PHASES = {
|
|
45343
|
+
AN: { name: 'L1', color: L1 },
|
|
45344
|
+
BN: { name: 'L2', color: L2 },
|
|
45345
|
+
CN: { name: 'L3', color: L3 },
|
|
45346
|
+
AB: { name: 'L1', color: L1 },
|
|
45347
|
+
BC: { name: 'L2', color: L2 },
|
|
45348
|
+
CA: { name: 'L3', color: L3 },
|
|
45349
|
+
'AN,BN,CN': { name: 'L1,L2,L3', color: THREE_PHASE },
|
|
45350
|
+
'AB,BC,CA': { name: 'L1,L2,L3', color: THREE_PHASE },
|
|
45351
|
+
ALL: { name: '', color: '#4C5CC5' },
|
|
45352
|
+
A: { name: 'L1' },
|
|
45353
|
+
B: { name: 'L2' },
|
|
45354
|
+
C: { name: 'L3' },
|
|
45355
|
+
'AN,BN': { name: 'L1,L2' },
|
|
45356
|
+
'AN,CN': { name: 'L1,L3' },
|
|
45357
|
+
'BN,CN': { name: 'L2,L3' },
|
|
45358
|
+
'AB,BC': { name: 'L1,L2' },
|
|
45359
|
+
'AB,CA': { name: 'L1,L3' },
|
|
45360
|
+
'BC,CA': { name: 'L2,L3' },
|
|
45361
|
+
NONE: { name: '' },
|
|
45362
|
+
};
|
|
45363
|
+
const phaseCode = (phase) => (phase == null ? '' : String(phase));
|
|
45364
|
+
// Unknown codes keep the code as name and have no color
|
|
45365
|
+
const catalogPhase = (code) => Object.prototype.hasOwnProperty.call(PHASES, code) ? PHASES[code] : { name: code };
|
|
45366
|
+
/** Name, in the given language, and color of a phase code. */
|
|
45367
|
+
function getPhase(phase, messages) {
|
|
45368
|
+
var _a;
|
|
45369
|
+
const code = phaseCode(phase);
|
|
45370
|
+
const known = catalogPhase(code);
|
|
45371
|
+
return Object.assign(Object.assign({}, known), { name: (_a = translatePhase(messages, code)) !== null && _a !== void 0 ? _a : known.name });
|
|
45372
|
+
}
|
|
45373
|
+
// `NONE` (no name) goes after the named phases and `ALL` always last. Only these two names are translated,
|
|
45374
|
+
// so ranking them by code keeps the order the same in every language.
|
|
45375
|
+
const rank = (code) => (code === 'ALL' ? 2 : code === 'NONE' ? 1 : 0);
|
|
45376
|
+
/**
|
|
45377
|
+
* Sorts groups by phase name, then by code (e.g. `AN` and `AB` are both "L1"), with `NONE` and `ALL` last.
|
|
45378
|
+
* Compares characters, not with a locale's rules, so the legend is the same in every language.
|
|
45379
|
+
* Returns a new array with the same group objects; groups with the same code keep their order.
|
|
45380
|
+
*/
|
|
45381
|
+
function sortGroups(groups) {
|
|
45382
|
+
const keyed = groups.map(group => {
|
|
45383
|
+
const code = phaseCode(group.phase);
|
|
45384
|
+
return { group, code, rank: rank(code), name: catalogPhase(code).name };
|
|
45385
|
+
});
|
|
45386
|
+
return keyed
|
|
45387
|
+
.sort((a, b) => a.rank - b.rank || compare(a.name, b.name) || compare(a.code, b.code))
|
|
45388
|
+
.map(({ group }) => group);
|
|
45389
|
+
}
|
|
45390
|
+
const compare = (a, b) => (a < b ? -1 : a > b ? 1 : 0);
|
|
45391
|
+
|
|
45392
|
+
const DEFAULT_SETTINGS = { locale: DEFAULT_LOCALE };
|
|
45122
45393
|
/**
|
|
45123
45394
|
* Normalizes the `groups` prop, which arrives as an array from JS/React
|
|
45124
45395
|
* or as a JSON string when set as an HTML attribute.
|
|
@@ -45133,6 +45404,16 @@ function parseGroups(groups) {
|
|
|
45133
45404
|
}
|
|
45134
45405
|
return parsed;
|
|
45135
45406
|
}
|
|
45407
|
+
function isValidTimeZone(timeZone) {
|
|
45408
|
+
try {
|
|
45409
|
+
// The result must be used: Rollup and terser drop an unused `new Intl.DateTimeFormat()` as side-effect free,
|
|
45410
|
+
// which turned this check into `return true` in the built packages
|
|
45411
|
+
return Boolean(new Intl.DateTimeFormat('en', { timeZone }).resolvedOptions().timeZone);
|
|
45412
|
+
}
|
|
45413
|
+
catch (_a) {
|
|
45414
|
+
return false;
|
|
45415
|
+
}
|
|
45416
|
+
}
|
|
45136
45417
|
function escapeHtml(value) {
|
|
45137
45418
|
return value
|
|
45138
45419
|
.replace(/&/g, '&')
|
|
@@ -45141,57 +45422,95 @@ function escapeHtml(value) {
|
|
|
45141
45422
|
.replace(/"/g, '"')
|
|
45142
45423
|
.replace(/'/g, ''');
|
|
45143
45424
|
}
|
|
45144
|
-
|
|
45145
|
-
|
|
45146
|
-
|
|
45147
|
-
|
|
45148
|
-
|
|
45149
|
-
|
|
45150
|
-
|
|
45151
|
-
|
|
45152
|
-
|
|
45153
|
-
|
|
45154
|
-
|
|
45155
|
-
|
|
45156
|
-
|
|
45157
|
-
|
|
45158
|
-
|
|
45159
|
-
|
|
45160
|
-
|
|
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
|
+
}
|
|
45161
45476
|
const isClickable = (point) => point.clickable !== false;
|
|
45162
45477
|
function buildChartOptions(groups, settings = DEFAULT_SETTINGS) {
|
|
45163
|
-
|
|
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: [
|
|
45164
45482
|
...CURVE_SERIES,
|
|
45165
|
-
...groups.map((group) =>
|
|
45166
|
-
|
|
45167
|
-
|
|
45168
|
-
|
|
45169
|
-
|
|
45170
|
-
|
|
45171
|
-
|
|
45172
|
-
|
|
45173
|
-
|
|
45174
|
-
|
|
45175
|
-
|
|
45176
|
-
|
|
45177
|
-
|
|
45178
|
-
|
|
45179
|
-
|
|
45180
|
-
|
|
45181
|
-
|
|
45182
|
-
|
|
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
|
+
}),
|
|
45183
45502
|
] });
|
|
45184
45503
|
}
|
|
45185
45504
|
/**
|
|
45186
|
-
* Maps an ECharts click back to the original point and group
|
|
45187
|
-
* 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`.
|
|
45188
45507
|
* Returns `undefined` for clicks outside the points and on points that aren't clickable.
|
|
45189
45508
|
*/
|
|
45190
45509
|
function findClickedPoint(groups, { componentType, seriesIndex, dataIndex }) {
|
|
45191
45510
|
if (componentType !== 'series' || seriesIndex == null || dataIndex == null) {
|
|
45192
45511
|
return undefined;
|
|
45193
45512
|
}
|
|
45194
|
-
const group = groups[seriesIndex - CURVE_SERIES.length];
|
|
45513
|
+
const group = sortGroups(groups)[seriesIndex - CURVE_SERIES.length];
|
|
45195
45514
|
const point = group === null || group === void 0 ? void 0 : group.points[dataIndex];
|
|
45196
45515
|
if (!point || !isClickable(point)) {
|
|
45197
45516
|
return undefined;
|
|
@@ -45216,10 +45535,11 @@ const ITIC_CURVE_NODAMAGE_REGION = [
|
|
|
45216
45535
|
[10000, 90],
|
|
45217
45536
|
[100000, 90],
|
|
45218
45537
|
];
|
|
45538
|
+
// Fixed ranges, as in Scout: ECharts clips points outside them (duration < 1 ms or voltage > 200%)
|
|
45219
45539
|
const BASE_OPTIONS = {
|
|
45220
45540
|
animation: false,
|
|
45221
45541
|
grid: {
|
|
45222
|
-
right: '
|
|
45542
|
+
right: '20px',
|
|
45223
45543
|
left: '60px',
|
|
45224
45544
|
},
|
|
45225
45545
|
// ECharts 6 moved the default legend to the bottom; keep it on top as in previous versions
|
|
@@ -45231,7 +45551,7 @@ const BASE_OPTIONS = {
|
|
|
45231
45551
|
},
|
|
45232
45552
|
xAxis: {
|
|
45233
45553
|
type: 'log',
|
|
45234
|
-
min:
|
|
45554
|
+
min: 1,
|
|
45235
45555
|
max: 100000,
|
|
45236
45556
|
nameGap: 30,
|
|
45237
45557
|
nameLocation: 'middle',
|
|
@@ -45243,7 +45563,7 @@ const BASE_OPTIONS = {
|
|
|
45243
45563
|
yAxis: {
|
|
45244
45564
|
type: 'value',
|
|
45245
45565
|
min: 0,
|
|
45246
|
-
max:
|
|
45566
|
+
max: 200,
|
|
45247
45567
|
nameTextStyle: {
|
|
45248
45568
|
fontSize: 16,
|
|
45249
45569
|
fontWeight: 'bold',
|
|
@@ -45253,6 +45573,7 @@ const BASE_OPTIONS = {
|
|
|
45253
45573
|
nameLocation: 'middle',
|
|
45254
45574
|
},
|
|
45255
45575
|
};
|
|
45576
|
+
// `silent`: the curve doesn't react to the mouse (no tooltip, cursor or click)
|
|
45256
45577
|
const CURVE_SERIES = [
|
|
45257
45578
|
{
|
|
45258
45579
|
type: 'line',
|
|
@@ -45264,6 +45585,7 @@ const CURVE_SERIES = [
|
|
|
45264
45585
|
lineStyle: {
|
|
45265
45586
|
color: '#000',
|
|
45266
45587
|
},
|
|
45588
|
+
silent: true,
|
|
45267
45589
|
showSymbol: false,
|
|
45268
45590
|
emphasis: {
|
|
45269
45591
|
disabled: true,
|
|
@@ -45276,6 +45598,7 @@ const CURVE_SERIES = [
|
|
|
45276
45598
|
origin: 'start',
|
|
45277
45599
|
color: '#FFF5DF',
|
|
45278
45600
|
},
|
|
45601
|
+
silent: true,
|
|
45279
45602
|
showSymbol: false,
|
|
45280
45603
|
lineStyle: {
|
|
45281
45604
|
color: '#000',
|
|
@@ -45291,6 +45614,7 @@ const CURVE_SERIES = [
|
|
|
45291
45614
|
origin: 100,
|
|
45292
45615
|
color: '#DDFAF1',
|
|
45293
45616
|
},
|
|
45617
|
+
silent: true,
|
|
45294
45618
|
showSymbol: false,
|
|
45295
45619
|
lineStyle: {
|
|
45296
45620
|
color: '#000',
|
|
@@ -45306,6 +45630,7 @@ const CURVE_SERIES = [
|
|
|
45306
45630
|
origin: 100,
|
|
45307
45631
|
color: '#DDFAF1',
|
|
45308
45632
|
},
|
|
45633
|
+
silent: true,
|
|
45309
45634
|
showSymbol: false,
|
|
45310
45635
|
lineStyle: {
|
|
45311
45636
|
color: '#000',
|
|
@@ -45324,6 +45649,7 @@ const CURVE_SERIES = [
|
|
|
45324
45649
|
origin: 100,
|
|
45325
45650
|
color: '#DDFAF1',
|
|
45326
45651
|
},
|
|
45652
|
+
silent: true,
|
|
45327
45653
|
showSymbol: false,
|
|
45328
45654
|
lineStyle: {
|
|
45329
45655
|
color: 'transparent',
|
|
@@ -45342,6 +45668,7 @@ const CURVE_SERIES = [
|
|
|
45342
45668
|
origin: 100,
|
|
45343
45669
|
color: '#DDFAF1',
|
|
45344
45670
|
},
|
|
45671
|
+
silent: true,
|
|
45345
45672
|
showSymbol: false,
|
|
45346
45673
|
lineStyle: {
|
|
45347
45674
|
color: 'transparent',
|
|
@@ -45361,16 +45688,21 @@ const IticChart = class {
|
|
|
45361
45688
|
registerInstance(this, hostRef);
|
|
45362
45689
|
this.pointClick = createEvent(this, "pointClick");
|
|
45363
45690
|
/**
|
|
45364
|
-
*
|
|
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`.
|
|
45365
45693
|
*/
|
|
45366
|
-
this.
|
|
45367
|
-
/**
|
|
45368
|
-
* Name of the voltage (Y) axis.
|
|
45369
|
-
*/
|
|
45370
|
-
this.yAxisName = DEFAULT_SETTINGS.yAxisName;
|
|
45694
|
+
this.locale = 'en';
|
|
45371
45695
|
this.parsedGroups = [];
|
|
45372
45696
|
}
|
|
45373
|
-
|
|
45697
|
+
onGroupsChange() {
|
|
45698
|
+
this.updateChart();
|
|
45699
|
+
}
|
|
45700
|
+
onLocaleChange() {
|
|
45701
|
+
this.updateAriaLabel();
|
|
45702
|
+
this.updateChart();
|
|
45703
|
+
}
|
|
45704
|
+
onTimeZoneChange() {
|
|
45705
|
+
this.validateTimeZone();
|
|
45374
45706
|
this.updateChart();
|
|
45375
45707
|
}
|
|
45376
45708
|
connectedCallback() {
|
|
@@ -45378,9 +45710,13 @@ const IticChart = class {
|
|
|
45378
45710
|
if (!this.el.hasAttribute('role')) {
|
|
45379
45711
|
this.el.setAttribute('role', 'img');
|
|
45380
45712
|
}
|
|
45713
|
+
this.updateAriaLabel();
|
|
45381
45714
|
// componentDidLoad only fires once, so re-create the chart when the element is re-attached
|
|
45382
45715
|
this.initChart();
|
|
45383
45716
|
}
|
|
45717
|
+
componentWillLoad() {
|
|
45718
|
+
this.validateTimeZone();
|
|
45719
|
+
}
|
|
45384
45720
|
componentDidLoad() {
|
|
45385
45721
|
this.initChart();
|
|
45386
45722
|
}
|
|
@@ -45391,6 +45727,27 @@ const IticChart = class {
|
|
|
45391
45727
|
(_b = this.chart) === null || _b === void 0 ? void 0 : _b.dispose();
|
|
45392
45728
|
this.chart = undefined;
|
|
45393
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(this.timeZone)) {
|
|
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
|
+
}
|
|
45394
45751
|
initChart() {
|
|
45395
45752
|
if (!this.container || this.chart) {
|
|
45396
45753
|
return;
|
|
@@ -45409,7 +45766,6 @@ const IticChart = class {
|
|
|
45409
45766
|
this.updateChart();
|
|
45410
45767
|
}
|
|
45411
45768
|
updateChart() {
|
|
45412
|
-
var _a;
|
|
45413
45769
|
if (!this.chart) {
|
|
45414
45770
|
return;
|
|
45415
45771
|
}
|
|
@@ -45421,28 +45777,24 @@ const IticChart = class {
|
|
|
45421
45777
|
console.error('[itic-chart] Invalid "groups" prop:', error);
|
|
45422
45778
|
}
|
|
45423
45779
|
const options = buildChartOptions(this.parsedGroups, {
|
|
45424
|
-
|
|
45425
|
-
|
|
45426
|
-
tooltipFormatter: (_a = this.tooltipFormatter) !== null && _a !== void 0 ? _a : DEFAULT_SETTINGS.tooltipFormatter,
|
|
45780
|
+
locale: normalizeLocale(this.locale),
|
|
45781
|
+
timeZone: this.validTimeZone,
|
|
45427
45782
|
});
|
|
45428
45783
|
this.chart.setOption(options, { notMerge: true });
|
|
45429
45784
|
}
|
|
45430
45785
|
render() {
|
|
45431
|
-
return h("div", { key: '
|
|
45786
|
+
return h("div", { key: 'e202bbf61ad19502fd76a42f37a8ea69f2d8c58b', class: "chart", ref: el => (this.container = el) });
|
|
45432
45787
|
}
|
|
45433
45788
|
get el() { return getElement(this); }
|
|
45434
45789
|
static get watchers() { return {
|
|
45435
45790
|
"groups": [{
|
|
45436
|
-
"
|
|
45437
|
-
}],
|
|
45438
|
-
"xAxisName": [{
|
|
45439
|
-
"onOptionsChange": 0
|
|
45791
|
+
"onGroupsChange": 0
|
|
45440
45792
|
}],
|
|
45441
|
-
"
|
|
45442
|
-
"
|
|
45793
|
+
"locale": [{
|
|
45794
|
+
"onLocaleChange": 0
|
|
45443
45795
|
}],
|
|
45444
|
-
"
|
|
45445
|
-
"
|
|
45796
|
+
"timeZone": [{
|
|
45797
|
+
"onTimeZoneChange": 0
|
|
45446
45798
|
}]
|
|
45447
45799
|
}; }
|
|
45448
45800
|
};
|