dcim-topology2d 1.1.6 → 3.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (168) 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 +0 -2
  17. package/chart-diagram/index.js +0 -1
  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 -1
  26. package/core/index.js +0 -1
  27. package/core/src/activeLayer.d.ts +10 -2
  28. package/core/src/activeLayer.js +41 -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 -17
  35. package/core/src/common.d.ts +5 -5
  36. package/core/src/common.js +202 -172
  37. package/core/src/core.d.ts +4 -3
  38. package/core/src/core.js +321 -339
  39. package/core/src/divLayer.d.ts +33 -2
  40. package/core/src/divLayer.js +292 -41
  41. package/core/src/healps/changeData.d.ts +1 -1
  42. package/core/src/healps/changeData.js +44 -102
  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 -51
  47. package/core/src/middles/index.js +2 -3
  48. package/core/src/middles/nodes/pentagon.rect.js +1 -1
  49. package/core/src/middles/nodes/rectangle.rect.js +1 -1
  50. package/core/src/models/data.d.ts +26 -0
  51. package/core/src/models/data.js +77 -0
  52. package/core/src/models/data.js.map +1 -0
  53. package/core/src/models/index.d.ts +1 -0
  54. package/core/src/models/index.js +1 -0
  55. package/core/src/models/node.d.ts +0 -6
  56. package/core/src/models/node.js +16 -29
  57. package/core/src/models/pen.js +7 -16
  58. package/core/src/mqtt.d.ts +14 -0
  59. package/core/src/mqtt.js +82 -0
  60. package/core/src/mqtt.js.map +1 -0
  61. package/core/src/offscreen.d.ts +4 -1
  62. package/core/src/offscreen.js +8 -10
  63. package/core/src/options.js +0 -1
  64. package/core/src/poll.js +2 -0
  65. package/core/src/preview.d.ts +13 -1
  66. package/core/src/preview.js +34 -56
  67. package/core/src/renderLayer.d.ts +3 -1
  68. package/core/src/renderLayer.js +31 -26
  69. package/core/src/socket.d.ts +10 -0
  70. package/core/src/socket.js +51 -0
  71. package/core/src/socket.js.map +1 -0
  72. package/core/src/utils/canvas.js +1 -1
  73. package/core/src/utils/conversion.d.ts +0 -7
  74. package/core/src/utils/conversion.js +0 -54
  75. package/core/src/utils/dom.d.ts +5 -6
  76. package/core/src/utils/dom.js +46 -82
  77. package/core/src/utils/index.d.ts +0 -1
  78. package/core/src/utils/index.js +0 -1
  79. package/core/src/utils/onmousevent.js +3 -12
  80. package/flow-diagram/src/comment/comment.anchor.d.ts +1 -1
  81. package/flow-diagram/src/comment/comment.anchor.js +1 -1
  82. package/flow-diagram/src/comment/comment.d.ts +1 -1
  83. package/flow-diagram/src/data/data.anchor.d.ts +1 -1
  84. package/flow-diagram/src/data/data.anchor.js +1 -1
  85. package/flow-diagram/src/data/data.d.ts +1 -1
  86. package/flow-diagram/src/data/data.rect.d.ts +1 -1
  87. package/flow-diagram/src/data/data.rect.js +1 -1
  88. package/flow-diagram/src/db/db.d.ts +1 -1
  89. package/flow-diagram/src/db/db.rect.d.ts +1 -1
  90. package/flow-diagram/src/db/db.rect.js +1 -1
  91. package/flow-diagram/src/display/display.anchor.d.ts +1 -1
  92. package/flow-diagram/src/display/display.anchor.js +1 -1
  93. package/flow-diagram/src/display/display.d.ts +1 -1
  94. package/flow-diagram/src/display/display.rect.d.ts +1 -1
  95. package/flow-diagram/src/display/display.rect.js +1 -1
  96. package/flow-diagram/src/document/document.anchor.d.ts +1 -1
  97. package/flow-diagram/src/document/document.anchor.js +1 -1
  98. package/flow-diagram/src/document/document.d.ts +1 -1
  99. package/flow-diagram/src/document/document.rect.d.ts +1 -1
  100. package/flow-diagram/src/document/document.rect.js +1 -1
  101. package/flow-diagram/src/externStorage/externStorage.anchor.d.ts +1 -1
  102. package/flow-diagram/src/externStorage/externStorage.anchor.js +1 -1
  103. package/flow-diagram/src/externStorage/externStorage.d.ts +1 -1
  104. package/flow-diagram/src/externStorage/externStorage.rect.d.ts +1 -1
  105. package/flow-diagram/src/externStorage/externStorage.rect.js +1 -1
  106. package/flow-diagram/src/internalStorage/internalStorage.d.ts +1 -1
  107. package/flow-diagram/src/internalStorage/internalStorage.rect.d.ts +1 -1
  108. package/flow-diagram/src/internalStorage/internalStorage.rect.js +1 -1
  109. package/flow-diagram/src/manually/manually.anchor.d.ts +1 -1
  110. package/flow-diagram/src/manually/manually.anchor.js +1 -1
  111. package/flow-diagram/src/manually/manually.d.ts +1 -1
  112. package/flow-diagram/src/manually/manually.rect.d.ts +1 -1
  113. package/flow-diagram/src/manually/manually.rect.js +1 -1
  114. package/flow-diagram/src/parallel/parallel.anchor.d.ts +1 -1
  115. package/flow-diagram/src/parallel/parallel.anchor.js +1 -1
  116. package/flow-diagram/src/parallel/parallel.d.ts +1 -1
  117. package/flow-diagram/src/queue/queue.d.ts +1 -1
  118. package/flow-diagram/src/queue/queue.rect.d.ts +1 -1
  119. package/flow-diagram/src/queue/queue.rect.js +1 -1
  120. package/flow-diagram/src/register.js +1 -1
  121. package/flow-diagram/src/subprocess/subprocess.d.ts +1 -1
  122. package/flow-diagram/src/subprocess/subprocess.rect.d.ts +1 -1
  123. package/flow-diagram/src/subprocess/subprocess.rect.js +1 -1
  124. package/layout/src/align.d.ts +1 -1
  125. package/layout/src/align.js +1 -1
  126. package/layout/src/layout.d.ts +1 -1
  127. package/layout/src/layout.js +1 -1
  128. package/myShape-diagram/myShape.js +1 -1
  129. package/package.json +1 -1
  130. package/sequence-diagram/src/focus/focus.anchor.d.ts +1 -1
  131. package/sequence-diagram/src/focus/focus.anchor.js +1 -1
  132. package/sequence-diagram/src/focus/focus.d.ts +1 -1
  133. package/sequence-diagram/src/focus/focus.rect.d.ts +1 -1
  134. package/sequence-diagram/src/focus/focus.rect.js +1 -1
  135. package/sequence-diagram/src/lifeline/lifeline.anchor.d.ts +1 -1
  136. package/sequence-diagram/src/lifeline/lifeline.anchor.js +1 -1
  137. package/sequence-diagram/src/lifeline/lifeline.d.ts +1 -1
  138. package/sequence-diagram/src/lifeline/lifeline.rect.d.ts +1 -1
  139. package/sequence-diagram/src/lifeline/lifeline.rect.js +1 -1
  140. package/sequence-diagram/src/register.js +1 -1
  141. package/chart-diagram/src/utils/changeOptions.d.ts +0 -4
  142. package/chart-diagram/src/utils/changeOptions.js +0 -163
  143. package/chart-diagram/src/utils/conversion.d.ts +0 -17
  144. package/chart-diagram/src/utils/conversion.js +0 -179
  145. package/chart-diagram/src/utils/drawGraphic.d.ts +0 -3
  146. package/chart-diagram/src/utils/drawGraphic.js +0 -97
  147. package/chart-diagram/src/utils/index.d.ts +0 -3
  148. package/chart-diagram/src/utils/index.js +0 -3
  149. package/core/src/middles/arrows/index.d.ts +0 -4
  150. package/core/src/middles/arrows/index.js +0 -5
  151. package/core/src/middles/lines/index.d.ts +0 -4
  152. package/core/src/middles/lines/index.js +0 -5
  153. package/core/src/middles/nodes/iframe.d.ts +0 -2
  154. package/core/src/middles/nodes/iframe.js +0 -12
  155. package/core/src/middles/nodes/index.d.ts +0 -46
  156. package/core/src/middles/nodes/index.js +0 -47
  157. package/core/src/store/common.d.ts +0 -9
  158. package/core/src/store/common.js +0 -5
  159. package/core/src/store/data.d.ts +0 -129
  160. package/core/src/store/data.js +0 -86
  161. package/core/src/store/index.d.ts +0 -2
  162. package/core/src/store/index.js +0 -2
  163. package/core/src/utils/assignment.d.ts +0 -3
  164. package/core/src/utils/assignment.js +0 -69
  165. package/static/echartsDefaultData.js +0 -239
  166. package/static/echartsStore.js +0 -14
  167. package/static/index.js +0 -2
  168. package/style/index.css +0 -13
@@ -1,4 +1,4 @@
1
- import { Rect } from '../../../core';
1
+ import { Rect } from 'dcim-topology/core';
2
2
  export function flowExternStorageIconRect(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 flowInternalStorage(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 flowInternalStorageIconRect(node: Node): void;
3
3
  export declare function flowInternalStorageTextRect(node: Node): void;
@@ -1,4 +1,4 @@
1
- import { Rect } from '../../../core';
1
+ import { Rect } from 'dcim-topology/core';
2
2
  export function flowInternalStorageIconRect(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 flowManuallyAnchors(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 flowManuallyAnchors(node) {
3
3
  node.anchors.push(new Point(node.rect.x, node.rect.y + (node.rect.height * 5) / 8, Direction.Left));
4
4
  node.anchors.push(new Point(node.rect.x + node.rect.width / 2, node.rect.y + node.rect.height / 8, Direction.Up));
@@ -1,2 +1,2 @@
1
- import { Node } from '../../../core';
1
+ import { Node } from 'dcim-topology/core';
2
2
  export declare function flowManually(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 flowManuallyIconRect(node: Node): void;
3
3
  export declare function flowManuallyTextRect(node: Node): void;
@@ -1,4 +1,4 @@
1
- import { Rect } from '../../../core';
1
+ import { Rect } from 'dcim-topology/core';
2
2
  export function flowManuallyIconRect(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 flowParallelAnchors(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 flowParallelAnchors(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.y + node.rect.height, Direction.Bottom));
@@ -1,2 +1,2 @@
1
- import { Node } from '../../../core';
1
+ import { Node } from 'dcim-topology/core';
2
2
  export declare function flowParallel(ctx: CanvasRenderingContext2D, node: Node): void;
@@ -1,2 +1,2 @@
1
- import { Node } from '../../../core';
1
+ import { Node } from 'dcim-topology/core';
2
2
  export declare function flowQueue(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 flowQueueIconRect(node: Node): void;
3
3
  export declare function flowQueueTextRect(node: Node): void;
@@ -1,4 +1,4 @@
1
- import { Rect } from '../../../core';
1
+ import { Rect } from 'dcim-topology/core';
2
2
  export function flowQueueIconRect(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 { 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,5 +1,5 @@
1
1
  // 源码版写法
2
- import { registerNode } from '../core'
2
+ import { registerNode } from 'dcim-topology/core'
3
3
 
4
4
  // 组件版写法和bundle一致
5
5
  // window.Le5leTopology.registerNode
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dcim-topology2d",
3
- "version": "1.1.6",
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,4 +0,0 @@
1
- export declare function setChartLegendData<T>(legend: T, appearance: T): T;
2
- export declare function setChartXAxisData<T>(xAxis: [], appearance: T): [];
3
- export declare function setChartYAxisData<T>(yAxis: [], appearance: T): [];
4
- export declare function setLineSeriesStyleData<T>(series: [], appearance: T): [];
@@ -1,163 +0,0 @@
1
- // 初始化图例数据和图例配置数据
2
- import {
3
- echartsLegendDefaultData,
4
- echartsXAxisDefaultStyleData,
5
- echartsYAxisDefaultStyleData,
6
- echartsLineSeriesStyleData
7
- } from '../../../static';
8
- // 图表X轴数据
9
- export function setChartXAxisData(xAxis, appearance){
10
- for (let i = 0; i < xAxis.length; i++) {
11
- const item = xAxis[i];
12
- if(!item.axisLabel) {
13
- item.axisLabel = JSON.parse(JSON.stringify(echartsXAxisDefaultStyleData['x1AxisLabel']));
14
- }
15
- const axisLabelStr = `x${i+1}AxisLabel`;
16
- if(!appearance[axisLabelStr]) {
17
- appearance[axisLabelStr] = JSON.parse(JSON.stringify(echartsXAxisDefaultStyleData[axisLabelStr]));
18
- Object.assign(appearance[axisLabelStr], item.axisLabel);
19
- }else {
20
- item.axisLabel.color = appearance[axisLabelStr].color || '';
21
- item.axisLabel.fontSize = appearance[axisLabelStr].fontSize || 12;
22
- }
23
- }
24
- return xAxis;
25
- }
26
- // 图表Y轴数据
27
- export function setChartYAxisData(yAxis, appearance){
28
- if(typeof appearance.ySplitLineShow !== 'boolean') {
29
- appearance.ySplitLineShow = yAxis[0].splitLine.show;
30
- }
31
- if(!appearance.ysplitLineLineStyle && yAxis[0].splitLine.show) {
32
- appearance.ysplitLineLineStyle = JSON.parse(JSON.stringify(echartsYAxisDefaultStyleData['ysplitLineLineStyle']));
33
- }
34
- for (let i = 0; i < yAxis.length; i++) {
35
- const item = yAxis[i];
36
- if(!item.axisLabel.textStyle) {
37
- item.axisLabel.textStyle = JSON.parse(JSON.stringify(echartsYAxisDefaultStyleData['y1axisLabelTextStyle']));
38
- }
39
- if(!item.splitLine.lineStyle) {
40
- item.splitLine.lineStyle = JSON.parse(JSON.stringify(echartsYAxisDefaultStyleData['ysplitLineLineStyle']));
41
- }
42
- const axisLabelTextStyleStr = `y${i+1}axisLabelTextStyle`;
43
- if(!appearance[axisLabelTextStyleStr]) {
44
- appearance[axisLabelTextStyleStr] = JSON.parse(JSON.stringify(echartsYAxisDefaultStyleData[axisLabelTextStyleStr]));
45
- Object.assign(appearance[axisLabelTextStyleStr], item.axisLabel.textStyle);
46
- }else {
47
- const axisLabelTextStyNode = appearance[axisLabelTextStyleStr];
48
- item.axisLabel.textStyle.color = axisLabelTextStyNode.color || '';
49
- item.axisLabel.textStyle.fontSize = axisLabelTextStyNode.fontSize || '12';
50
- item.axisLabel.textStyle.padding = axisLabelTextStyNode.padding || [20, 20, 20, 20];
51
- }
52
- if(appearance.ysplitLineLineStyle) {
53
- item.splitLine.show = appearance.ySplitLineShow;
54
- const axisLabelTextStyNode = appearance.ysplitLineLineStyle;
55
- item.splitLine.lineStyle.type = axisLabelTextStyNode.type || 'solid';
56
- item.splitLine.lineStyle.color = axisLabelTextStyNode.color || '';
57
- }
58
- const minMaxStr = `y${i+1}MinMaxData`;
59
- if(!appearance[minMaxStr] && item.max){
60
- appearance[minMaxStr] = JSON.parse(JSON.stringify(echartsYAxisDefaultStyleData[minMaxStr]));
61
- const minMaxParams = {
62
- max: item.max,
63
- min: item.min,
64
- interval: item.interval
65
- };
66
- Object.assign(appearance[minMaxStr], minMaxParams);
67
- }else {
68
- const minMaxNode = appearance[minMaxStr];
69
- if(minMaxNode) {
70
- item.max = minMaxNode.max;
71
- item.min = minMaxNode.min;
72
- item.interval = minMaxNode.interval;
73
- }
74
- }
75
- const nameStr = `y${i+1}NameData`;
76
- if(!appearance[nameStr] && item.name){
77
- appearance[nameStr] = JSON.parse(JSON.stringify(echartsYAxisDefaultStyleData[nameStr]));
78
- const nameParams = {
79
- name: item.name,
80
- nameTextStyle: {
81
- color: item.nameTextStyle.color,
82
- padding: item.nameTextStyle.padding,
83
- },
84
- nameGap: item.nameGap
85
- };
86
- Object.assign(appearance[nameStr], nameParams);
87
- }else {
88
- const nameNode = appearance[nameStr];
89
- if(nameNode) {
90
- item.name = nameNode.name;
91
- item.nameTextStyle.color = nameNode.nameTextStyle.color;
92
- item.nameTextStyle.padding = nameNode.nameTextStyle.padding;
93
- item.nameGap = nameNode.nameGap;
94
- }
95
- }
96
- }
97
- return yAxis;
98
- }
99
- // 图表图例数据
100
- export function setChartLegendData(legend, appearance) {
101
- if(!legend.formatter) legend.formatter = ['{a|{name}}'].join('\n');
102
- // 设置默认图例文字配置,如果想改变初始化文字属性,在 appearance中配置即可
103
- if(!legend.textStyle) legend.textStyle = {
104
- color: '#fff',
105
- height: 8,
106
- rich: {
107
- a: {
108
- fontSize: 12,
109
- verticalAlign: 'bottom',
110
- }
111
- }
112
- };
113
- if (!appearance.legend) {
114
- appearance.legend = JSON.parse(JSON.stringify(echartsLegendDefaultData));
115
- Object.assign(appearance.legend, legend);
116
- delete appearance.legend['data'];
117
- delete appearance.legend['textStyle'];
118
- }else {
119
- const { icon, itemWidth, itemHeight, itemGap, top, right, bottom, left, padding, color, height, fontSize } = appearance.legend;
120
- legend.icon = icon || '';
121
- legend.itemWidth = itemWidth || 12;
122
- legend.itemHeight = itemHeight || 12;
123
- legend.itemGap = itemGap || 8;
124
- legend.top = top || 'auto';
125
- legend.right = right || 'auto';
126
- legend.bottom = bottom || 'auto';
127
- legend.left = left || 'auto';
128
- legend.padding = padding || [5, 5, 5, 5];
129
- legend.textStyle.color = color || '';
130
- legend.textStyle.height = height || 8;
131
- legend.textStyle.rich.a = fontSize || 12;
132
- }
133
- return legend;
134
- }
135
- // 图表曲线数据配置
136
- export function setLineSeriesStyleData(series, appearance) {
137
- const defaultSeriesStyle = JSON.parse(JSON.stringify(echartsLineSeriesStyleData));
138
- if(!appearance.seriesOptions) appearance.seriesOptions = [defaultSeriesStyle];
139
- for (let i = 0; i < series.length; i++) {
140
- const item = series[i];
141
- const appearanceSeries = appearance.seriesOptions[i] || defaultSeriesStyle;
142
- item.symbol = appearanceSeries.symbol;
143
- item.smooth = appearanceSeries.smooth;
144
- item.symbolSize = appearanceSeries.symbolSize || 18;
145
- item.itemStyle = {
146
- normal: {
147
- color: appearanceSeries.itemLineStyle.color,
148
- lineStyle: appearanceSeries.itemLineStyle
149
- }
150
- };
151
- if(appearanceSeries.area) {
152
- item.areaStyle = {
153
- color: appearanceSeries.areaColor && { ...appearanceSeries.areaColor } || { ...defaultSeriesStyle.areaColor }
154
- };
155
- appearanceSeries.linear ?
156
- item.areaStyle.color.colorStops = [...appearanceSeries.areaColorStops] :
157
- item.areaStyle = Object.assign({}, item.areaStyle, {color: appearanceSeries.areaBgColor || 'rgba(49, 144, 255, 0.21)'});
158
- }else {
159
- if(item.areaStyle) delete item['areaStyle'];
160
- }
161
- }
162
- return series;
163
- }
@@ -1,17 +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 setMapLineBarOptions(option: echartsOptions, node: any): echartsOptions;
10
- export declare function setMapGaugeOptions(option: echartsOptions, node: any): echartsOptions;
11
- export declare function setMapRingOptions(option: echartsOptions, node: any): echartsOptions;
12
- export declare function setMap3dBarOptions(option: echartsOptions, node: any): echartsOptions;
13
- export declare function setMapTopOptions(option: echartsOptions, node: any): echartsOptions;
14
- export declare function setMapGlobalOptions(option: echartsOptions, node: any): echartsOptions;
15
- export declare function setMapDataOptions(option: echartsOptions, node: any): echartsOptions;
16
- export declare function setMapAutoMoveOptions(option: echartsOptions, chartNode: string,node: any, callback: any): void;
17
- export declare function setMapStopAutoMoveOptions(chartNode: string): void;
@@ -1,179 +0,0 @@
1
- import { echartsDataRoom, echartsOptionsStore } from '../../../static';
2
- import {
3
- setSeriesRenderGroup,
4
- drawGraphicShape,
5
- setChartLegendData,
6
- setChartXAxisData,
7
- setChartYAxisData,
8
- setLineSeriesStyleData
9
- } from '../utils';
10
-
11
- export function getXYAxisLabelVal(index, intervalNum, value) {
12
- if (index === 0 || index % intervalNum === 0) {
13
- return value;
14
- } else {
15
- return '';
16
- }
17
- }
18
- // 自动滑动展示数据
19
- export function setMapAutoMoveOptions(option, chartNode, node, callback) {
20
- option.dataZoom = echartsDataRoom;
21
- const dataZoomNode = option.dataZoom[0];
22
- const { start, end, time } = node.appearance.zoomParams;
23
- const zoomStart = Number(start);
24
- const zoomEnd = Number(end);
25
- const zoomTime = Number(time);
26
- dataZoomNode.start = zoomStart;
27
- dataZoomNode.end = zoomEnd;
28
- chartNode.timeTicket = setInterval(() => {
29
- if (Number(dataZoomNode.end) > 100) {
30
- dataZoomNode.end = zoomEnd;
31
- dataZoomNode.start = zoomStart;
32
- } else {
33
- dataZoomNode.end = dataZoomNode.end + 1 * (100 / option.series[0].data.length);
34
- dataZoomNode.start = dataZoomNode.start + 1 * (100 / option.series[0].data.length);
35
- }
36
- callback(option);
37
- }, zoomTime * 1000);
38
- }
39
- // 停止自动滑动展示数据
40
- export function setMapStopAutoMoveOptions(chartNode) {
41
-
42
- clearInterval(chartNode.timeTicket);
43
-
44
- }
45
- // 自动配置折线和柱状图的节点数据
46
- export function setMapLineBarOptions(option, node) {
47
- const chartOption = JSON.parse(JSON.stringify(option));
48
- chartOption.color = node.appearance.color;
49
- chartOption.xAxis[0].axisLabel.formatter = function(value, index) {
50
- return getXYAxisLabelVal(index, node.appearance.intervalNumX, value);
51
- }
52
- chartOption.yAxis[0].axisLabel.formatter = function(value, index) {
53
- return getXYAxisLabelVal(index, node.appearance.intervalNumY, value);
54
- }
55
- if (chartOption.series.length < 2) {
56
- chartOption.tooltip.formatter = function(params) {
57
- const item = params[0];
58
- return item.name + ' : ' + item.value;
59
- }
60
- }
61
- // chartOption.yAxis[0].splitLine = node.appearance.splitLine;
62
- return chartOption;
63
- }
64
- // 自动配置仪表盘的节点数据
65
- export function setMapGaugeOptions(option, node) {
66
- const chartOption = JSON.parse(JSON.stringify(option));
67
- const seriesNode = chartOption.series[0];
68
- const appearance = node.appearance;
69
- seriesNode.min = appearance.min;
70
- seriesNode.max = appearance.max;
71
- seriesNode.splitNumber = appearance.splitNumber;
72
- seriesNode.pointer = appearance.pointer;
73
- seriesNode.axisLabel = appearance.axisLabel;
74
- seriesNode.axisLine.lineStyle = appearance.axisLine.lineStyle;
75
- if(appearance.detail) seriesNode.detail = appearance.detail;
76
- if(appearance.data) seriesNode.data = appearance.data;
77
- if(chartOption.isGaugeLinear) {
78
- seriesNode.axisLine.lineStyle.color = [
79
- [1, new echarts.graphic.LinearGradient(0, 0, 1, 0, chartOption.linearColors)]
80
- ]
81
- }
82
- return chartOption;
83
- }
84
- // 自动配置环形图和饼图的节点数据
85
- export function setMapRingOptions(option, node) {
86
- const chartOption = JSON.parse(JSON.stringify(option));
87
- const seriesNode = chartOption.series[0];
88
- const appearance = node.appearance;
89
- seriesNode.radius = [`${appearance.innerRadius}%`, `${appearance.outerRadius}%`];
90
- seriesNode.label = appearance.label;
91
- return chartOption;
92
- }
93
- // 自动配置3D柱状图的节点数据
94
- export function setMap3dBarOptions(option, node) {
95
- // 取消注册自定义形状
96
- const chartOption = JSON.parse(JSON.stringify(option));
97
- const seriesNode = chartOption.series[0];
98
- const appearance = node.appearance;
99
- if(appearance.seriesCubeLeftLinear) appearance.seriesCubeLeftColor = 'rgb(0, 128, 215)';
100
- if(appearance.seriesCubeRightLinear) appearance.seriesCubeRightColor = 'rgb(3, 58, 125)';
101
- if(appearance.graphicShape) {
102
- const { CubeLeft, CubeRight, CubeTop } = drawGraphicShape(appearance);
103
- // 注册三个面图形
104
- echarts.graphic.registerShape('CubeLeft', CubeLeft);
105
- echarts.graphic.registerShape('CubeRight', CubeRight);
106
- echarts.graphic.registerShape('CubeTop', CubeTop);
107
- seriesNode.renderItem = (params, api) => {
108
- const seriesRenderData = setSeriesRenderGroup(appearance, api);
109
- return {
110
- type: 'group',
111
- children: seriesRenderData,
112
- };
113
- };
114
- }
115
- chartOption.tooltip.formatter = function(params) {
116
- const item = params[0];
117
- return item.name + ' : ' + item.value;
118
- }
119
- return chartOption;
120
- }
121
- export function setMapTopOptions(option, node) {
122
- const chartOption = JSON.parse(JSON.stringify(option));
123
- const appearance = node.appearance;
124
- Object.assign(chartOption.grid, appearance.grid);
125
- return chartOption;
126
- }
127
- // 公共配置
128
- export function setMapGlobalOptions(option, node) {
129
- const chartOption = JSON.parse(JSON.stringify(option));
130
- const appearance = node.appearance;
131
- // 图表网格数据
132
- if (appearance.grid) {
133
-
134
- chartOption.grid ? Object.assign(chartOption.grid, appearance.grid) : chartOption.grid = appearance.grid;
135
-
136
- }
137
- // 图表X轴数据
138
- if(chartOption.xAxis) setChartXAxisData(chartOption.xAxis, appearance);
139
- // 图表Y轴数据
140
- if(chartOption.yAxis) setChartYAxisData(chartOption.yAxis, appearance);
141
- // 图表图例数据
142
- if (chartOption.legend) setChartLegendData(chartOption.legend, appearance);
143
- // 曲线样式数据
144
- if (appearance.type.includes('line')) setLineSeriesStyleData(chartOption.series, appearance);
145
-
146
- return chartOption;
147
- }
148
- // 实时改变图表data值
149
- export function setMapDataOptions(option, node) {
150
- const optionNode = echartsOptionsStore[node.id];
151
- if (option.legend) {
152
- optionNode.legend = option.legend;
153
- }else {
154
- delete optionNode['legend'];
155
- }
156
- if(option.xAxis) {
157
- for (let i = 0; i < option.xAxis.length; i++) {
158
- const item = option.xAxis[i];
159
- if(item.data){
160
- optionNode.xAxis[i].data = item.data;
161
- }
162
- }
163
- }
164
- if(option.yAxis) {
165
- for (let i = 0; i < option.yAxis.length; i++) {
166
- const item = option.yAxis[i];
167
- if(item.data){
168
- optionNode.yAxis[i].data = item.data;
169
- };
170
- }
171
- }
172
- if(option.series) {
173
- for (let i = 0; i < option.series.length; i++) {
174
- const item = option.series[i];
175
- optionNode.series[i].data = item.data;
176
- }
177
- }
178
- return optionNode;
179
- }
@@ -1,3 +0,0 @@
1
- export declare function drawGraphicShape(appearance: any): any;
2
- export declare function graphicLinearGradient(nr: number, nb: number, nl: number, nt: number, colors: []): any;
3
- export declare function setSeriesRenderGroup(appearance: any, api: any): [];