dcim-topology2d 1.1.3 → 3.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (139) 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/src/echarts/index.d.ts +1 -1
  17. package/chart-diagram/src/echarts/index.js +7 -10
  18. package/chart-diagram/src/register.js +1 -1
  19. package/class-diagram/src/class/class.d.ts +1 -1
  20. package/class-diagram/src/class/class.rect.d.ts +1 -1
  21. package/class-diagram/src/class/class.rect.js +1 -1
  22. package/class-diagram/src/register.js +1 -1
  23. package/core/index.d.ts +0 -1
  24. package/core/index.js +0 -1
  25. package/core/src/activeLayer.d.ts +10 -2
  26. package/core/src/activeLayer.js +41 -42
  27. package/core/src/animateLayer.d.ts +7 -3
  28. package/core/src/animateLayer.js +12 -10
  29. package/core/src/calling.d.ts +4 -1
  30. package/core/src/calling.js +41 -40
  31. package/core/src/canvas.d.ts +6 -1
  32. package/core/src/canvas.js +18 -17
  33. package/core/src/common.d.ts +5 -5
  34. package/core/src/common.js +115 -161
  35. package/core/src/core.d.ts +4 -3
  36. package/core/src/core.js +253 -228
  37. package/core/src/divLayer.d.ts +7 -2
  38. package/core/src/divLayer.js +25 -25
  39. package/core/src/healps/changeData.d.ts +1 -1
  40. package/core/src/healps/changeData.js +42 -77
  41. package/core/src/hoverLayer.d.ts +9 -2
  42. package/core/src/hoverLayer.js +34 -31
  43. package/core/src/models/data.d.ts +26 -0
  44. package/core/src/models/data.js +77 -0
  45. package/core/src/models/data.js.map +1 -0
  46. package/core/src/models/index.d.ts +1 -0
  47. package/core/src/models/index.js +1 -0
  48. package/core/src/models/node.js +12 -14
  49. package/core/src/models/pen.js +1 -10
  50. package/core/src/mqtt.d.ts +14 -0
  51. package/core/src/mqtt.js +82 -0
  52. package/core/src/mqtt.js.map +1 -0
  53. package/core/src/offscreen.d.ts +4 -1
  54. package/core/src/offscreen.js +8 -10
  55. package/core/src/options.js +0 -1
  56. package/core/src/poll.js +2 -0
  57. package/core/src/preview.d.ts +13 -1
  58. package/core/src/preview.js +34 -42
  59. package/core/src/renderLayer.d.ts +3 -1
  60. package/core/src/renderLayer.js +31 -26
  61. package/core/src/socket.d.ts +10 -0
  62. package/core/src/socket.js +51 -0
  63. package/core/src/socket.js.map +1 -0
  64. package/core/src/utils/canvas.js +1 -1
  65. package/core/src/utils/conversion.d.ts +0 -7
  66. package/core/src/utils/conversion.js +0 -54
  67. package/core/src/utils/dom.d.ts +5 -4
  68. package/core/src/utils/dom.js +1 -3
  69. package/core/src/utils/onmousevent.js +3 -12
  70. package/flow-diagram/src/comment/comment.anchor.d.ts +1 -1
  71. package/flow-diagram/src/comment/comment.anchor.js +1 -1
  72. package/flow-diagram/src/comment/comment.d.ts +1 -1
  73. package/flow-diagram/src/data/data.anchor.d.ts +1 -1
  74. package/flow-diagram/src/data/data.anchor.js +1 -1
  75. package/flow-diagram/src/data/data.d.ts +1 -1
  76. package/flow-diagram/src/data/data.rect.d.ts +1 -1
  77. package/flow-diagram/src/data/data.rect.js +1 -1
  78. package/flow-diagram/src/db/db.d.ts +1 -1
  79. package/flow-diagram/src/db/db.rect.d.ts +1 -1
  80. package/flow-diagram/src/db/db.rect.js +1 -1
  81. package/flow-diagram/src/display/display.anchor.d.ts +1 -1
  82. package/flow-diagram/src/display/display.anchor.js +1 -1
  83. package/flow-diagram/src/display/display.d.ts +1 -1
  84. package/flow-diagram/src/display/display.rect.d.ts +1 -1
  85. package/flow-diagram/src/display/display.rect.js +1 -1
  86. package/flow-diagram/src/document/document.anchor.d.ts +1 -1
  87. package/flow-diagram/src/document/document.anchor.js +1 -1
  88. package/flow-diagram/src/document/document.d.ts +1 -1
  89. package/flow-diagram/src/document/document.rect.d.ts +1 -1
  90. package/flow-diagram/src/document/document.rect.js +1 -1
  91. package/flow-diagram/src/externStorage/externStorage.anchor.d.ts +1 -1
  92. package/flow-diagram/src/externStorage/externStorage.anchor.js +1 -1
  93. package/flow-diagram/src/externStorage/externStorage.d.ts +1 -1
  94. package/flow-diagram/src/externStorage/externStorage.rect.d.ts +1 -1
  95. package/flow-diagram/src/externStorage/externStorage.rect.js +1 -1
  96. package/flow-diagram/src/internalStorage/internalStorage.d.ts +1 -1
  97. package/flow-diagram/src/internalStorage/internalStorage.rect.d.ts +1 -1
  98. package/flow-diagram/src/internalStorage/internalStorage.rect.js +1 -1
  99. package/flow-diagram/src/manually/manually.anchor.d.ts +1 -1
  100. package/flow-diagram/src/manually/manually.anchor.js +1 -1
  101. package/flow-diagram/src/manually/manually.d.ts +1 -1
  102. package/flow-diagram/src/manually/manually.rect.d.ts +1 -1
  103. package/flow-diagram/src/manually/manually.rect.js +1 -1
  104. package/flow-diagram/src/parallel/parallel.anchor.d.ts +1 -1
  105. package/flow-diagram/src/parallel/parallel.anchor.js +1 -1
  106. package/flow-diagram/src/parallel/parallel.d.ts +1 -1
  107. package/flow-diagram/src/queue/queue.d.ts +1 -1
  108. package/flow-diagram/src/queue/queue.rect.d.ts +1 -1
  109. package/flow-diagram/src/queue/queue.rect.js +1 -1
  110. package/flow-diagram/src/register.js +1 -1
  111. package/flow-diagram/src/subprocess/subprocess.d.ts +1 -1
  112. package/flow-diagram/src/subprocess/subprocess.rect.d.ts +1 -1
  113. package/flow-diagram/src/subprocess/subprocess.rect.js +1 -1
  114. package/layout/src/align.d.ts +1 -1
  115. package/layout/src/align.js +1 -1
  116. package/layout/src/layout.d.ts +1 -1
  117. package/layout/src/layout.js +1 -1
  118. package/myShape-diagram/myShape.js +1 -1
  119. package/package.json +1 -1
  120. package/sequence-diagram/src/focus/focus.anchor.d.ts +1 -1
  121. package/sequence-diagram/src/focus/focus.anchor.js +1 -1
  122. package/sequence-diagram/src/focus/focus.d.ts +1 -1
  123. package/sequence-diagram/src/focus/focus.rect.d.ts +1 -1
  124. package/sequence-diagram/src/focus/focus.rect.js +1 -1
  125. package/sequence-diagram/src/lifeline/lifeline.anchor.d.ts +1 -1
  126. package/sequence-diagram/src/lifeline/lifeline.anchor.js +1 -1
  127. package/sequence-diagram/src/lifeline/lifeline.d.ts +1 -1
  128. package/sequence-diagram/src/lifeline/lifeline.rect.d.ts +1 -1
  129. package/sequence-diagram/src/lifeline/lifeline.rect.js +1 -1
  130. package/sequence-diagram/src/register.js +1 -1
  131. package/core/src/store/common.d.ts +0 -9
  132. package/core/src/store/common.js +0 -5
  133. package/core/src/store/data.d.ts +0 -126
  134. package/core/src/store/data.js +0 -80
  135. package/core/src/store/index.d.ts +0 -2
  136. package/core/src/store/index.js +0 -2
  137. package/static/echartsDefaultData.js +0 -95
  138. package/static/index.js +0 -1
  139. package/style/index.css +0 -10
@@ -0,0 +1,51 @@
1
+ import { EventType } from './models';
2
+ var Socket = /** @class */ (function () {
3
+ function Socket(url, data) {
4
+ var _this = this;
5
+ this.url = url;
6
+ this.data = data;
7
+ this.onmessage = function (e) {
8
+ if (!_this.data.pens.length || !e || !e.data) {
9
+ return;
10
+ }
11
+ var msg;
12
+ try {
13
+ msg = JSON.parse(e.data);
14
+ }
15
+ catch (error) {
16
+ msg = e.data;
17
+ }
18
+ for (var _i = 0, _a = _this.data.pens; _i < _a.length; _i++) {
19
+ var item = _a[_i];
20
+ for (var _b = 0, _c = item.events; _b < _c.length; _b++) {
21
+ var event_1 = _c[_b];
22
+ if (event_1.type === EventType.WebSocket) {
23
+ if (event_1.name && event_1.name === msg.event) {
24
+ item.doSocketMqtt(event_1, msg.data, _this.socket);
25
+ }
26
+ else if (!event_1.name && msg) {
27
+ item.doSocketMqtt(event_1, msg, _this.socket);
28
+ }
29
+ }
30
+ }
31
+ }
32
+ };
33
+ this.init();
34
+ }
35
+ Socket.prototype.init = function () {
36
+ var _this = this;
37
+ this.socket = new WebSocket(this.url);
38
+ this.socket.onmessage = this.onmessage;
39
+ this.socket.onclose = function () {
40
+ console.log('Canvas websocket closed and reconneting...');
41
+ _this.init();
42
+ };
43
+ };
44
+ Socket.prototype.close = function () {
45
+ this.socket.onclose = null;
46
+ this.socket.close();
47
+ };
48
+ return Socket;
49
+ }());
50
+ export { Socket };
51
+ //# sourceMappingURL=socket.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"socket.js","sourceRoot":"","sources":["../../../packages/core/src/socket.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAgB,MAAM,UAAU,CAAC;AAEnD;IAEE,gBAAmB,GAAW,EAAS,IAAkB;QAAzD,iBAEC;QAFkB,QAAG,GAAH,GAAG,CAAQ;QAAS,SAAI,GAAJ,IAAI,CAAc;QAczD,cAAS,GAAG,UAAC,CAAe;YAC1B,IAAI,CAAC,KAAI,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,EAAE;gBAC3C,OAAO;aACR;YAED,IAAI,GAAkC,CAAC;YACvC,IAAI;gBACF,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;aAC1B;YAAC,OAAO,KAAK,EAAE;gBACd,GAAG,GAAG,CAAC,CAAC,IAAI,CAAC;aACd;YAED,KAAmB,UAAc,EAAd,KAAA,KAAI,CAAC,IAAI,CAAC,IAAI,EAAd,cAAc,EAAd,IAAc,EAAE;gBAA9B,IAAM,IAAI,SAAA;gBACb,KAAoB,UAAW,EAAX,KAAA,IAAI,CAAC,MAAM,EAAX,cAAW,EAAX,IAAW,EAAE;oBAA5B,IAAM,OAAK,SAAA;oBACd,IAAI,OAAK,CAAC,IAAI,KAAK,SAAS,CAAC,SAAS,EAAE;wBACtC,IAAI,OAAK,CAAC,IAAI,IAAI,OAAK,CAAC,IAAI,KAAK,GAAG,CAAC,KAAK,EAAE;4BAC1C,IAAI,CAAC,YAAY,CAAC,OAAK,EAAE,GAAG,CAAC,IAAI,EAAE,KAAI,CAAC,MAAM,CAAC,CAAC;yBACjD;6BAAM,IAAI,CAAC,OAAK,CAAC,IAAI,IAAI,GAAG,EAAE;4BAC7B,IAAI,CAAC,YAAY,CAAC,OAAK,EAAE,GAAG,EAAE,KAAI,CAAC,MAAM,CAAC,CAAC;yBAC5C;qBACF;iBACF;aACF;QACH,CAAC,CAAC;QApCA,IAAI,CAAC,IAAI,EAAE,CAAC;IACd,CAAC;IAED,qBAAI,GAAJ;QAAA,iBAQC;QAPC,IAAI,CAAC,MAAM,GAAG,IAAI,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACtC,IAAI,CAAC,MAAM,CAAC,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC;QAEvC,IAAI,CAAC,MAAM,CAAC,OAAO,GAAG;YACpB,OAAO,CAAC,GAAG,CAAC,4CAA4C,CAAC,CAAC;YAC1D,KAAI,CAAC,IAAI,EAAE,CAAC;QACd,CAAC,CAAC;IACJ,CAAC;IA2BD,sBAAK,GAAL;QACE,IAAI,CAAC,MAAM,CAAC,OAAO,GAAG,IAAI,CAAC;QAC3B,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;IACtB,CAAC;IACH,aAAC;AAAD,CAAC,AA7CD,IA6CC"}
@@ -1,4 +1,4 @@
1
- import { Point } from '../models';
1
+ import { Point } from '../models/point';
2
2
  export function flatNodes(nodes) {
3
3
  var result = {
4
4
  nodes: [],
@@ -1,7 +0,0 @@
1
- import {Node} from "../models";
2
-
3
- export declare function setTagIdData(data: any): [];
4
- export declare function setKpiAddrData(data: any): [];
5
- export declare function setAssetIdData(data: any): [];
6
- export declare function setAreaIdData(data: any): [];
7
- export declare function setThreeCategoryIdData(pen: Node, data: any): [];
@@ -1,54 +0,0 @@
1
- export function setTagIdData(data) {
2
- return [{
3
- "key": "tagId",
4
- "value": data.tagId,
5
- "isControlDis": data.isControlDis,
6
- "type": data.tagType,
7
- "tagVal": data.value,
8
- "valExplain": data.valExplain,
9
- "tagId": data.tagId
10
- }, {
11
- "key": "测点名称",
12
- "value": data.tagName
13
- }];
14
- }
15
- export function setKpiAddrData(data) {
16
- return [{
17
- "key": "kpiAddr",
18
- "value": data.kpiId + '_' + data.kpiAddr,
19
- "isControlDis": data.isControlDis,
20
- "type": data.tagType
21
- }, {
22
- "key": "指标名称",
23
- "value": data.kpiName
24
- }];
25
- }
26
- export function setAssetIdData(data) {
27
- return [{
28
- "key": "assetId",
29
- "value": data.id
30
- }, {
31
- "key": "资产名称",
32
- "value": data.name
33
- }];
34
- }
35
- export function setAreaIdData(data) {
36
- return [{
37
- "key": "areaId",
38
- "value": data.id
39
- }, {
40
- "key": "区域名称",
41
- "value": data.name
42
- }];
43
- }
44
- export function setThreeCategoryIdData(pen, data) {
45
- let params = [];
46
- const hasThreeCategoryId = pen.data.find((tc) => {
47
- return tc.key === 'threeCategoryId' && tc.value.includes(data.threeCategoryId);
48
- });
49
- if(!hasThreeCategoryId) params = [{
50
- "key": "threeCategoryId",
51
- "value": data.threeCategoryId
52
- }];
53
- return params;
54
- }
@@ -1,7 +1,8 @@
1
- import { Node } from '../models';
2
- import { visualization2DStore } from '../store';
1
+ import { Node } from '../models/node';
2
+ // @ts-ignore
3
+ import { TopologyData } from 'dcim-topology/core'
3
4
  export declare let DomElements: {};
4
- export declare function createChildrenDivByElementId(node: Node, data?: visualization2DStore): HTMLDivElement;
5
- export declare function setStyleForElementIdDiv(node: Node, elem: HTMLElement, data: visualization2DStore): void;
5
+ export declare function createChildrenDivByElementId(node: Node, data?: TopologyData): HTMLDivElement;
6
+ export declare function setStyleForElementIdDiv(node: Node, elem: HTMLElement, data: TopologyData): void;
6
7
  export declare function createDiv(node: Node): HTMLDivElement;
7
8
  export declare function loadJS(url: string, callback?: () => void, render?: boolean): void;
@@ -1,9 +1,7 @@
1
1
  import { Store } from 'le5le-store';
2
- import { Lock } from '../models'
3
- import {commonStore} from '../store';
2
+ import { Lock } from 'dcim-topology/core/src/models/status'
4
3
  export let DomElements = {};
5
4
  export function createChildrenDivByElementId(node, data) {
6
- if(!data) data = commonStore[node.TID].data;
7
5
  if (!DomElements[node.id]) {
8
6
  DomElements[node.id] = document.getElementById(node.id);
9
7
  if (DomElements[node.id]) {
@@ -1,6 +1,5 @@
1
1
  import { ptInPolyXY } from './math';
2
2
  import { moveDataType, downDataType } from './construction'
3
- import { Node } from '../models'
4
3
  // 执行window函数
5
4
  export function omouseEventPrototDoWindowFn (eventNode, node) {
6
5
 
@@ -19,16 +18,8 @@ export function mousMoveFun(type, pos, data) {
19
18
 
20
19
  for (var _i = 0, _a = data; _i < _a.length; _i++) {
21
20
  var item = _a[_i];
22
- //const isPoint = ptInPolyXY(pos, item.rotatedAnchors);
23
- let isInPointNode = null;
24
- if(item.name === 'arbitraryGraph') {
25
- // 任意多边形通过点获取区域
26
- isInPointNode = ptInPolyXY(pos, item.rotatedAnchors);
27
- }else {
28
- if(!(item instanceof Node)) item = new Node(item);
29
- isInPointNode = item.hit(pos);
30
- }
31
- if(isInPointNode) {
21
+ const isPoint = ptInPolyXY(pos, item.rotatedAnchors);
22
+ if(isPoint) {
32
23
  params.hoverNode = item;
33
24
  params.order = _i;
34
25
  }
@@ -52,7 +43,7 @@ export function mousDownFun(type, eventNode) {
52
43
  if(action === 3) {
53
44
  params.eventType = downDataType.Window; // 打开会话窗口
54
45
  }else if(action === 7){
55
- params.eventType = downDataType.Showhide; // 显示/隐藏
46
+ params.eventType = downDataType.Showhide; // 链接跳转
56
47
  params.value = eventNode.value;
57
48
  }else if(action === 8){
58
49
  params.eventType = downDataType.Tabswitch; // Tab切换
@@ -1,2 +1,2 @@
1
- import { Node } from '../../../core';
1
+ import { Node } from 'dcim-topology/core';
2
2
  export declare function flowCommentAnchors(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 flowCommentAnchors(node) {
3
3
  node.anchors.push(new Point(node.rect.x, node.rect.y + node.rect.height / 2, Direction.Left));
4
4
  }
@@ -1,2 +1,2 @@
1
- import { Node } from '../../../core';
1
+ import { Node } from 'dcim-topology/core';
2
2
  export declare function flowComment(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 flowDataAnchors(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 flowDataAnchors(node) {
3
3
  node.anchors.push(new Point(node.rect.x + node.rect.width / 14, node.rect.y + node.rect.height / 2, Direction.Left));
4
4
  node.anchors.push(new Point(node.rect.x + (node.rect.width * 4) / 7, 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 flowData(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 flowDataIconRect(node: Node): void;
3
3
  export declare function flowDataTextRect(node: Node): void;
@@ -1,4 +1,4 @@
1
- import { Rect } from '../../../core';
1
+ import { Rect } from 'dcim-topology/core';
2
2
  export function flowDataIconRect(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 flowDb(ctx: CanvasRenderingContext2D, node: Node): void;
@@ -1,4 +1,4 @@
1
1
  // @ts-ignore
2
- import { Node } from '../../../core';
2
+ import { Node } from 'dcim-topology/core';
3
3
  export declare function flowDbIconRect(node: Node): void;
4
4
  export declare function flowDbTextRect(node: Node): void;
@@ -1,4 +1,4 @@
1
- import { Rect } from '../../../core';
1
+ import { Rect } from 'dcim-topology/core';
2
2
  export function flowDbIconRect(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 flowDisplayAnchors(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 flowDisplayAnchors(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.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 flowDisplay(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 flowDisplayIconRect(node: Node): void;
3
3
  export declare function flowDisplayTextRect(node: Node): void;
@@ -1,4 +1,4 @@
1
- import { Rect } from '../../../core';
1
+ import { Rect } from 'dcim-topology/core';
2
2
  export function flowDisplayIconRect(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 flowDocumentAnchors(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 flowDocumentAnchors(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.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 flowDocument(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 flowDocumentIconRect(node: Node): void;
3
3
  export declare function flowDocumentTextRect(node: Node): void;
@@ -1,4 +1,4 @@
1
- import { Rect } from '../../../core';
1
+ import { Rect } from 'dcim-topology/core';
2
2
  export function flowDocumentIconRect(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 flowExternStorageAnchors(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 flowExternStorageAnchors(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.x + (node.rect.width * 8) / 15, 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 flowExternStorage(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 flowExternStorageIconRect(node: Node): void;
3
3
  export declare function flowExternStorageTextRect(node: Node): void;
@@ -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.3",
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,9 +0,0 @@
1
- import { Pen } from '../models';
2
- // @ts-ignore
3
- export const commonStore: {
4
- canvasDraws: {
5
- [key: string]: (ctx: CanvasRenderingContext2D, pen: Pen) => void;
6
- };
7
- anchors: { [key: string]: (pen: Pen) => void };
8
- htmlElements: { [key: string]: HTMLDivElement }; // html元素
9
- };
@@ -1,5 +0,0 @@
1
- export var commonStore = {
2
- canvasDraws: {},
3
- anchors: {},
4
- htmlElements: {}
5
- };