@flexem/fc-gui 3.0.0-alpha.90 → 3.0.0-alpha.92
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/CHANGELOG.md +5 -0
- package/bundles/@flexem/fc-gui.umd.js +51 -0
- package/bundles/@flexem/fc-gui.umd.js.map +1 -1
- package/bundles/@flexem/fc-gui.umd.min.js +1 -1
- package/bundles/@flexem/fc-gui.umd.min.js.map +1 -1
- package/elements/historical-curve/historical-curve.element.d.ts +3 -0
- package/elements/historical-curve/historical-curve.element.js +51 -0
- package/elements/historical-curve/historical-curve.element.metadata.json +1 -1
- package/model/historical-curve/historical-curve-chanel.model.d.ts +8 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -36357,6 +36357,7 @@ class historical_curve_element_HistoricalCurveElement extends conditional_displa
|
|
|
36357
36357
|
operationButtonMargin: 4
|
|
36358
36358
|
};
|
|
36359
36359
|
this.elementStatus = HistoricalCurveElementStatus.Loading;
|
|
36360
|
+
this.data = [];
|
|
36360
36361
|
this.logger = injector.get(logger["b" /* LOGGER_SERVICE_TOKEN */]);
|
|
36361
36362
|
this.localization = injector.get(_tmp_localization["b" /* LOCALIZATION */]);
|
|
36362
36363
|
this.timePeriods = this.getValidTimePeriods();
|
|
@@ -36468,6 +36469,7 @@ class historical_curve_element_HistoricalCurveElement extends conditional_displa
|
|
|
36468
36469
|
Object(lodash["each"])(result, v => values.push({ x: moment(v.time).local().toDate().valueOf(), y: v.values[key] }));
|
|
36469
36470
|
data.push({ key: channel.name, area: channel.projectEnabled, values: values });
|
|
36470
36471
|
});
|
|
36472
|
+
this.data = data;
|
|
36471
36473
|
nv_d3["addGraph"](() => {
|
|
36472
36474
|
if (this.model.displaySetting.curveType === CurveType.BarGroup || this.model.displaySetting.curveType === CurveType.BarStack) {
|
|
36473
36475
|
return this.getMultiBarWithFocusChart(chartWidth, chartHeight, data);
|
|
@@ -36477,6 +36479,44 @@ class historical_curve_element_HistoricalCurveElement extends conditional_displa
|
|
|
36477
36479
|
}
|
|
36478
36480
|
});
|
|
36479
36481
|
}
|
|
36482
|
+
initPoint() {
|
|
36483
|
+
try {
|
|
36484
|
+
this.rootElement
|
|
36485
|
+
.selectAll('.nv-scatterWrap')
|
|
36486
|
+
.selectAll('.nv-point')
|
|
36487
|
+
.style('stroke-opacity', 0)
|
|
36488
|
+
.style('stroke-width', 0);
|
|
36489
|
+
const legendList = this.rootElement
|
|
36490
|
+
.selectAll('.nv-legend')
|
|
36491
|
+
.selectAll('.nv-series');
|
|
36492
|
+
let hiddenCount = 0;
|
|
36493
|
+
for (let i = 0; i < this.data.length; i++) {
|
|
36494
|
+
const channel = this.model.dataSetting.channels[i];
|
|
36495
|
+
const pointStyle = `stroke-opacity: 1;stroke-width: 8px;stroke :${channel.pointColor}`;
|
|
36496
|
+
if (legendList._groups[0][i].firstChild.style.fillOpacity === '1') {
|
|
36497
|
+
const pointList = this.rootElement
|
|
36498
|
+
.selectAll('.nv-scatterWrap')
|
|
36499
|
+
.selectAll('.nv-series-' + (i - hiddenCount)).selectAll('.nv-point')._groups[0];
|
|
36500
|
+
if (pointList && pointList.length) {
|
|
36501
|
+
for (let j = 0; j < pointList.length; j++) {
|
|
36502
|
+
if (j && $(pointList[j]).attr('transform').split(',')[1] !== $(pointList[j - 1]).attr('transform').split(',')[1]) {
|
|
36503
|
+
if (channel.enablePoint && channel.pointColor) {
|
|
36504
|
+
pointList[j].setAttribute('style', pointStyle);
|
|
36505
|
+
pointList[j - 1].setAttribute('style', pointStyle);
|
|
36506
|
+
}
|
|
36507
|
+
}
|
|
36508
|
+
}
|
|
36509
|
+
}
|
|
36510
|
+
}
|
|
36511
|
+
else {
|
|
36512
|
+
hiddenCount++;
|
|
36513
|
+
}
|
|
36514
|
+
}
|
|
36515
|
+
}
|
|
36516
|
+
catch (e) {
|
|
36517
|
+
console.log(e);
|
|
36518
|
+
}
|
|
36519
|
+
}
|
|
36480
36520
|
getLineChart(chartWidth, chartHeight, data) {
|
|
36481
36521
|
const chart = nv_d3["models"].lineChart().showLegend(true)
|
|
36482
36522
|
.margin({ top: 0, bottom: 0, left: this.displayOption.marginLeft, right: this.displayOption.marginRight })
|
|
@@ -36492,6 +36532,12 @@ class historical_curve_element_HistoricalCurveElement extends conditional_displa
|
|
|
36492
36532
|
}
|
|
36493
36533
|
this.renderCommonProperty(chart, chartWidth, chartHeight, data);
|
|
36494
36534
|
this.renderOperationArea(chartWidth, chartHeight);
|
|
36535
|
+
this.initPoint();
|
|
36536
|
+
chart.legend.dispatch.on('legendClick', () => {
|
|
36537
|
+
setTimeout(() => {
|
|
36538
|
+
this.initPoint();
|
|
36539
|
+
}, 1);
|
|
36540
|
+
});
|
|
36495
36541
|
return chart;
|
|
36496
36542
|
}
|
|
36497
36543
|
getMultiBarWithFocusChart(chartWidth, chartHeight, data) {
|
|
@@ -36535,6 +36581,11 @@ class historical_curve_element_HistoricalCurveElement extends conditional_displa
|
|
|
36535
36581
|
chart.tooltip.headerFormatter(d => this.timeFormat(d, '%x %X'));
|
|
36536
36582
|
if (this.model.displaySetting.showAxis) {
|
|
36537
36583
|
chart.xAxis.showMaxMin(true).tickFormat(d => {
|
|
36584
|
+
clearTimeout(this.timer);
|
|
36585
|
+
this.timer = undefined;
|
|
36586
|
+
this.timer = setTimeout(() => {
|
|
36587
|
+
this.initPoint();
|
|
36588
|
+
}, 1);
|
|
36538
36589
|
if (this.currentTimePeriod === 3 || this.currentTimePeriod === 4 || this.currentTimePeriod === 5) {
|
|
36539
36590
|
return this.timeFormat(d, '%y-%m-%d');
|
|
36540
36591
|
}
|