@flexem/fc-gui 3.0.0-alpha.101 → 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.
- package/CHANGELOG.md +6 -1
- package/bundles/@flexem/fc-gui.umd.js +58 -24
- package/bundles/@flexem/fc-gui.umd.js.map +1 -1
- package/bundles/@flexem/fc-gui.umd.min.js +2 -2
- package/bundles/@flexem/fc-gui.umd.min.js.map +1 -1
- package/elements/bar-graph-element.js +18 -0
- package/elements/ring-graph/ring-graph-element.d.ts +1 -0
- package/elements/ring-graph/ring-graph-element.js +16 -0
- package/elements/ring-graph/ring-graph-element.metadata.json +1 -1
- package/package.json +1 -1
|
@@ -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
|
}
|
|
@@ -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":
|
|
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}}}}]
|