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,2 +1,2 @@
1
- import { Node } from '../../../core';
1
+ import { Node } from 'dcim-topology/core';
2
2
  export declare function activityFinal(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 activityFinalIconRect(node: Node): void;
3
3
  export declare function activityFinalTextRect(node: Node): void;
@@ -1,4 +1,4 @@
1
- import { Rect } from '../../../core';
1
+ import { Rect } from 'dcim-topology/core';
2
2
  export function activityFinalIconRect(node) {
3
3
  node.iconRect = new Rect(0, 0, 0, 0);
4
4
  }
@@ -1,3 +1,3 @@
1
- import { Node } from '../../../core';
1
+ import { Node } from 'dcim-topology/core';
2
2
  export declare function forkHAnchors(node: Node): void;
3
3
  export declare function forkVAnchors(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 forkHAnchors(node) {
3
3
  node.anchors.push(new Point(node.rect.x, node.rect.y + node.rect.height / 2, Direction.Left));
4
4
  node.anchors.push(new Point(node.rect.ex, node.rect.y + node.rect.height / 2, Direction.Right));
@@ -1,2 +1,2 @@
1
- import { Node } from '../../../core';
1
+ import { Node } from 'dcim-topology/core';
2
2
  export declare function fork(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 forkIconRect(node: Node): void;
3
3
  export declare function forkTextRect(node: Node): void;
@@ -1,4 +1,4 @@
1
- import { Rect } from '../../../core';
1
+ import { Rect } from 'dcim-topology/core';
2
2
  export function forkIconRect(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 { activityFinal, activityFinalIconRect, activityFinalTextRect } from './final';
3
3
  import { fork, forkHAnchors, forkVAnchors, forkIconRect, forkTextRect } from './fork';
4
4
  import { swimlaneH, swimlaneHIconRect, swimlaneHTextRect } from './swimlaneH';
@@ -1,2 +1,2 @@
1
- import { Node } from '../../../core';
1
+ import { Node } from 'dcim-topology/core';
2
2
  export declare function swimlaneH(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 swimlaneHIconRect(node: Node): void;
3
3
  export declare function swimlaneHTextRect(node: Node): void;
@@ -1,4 +1,4 @@
1
- import { Rect } from '../../../core';
1
+ import { Rect } from 'dcim-topology/core';
2
2
  export function swimlaneHIconRect(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 swimlaneV(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 swimlaneVIconRect(node: Node): void;
3
3
  export declare function swimlaneVTextRect(node: Node): void;
@@ -1,4 +1,4 @@
1
- import { Rect } from '../../../core';
1
+ import { Rect } from 'dcim-topology/core';
2
2
  export function swimlaneVIconRect(node) {
3
3
  node.iconRect = new Rect(0, 0, 0, 0);
4
4
  }
@@ -1,5 +1,3 @@
1
- // @ts-ignore
2
- export * from './src/utils';
3
1
  export * from './src/echarts';
4
2
  export * from './src/register';
5
3
  export * from '../myShape-diagram/myShape';
@@ -1,4 +1,3 @@
1
- export * from './src/utils';
2
1
  export * from './src/echarts';
3
2
  export * from './src/register';
4
3
  export * from '../myShape-diagram/myShape.js';
@@ -1,3 +1,4 @@
1
1
  // @ts-ignore
2
- import { Node } from '../../../core';
2
+ import { Node } from 'dcim-topology/core';
3
+ export declare const echartsData: any;
3
4
  export declare function echarts(ctx: CanvasRenderingContext2D, node: Node): void;
@@ -1,106 +1,104 @@
1
- import { s8, createDiv, rectangle, commonStore } from '../../../core';
2
- import {
3
- setMapLineBarOptions,
4
- setMapGaugeOptions,
5
- setMapRingOptions,
6
- setMapAutoMoveOptions,
7
- setMapStopAutoMoveOptions,
8
- setMap3dBarOptions,
9
- setMapTopOptions,
10
- setMapGlobalOptions,
11
- setMapDataOptions
12
- } from '../utils';
13
- import { echartsDataStore, echartsOptionsStore } from '../../../static';
14
-
15
- export function echarts(ctx, node) {
16
- if(!(commonStore[node.TID] && commonStore[node.TID].data.dataResize)) return;
17
- //console.log('echarts绘制-----node', node);
18
- // 绘制一个底图,类似于占位符。
19
- rectangle(ctx, node)
20
- // tslint:disable-next-line:no-shadowed-variable
21
- var echarts = echartsDataStore.echarts || window.echarts
22
- if (!node.data || !echarts) {
23
- return
24
- }
25
- if (typeof node.data === 'string') {
26
- node.data = JSON.parse(node.data)
27
- }
28
- if (!node.data.echarts) {
29
- return
30
- }
31
- if (!node.elementId) {
32
- node.elementId = s8()
33
- }
34
- const currentElement = document.getElementById(node.id)
35
- if (!node.elementLoaded && !currentElement) {
36
- echartsDataStore[node.id] = {
37
- div: createDiv(node)
38
- }
39
- node.elementLoaded = true
40
- document.body.appendChild(echartsDataStore[node.id].div)
41
- // 添加当前节点到div层
42
- node.addToDiv('init')
43
- echartsDataStore[node.id].chart = echarts.init(echartsDataStore[node.id].div, node.data.echarts.theme)
44
- node.elementRendered = false
45
- // 等待父div先渲染完成,避免初始图表控件太大
46
- setTimeout(function() {
47
- echartsDataStore[node.id].chart.resize()
48
- })
49
- }
50
- if (!node.elementRendered) {
51
- const appearance = node.appearance;
52
- // 初始化时,等待父div先渲染完成,避免初始图表控件太大。
53
- setTimeout(function() {
54
- let option = node.data.echarts.option;
55
- const currentChartNode = echartsDataStore[node.id];
56
- const mapChart = currentChartNode.chart;
57
- const isLocked = commonStore[node.TID] && commonStore[node.TID].data.locked;
58
- if(!isLocked || !echartsOptionsStore[node.id]) {
59
- // 【未锁定(编辑)状态, options未初始化的状态】
60
- // 公共配置 Top排行榜跳过公共属性配置
61
- if(option.displayMode !== 4) option = setMapGlobalOptions(option, node);
62
- // 折线图和柱状图
63
- if (appearance.type === 'line' || appearance.type === 'bar') option = setMapLineBarOptions(option, node);
64
- // 仪表盘
65
- if (appearance.type === 'gauge') option = setMapGaugeOptions(option, node);
66
- // 环形图
67
- if (appearance.type === 'ring') option = setMapRingOptions(option, node);
68
- // 3d 柱状图
69
- if (appearance.type === '3dBar') option = setMap3dBarOptions(option, node);
70
- // Top排行榜
71
- if (appearance.type === 'TOP') option = setMapTopOptions(option, node);
72
- //option.title = appearance.title;
73
- option.backgroundColor = appearance.backgroundColor;
74
- echartsOptionsStore[node.id] = option;
75
- if(!isLocked) mapChart.clear();
76
- }else {
77
- // 【锁定状态且option值已初始化完成】
78
- option = setMapDataOptions(option, node);
79
- }
80
- // if (window.location.pathname.includes('workspace')) mapChart.clear();
81
- clearInterval(currentChartNode.timeTicket);
82
- currentChartNode.timeTicket = null;
83
- // 自动滑动展示数据
84
- if(appearance.timeTicket) {
85
- mapChart.off('mouseover');
86
- mapChart.off('mouseout');
87
- mapChart.on('mouseover', function(){
88
- setMapStopAutoMoveOptions(currentChartNode);
89
- });
90
- mapChart.on('mouseout', function(){
91
- setMapAutoMoveOptions(option, currentChartNode, node, function(chartNode){
92
- return mapChart.setOption(chartNode);
93
- })
94
- });
95
- setMapAutoMoveOptions(option, currentChartNode, node, function(chartNode){
96
- return mapChart.setOption(chartNode);
97
- })
98
- }
99
- mapChart.setOption(option);
100
- mapChart.resize();
101
- node.elementRendered = true;
102
- })
103
- }
104
- }
105
-
106
- //# sourceMappingURL=index.js.map
1
+ import { s8, createDiv, rectangle } from 'dcim-topology/core';
2
+ export let echartsData = {};
3
+ export function echarts(ctx, node) {
4
+ //console.log('echarts绘制-----node', node);
5
+ // 绘制一个底图,类似于占位符。
6
+ rectangle(ctx, node);
7
+ // tslint:disable-next-line:no-shadowed-variable
8
+ var echarts = echartsData.echarts || window.echarts;
9
+ if (!node.data || !echarts) {
10
+ return;
11
+ }
12
+ if (typeof node.data === 'string') {
13
+ node.data = JSON.parse(node.data);
14
+ }
15
+ if (!node.data.echarts) {
16
+ return;
17
+ }
18
+ if (!node.elementId) {
19
+ node.elementId = s8();
20
+ }
21
+ const currentElement = document.getElementById(node.id);
22
+ if (!node.elementLoaded && !currentElement) {
23
+ // if(echartsData[node.id]) {
24
+ // const appearCharts = echarts.getInstanceByDom(echartsData[node.id].div);
25
+ // if (appearCharts) echarts.dispose(appearCharts);
26
+ // echartsData[node.id] = null;
27
+ // }
28
+ echartsData[node.id] = {
29
+ div: createDiv(node)
30
+ };
31
+ node.elementLoaded = true;
32
+ document.body.appendChild(echartsData[node.id].div);
33
+ // 添加当前节点到div层
34
+ node.addToDiv('init');
35
+ echartsData[node.id].chart = echarts.init(echartsData[node.id].div, node.data.echarts.theme);
36
+ node.elementRendered = false;
37
+ // 等待父div先渲染完成,避免初始图表控件太大
38
+ setTimeout(function () {
39
+ echartsData[node.id].chart.resize();
40
+ });
41
+ }
42
+ if (!node.elementRendered) {
43
+ // 初始化时,等待父div先渲染完成,避免初始图表控件太大。
44
+ setTimeout(function () {
45
+ let option = {...node.data.echarts.option};
46
+ if(node.appearance.type === 'line' || node.appearance.type === 'bar') {
47
+ option.color = node.appearance.color;
48
+ option.xAxis[0].axisLabel.formatter = function(value, index){
49
+ if (index === 0 || index%(node.appearance.intervalNumX) === 0){
50
+ return value;
51
+ }
52
+ else {
53
+ return '';
54
+ }
55
+ }
56
+
57
+ option.yAxis[0].axisLabel.formatter = function(value, index){
58
+ if (index === 0 || index%(node.appearance.intervalNumY) === 0){
59
+ return value;
60
+ }
61
+ else {
62
+ return '';
63
+ }
64
+ }
65
+ // if(option.series.length >= 2) {
66
+
67
+ // for(let i=0; i<option.series.length-1 ; i++){
68
+
69
+ // option.color.push(node.appearance.color[0])
70
+ // }
71
+ // }
72
+ option.yAxis[0].splitLine = node.appearance.splitLine;
73
+
74
+ }else if(node.appearance.type === 'gauge') {
75
+ const pointerColor = node.appearance.pointerColor;
76
+ node.appearance.pointer.length = `${node.appearance.pointer.length}%`;
77
+ option.series[0].min = node.appearance.min;
78
+ option.series[0].max = node.appearance.max;
79
+ option.series[0].itemStyle.color = pointerColor ? pointerColor : node.appearance.axisLabel.color;
80
+ option.series[0].splitNumber = node.appearance.splitNumber;
81
+ option.series[0].pointer = node.appearance.pointer;
82
+ option.series[0].axisLabel = node.appearance.axisLabel;
83
+ option.series[0].axisLine.lineStyle = node.appearance.axisLine.lineStyle;
84
+ option.series[0].detail = node.appearance.detail;
85
+ //option.series[0].data = node.appearance.data;
86
+ if(option.isGaugeLinear) {
87
+ option.series[0].axisLine.lineStyle.color = [
88
+ [1, new echarts.graphic.LinearGradient(0, 0, 1, 0, option.linearColors)]
89
+ ]
90
+ }
91
+ }else if(node.appearance.type === 'ring') {
92
+ option.series[0].radius = [`${node.appearance.innerRadius}%`, `${node.appearance.outerRadius}%`];
93
+ option.series[0].label = node.appearance.label;
94
+ }
95
+ option.title = node.appearance.title;
96
+ option.backgroundColor = node.appearance.backgroundColor;
97
+ echartsData[node.id].chart.clear();
98
+ echartsData[node.id].chart.setOption(option);
99
+ echartsData[node.id].chart.resize();
100
+ node.elementRendered = true;
101
+ });
102
+ }
103
+ }
104
+ //# sourceMappingURL=index.js.map
@@ -1,13 +1,12 @@
1
- import { registerNode } from '../../core';
2
- import { echarts } from './echarts';
3
- import { echartsDataStore } from '../../static';
4
- // import './echarts/echarts.min.js';
1
+ import { registerNode, loadJS } from 'dcim-topology/core';
2
+ import { echarts, echartsData } from './echarts';
3
+ import './echarts/echarts.min.js';
5
4
  export function register(_echarts) {
6
- echartsDataStore.echarts = _echarts;
7
- // if (process.browser && !echartsDataStore.echarts && !window.echarts) {
8
- // //loadJS('https://cdn.bootcdn.net/ajax/libs/echarts/4.8.0/echarts.min.js', null, true);
9
- // loadJS(`${location.origin}/libary/echarts.min.js`, null, true);
10
- // }
5
+ echartsData.echarts = _echarts;
6
+ if (process.browser && !echartsData.echarts && !window.echarts) {
7
+ //loadJS('https://cdn.bootcdn.net/ajax/libs/echarts/4.8.0/echarts.min.js', null, true);
8
+ loadJS(`${location.origin}/libary/echarts.min.js`, null, true);
9
+ }
11
10
  registerNode('echarts', echarts, null, null, null);
12
11
  }
13
12
  //# sourceMappingURL=register.js.map
@@ -1,3 +1,3 @@
1
- import { Node } from '../../../core';
1
+ import { Node } from 'dcim-topology/core';
2
2
  export declare function simpleClass(ctx: CanvasRenderingContext2D, node: Node): void;
3
3
  export declare function interfaceClass(ctx: CanvasRenderingContext2D, node: Node): void;
@@ -1,4 +1,4 @@
1
- import { Node } from '../../../core';
1
+ import { Node } from 'dcim-topology/core';
2
2
  export declare function simpleClassIconRect(node: Node): void;
3
3
  export declare function simpleClassTextRect(node: Node): void;
4
4
  export declare function interfaceClassIconRect(node: Node): void;
@@ -1,4 +1,4 @@
1
- import { Rect } from '../../../core';
1
+ import { Rect } from 'dcim-topology/core';
2
2
  export function simpleClassIconRect(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 { simpleClass, simpleClassIconRect, simpleClassTextRect, interfaceClass, interfaceClassIconRect, interfaceClassTextRect } from './class';
3
3
  export function register() {
4
4
  registerNode('simpleClass', simpleClass, null, simpleClassIconRect, simpleClassTextRect);
package/core/index.d.ts CHANGED
@@ -6,4 +6,3 @@ export * from './src/utils';
6
6
  export * from './src/models';
7
7
  export * from './src/middles';
8
8
  export * from './src/healps';
9
- export * from './src/store';
package/core/index.js CHANGED
@@ -6,7 +6,6 @@ export * from './src/utils';
6
6
  export * from './src/models';
7
7
  export * from './src/middles';
8
8
  export * from './src/healps';
9
- export * from './src/store';
10
9
  //# sourceMappingURL=index.js.map
11
10
  import axios from 'axios'
12
11
  if(axios.defaults.headers.common) axios.defaults.headers.common['Authorization'] = getToken();
@@ -1,7 +1,15 @@
1
- import { Pen, Node, Line, Rect, Point } from './models';
1
+ import { Options } from './options';
2
+ import { Pen } from './models/pen';
3
+ import { Node } from './models/node';
4
+ import { Line } from './models/line';
5
+ import { Rect } from './models/rect';
6
+ import { Point } from './models/point';
7
+ import { TopologyData } from './models/data';
2
8
  import { Layer } from './layer';
3
9
  import { Topology } from './core';
4
10
  export declare class ActiveLayer extends Layer {
11
+ options: Options;
12
+ protected data: TopologyData;
5
13
  rotateCPs: Point[];
6
14
  sizeCPs: Point[];
7
15
  rect: Rect;
@@ -18,7 +26,7 @@ export declare class ActiveLayer extends Layer {
18
26
  dockWatchers: Point[];
19
27
  topology: Topology;
20
28
  rotating: boolean;
21
- constructor(TID: String);
29
+ constructor(options: Options, TID: String);
22
30
  calcControlPoints(): void;
23
31
  locked(): boolean;
24
32
  getPoints(): Point[];