dcim-topology2d 2.0.7 → 3.0.2

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.
Files changed (204) hide show
  1. package/activity-diagram/src/final/final.d.ts +1 -1
  2. package/activity-diagram/src/final/final.rect.d.ts +1 -1
  3. package/activity-diagram/src/final/final.rect.js +1 -1
  4. package/activity-diagram/src/fork/fork.anchor.d.ts +1 -1
  5. package/activity-diagram/src/fork/fork.anchor.js +1 -1
  6. package/activity-diagram/src/fork/fork.d.ts +1 -1
  7. package/activity-diagram/src/fork/fork.rect.d.ts +1 -1
  8. package/activity-diagram/src/fork/fork.rect.js +1 -1
  9. package/activity-diagram/src/register.js +1 -1
  10. package/activity-diagram/src/swimlaneH/swimlaneH.d.ts +1 -1
  11. package/activity-diagram/src/swimlaneH/swimlaneH.rect.d.ts +1 -1
  12. package/activity-diagram/src/swimlaneH/swimlaneH.rect.js +1 -1
  13. package/activity-diagram/src/swimlaneV/swimlaneV.d.ts +1 -1
  14. package/activity-diagram/src/swimlaneV/swimlaneV.rect.d.ts +1 -1
  15. package/activity-diagram/src/swimlaneV/swimlaneV.rect.js +1 -1
  16. package/chart-diagram/index.d.ts +1 -3
  17. package/chart-diagram/index.js +1 -2
  18. package/chart-diagram/src/echarts/index.d.ts +2 -1
  19. package/chart-diagram/src/echarts/index.js +104 -106
  20. package/chart-diagram/src/register.js +8 -9
  21. package/class-diagram/src/class/class.d.ts +1 -1
  22. package/class-diagram/src/class/class.rect.d.ts +1 -1
  23. package/class-diagram/src/class/class.rect.js +1 -1
  24. package/class-diagram/src/register.js +1 -1
  25. package/core/index.d.ts +0 -2
  26. package/core/index.js +0 -2
  27. package/core/src/activeLayer.d.ts +10 -2
  28. package/core/src/activeLayer.js +47 -42
  29. package/core/src/animateLayer.d.ts +7 -3
  30. package/core/src/animateLayer.js +12 -10
  31. package/core/src/calling.d.ts +4 -1
  32. package/core/src/calling.js +41 -43
  33. package/core/src/canvas.d.ts +6 -1
  34. package/core/src/canvas.js +18 -18
  35. package/core/src/common.d.ts +7 -6
  36. package/core/src/common.js +672 -333
  37. package/core/src/core.d.ts +4 -3
  38. package/core/src/core.js +367 -466
  39. package/core/src/divLayer.d.ts +36 -2
  40. package/core/src/divLayer.js +305 -33
  41. package/core/src/healps/changeData.d.ts +2 -1
  42. package/core/src/healps/changeData.js +66 -32
  43. package/core/src/hoverLayer.d.ts +9 -2
  44. package/core/src/hoverLayer.js +34 -31
  45. package/core/src/middles/default.d.ts +3 -1
  46. package/core/src/middles/default.js +51 -53
  47. package/core/src/middles/index.js +2 -3
  48. package/core/src/middles/nodes/arbitrarygraph.js +9 -11
  49. package/core/src/middles/nodes/pentagon.rect.js +1 -1
  50. package/core/src/middles/nodes/rectangle.rect.js +1 -1
  51. package/core/src/models/data.d.ts +26 -0
  52. package/core/src/models/data.js +77 -0
  53. package/core/src/models/data.js.map +1 -0
  54. package/core/src/models/index.d.ts +1 -0
  55. package/core/src/models/index.js +1 -0
  56. package/core/src/models/node.d.ts +0 -10
  57. package/core/src/models/node.js +32 -54
  58. package/core/src/models/pen.js +59 -19
  59. package/core/src/models/rect.js +2 -2
  60. package/core/src/mqtt.d.ts +14 -0
  61. package/core/src/mqtt.js +82 -0
  62. package/core/src/mqtt.js.map +1 -0
  63. package/core/src/offscreen.d.ts +4 -1
  64. package/core/src/offscreen.js +8 -10
  65. package/core/src/options.d.ts +1 -3
  66. package/core/src/options.js +0 -2
  67. package/core/src/poll.js +39 -0
  68. package/core/src/preview.d.ts +13 -1
  69. package/core/src/preview.js +43 -111
  70. package/core/src/renderLayer.d.ts +9 -11
  71. package/core/src/renderLayer.js +60 -48
  72. package/core/src/socket.d.ts +10 -0
  73. package/core/src/socket.js +51 -0
  74. package/core/src/socket.js.map +1 -0
  75. package/core/src/utils/canvas.js +1 -1
  76. package/core/src/utils/construction.d.ts +3 -12
  77. package/core/src/utils/construction.js +1 -8
  78. package/core/src/utils/conversion.d.ts +0 -11
  79. package/core/src/utils/conversion.js +0 -167
  80. package/core/src/utils/dom.d.ts +8 -0
  81. package/core/src/utils/dom.js +67 -0
  82. package/core/src/utils/dom.js.map +1 -0
  83. package/core/src/utils/index.d.ts +1 -2
  84. package/core/src/utils/index.js +1 -2
  85. package/core/src/utils/math.d.ts +0 -1
  86. package/core/src/utils/math.js +0 -3
  87. package/core/src/utils/onmousevent.d.ts +0 -3
  88. package/core/src/utils/onmousevent.js +8 -37
  89. package/flow-diagram/src/comment/comment.anchor.d.ts +1 -1
  90. package/flow-diagram/src/comment/comment.anchor.js +1 -1
  91. package/flow-diagram/src/comment/comment.d.ts +1 -1
  92. package/flow-diagram/src/data/data.anchor.d.ts +1 -1
  93. package/flow-diagram/src/data/data.anchor.js +1 -1
  94. package/flow-diagram/src/data/data.d.ts +1 -1
  95. package/flow-diagram/src/data/data.rect.d.ts +1 -1
  96. package/flow-diagram/src/data/data.rect.js +1 -1
  97. package/flow-diagram/src/db/db.d.ts +1 -1
  98. package/flow-diagram/src/db/db.rect.d.ts +1 -1
  99. package/flow-diagram/src/db/db.rect.js +1 -1
  100. package/flow-diagram/src/display/display.anchor.d.ts +1 -1
  101. package/flow-diagram/src/display/display.anchor.js +1 -1
  102. package/flow-diagram/src/display/display.d.ts +1 -1
  103. package/flow-diagram/src/display/display.rect.d.ts +1 -1
  104. package/flow-diagram/src/display/display.rect.js +1 -1
  105. package/flow-diagram/src/document/document.anchor.d.ts +1 -1
  106. package/flow-diagram/src/document/document.anchor.js +1 -1
  107. package/flow-diagram/src/document/document.d.ts +1 -1
  108. package/flow-diagram/src/document/document.rect.d.ts +1 -1
  109. package/flow-diagram/src/document/document.rect.js +1 -1
  110. package/flow-diagram/src/externStorage/externStorage.anchor.d.ts +1 -1
  111. package/flow-diagram/src/externStorage/externStorage.anchor.js +1 -1
  112. package/flow-diagram/src/externStorage/externStorage.d.ts +1 -1
  113. package/flow-diagram/src/externStorage/externStorage.rect.d.ts +1 -1
  114. package/flow-diagram/src/externStorage/externStorage.rect.js +1 -1
  115. package/flow-diagram/src/internalStorage/internalStorage.d.ts +1 -1
  116. package/flow-diagram/src/internalStorage/internalStorage.rect.d.ts +1 -1
  117. package/flow-diagram/src/internalStorage/internalStorage.rect.js +1 -1
  118. package/flow-diagram/src/manually/manually.anchor.d.ts +1 -1
  119. package/flow-diagram/src/manually/manually.anchor.js +1 -1
  120. package/flow-diagram/src/manually/manually.d.ts +1 -1
  121. package/flow-diagram/src/manually/manually.rect.d.ts +1 -1
  122. package/flow-diagram/src/manually/manually.rect.js +1 -1
  123. package/flow-diagram/src/parallel/parallel.anchor.d.ts +1 -1
  124. package/flow-diagram/src/parallel/parallel.anchor.js +1 -1
  125. package/flow-diagram/src/parallel/parallel.d.ts +1 -1
  126. package/flow-diagram/src/queue/queue.d.ts +1 -1
  127. package/flow-diagram/src/queue/queue.rect.d.ts +1 -1
  128. package/flow-diagram/src/queue/queue.rect.js +1 -1
  129. package/flow-diagram/src/register.js +1 -1
  130. package/flow-diagram/src/subprocess/subprocess.d.ts +1 -1
  131. package/flow-diagram/src/subprocess/subprocess.rect.d.ts +1 -1
  132. package/flow-diagram/src/subprocess/subprocess.rect.js +1 -1
  133. package/layout/src/align.d.ts +1 -1
  134. package/layout/src/align.js +1 -1
  135. package/layout/src/layout.d.ts +1 -1
  136. package/layout/src/layout.js +1 -1
  137. package/myShape-diagram/{index.js → myShape.js} +1 -4
  138. package/package.json +1 -1
  139. package/sequence-diagram/src/focus/focus.anchor.d.ts +1 -1
  140. package/sequence-diagram/src/focus/focus.anchor.js +1 -1
  141. package/sequence-diagram/src/focus/focus.d.ts +1 -1
  142. package/sequence-diagram/src/focus/focus.rect.d.ts +1 -1
  143. package/sequence-diagram/src/focus/focus.rect.js +1 -1
  144. package/sequence-diagram/src/lifeline/lifeline.anchor.d.ts +1 -1
  145. package/sequence-diagram/src/lifeline/lifeline.anchor.js +1 -1
  146. package/sequence-diagram/src/lifeline/lifeline.d.ts +1 -1
  147. package/sequence-diagram/src/lifeline/lifeline.rect.d.ts +1 -1
  148. package/sequence-diagram/src/lifeline/lifeline.rect.js +1 -1
  149. package/sequence-diagram/src/register.js +1 -1
  150. package/chart-diagram/src/utils/changeOptions.d.ts +0 -7
  151. package/chart-diagram/src/utils/changeOptions.js +0 -253
  152. package/chart-diagram/src/utils/conversion.d.ts +0 -18
  153. package/chart-diagram/src/utils/conversion.js +0 -399
  154. package/chart-diagram/src/utils/drawGraphic.d.ts +0 -3
  155. package/chart-diagram/src/utils/drawGraphic.js +0 -97
  156. package/chart-diagram/src/utils/formatter.d.ts +0 -1
  157. package/chart-diagram/src/utils/formatter.js +0 -129
  158. package/chart-diagram/src/utils/index.d.ts +0 -4
  159. package/chart-diagram/src/utils/index.js +0 -4
  160. package/chart-diagram/src/utils/render.d.ts +0 -8
  161. package/chart-diagram/src/utils/render.js +0 -199
  162. package/core/src/element/common.d.ts +0 -5
  163. package/core/src/element/common.js +0 -54
  164. package/core/src/element/iframe.d.ts +0 -3
  165. package/core/src/element/iframe.js +0 -12
  166. package/core/src/element/index.d.ts +0 -4
  167. package/core/src/element/index.js +0 -4
  168. package/core/src/element/select.d.ts +0 -11
  169. package/core/src/element/select.js +0 -263
  170. package/core/src/element/tab.d.ts +0 -1
  171. package/core/src/element/tab.js +0 -23
  172. package/core/src/middles/arrows/index.d.ts +0 -4
  173. package/core/src/middles/arrows/index.js +0 -5
  174. package/core/src/middles/lines/index.d.ts +0 -4
  175. package/core/src/middles/lines/index.js +0 -5
  176. package/core/src/middles/nodes/formoverflow.js +0 -61
  177. package/core/src/middles/nodes/formselect.d.ts +0 -2
  178. package/core/src/middles/nodes/formselect.js +0 -95
  179. package/core/src/middles/nodes/iframe.d.ts +0 -2
  180. package/core/src/middles/nodes/iframe.js +0 -29
  181. package/core/src/middles/nodes/index.d.ts +0 -48
  182. package/core/src/middles/nodes/index.js +0 -49
  183. package/core/src/store/common.d.ts +0 -9
  184. package/core/src/store/common.js +0 -5
  185. package/core/src/store/data.d.ts +0 -186
  186. package/core/src/store/data.js +0 -178
  187. package/core/src/store/index.d.ts +0 -2
  188. package/core/src/store/index.js +0 -2
  189. package/core/src/utils/assignment.d.ts +0 -6
  190. package/core/src/utils/assignment.js +0 -168
  191. package/core/src/utils/params.d.ts +0 -2
  192. package/core/src/utils/params.js +0 -60
  193. package/static/echartsDefaultData.js +0 -167
  194. package/static/element.js +0 -14
  195. package/static/form.js +0 -11
  196. package/static/index.js +0 -3
  197. package/store/actions.js +0 -1
  198. package/store/clear.js +0 -10
  199. package/store/index.js +0 -2
  200. package/style/common.css +0 -18
  201. package/style/editor.css +0 -13
  202. package/style/index.css +0 -4
  203. package/style/select.css +0 -143
  204. /package/myShape-diagram/{index.ts → myShape.ts} +0 -0
@@ -1,4 +1,4 @@
1
- import { registerNode } from '../../core';
1
+ import { registerNode } from 'dcim-topology/core';
2
2
  import { flowData, flowDataAnchors, flowDataIconRect, flowDataTextRect } from './data';
3
3
  import { flowSubprocess, flowSubprocessIconRect, flowSubprocessTextRect } from './subprocess';
4
4
  import { flowDb, flowDbIconRect, flowDbTextRect } from './db';
@@ -1,2 +1,2 @@
1
- import { Node } from '../../../core';
1
+ import { Node } from 'dcim-topology/core';
2
2
  export declare function flowSubprocess(ctx: CanvasRenderingContext2D, node: Node): void;
@@ -1,3 +1,3 @@
1
- import { Node } from '../../../core';
1
+ import { Node } from 'dcim-topology/core';
2
2
  export declare function flowSubprocessIconRect(node: Node): void;
3
3
  export declare function flowSubprocessTextRect(node: Node): void;
@@ -1,4 +1,4 @@
1
- import { Rect } from '../../../core';
1
+ import { Rect } from 'dcim-topology/core';
2
2
  export function flowSubprocessIconRect(node) {
3
3
  node.iconRect = new Rect(0, 0, 0, 0);
4
4
  }
@@ -1,3 +1,3 @@
1
- import { Pen, Rect } from '../../core';
1
+ import { Pen, Rect } from 'dcim-topology/core';
2
2
  export declare function alignNodes(pens: Pen[], rect: Rect, align: string): void;
3
3
  export declare function spaceBetween(pens: Pen[], width: number): void;
@@ -1,4 +1,4 @@
1
- import { Node } from '../../core';
1
+ import { Node } from 'dcim-topology/core';
2
2
  export function alignNodes(pens, rect, align) {
3
3
  for (var _i = 0, pens_1 = pens; _i < pens_1.length; _i++) {
4
4
  var item = pens_1[_i];
@@ -1,4 +1,4 @@
1
- import { Pen } from '../../core';
1
+ import { Pen } from 'dcim-topology/core';
2
2
  export declare function layout(pens: Pen[], params: {
3
3
  maxWidth: number;
4
4
  nodeWidth?: number;
@@ -1,4 +1,4 @@
1
- import { PenType, getRect } from '../../core';
1
+ import { PenType, getRect } from 'dcim-topology/core';
2
2
  import { alignNodes, spaceBetween } from './align';
3
3
  export function layout(pens, params) {
4
4
  var spaceWidth = params.spaceWidth || 30;
@@ -1,7 +1,5 @@
1
1
  // 源码版写法
2
- import { registerNode } from '../core'
3
- import { formOverflow } from '../core/src/middles/nodes/formoverflow'
4
-
2
+ import { registerNode } from 'dcim-topology/core'
5
3
 
6
4
  // 组件版写法和bundle一致
7
5
  // window.Le5leTopology.registerNode
@@ -193,7 +191,6 @@ export function registerMyShape() {
193
191
  registerNode('electricFan', electricFan);
194
192
  registerNode('pool', pool);
195
193
  registerNode('thermometer', thermometer);
196
- registerNode('formOverflow', formOverflow);
197
194
  }
198
195
 
199
196
  // src\views\data.ts 里面加载到工具栏,第一个就是此自定义图形库
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dcim-topology2d",
3
- "version": "2.0.7",
3
+ "version": "3.0.2",
4
4
  "description": "",
5
5
  "main": "-",
6
6
  "scripts": {
@@ -1,2 +1,2 @@
1
- import { Node } from '../../../core';
1
+ import { Node } from 'dcim-topology/core';
2
2
  export declare function sequenceFocusAnchors(node: Node): void;
@@ -1,4 +1,4 @@
1
- import { Point, Direction } from '../../../core';
1
+ import { Point, Direction } from 'dcim-topology/core';
2
2
  export function sequenceFocusAnchors(node) {
3
3
  node.anchors.push(new Point(node.rect.x + node.rect.width / 2, node.rect.y, Direction.Up));
4
4
  node.anchors.push(new Point(node.rect.x + node.rect.width / 2, node.rect.ey, Direction.Bottom));
@@ -1,2 +1,2 @@
1
- import { Node } from '../../../core';
1
+ import { Node } from 'dcim-topology/core';
2
2
  export declare function sequenceFocus(ctx: CanvasRenderingContext2D, node: Node): void;
@@ -1,3 +1,3 @@
1
- import { Node } from '../../../core';
1
+ import { Node } from 'dcim-topology/core';
2
2
  export declare function sequenceFocusIconRect(node: Node): void;
3
3
  export declare function sequenceFocusTextRect(node: Node): void;
@@ -1,4 +1,4 @@
1
- import { Rect } from '../../../core';
1
+ import { Rect } from 'dcim-topology/core';
2
2
  export function sequenceFocusIconRect(node) {
3
3
  node.iconRect = new Rect(0, 0, 0, 0);
4
4
  }
@@ -1,2 +1,2 @@
1
- import { Node } from '../../../core';
1
+ import { Node } from 'dcim-topology/core';
2
2
  export declare function lifelineAnchors(node: Node): void;
@@ -1,4 +1,4 @@
1
- import { Point, Direction } from '../../../core';
1
+ import { Point, Direction } from 'dcim-topology/core';
2
2
  export function lifelineAnchors(node) {
3
3
  node.anchors.push(new Point(node.rect.x, node.rect.y + 25, Direction.Left));
4
4
  node.anchors.push(new Point(node.rect.x + node.rect.width / 2, node.rect.y, Direction.Up));
@@ -1,2 +1,2 @@
1
- import { Node } from '../../../core';
1
+ import { Node } from 'dcim-topology/core';
2
2
  export declare function lifeline(ctx: CanvasRenderingContext2D, node: Node): void;
@@ -1,3 +1,3 @@
1
- import { Node } from '../../../core';
1
+ import { Node } from 'dcim-topology/core';
2
2
  export declare function lifelineIconRect(node: Node): void;
3
3
  export declare function lifelineTextRect(node: Node): void;
@@ -1,4 +1,4 @@
1
- import { Rect } from '../../../core';
1
+ import { Rect } from 'dcim-topology/core';
2
2
  export function lifelineIconRect(node) {
3
3
  node.iconRect = new Rect(0, 0, 0, 0);
4
4
  }
@@ -1,4 +1,4 @@
1
- import { registerNode } from '../../core';
1
+ import { registerNode } from 'dcim-topology/core';
2
2
  import { lifeline, lifelineAnchors, lifelineIconRect, lifelineTextRect } from './lifeline';
3
3
  import { sequenceFocus, sequenceFocusAnchors, sequenceFocusIconRect, sequenceFocusTextRect } from './focus';
4
4
  export function register() {
@@ -1,7 +0,0 @@
1
- export declare function setRingChartText<T>(textData: T): void;
2
- export declare function setRingPreSeriesOptions<T>(option: T, appearance: T): void;
3
- export declare function setRingProSeriesOptions<T>(option: T, appearance: T): void;
4
- export declare function setChartLegendData<T>(legend: T, appearance: T): void;
5
- export declare function setChartXAxisData<T>(xAxis: [], appearance: T): void;
6
- export declare function setChartYAxisData<T>(yAxis: [], appearance: T): void;
7
- export declare function setLineSeriesStyleData<T>(series: [], appearance: T): void;
@@ -1,253 +0,0 @@
1
- // 初始化图例数据和图例配置数据
2
- import {
3
- echartsLegendDefaultData,
4
- echartsXAxisDefaultStyleData,
5
- echartsYAxisDefaultStyleData,
6
- echartsLineSeriesStyleData,
7
- echartsColorData
8
- } from '../../../static';
9
-
10
- // 配置环形图中间区域文字样式
11
- export function setRingChartText(textData) {
12
- const {
13
- vFontSize, vFontWeight, vColor,
14
- vTop, unitTop, unitFontSize, unitFontWeight,
15
- unitColor} = textData;
16
- if(!unitTop) textData.unitTop = 0;
17
- return {
18
- v: {
19
- fontSize: vFontSize,
20
- fontWeight: vFontWeight,
21
- color: vColor,
22
- padding: [vTop, 0, 0, 0]
23
- },
24
- unit: {
25
- fontSize: unitFontSize,
26
- fontWeight: unitFontWeight,
27
- color: unitColor,
28
- padding: [unitTop, 0, 0, 0]
29
- }
30
- };
31
- }
32
- // 配置环形‘设备告警统计图’节点展示
33
- export function setRingPreSeriesOptions(option, appearance) {
34
- const rich = setRingChartText(appearance.text);
35
- Object.assign(option.title.textStyle.rich, rich);
36
- option.title.y = `${appearance.text.y}%`;
37
- option.series[0].radius[1] = `${appearance.inner.borderWidth}%`;
38
- option.series[0].data[0].itemStyle.color = appearance.inner.borderColor;
39
- option.series[0].data[1].itemStyle.color = appearance.inner.borderBgColor;
40
- option.series[1].radius[1] = `${appearance.outer.borderWidth}%`;
41
- option.series[1].data[0].itemStyle.color = appearance.outer.borderColor;
42
- }
43
- // 配置环形‘内存、硬盘、CPU指标占比统计’节点展示
44
- export function setRingProSeriesOptions(option, appearance) {
45
- const seriesFirstChildNode = option.series[0];
46
- const rich = setRingChartText(appearance.text);
47
- Object.assign(seriesFirstChildNode.data[0].label.normal.rich, rich);
48
- seriesFirstChildNode.data[0].label.normal.formatter = function(params){
49
- return `{v|${params.value}}{unit|%}`;
50
- }
51
- seriesFirstChildNode.data[0].value = appearance.proportion;
52
- seriesFirstChildNode.radius = appearance.outer.radius;
53
- seriesFirstChildNode.data[0].itemStyle = {
54
- normal: {
55
- color: appearance.outer.borderColor,
56
- shadowColor: appearance.outer.borderColor,
57
- shadowBlur: 0
58
- }
59
- };
60
- seriesFirstChildNode.data[1].value = 100 - appearance.proportion;
61
- seriesFirstChildNode.data[1].itemStyle.normal.color = appearance.outer.borderBgColor;
62
- const seriesLastChildNode = option.series[1];
63
- seriesLastChildNode.radius = appearance.inner.radius;
64
- seriesLastChildNode.itemStyle.normal.color.colorStops[0].color = appearance.inner.borderColor;
65
- }
66
- // 图表X轴数据
67
- export function setChartXAxisData(xAxis, appearance) {
68
- for (let i = 0; i < xAxis.length; i++) {
69
- const item = xAxis[i];
70
- if (!item.axisLabel) {
71
- item.axisLabel = JSON.parse(JSON.stringify(echartsXAxisDefaultStyleData['x1AxisLabel']));
72
- }
73
- const axisLabelStr = `x${i + 1}AxisLabel`;
74
- if (!appearance[axisLabelStr]) {
75
- appearance[axisLabelStr] = JSON.parse(JSON.stringify(echartsXAxisDefaultStyleData[axisLabelStr]));
76
- Object.assign(appearance[axisLabelStr], item.axisLabel);
77
- } else {
78
- item.axisLabel.color = appearance[axisLabelStr].color || '';
79
- item.axisLabel.fontSize = appearance[axisLabelStr].fontSize || 12;
80
- }
81
- }
82
- //return xAxis;
83
- }
84
-
85
- /**
86
- * 图表Y轴数据
87
- * @param yAxis Y轴配置数据
88
- * @param appearance 图表自定义配置
89
- */
90
- export function setChartYAxisData(yAxis, appearance) {
91
- if (typeof appearance.ySplitLineShow !== 'boolean') {
92
- appearance.ySplitLineShow = yAxis[0].splitLine.show;
93
- }
94
- if (!appearance.ysplitLineLineStyle && yAxis[0].splitLine.show) {
95
- appearance.ysplitLineLineStyle = JSON.parse(JSON.stringify(echartsYAxisDefaultStyleData['ysplitLineLineStyle']));
96
- }
97
- for (let i = 0; i < yAxis.length; i++) {
98
- const item = yAxis[i];
99
- if(!item.axisLabel) item.axisLabel = {};
100
- if (!item.axisLabel.textStyle) {
101
- item.axisLabel.textStyle = JSON.parse(JSON.stringify(echartsYAxisDefaultStyleData['y1axisLabelTextStyle']));
102
- }
103
- if(!item.splitLine) item.splitLine = {};
104
- if (!item.splitLine.lineStyle) {
105
- item.splitLine.lineStyle = JSON.parse(JSON.stringify(echartsYAxisDefaultStyleData['ysplitLineLineStyle']));
106
- }
107
- const axisLabelTextStyleStr = `y${i + 1}axisLabelTextStyle`;
108
- if (!appearance[axisLabelTextStyleStr]) {
109
- appearance[axisLabelTextStyleStr] = JSON.parse(JSON.stringify(echartsYAxisDefaultStyleData[axisLabelTextStyleStr]));
110
- Object.assign(appearance[axisLabelTextStyleStr], item.axisLabel.textStyle);
111
- } else {
112
- const axisLabelTextStyNode = appearance[axisLabelTextStyleStr];
113
- item.axisLabel.textStyle.color = axisLabelTextStyNode.color || '';
114
- item.axisLabel.textStyle.fontSize = axisLabelTextStyNode.fontSize || '12';
115
- item.axisLabel.textStyle.padding = axisLabelTextStyNode.padding || [20, 20, 20, 20];
116
- }
117
- if (appearance.ysplitLineLineStyle) {
118
- item.splitLine.show = appearance.ySplitLineShow;
119
- const axisLabelTextStyNode = appearance.ysplitLineLineStyle;
120
- item.splitLine.lineStyle.type = axisLabelTextStyNode.type || 'solid';
121
- item.splitLine.lineStyle.color = axisLabelTextStyNode.color || '';
122
- }
123
- const minMaxStr = `y${i + 1}MinMaxData`;
124
- if (!appearance[minMaxStr] && item.max) {
125
- appearance[minMaxStr] = JSON.parse(JSON.stringify(echartsYAxisDefaultStyleData[minMaxStr]));
126
- const minMaxParams = {
127
- max: item.max,
128
- min: item.min,
129
- interval: item.interval
130
- };
131
- Object.assign(appearance[minMaxStr], minMaxParams);
132
- } else {
133
- const minMaxNode = appearance[minMaxStr];
134
- if (minMaxNode) {
135
- item.max = minMaxNode.max;
136
- item.min = minMaxNode.min;
137
- item.interval = minMaxNode.interval;
138
- }
139
- }
140
- const nameStr = `y${i + 1}NameData`;
141
- if (!appearance[nameStr] && item.name) {
142
- appearance[nameStr] = JSON.parse(JSON.stringify(echartsYAxisDefaultStyleData[nameStr]));
143
- const nameParams = {
144
- name: item.name,
145
- nameTextStyle: {
146
- color: item.nameTextStyle.color,
147
- padding: item.nameTextStyle.padding,
148
- },
149
- nameGap: item.nameGap
150
- };
151
- Object.assign(appearance[nameStr], nameParams);
152
- } else {
153
- const nameNode = appearance[nameStr];
154
- if (nameNode) {
155
- item.name = nameNode.name;
156
- item.nameTextStyle.color = nameNode.nameTextStyle.color;
157
- item.nameTextStyle.padding = nameNode.nameTextStyle.padding;
158
- item.nameGap = nameNode.nameGap;
159
- }
160
- }
161
- }
162
- //return yAxis;
163
- }
164
-
165
- // 图表图例数据
166
- export function setChartLegendData(legend, appearance) {
167
- if (!legend.formatter) legend.formatter = ['{a|{name}}'].join('\n');
168
- // 设置默认图例文字配置,如果想改变初始化文字属性,在 appearance中配置即可
169
- if (!legend.textStyle) legend.textStyle = {
170
- color: '#fff',
171
- height: 8
172
- };
173
- legend.textStyle.rich = {
174
- a: {
175
- fontSize: 12,
176
- verticalAlign: 'bottom',
177
- }
178
- };
179
- if (!appearance.legend) {
180
- appearance.legend = JSON.parse(JSON.stringify(echartsLegendDefaultData));
181
- Object.assign(appearance.legend, legend);
182
- delete appearance.legend['data'];
183
- delete appearance.legend['textStyle'];
184
- } else {
185
- const {
186
- icon,
187
- itemWidth,
188
- itemHeight,
189
- itemGap,
190
- top,
191
- right,
192
- bottom,
193
- left,
194
- padding,
195
- color,
196
- height,
197
- fontSize
198
- } = appearance.legend;
199
- legend.icon = icon || '';
200
- legend.itemWidth = itemWidth || 12;
201
- legend.itemHeight = itemHeight || 12;
202
- legend.itemGap = itemGap || 8;
203
- legend.top = top || 'auto';
204
- legend.right = right || 'auto';
205
- legend.bottom = bottom || 'auto';
206
- legend.left = left || 'auto';
207
- legend.padding = padding || [5, 5, 5, 5];
208
- legend.textStyle.color = color || '';
209
- legend.textStyle.height = height || 8;
210
- legend.textStyle.rich.a = fontSize || 12;
211
- }
212
- //return legend;
213
- }
214
-
215
- // 图表曲线数据配置
216
- export function setLineSeriesStyleData(series, appearance) {
217
- let seriesOptions = [];
218
- for (let i = 0; i < series.length; i++) {
219
- const defaultSeriesStyle = JSON.parse(JSON.stringify(echartsLineSeriesStyleData));
220
- const item = series[i];
221
- let appearanceSeries = appearance.seriesOptions && appearance.seriesOptions[i];
222
- if(!appearanceSeries) {
223
- appearanceSeries = defaultSeriesStyle;
224
- appearanceSeries.name = item.name;
225
- appearanceSeries.itemLineStyle.color = i === 0 ? defaultSeriesStyle.itemLineStyle.color : echartsColorData[i];
226
- seriesOptions.push(defaultSeriesStyle);
227
- }else {
228
- seriesOptions.push(appearanceSeries);
229
- }
230
- item.symbol = appearanceSeries.symbol;
231
- item.smooth = appearanceSeries.smooth;
232
- item.symbolSize = appearanceSeries.symbolSize || 18;
233
- item.itemStyle = {
234
- normal: {
235
- color: appearanceSeries.itemLineStyle.color,
236
- lineStyle: appearanceSeries.itemLineStyle
237
- }
238
- };
239
- if (appearanceSeries.area) {
240
- item.areaStyle = {
241
- color: appearanceSeries.areaColor && {...appearanceSeries.areaColor} || {...defaultSeriesStyle.areaColor}
242
- };
243
- appearanceSeries.linear ?
244
- item.areaStyle.color.colorStops = [...appearanceSeries.areaColorStops] :
245
- item.areaStyle = Object.assign({}, item.areaStyle, {color: appearanceSeries.areaBgColor || 'rgba(49, 144, 255, 0.21)'});
246
- } else {
247
- if (item.areaStyle) delete item['areaStyle'];
248
- }
249
- }
250
-
251
- appearance.seriesOptions = seriesOptions;
252
- //return series;
253
- }
@@ -1,18 +0,0 @@
1
- interface echartsOptions {
2
- color: '',
3
- xAxis: [],
4
- yAxis: [],
5
- series: [],
6
- tooltip: null
7
- }
8
- export declare function getXYAxisLabelVal(index: number, intervalNum: number, value: any): string;
9
- export declare function initBindTabSetting(node: any): string;
10
- export declare function setMapLineBarOptions(option: echartsOptions, node: any): void;
11
- export declare function setMapGaugeOptions(option: echartsOptions, node: any): void;
12
- export declare function setMapRingOptions(option: echartsOptions, node: any): void;
13
- export declare function setMap3dBarOptions(option: echartsOptions, node: any): void;
14
- export declare function setMapTopOptions(option: echartsOptions, node: any): void;
15
- export declare function setMapGlobalOptions(option: echartsOptions, node: any): void;
16
- export declare function setMapDataOptions(option: echartsOptions, node: any): void;
17
- export declare function setMapAutoMoveOptions(option: echartsOptions, chartNode: string,node: any, callback: any): void;
18
- export declare function setMapStopAutoMoveOptions(chartNode: string): void;