@riil-frontend/component-topology 8.0.2 → 8.0.3

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.
@@ -23,7 +23,7 @@ import topoFactory from "./topoFactory";
23
23
  import ElementTagTipConfig from "./tagstips/ElementTagTipConfig";
24
24
  import SelectionModel from "./SelectionModel"; // eslint-disable-next-line no-undef
25
25
 
26
- var version = typeof "8.0.2" === 'string' ? "8.0.2" : null;
26
+ var version = typeof "8.0.3" === 'string' ? "8.0.3" : null;
27
27
  console.info("\u62D3\u6251\u7248\u672C: " + version);
28
28
  /**
29
29
  * 拓扑显示和编辑
@@ -16,12 +16,14 @@ export default function useLinkDynamicStyle(props) {
16
16
  var topoModState = topo.store.useModelState('topoMod');
17
17
  var graphLoaded = topoModState.graphLoaded,
18
18
  topoData = topoModState.data;
19
+ var displayConfig = topo.store.getModelState('displayConfig');
20
+ var autoChangeEdgeWidth = displayConfig.autoChangeEdgeWidth !== false;
19
21
  useEffect(function () {
20
22
  // 拓扑图加载完成时刷新
21
23
  if (graphLoaded && topoData) {
22
24
  topo.linkDynamicStyleExecutor.execute();
23
25
  }
24
- }, [topoData, graphLoaded]);
26
+ }, [topoData, graphLoaded, autoChangeEdgeWidth]);
25
27
 
26
28
  var onLoaded = function onLoaded() {};
27
29
 
@@ -165,6 +165,13 @@ var LinkDynamicStyleExecutor = /*#__PURE__*/function () {
165
165
  ;
166
166
 
167
167
  _proto.calcEdgeGroupEdgeWidth = function calcEdgeGroupEdgeWidth(links) {
168
+ var displayConfig = this.topo.store.getModelState('displayConfig');
169
+ var autoChangeEdgeWidth = displayConfig.autoChangeEdgeWidth !== false;
170
+
171
+ if (!autoChangeEdgeWidth) {
172
+ return 2;
173
+ }
174
+
168
175
  if (!links.length) {
169
176
  return 2;
170
177
  }
@@ -181,6 +188,13 @@ var LinkDynamicStyleExecutor = /*#__PURE__*/function () {
181
188
  };
182
189
 
183
190
  _proto.calcLinkEdgeWidth = function calcLinkEdgeWidth(link) {
191
+ var displayConfig = this.topo.store.getModelState('displayConfig');
192
+ var autoChangeEdgeWidth = displayConfig.autoChangeEdgeWidth !== false;
193
+
194
+ if (!autoChangeEdgeWidth) {
195
+ return 2;
196
+ }
197
+
184
198
  return this.calcEdgeWidth(link.attributes['network_link.actual_bandwidth']);
185
199
  } // network_link.actual_bandwidth
186
200
  ;
@@ -54,7 +54,7 @@ var _ElementTagTipConfig = _interopRequireDefault(require("./tagstips/ElementTag
54
54
  var _SelectionModel = _interopRequireDefault(require("./SelectionModel"));
55
55
 
56
56
  // eslint-disable-next-line no-undef
57
- var version = typeof "8.0.2" === 'string' ? "8.0.2" : null;
57
+ var version = typeof "8.0.3" === 'string' ? "8.0.3" : null;
58
58
  console.info("\u62D3\u6251\u7248\u672C: " + version);
59
59
  /**
60
60
  * 拓扑显示和编辑
@@ -24,12 +24,14 @@ function useLinkDynamicStyle(props) {
24
24
  var topoModState = topo.store.useModelState('topoMod');
25
25
  var graphLoaded = topoModState.graphLoaded,
26
26
  topoData = topoModState.data;
27
+ var displayConfig = topo.store.getModelState('displayConfig');
28
+ var autoChangeEdgeWidth = displayConfig.autoChangeEdgeWidth !== false;
27
29
  (0, _react.useEffect)(function () {
28
30
  // 拓扑图加载完成时刷新
29
31
  if (graphLoaded && topoData) {
30
32
  topo.linkDynamicStyleExecutor.execute();
31
33
  }
32
- }, [topoData, graphLoaded]);
34
+ }, [topoData, graphLoaded, autoChangeEdgeWidth]);
33
35
 
34
36
  var onLoaded = function onLoaded() {};
35
37
 
@@ -176,6 +176,13 @@ var LinkDynamicStyleExecutor = /*#__PURE__*/function () {
176
176
  ;
177
177
 
178
178
  _proto.calcEdgeGroupEdgeWidth = function calcEdgeGroupEdgeWidth(links) {
179
+ var displayConfig = this.topo.store.getModelState('displayConfig');
180
+ var autoChangeEdgeWidth = displayConfig.autoChangeEdgeWidth !== false;
181
+
182
+ if (!autoChangeEdgeWidth) {
183
+ return 2;
184
+ }
185
+
179
186
  if (!links.length) {
180
187
  return 2;
181
188
  }
@@ -192,6 +199,13 @@ var LinkDynamicStyleExecutor = /*#__PURE__*/function () {
192
199
  };
193
200
 
194
201
  _proto.calcLinkEdgeWidth = function calcLinkEdgeWidth(link) {
202
+ var displayConfig = this.topo.store.getModelState('displayConfig');
203
+ var autoChangeEdgeWidth = displayConfig.autoChangeEdgeWidth !== false;
204
+
205
+ if (!autoChangeEdgeWidth) {
206
+ return 2;
207
+ }
208
+
195
209
  return this.calcEdgeWidth(link.attributes['network_link.actual_bandwidth']);
196
210
  } // network_link.actual_bandwidth
197
211
  ;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@riil-frontend/component-topology",
3
- "version": "8.0.2",
3
+ "version": "8.0.3",
4
4
  "description": "拓扑",
5
5
  "scripts": {
6
6
  "start": "build-scripts start",
@@ -116,6 +116,6 @@
116
116
  "access": "public"
117
117
  },
118
118
  "license": "MIT",
119
- "homepage": "https://unpkg.com/@riil-frontend/component-topology@8.0.2/build/index.html",
119
+ "homepage": "https://unpkg.com/@riil-frontend/component-topology@8.0.3/build/index.html",
120
120
  "gitHead": "2da19ffccbb7ca60a8acf396e39f542c68bb33f5"
121
121
  }