@flexem/fc-gui 3.0.0-alpha.30 → 3.0.0-alpha.33

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.
@@ -40,9 +40,9 @@ export class AirQualityElement extends ConditionalDisplayElement {
40
40
  this.buildBackgroudRect(airQualitySvg, backgroundColor);
41
41
  this.buildLocGroup(airQualitySvg, airQuality.city, fontColor);
42
42
  this.buildAirQualityText(airQualitySvg, 130, 55, airQuality.aqi, fontColor, 53);
43
- this.buildAirQualityText(airQualitySvg, 190, 28, '空气质量', fontColor);
43
+ this.buildAirQualityText(airQualitySvg, 220, 28, '空气质量', fontColor);
44
44
  this.buildRectBackgroundForAqi(airQualitySvg, airQuality.level);
45
- this.buildAirQualityText(airQualitySvg, 190, 49, airQuality.category, fontColor);
45
+ this.buildAirQualityText(airQualitySvg, 220, 49, airQuality.category, fontColor);
46
46
  this.buildAirQualityText(airQualitySvg, 30, 75, 'PM2.5', fontColor, 12, 0.8);
47
47
  this.buildAirQualityText(airQualitySvg, 30, 95, airQuality.pm25, fontColor, 15);
48
48
  this.buildAirQualityText(airQualitySvg, 80, 75, 'PM10', fontColor, 12, 0.8);
@@ -105,7 +105,7 @@ export class AirQualityElement extends ConditionalDisplayElement {
105
105
  backgroundColor = '#A10E0E';
106
106
  }
107
107
  airQualitySvg.append('rect')
108
- .attr('x', '165')
108
+ .attr('x', '195')
109
109
  .attr('y', '35')
110
110
  .attr('rx', '5')
111
111
  .attr('width', '50')
@@ -10,6 +10,7 @@ import { HistoricalCurveElementStatus } from './historical-curve-element-status'
10
10
  import { LOGGER_SERVICE_TOKEN } from '../../logger';
11
11
  import { GlobalSettings, DisplayMode } from '../../settings';
12
12
  import { CurveType } from '../../model/historical-curve/curve-type';
13
+ import { AxisRangeType } from '../../model/historical-curve/historical-curve-axis-settings';
13
14
  export class HistoricalCurveElement extends ConditionalDisplayElement {
14
15
  constructor(element, injector, permissionChecker, variableCommunicator, variableStore, historyDataStore, signalRAppId) {
15
16
  super(element, permissionChecker, variableCommunicator, variableStore, signalRAppId);
@@ -152,6 +153,9 @@ export class HistoricalCurveElement extends ConditionalDisplayElement {
152
153
  const chart = nv.models.lineChart().showLegend(true)
153
154
  .margin({ top: 0, bottom: 0, left: this.displayOption.marginLeft, right: this.displayOption.marginRight })
154
155
  .noData(this.localization.chartNoData);
156
+ if (this.model.displaySetting.axisSetting.yAxisRangeType === AxisRangeType.Custom) {
157
+ chart.yDomain([this.model.displaySetting.axisSetting.yAxisMin, this.model.displaySetting.axisSetting.yAxisMax]);
158
+ }
155
159
  if (!this.isMobileMode) {
156
160
  chart.focusEnable(true);
157
161
  chart.focus.margin({ top: 10, right: 0, bottom: 0, left: 0 });
@@ -176,6 +180,9 @@ export class HistoricalCurveElement extends ConditionalDisplayElement {
176
180
  chart.multibar.stacked(true);
177
181
  chart.multibar2.stacked(true);
178
182
  }
183
+ if (this.model.displaySetting.axisSetting.yAxisRangeType === AxisRangeType.Custom) {
184
+ chart.yDomain([this.model.displaySetting.axisSetting.yAxisMin, this.model.displaySetting.axisSetting.yAxisMax]);
185
+ }
179
186
  if (!this.isMobileMode) {
180
187
  chart.focusEnable(true);
181
188
  chart.focusShowAxisX(false);
@@ -1 +1 @@
1
- [{"__symbolic":"module","version":4,"metadata":{"HistoricalCurveElement":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"../base/conditional-display-element","name":"ConditionalDisplayElement","line":20,"character":44},"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"error","message":"Could not resolve type","line":62,"character":25,"context":{"typeName":"HTMLElement"}},{"__symbolic":"reference","module":"@angular/core","name":"Injector","line":63,"character":18},{"__symbolic":"reference","module":"../../service","name":"PermissionChecker","line":64,"character":27},{"__symbolic":"reference","module":"../../communication","name":"VariableCommunicator","line":65,"character":30},{"__symbolic":"reference","module":"../../config","name":"VariableStore","line":66,"character":23},{"__symbolic":"reference","module":"../../config","name":"HistoryDataStore","line":67,"character":43},{"__symbolic":"reference","name":"string"}]}],"dispose":[{"__symbolic":"method"}],"getValidTimePeriods":[{"__symbolic":"method"}],"updateTimeRange":[{"__symbolic":"method"}],"updateQueryTimeRange":[{"__symbolic":"method"}],"reRenderElement":[{"__symbolic":"method"}],"renderElement":[{"__symbolic":"method"}],"renderChart":[{"__symbolic":"method"}],"getLineChart":[{"__symbolic":"method"}],"getMultiBarWithFocusChart":[{"__symbolic":"method"}],"renderCommonProperty":[{"__symbolic":"method"}],"renderOperationArea":[{"__symbolic":"method"}],"timeFormat":[{"__symbolic":"method"}],"loadFirstPage":[{"__symbolic":"method"}],"loadNextPage":[{"__symbolic":"method"}],"loadPreviousPage":[{"__symbolic":"method"}],"loadLastPage":[{"__symbolic":"method"}],"initElementStatus":[{"__symbolic":"method"}],"updateElementStatus":[{"__symbolic":"method"}],"setStatusAsUnbound":[{"__symbolic":"method"}],"setStatusAsLoading":[{"__symbolic":"method"}],"setStatusAsLoadFailed":[{"__symbolic":"method"}],"renderStatus":[{"__symbolic":"method"}],"clearStatus":[{"__symbolic":"method"}]}}}}]
1
+ [{"__symbolic":"module","version":4,"metadata":{"HistoricalCurveElement":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"../base/conditional-display-element","name":"ConditionalDisplayElement","line":21,"character":44},"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"error","message":"Could not resolve type","line":63,"character":25,"context":{"typeName":"HTMLElement"}},{"__symbolic":"reference","module":"@angular/core","name":"Injector","line":64,"character":18},{"__symbolic":"reference","module":"../../service","name":"PermissionChecker","line":65,"character":27},{"__symbolic":"reference","module":"../../communication","name":"VariableCommunicator","line":66,"character":30},{"__symbolic":"reference","module":"../../config","name":"VariableStore","line":67,"character":23},{"__symbolic":"reference","module":"../../config","name":"HistoryDataStore","line":68,"character":43},{"__symbolic":"reference","name":"string"}]}],"dispose":[{"__symbolic":"method"}],"getValidTimePeriods":[{"__symbolic":"method"}],"updateTimeRange":[{"__symbolic":"method"}],"updateQueryTimeRange":[{"__symbolic":"method"}],"reRenderElement":[{"__symbolic":"method"}],"renderElement":[{"__symbolic":"method"}],"renderChart":[{"__symbolic":"method"}],"getLineChart":[{"__symbolic":"method"}],"getMultiBarWithFocusChart":[{"__symbolic":"method"}],"renderCommonProperty":[{"__symbolic":"method"}],"renderOperationArea":[{"__symbolic":"method"}],"timeFormat":[{"__symbolic":"method"}],"loadFirstPage":[{"__symbolic":"method"}],"loadNextPage":[{"__symbolic":"method"}],"loadPreviousPage":[{"__symbolic":"method"}],"loadLastPage":[{"__symbolic":"method"}],"initElementStatus":[{"__symbolic":"method"}],"updateElementStatus":[{"__symbolic":"method"}],"setStatusAsUnbound":[{"__symbolic":"method"}],"setStatusAsLoading":[{"__symbolic":"method"}],"setStatusAsLoadFailed":[{"__symbolic":"method"}],"renderStatus":[{"__symbolic":"method"}],"clearStatus":[{"__symbolic":"method"}]}}}}]
@@ -30,6 +30,9 @@ export class RingGraphElement extends ReadableElement {
30
30
  if (!this.model.variableId) {
31
31
  return '';
32
32
  }
33
+ if (!this.model.variableId.variableName || !this.model.variableId.variableName.name) {
34
+ return undefined;
35
+ }
33
36
  const variable = new VariableDefinition(this.model.variableId.variableName.name, this.model.variableId.variableName.groupName, this.model.variableId.dataSourceCode, this.model.variableId.variableName.variableVersion);
34
37
  return VariableUtil.getConvertedVariableName(this.variableStore, variable);
35
38
  }
@@ -37,14 +40,20 @@ export class RingGraphElement extends ReadableElement {
37
40
  if (!this.model.minValueType) {
38
41
  return undefined;
39
42
  }
40
- const variable = new VariableDefinition(this.model.minVariable.variableName.name, this.model.minVariable.variableName.groupName, this.model.minVariable.dataSourceCode, this.model.minVariable.variableName.variableVersion);
43
+ if (!this.model.minVariable || !this.model.minVariable.name) {
44
+ return undefined;
45
+ }
46
+ const variable = new VariableDefinition(this.model.minVariable.name, this.model.minVariable.groupName, this.model.minVariable.dataSourceCode, this.model.minVariable.variableVersion);
41
47
  return VariableUtil.getConvertedVariableName(this.variableStore, variable);
42
48
  }
43
49
  get maxVariableName() {
44
50
  if (!this.model.maxValueType) {
45
51
  return undefined;
46
52
  }
47
- const variable = new VariableDefinition(this.model.maxVariable.variableName.name, this.model.maxVariable.variableName.groupName, this.model.maxVariable.dataSourceCode, this.model.maxVariable.variableName.variableVersion);
53
+ if (!this.model.maxVariable || !this.model.maxVariable.name) {
54
+ return undefined;
55
+ }
56
+ const variable = new VariableDefinition(this.model.maxVariable.name, this.model.maxVariable.groupName, this.model.maxVariable.dataSourceCode, this.model.maxVariable.variableVersion);
48
57
  return VariableUtil.getConvertedVariableName(this.variableStore, variable);
49
58
  }
50
59
  initFrameNode() {
@@ -71,11 +80,11 @@ export class RingGraphElement extends ReadableElement {
71
80
  this.isNeedUpdateScale = false;
72
81
  this.valueObj.value = value;
73
82
  }
74
- if (((_b = this.model.minVariable) === null || _b === void 0 ? void 0 : _b.variableName.name) === variableName) {
83
+ if (((_b = this.model.minVariable) === null || _b === void 0 ? void 0 : _b.name) === variableName) {
75
84
  this.isNeedUpdateScale = true;
76
85
  this.valueObj.min = value;
77
86
  }
78
- if (((_c = this.model.maxVariable) === null || _c === void 0 ? void 0 : _c.variableName.name) === variableName) {
87
+ if (((_c = this.model.maxVariable) === null || _c === void 0 ? void 0 : _c.name) === variableName) {
79
88
  this.isNeedUpdateScale = true;
80
89
  this.valueObj.max = value;
81
90
  }
@@ -1 +1 @@
1
- [{"__symbolic":"module","version":4,"metadata":{"RingGraphElement":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"../base/readable-element","name":"ReadableElement","line":16,"character":38},"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"error","message":"Could not resolve type","line":48,"character":25,"context":{"typeName":"HTMLElement"}},{"__symbolic":"reference","module":"../../service","name":"PermissionChecker","line":48,"character":57},{"__symbolic":"reference","module":"../../communication/variable/variable-communicator","name":"VariableCommunicator","line":49,"character":30},{"__symbolic":"reference","module":"../../config","name":"VariableStore","line":50,"character":23},{"__symbolic":"reference","module":"../../localization/localization.service","name":"Localization","line":51,"character":22},{"__symbolic":"reference","name":"string"}]}],"initFrameNode":[{"__symbolic":"method"}],"init":[{"__symbolic":"method"}],"updateValueObj":[{"__symbolic":"method"}],"updateScale":[{"__symbolic":"method"}],"updateVariableValue":[{"__symbolic":"method"}],"updateBar":[{"__symbolic":"method"}],"getBarColor":[{"__symbolic":"method"}],"drawClockWiseArc":[{"__symbolic":"method"}],"drawAntiClockWiseArc":[{"__symbolic":"method"}]},"statics":{"DEFAULT_MIN_VALUE":0,"DEFAULT_MAX_VALUE":100}}}}]
1
+ [{"__symbolic":"module","version":4,"metadata":{"RingGraphElement":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"../base/readable-element","name":"ReadableElement","line":16,"character":38},"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"error","message":"Could not resolve type","line":60,"character":25,"context":{"typeName":"HTMLElement"}},{"__symbolic":"reference","module":"../../service","name":"PermissionChecker","line":60,"character":57},{"__symbolic":"reference","module":"../../communication/variable/variable-communicator","name":"VariableCommunicator","line":61,"character":30},{"__symbolic":"reference","module":"../../config","name":"VariableStore","line":62,"character":23},{"__symbolic":"reference","module":"../../localization/localization.service","name":"Localization","line":63,"character":22},{"__symbolic":"reference","name":"string"}]}],"initFrameNode":[{"__symbolic":"method"}],"init":[{"__symbolic":"method"}],"updateValueObj":[{"__symbolic":"method"}],"updateScale":[{"__symbolic":"method"}],"updateVariableValue":[{"__symbolic":"method"}],"updateBar":[{"__symbolic":"method"}],"getBarColor":[{"__symbolic":"method"}],"drawClockWiseArc":[{"__symbolic":"method"}],"drawAntiClockWiseArc":[{"__symbolic":"method"}]},"statics":{"DEFAULT_MIN_VALUE":0,"DEFAULT_MAX_VALUE":100}}}}]
@@ -1,6 +1,13 @@
1
1
  import { Font } from '../shared/text/font';
2
2
  export interface HistoricalCurveAxisSettings {
3
+ readonly yAxisRangeType: AxisRangeType;
4
+ readonly yAxisMax?: number;
5
+ readonly yAxisMin?: number;
3
6
  readonly axisColor: string;
4
7
  readonly showAxisLabel: boolean;
5
8
  readonly axisLabelFont: Font;
6
9
  }
10
+ export declare enum AxisRangeType {
11
+ Auto = 0,
12
+ Custom = 1
13
+ }
@@ -0,0 +1,5 @@
1
+ export var AxisRangeType;
2
+ (function (AxisRangeType) {
3
+ AxisRangeType[AxisRangeType["Auto"] = 0] = "Auto";
4
+ AxisRangeType[AxisRangeType["Custom"] = 1] = "Custom"; // 自定义范围
5
+ })(AxisRangeType || (AxisRangeType = {}));
@@ -1 +1 @@
1
- [{"__symbolic":"module","version":4,"metadata":{"HistoricalCurveAxisSettings":{"__symbolic":"interface"}}}]
1
+ [{"__symbolic":"module","version":4,"metadata":{"HistoricalCurveAxisSettings":{"__symbolic":"interface"},"AxisRangeType":{"Auto":0,"Custom":1}}}]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "main": "bundles/fc-gui.umd.js",
3
- "version": "3.0.0-alpha.30",
3
+ "version": "3.0.0-alpha.33",
4
4
  "module": "public_api.js",
5
5
  "typings": "public_api.d.ts",
6
6
  "license": "UNLICENSED",