@flexem/fc-gui 3.0.0-alpha.103 → 3.0.0-alpha.104
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 +25 -22
- 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/ring-graph/ring-graph-element.js +25 -22
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -459,4 +459,9 @@
|
|
|
459
459
|
## 3.0.0-alpha.102(2023-12-18),3.0.0-alpha.103(2024-03-07)
|
|
460
460
|
### Web端
|
|
461
461
|
#### Features
|
|
462
|
-
1. FLEXCLOUD-2619 棒图、环形图设置最大值、最小值为参数后,刻度数值对齐及模糊问题
|
|
462
|
+
1. FLEXCLOUD-2619 棒图、环形图设置最大值、最小值为参数后,刻度数值对齐及模糊问题
|
|
463
|
+
|
|
464
|
+
## 3.0.0-alpha.104(2024-03-13)
|
|
465
|
+
### Web端
|
|
466
|
+
#### Features
|
|
467
|
+
1. FLEXCLOUD-2619 环形图配置常数后再配置变量导致刻度值间隔较大
|
|
@@ -37919,9 +37919,7 @@ class ring_graph_element_RingGraphElement extends readable_element_ReadableEleme
|
|
|
37919
37919
|
this._barElement$ = el$.find('path[data-id="barArc"]');
|
|
37920
37920
|
this._textElement$ = el$.find('text[data-id="pText"]');
|
|
37921
37921
|
setTimeout(() => {
|
|
37922
|
-
|
|
37923
|
-
this.initFrameNode();
|
|
37924
|
-
}
|
|
37922
|
+
this.initFrameNode();
|
|
37925
37923
|
this.changeStates();
|
|
37926
37924
|
});
|
|
37927
37925
|
}
|
|
@@ -37955,12 +37953,12 @@ class ring_graph_element_RingGraphElement extends readable_element_ReadableEleme
|
|
|
37955
37953
|
const variable = new variable_definition["a" /* VariableDefinition */](this.model.maxVariable.name, this.model.maxVariable.groupName, this.model.maxVariable.dataSourceCode, this.model.maxVariable.variableVersion);
|
|
37956
37954
|
return variable_util["a" /* VariableUtil */].getConvertedVariableName(this.variableStore, variable);
|
|
37957
37955
|
}
|
|
37958
|
-
initTransformFun() {
|
|
37959
|
-
if (this.needAddNumber <= 3)
|
|
37960
|
-
return;
|
|
37956
|
+
initTransformFun(len) {
|
|
37961
37957
|
this.$element[0].childNodes.forEach((node) => {
|
|
37962
|
-
|
|
37963
|
-
|
|
37958
|
+
if (!node.transform.baseVal[0])
|
|
37959
|
+
return;
|
|
37960
|
+
// const matrixE = node.transform.baseVal[0].matrix.e;
|
|
37961
|
+
// node.transform.baseVal[0].matrix.e = matrixE + len * 5;
|
|
37964
37962
|
if (node.nodeName === 'g') {
|
|
37965
37963
|
const nodeValue = node.attributes['clip-path'].value.replace('url(#', '').replace(')', '');
|
|
37966
37964
|
const rootNode = node.parentNode.parentNode.parentElement;
|
|
@@ -37972,8 +37970,8 @@ class ring_graph_element_RingGraphElement extends readable_element_ReadableEleme
|
|
|
37972
37970
|
const values = [];
|
|
37973
37971
|
line.split(' ').forEach((item) => {
|
|
37974
37972
|
const nItem = Number(item);
|
|
37975
|
-
if (!isNaN(nItem) && (index === 1 || nItem === -1)) {
|
|
37976
|
-
item = nItem > 0 ? nItem + (
|
|
37973
|
+
if (!isNaN(nItem) && (index === 1 || index === 2 || nItem === -1)) {
|
|
37974
|
+
item = nItem > 0 ? (index === 1 || index === 2 ? nItem + (len + 2) * 8 : nItem + len * 8) : nItem - len * 8;
|
|
37977
37975
|
}
|
|
37978
37976
|
values.push(item);
|
|
37979
37977
|
});
|
|
@@ -37986,8 +37984,7 @@ class ring_graph_element_RingGraphElement extends readable_element_ReadableEleme
|
|
|
37986
37984
|
initFrameNode() {
|
|
37987
37985
|
const arcPath = Snap(this.$element[0]);
|
|
37988
37986
|
const b = arcPath.getBBox(true);
|
|
37989
|
-
|
|
37990
|
-
this.rootElement.append('rect').attr('id', 'StateFrame').attr('width', width).attr('height', b.height).attr('fill', 'transparent');
|
|
37987
|
+
this.rootElement.append('rect').attr('id', 'StateFrame').attr('width', b.width).attr('height', b.height).attr('fill', 'transparent');
|
|
37991
37988
|
}
|
|
37992
37989
|
init(variableName) {
|
|
37993
37990
|
if (variableName) {
|
|
@@ -38019,7 +38016,6 @@ class ring_graph_element_RingGraphElement extends readable_element_ReadableEleme
|
|
|
38019
38016
|
}
|
|
38020
38017
|
updateScale() {
|
|
38021
38018
|
// 刻度模糊问题
|
|
38022
|
-
let isInitTransform = false;
|
|
38023
38019
|
const matrix = this.$element[0].transform.baseVal[0].matrix;
|
|
38024
38020
|
if (!this.$element[0].style.transform) {
|
|
38025
38021
|
this.$element[0].style.transform = `translate3d(${matrix.e}px, ${matrix.f}px, 0)`;
|
|
@@ -38036,11 +38032,13 @@ class ring_graph_element_RingGraphElement extends readable_element_ReadableEleme
|
|
|
38036
38032
|
min = ring_graph_element_RingGraphElement.DEFAULT_MIN_VALUE;
|
|
38037
38033
|
max = ring_graph_element_RingGraphElement.DEFAULT_MAX_VALUE;
|
|
38038
38034
|
}
|
|
38039
|
-
if (this.model.minValueType === variable_value_type["a" /* VariableValueType */].Variable) {
|
|
38040
|
-
|
|
38041
|
-
if (
|
|
38042
|
-
this.
|
|
38043
|
-
this.
|
|
38035
|
+
if (this.model.minValueType === variable_value_type["a" /* VariableValueType */].Variable || this.model.maxValueType === variable_value_type["a" /* VariableValueType */].Variable) {
|
|
38036
|
+
const len = max.toString().length > min.toString().length ? max.toString().length : min.toString().length;
|
|
38037
|
+
if (Math.abs(len - this.needAddNumber) > 2) {
|
|
38038
|
+
const width = this.$element.find('rect').attr('width');
|
|
38039
|
+
this.$element.find('rect').attr('width', Number(width) + (len - this.needAddNumber) * 8);
|
|
38040
|
+
this.initTransformFun(Math.abs(len - this.needAddNumber));
|
|
38041
|
+
this.needAddNumber = len;
|
|
38044
38042
|
}
|
|
38045
38043
|
}
|
|
38046
38044
|
const avgSacle = ((max - min) / this.model.masterDivisionNumber).toFixed(5);
|
|
@@ -38055,18 +38053,23 @@ class ring_graph_element_RingGraphElement extends readable_element_ReadableEleme
|
|
|
38055
38053
|
sacleValue = (sacleValue / Math.pow(10, this.model.fractionDigits)).toFixed(this.model.fractionDigits);
|
|
38056
38054
|
}
|
|
38057
38055
|
if (!isNaN(sacleValue)) {
|
|
38056
|
+
const oriValue = text.innerHTML;
|
|
38058
38057
|
text.innerHTML = sacleValue;
|
|
38059
|
-
isInitTransform = true;
|
|
38060
38058
|
if (this.model.minValueType !== variable_value_type["a" /* VariableValueType */].Constant || this.model.maxValueType !== variable_value_type["a" /* VariableValueType */].Constant) {
|
|
38061
38059
|
// FLEXCLOUD-2619 刻度显示不全问题
|
|
38062
38060
|
const order = (i + 1) / textElements.length;
|
|
38063
|
-
|
|
38064
|
-
|
|
38061
|
+
const len = oriValue.toString().length - sacleValue.toString().length;
|
|
38062
|
+
if (order <= 0.7 && len > 1 && !this.initTransform) {
|
|
38063
|
+
text.transform.baseVal[0].matrix.e += (len - 1) * 5;
|
|
38064
|
+
}
|
|
38065
|
+
if (order > 0.7 && Math.abs(len) > 0) {
|
|
38066
|
+
text.transform.baseVal[0].matrix.e += len > 1 ? (len - 1) * 5 : len < -1 ? (len + 1) * 5 : len * 5;
|
|
38067
|
+
text.transform.baseVal[0].matrix.e += len === -2 ? -3 : 0;
|
|
38065
38068
|
}
|
|
38066
38069
|
}
|
|
38067
38070
|
}
|
|
38068
38071
|
}
|
|
38069
|
-
this.initTransform =
|
|
38072
|
+
this.initTransform = true;
|
|
38070
38073
|
}
|
|
38071
38074
|
updateVariableValue(value, variableName) {
|
|
38072
38075
|
this.updateValueObj(value, variableName);
|