@flexem/fc-gui 3.0.0-alpha.100 → 3.0.0-alpha.102

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.
@@ -91,6 +91,24 @@ export class BarGraphElement extends ReadableElement {
91
91
  }
92
92
  if (!isNaN(sacleValue)) {
93
93
  text.innerHTML = sacleValue;
94
+ if (this.model.minValueType !== VariableValueType.Constant || this.model.maxValueType !== VariableValueType.Constant) {
95
+ // FLEXCLOUD-2619 刻度未对齐问题
96
+ let translateX = 0;
97
+ switch (sacleValue.toString().length) {
98
+ case 1:
99
+ translateX = 13;
100
+ break;
101
+ case 2:
102
+ translateX = 7;
103
+ break;
104
+ case 3:
105
+ translateX = this.model.fractionDigits ? 5 : 0;
106
+ break;
107
+ default:
108
+ break;
109
+ }
110
+ text.transform.baseVal[0].matrix.e = translateX;
111
+ }
94
112
  }
95
113
  }
96
114
  }
@@ -34,6 +34,7 @@ export declare class HistoricalCurveElement extends ConditionalDisplayElement {
34
34
  private isMobileMode;
35
35
  private data;
36
36
  private timer;
37
+ private resizeEventListener;
37
38
  constructor(element: HTMLElement, injector: Injector, permissionChecker: PermissionChecker, variableCommunicator: VariableCommunicator, variableStore: VariableStore, historyDataStore: HistoryDataStore, signalRAppId: string);
38
39
  dispose(): void;
39
40
  private getValidTimePeriods;
@@ -56,6 +56,9 @@ export class HistoricalCurveElement extends ConditionalDisplayElement {
56
56
  if (this.chartElement) {
57
57
  this.chartElement.tooltip.hidden(true);
58
58
  }
59
+ if (this.resizeEventListener) {
60
+ this.resizeEventListener.clear();
61
+ }
59
62
  this.logger.debug(`[GUI]Dispose Histoical Curve Refresh Interval:${d3.time.format('%x %X')(new Date())}`);
60
63
  }
61
64
  getValidTimePeriods() {
@@ -303,7 +306,7 @@ export class HistoricalCurveElement extends ConditionalDisplayElement {
303
306
  chart.color(this.model.dataSetting.channels.map(c => c.connectorColor));
304
307
  this.rootElement.append('g').datum(data).call(chart);
305
308
  this.rootElement.selectAll('.nv-noData').attr('x', chartWidth / 2).attr('y', chartHeight / 2 + this.displayOption.operationAreaHeight);
306
- nv.utils.windowResize(() => {
309
+ this.resizeEventListener = nv.utils.windowResize(() => {
307
310
  chart.update();
308
311
  this.rootElement.selectAll('.nv-noData').attr('x', chartWidth / 2).attr('y', chartHeight / 2 + this.displayOption.operationAreaHeight);
309
312
  });
@@ -1 +1 @@
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":65,"character":25,"context":{"typeName":"HTMLElement"}},{"__symbolic":"reference","module":"@angular/core","name":"Injector","line":66,"character":18},{"__symbolic":"reference","module":"../../service","name":"PermissionChecker","line":67,"character":27},{"__symbolic":"reference","module":"../../communication","name":"VariableCommunicator","line":68,"character":30},{"__symbolic":"reference","module":"../../config","name":"VariableStore","line":69,"character":23},{"__symbolic":"reference","module":"../../config","name":"HistoryDataStore","line":70,"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"}],"initPoint":[{"__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":66,"character":25,"context":{"typeName":"HTMLElement"}},{"__symbolic":"reference","module":"@angular/core","name":"Injector","line":67,"character":18},{"__symbolic":"reference","module":"../../service","name":"PermissionChecker","line":68,"character":27},{"__symbolic":"reference","module":"../../communication","name":"VariableCommunicator","line":69,"character":30},{"__symbolic":"reference","module":"../../config","name":"VariableStore","line":70,"character":23},{"__symbolic":"reference","module":"../../config","name":"HistoryDataStore","line":71,"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"}],"initPoint":[{"__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"}]}}}}]
@@ -12,6 +12,7 @@ export declare class RingGraphElement extends ReadableElement {
12
12
  private _textElement$;
13
13
  private valueObj;
14
14
  private isNeedUpdateScale;
15
+ private initTransform;
15
16
  get readVariableName(): string;
16
17
  get minVariableName(): string;
17
18
  get maxVariableName(): string;
@@ -12,6 +12,7 @@ export class RingGraphElement extends ReadableElement {
12
12
  super(element, permissionChecker, variableCommunicator, variableStore, localization, signalRAppId);
13
13
  this.valueObj = {};
14
14
  this.isNeedUpdateScale = false;
15
+ this.initTransform = false;
15
16
  if ((this.model.minValueType === VariableValueType.Constant && this.model.maxValueType === VariableValueType.Variable)
16
17
  || this.model.maxValueType === VariableValueType.Constant && this.model.minValueType === VariableValueType.Variable) {
17
18
  this.isNeedUpdateScale = true;
@@ -90,6 +91,12 @@ export class RingGraphElement extends ReadableElement {
90
91
  }
91
92
  }
92
93
  updateScale() {
94
+ // 刻度模糊问题
95
+ let isInitTransform = false;
96
+ const matrix = this.$element[0].transform.baseVal[0].matrix;
97
+ if (!this.$element[0].style.transform) {
98
+ this.$element[0].style.transform = `translate3d(${matrix.e}px, ${matrix.f}px, 0)`;
99
+ }
93
100
  if (!this.isNeedUpdateScale) {
94
101
  return;
95
102
  }
@@ -115,8 +122,17 @@ export class RingGraphElement extends ReadableElement {
115
122
  }
116
123
  if (!isNaN(sacleValue)) {
117
124
  text.innerHTML = sacleValue;
125
+ if (this.model.minValueType !== VariableValueType.Constant || this.model.maxValueType !== VariableValueType.Constant) {
126
+ // FLEXCLOUD-2619 刻度显示不全问题
127
+ const order = (i + 1) / textElements.length;
128
+ if (!this.initTransform && order > 0.2 && order < 0.5 && sacleValue.toString().length > 2) {
129
+ text.transform.baseVal[0].matrix.e -= 5;
130
+ isInitTransform = true;
131
+ }
132
+ }
118
133
  }
119
134
  }
135
+ this.initTransform = this.initTransform || isInitTransform;
120
136
  }
121
137
  updateVariableValue(value, variableName) {
122
138
  this.updateValueObj(value, variableName);
@@ -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":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
+ [{"__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":61,"character":25,"context":{"typeName":"HTMLElement"}},{"__symbolic":"reference","module":"../../service","name":"PermissionChecker","line":61,"character":57},{"__symbolic":"reference","module":"../../communication/variable/variable-communicator","name":"VariableCommunicator","line":62,"character":30},{"__symbolic":"reference","module":"../../config","name":"VariableStore","line":63,"character":23},{"__symbolic":"reference","module":"../../localization/localization.service","name":"Localization","line":64,"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}}}}]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "main": "bundles/fc-gui.umd.js",
3
- "version": "3.0.0-alpha.100",
3
+ "version": "3.0.0-alpha.102",
4
4
  "module": "public_api.js",
5
5
  "typings": "public_api.d.ts",
6
6
  "license": "UNLICENSED",