dcim-topology2d 2.2.0 → 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.
- package/activity-diagram/src/final/final.d.ts +1 -1
 - package/activity-diagram/src/final/final.rect.d.ts +1 -1
 - package/activity-diagram/src/final/final.rect.js +1 -1
 - package/activity-diagram/src/fork/fork.anchor.d.ts +1 -1
 - package/activity-diagram/src/fork/fork.anchor.js +1 -1
 - package/activity-diagram/src/fork/fork.d.ts +1 -1
 - package/activity-diagram/src/fork/fork.rect.d.ts +1 -1
 - package/activity-diagram/src/fork/fork.rect.js +1 -1
 - package/activity-diagram/src/register.js +1 -1
 - package/activity-diagram/src/swimlaneH/swimlaneH.d.ts +1 -1
 - package/activity-diagram/src/swimlaneH/swimlaneH.rect.d.ts +1 -1
 - package/activity-diagram/src/swimlaneH/swimlaneH.rect.js +1 -1
 - package/activity-diagram/src/swimlaneV/swimlaneV.d.ts +1 -1
 - package/activity-diagram/src/swimlaneV/swimlaneV.rect.d.ts +1 -1
 - package/activity-diagram/src/swimlaneV/swimlaneV.rect.js +1 -1
 - package/chart-diagram/index.d.ts +1 -3
 - package/chart-diagram/index.js +1 -2
 - package/chart-diagram/src/echarts/index.d.ts +2 -1
 - package/chart-diagram/src/echarts/index.js +104 -112
 - package/chart-diagram/src/register.js +8 -9
 - package/class-diagram/src/class/class.d.ts +1 -1
 - package/class-diagram/src/class/class.rect.d.ts +1 -1
 - package/class-diagram/src/class/class.rect.js +1 -1
 - package/class-diagram/src/register.js +1 -1
 - package/core/index.d.ts +0 -2
 - package/core/index.js +0 -2
 - package/core/src/activeLayer.d.ts +10 -2
 - package/core/src/activeLayer.js +47 -42
 - package/core/src/animateLayer.d.ts +7 -3
 - package/core/src/animateLayer.js +12 -10
 - package/core/src/calling.d.ts +4 -1
 - package/core/src/calling.js +41 -43
 - package/core/src/canvas.d.ts +6 -1
 - package/core/src/canvas.js +21 -22
 - package/core/src/common.d.ts +7 -6
 - package/core/src/common.js +675 -343
 - package/core/src/core.d.ts +4 -5
 - package/core/src/core.js +385 -536
 - package/core/src/divLayer.d.ts +36 -2
 - package/core/src/divLayer.js +305 -33
 - package/core/src/healps/changeData.d.ts +2 -1
 - package/core/src/healps/changeData.js +100 -86
 - package/core/src/hoverLayer.d.ts +9 -2
 - package/core/src/hoverLayer.js +34 -31
 - package/core/src/middles/default.d.ts +3 -1
 - package/core/src/middles/default.js +51 -63
 - package/core/src/middles/index.js +2 -3
 - package/core/src/middles/nodes/arbitrarygraph.js +9 -11
 - package/core/src/middles/nodes/pentagon.rect.js +1 -1
 - package/core/src/middles/nodes/rectangle.rect.js +1 -1
 - package/core/src/models/data.d.ts +26 -0
 - package/core/src/models/data.js +77 -0
 - package/core/src/models/data.js.map +1 -0
 - package/core/src/models/index.d.ts +1 -0
 - package/core/src/models/index.js +1 -0
 - package/core/src/models/line.js +7 -7
 - package/core/src/models/node.d.ts +0 -10
 - package/core/src/models/node.js +101 -148
 - package/core/src/models/pen.js +67 -27
 - package/core/src/models/rect.js +2 -2
 - package/core/src/mqtt.d.ts +14 -0
 - package/core/src/mqtt.js +82 -0
 - package/core/src/mqtt.js.map +1 -0
 - package/core/src/offscreen.d.ts +4 -1
 - package/core/src/offscreen.js +24 -26
 - package/core/src/options.d.ts +1 -3
 - package/core/src/options.js +0 -2
 - package/core/src/poll.js +39 -0
 - package/core/src/preview.d.ts +13 -2
 - package/core/src/preview.js +43 -144
 - package/core/src/renderLayer.d.ts +9 -11
 - package/core/src/renderLayer.js +61 -60
 - package/core/src/socket.d.ts +10 -0
 - package/core/src/socket.js +51 -0
 - package/core/src/socket.js.map +1 -0
 - package/core/src/utils/canvas.js +1 -1
 - package/core/src/utils/construction.d.ts +3 -36
 - package/core/src/utils/construction.js +1 -29
 - package/core/src/utils/conversion.d.ts +0 -15
 - package/core/src/utils/conversion.js +0 -319
 - package/core/src/utils/dom.d.ts +8 -0
 - package/core/src/utils/dom.js +67 -0
 - package/core/src/utils/dom.js.map +1 -0
 - package/core/src/utils/index.d.ts +1 -2
 - package/core/src/utils/index.js +1 -2
 - package/core/src/utils/onmousevent.d.ts +0 -3
 - package/core/src/utils/onmousevent.js +10 -42
 - package/flow-diagram/src/comment/comment.anchor.d.ts +1 -1
 - package/flow-diagram/src/comment/comment.anchor.js +1 -1
 - package/flow-diagram/src/comment/comment.d.ts +1 -1
 - package/flow-diagram/src/data/data.anchor.d.ts +1 -1
 - package/flow-diagram/src/data/data.anchor.js +1 -1
 - package/flow-diagram/src/data/data.d.ts +1 -1
 - package/flow-diagram/src/data/data.rect.d.ts +1 -1
 - package/flow-diagram/src/data/data.rect.js +1 -1
 - package/flow-diagram/src/db/db.d.ts +1 -1
 - package/flow-diagram/src/db/db.rect.d.ts +1 -1
 - package/flow-diagram/src/db/db.rect.js +1 -1
 - package/flow-diagram/src/display/display.anchor.d.ts +1 -1
 - package/flow-diagram/src/display/display.anchor.js +1 -1
 - package/flow-diagram/src/display/display.d.ts +1 -1
 - package/flow-diagram/src/display/display.rect.d.ts +1 -1
 - package/flow-diagram/src/display/display.rect.js +1 -1
 - package/flow-diagram/src/document/document.anchor.d.ts +1 -1
 - package/flow-diagram/src/document/document.anchor.js +1 -1
 - package/flow-diagram/src/document/document.d.ts +1 -1
 - package/flow-diagram/src/document/document.rect.d.ts +1 -1
 - package/flow-diagram/src/document/document.rect.js +1 -1
 - package/flow-diagram/src/externStorage/externStorage.anchor.d.ts +1 -1
 - package/flow-diagram/src/externStorage/externStorage.anchor.js +1 -1
 - package/flow-diagram/src/externStorage/externStorage.d.ts +1 -1
 - package/flow-diagram/src/externStorage/externStorage.rect.d.ts +1 -1
 - package/flow-diagram/src/externStorage/externStorage.rect.js +1 -1
 - package/flow-diagram/src/internalStorage/internalStorage.d.ts +1 -1
 - package/flow-diagram/src/internalStorage/internalStorage.rect.d.ts +1 -1
 - package/flow-diagram/src/internalStorage/internalStorage.rect.js +1 -1
 - package/flow-diagram/src/manually/manually.anchor.d.ts +1 -1
 - package/flow-diagram/src/manually/manually.anchor.js +1 -1
 - package/flow-diagram/src/manually/manually.d.ts +1 -1
 - package/flow-diagram/src/manually/manually.rect.d.ts +1 -1
 - package/flow-diagram/src/manually/manually.rect.js +1 -1
 - package/flow-diagram/src/parallel/parallel.anchor.d.ts +1 -1
 - package/flow-diagram/src/parallel/parallel.anchor.js +1 -1
 - package/flow-diagram/src/parallel/parallel.d.ts +1 -1
 - package/flow-diagram/src/queue/queue.d.ts +1 -1
 - package/flow-diagram/src/queue/queue.rect.d.ts +1 -1
 - package/flow-diagram/src/queue/queue.rect.js +1 -1
 - package/flow-diagram/src/register.js +1 -1
 - package/flow-diagram/src/subprocess/subprocess.d.ts +1 -1
 - package/flow-diagram/src/subprocess/subprocess.rect.d.ts +1 -1
 - package/flow-diagram/src/subprocess/subprocess.rect.js +1 -1
 - package/layout/src/align.d.ts +1 -1
 - package/layout/src/align.js +1 -1
 - package/layout/src/layout.d.ts +1 -1
 - package/layout/src/layout.js +1 -1
 - package/myShape-diagram/{index.js → myShape.js} +1 -4
 - package/package.json +1 -1
 - package/sequence-diagram/src/focus/focus.anchor.d.ts +1 -1
 - package/sequence-diagram/src/focus/focus.anchor.js +1 -1
 - package/sequence-diagram/src/focus/focus.d.ts +1 -1
 - package/sequence-diagram/src/focus/focus.rect.d.ts +1 -1
 - package/sequence-diagram/src/focus/focus.rect.js +1 -1
 - package/sequence-diagram/src/lifeline/lifeline.anchor.d.ts +1 -1
 - package/sequence-diagram/src/lifeline/lifeline.anchor.js +1 -1
 - package/sequence-diagram/src/lifeline/lifeline.d.ts +1 -1
 - package/sequence-diagram/src/lifeline/lifeline.rect.d.ts +1 -1
 - package/sequence-diagram/src/lifeline/lifeline.rect.js +1 -1
 - package/sequence-diagram/src/register.js +1 -1
 - package/chart-diagram/src/utils/changeOptions.d.ts +0 -8
 - package/chart-diagram/src/utils/changeOptions.js +0 -267
 - package/chart-diagram/src/utils/conversion.d.ts +0 -19
 - package/chart-diagram/src/utils/conversion.js +0 -560
 - package/chart-diagram/src/utils/drawGraphic.d.ts +0 -3
 - package/chart-diagram/src/utils/drawGraphic.js +0 -97
 - package/chart-diagram/src/utils/formatter.d.ts +0 -1
 - package/chart-diagram/src/utils/formatter.js +0 -206
 - package/chart-diagram/src/utils/index.d.ts +0 -5
 - package/chart-diagram/src/utils/index.js +0 -5
 - package/chart-diagram/src/utils/render.d.ts +0 -8
 - package/chart-diagram/src/utils/render.js +0 -219
 - package/chart-diagram/src/utils/surfaceParametricConversion.d.ts +0 -3
 - package/chart-diagram/src/utils/surfaceParametricConversion.js +0 -252
 - package/core/src/element/common.d.ts +0 -6
 - package/core/src/element/common.js +0 -63
 - package/core/src/element/datePicker.d.ts +0 -3
 - package/core/src/element/datePicker.js +0 -44
 - package/core/src/element/iframe.d.ts +0 -3
 - package/core/src/element/iframe.js +0 -12
 - package/core/src/element/index.d.ts +0 -5
 - package/core/src/element/index.js +0 -6
 - package/core/src/element/select.d.ts +0 -11
 - package/core/src/element/select.js +0 -273
 - package/core/src/element/tab.d.ts +0 -1
 - package/core/src/element/tab.js +0 -20
 - package/core/src/element/time.d.ts +0 -3
 - package/core/src/element/time.js +0 -44
 - package/core/src/middles/arrows/index.d.ts +0 -4
 - package/core/src/middles/arrows/index.js +0 -5
 - package/core/src/middles/lines/index.d.ts +0 -4
 - package/core/src/middles/lines/index.js +0 -5
 - package/core/src/middles/nodes/formDatePicker.d.ts +0 -2
 - package/core/src/middles/nodes/formDatePicker.js +0 -107
 - package/core/src/middles/nodes/formoverflow.js +0 -61
 - package/core/src/middles/nodes/formselect.d.ts +0 -2
 - package/core/src/middles/nodes/formselect.js +0 -111
 - package/core/src/middles/nodes/iframe.d.ts +0 -2
 - package/core/src/middles/nodes/iframe.js +0 -29
 - package/core/src/middles/nodes/index.d.ts +0 -51
 - package/core/src/middles/nodes/index.js +0 -53
 - package/core/src/middles/nodes/switchs.d.ts +0 -2
 - package/core/src/middles/nodes/switchs.js +0 -46
 - package/core/src/middles/nodes/time.d.ts +0 -2
 - package/core/src/middles/nodes/time.js +0 -98
 - package/core/src/store/common.d.ts +0 -9
 - package/core/src/store/common.js +0 -5
 - package/core/src/store/data.d.ts +0 -196
 - package/core/src/store/data.js +0 -193
 - package/core/src/store/index.d.ts +0 -2
 - package/core/src/store/index.js +0 -2
 - package/core/src/utils/assignment.d.ts +0 -7
 - package/core/src/utils/assignment.js +0 -216
 - package/core/src/utils/params.d.ts +0 -3
 - package/core/src/utils/params.js +0 -136
 - package/static/echartsDefaultData.js +0 -178
 - package/static/element.js +0 -14
 - package/static/form.js +0 -11
 - package/static/index.js +0 -3
 - package/store/actions.js +0 -1
 - package/store/clear.js +0 -10
 - package/store/default.js +0 -22
 - package/store/index.js +0 -3
 - package/style/common.css +0 -15
 - package/style/datePicker.css +0 -44
 - package/style/editor.css +0 -16
 - package/style/index.css +0 -5
 - package/style/select.css +0 -143
 - /package/myShape-diagram/{index.ts → myShape.ts} +0 -0
 
| 
         @@ -1,2 +1,2 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            import { Node } from ' 
     | 
| 
      
 1 
     | 
    
         
            +
            import { Node } from 'dcim-topology/core';
         
     | 
| 
       2 
2 
     | 
    
         
             
            export declare function activityFinal(ctx: CanvasRenderingContext2D, node: Node): void;
         
     | 
| 
         @@ -1,4 +1,4 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            import { Point, Direction } from ' 
     | 
| 
      
 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 ' 
     | 
| 
      
 1 
     | 
    
         
            +
            import { Node } from 'dcim-topology/core';
         
     | 
| 
       2 
2 
     | 
    
         
             
            export declare function fork(ctx: CanvasRenderingContext2D, node: Node): void;
         
     | 
| 
         @@ -1,4 +1,4 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            import { registerNode } from ' 
     | 
| 
      
 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 ' 
     | 
| 
      
 1 
     | 
    
         
            +
            import { Node } from 'dcim-topology/core';
         
     | 
| 
       2 
2 
     | 
    
         
             
            export declare function swimlaneH(ctx: CanvasRenderingContext2D, node: Node): void;
         
     | 
| 
         @@ -1,2 +1,2 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            import { Node } from ' 
     | 
| 
      
 1 
     | 
    
         
            +
            import { Node } from 'dcim-topology/core';
         
     | 
| 
       2 
2 
     | 
    
         
             
            export declare function swimlaneV(ctx: CanvasRenderingContext2D, node: Node): void;
         
     | 
    
        package/chart-diagram/index.d.ts
    CHANGED
    
    
    
        package/chart-diagram/index.js
    CHANGED
    
    
| 
         @@ -1,112 +1,104 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            import {s8, createDiv, rectangle 
     | 
| 
       2 
     | 
    
         
            -
             
     | 
| 
       3 
     | 
    
         
            -
             
     | 
| 
       4 
     | 
    
         
            -
                 
     | 
| 
       5 
     | 
    
         
            -
                 
     | 
| 
       6 
     | 
    
         
            -
                 
     | 
| 
       7 
     | 
    
         
            -
                 
     | 
| 
       8 
     | 
    
         
            -
                 
     | 
| 
       9 
     | 
    
         
            -
                 
     | 
| 
       10 
     | 
    
         
            -
             
     | 
| 
       11 
     | 
    
         
            -
                 
     | 
| 
       12 
     | 
    
         
            -
                 
     | 
| 
       13 
     | 
    
         
            -
             
     | 
| 
       14 
     | 
    
         
            -
             
     | 
| 
       15 
     | 
    
         
            -
             
     | 
| 
       16 
     | 
    
         
            -
             
     | 
| 
       17 
     | 
    
         
            -
                 
     | 
| 
       18 
     | 
    
         
            -
                if (! 
     | 
| 
       19 
     | 
    
         
            -
             
     | 
| 
       20 
     | 
    
         
            -
                 
     | 
| 
       21 
     | 
    
         
            -
                 
     | 
| 
       22 
     | 
    
         
            -
                 
     | 
| 
       23 
     | 
    
         
            -
             
     | 
| 
       24 
     | 
    
         
            -
             
     | 
| 
       25 
     | 
    
         
            -
             
     | 
| 
       26 
     | 
    
         
            -
             
     | 
| 
       27 
     | 
    
         
            -
                     
     | 
| 
       28 
     | 
    
         
            -
             
     | 
| 
       29 
     | 
    
         
            -
             
     | 
| 
       30 
     | 
    
         
            -
                     
     | 
| 
       31 
     | 
    
         
            -
             
     | 
| 
       32 
     | 
    
         
            -
             
     | 
| 
       33 
     | 
    
         
            -
                     
     | 
| 
       34 
     | 
    
         
            -
             
     | 
| 
       35 
     | 
    
         
            -
             
     | 
| 
       36 
     | 
    
         
            -
                    node. 
     | 
| 
       37 
     | 
    
         
            -
             
     | 
| 
       38 
     | 
    
         
            -
             
     | 
| 
       39 
     | 
    
         
            -
             
     | 
| 
       40 
     | 
    
         
            -
                     
     | 
| 
       41 
     | 
    
         
            -
             
     | 
| 
       42 
     | 
    
         
            -
             
     | 
| 
       43 
     | 
    
         
            -
             
     | 
| 
       44 
     | 
    
         
            -
                     
     | 
| 
       45 
     | 
    
         
            -
                         
     | 
| 
       46 
     | 
    
         
            -
             
     | 
| 
       47 
     | 
    
         
            -
             
     | 
| 
       48 
     | 
    
         
            -
             
     | 
| 
       49 
     | 
    
         
            -
             
     | 
| 
       50 
     | 
    
         
            -
             
     | 
| 
       51 
     | 
    
         
            -
             
     | 
| 
       52 
     | 
    
         
            -
             
     | 
| 
       53 
     | 
    
         
            -
             
     | 
| 
       54 
     | 
    
         
            -
             
     | 
| 
       55 
     | 
    
         
            -
             
     | 
| 
       56 
     | 
    
         
            -
             
     | 
| 
       57 
     | 
    
         
            -
             
     | 
| 
       58 
     | 
    
         
            -
             
     | 
| 
       59 
     | 
    
         
            -
             
     | 
| 
       60 
     | 
    
         
            -
             
     | 
| 
       61 
     | 
    
         
            -
             
     | 
| 
       62 
     | 
    
         
            -
             
     | 
| 
       63 
     | 
    
         
            -
             
     | 
| 
       64 
     | 
    
         
            -
             
     | 
| 
       65 
     | 
    
         
            -
             
     | 
| 
       66 
     | 
    
         
            -
             
     | 
| 
       67 
     | 
    
         
            -
             
     | 
| 
       68 
     | 
    
         
            -
             
     | 
| 
       69 
     | 
    
         
            -
             
     | 
| 
       70 
     | 
    
         
            -
             
     | 
| 
       71 
     | 
    
         
            -
             
     | 
| 
       72 
     | 
    
         
            -
                             
     | 
| 
       73 
     | 
    
         
            -
             
     | 
| 
       74 
     | 
    
         
            -
             
     | 
| 
       75 
     | 
    
         
            -
                             
     | 
| 
       76 
     | 
    
         
            -
                             
     | 
| 
       77 
     | 
    
         
            -
                             
     | 
| 
       78 
     | 
    
         
            -
                             
     | 
| 
       79 
     | 
    
         
            -
                             
     | 
| 
       80 
     | 
    
         
            -
                             
     | 
| 
       81 
     | 
    
         
            -
                             
     | 
| 
       82 
     | 
    
         
            -
                             
     | 
| 
       83 
     | 
    
         
            -
                             
     | 
| 
       84 
     | 
    
         
            -
                             
     | 
| 
       85 
     | 
    
         
            -
                            //  
     | 
| 
       86 
     | 
    
         
            -
                            if 
     | 
| 
       87 
     | 
    
         
            -
             
     | 
| 
       88 
     | 
    
         
            -
             
     | 
| 
       89 
     | 
    
         
            -
             
     | 
| 
       90 
     | 
    
         
            -
                             
     | 
| 
       91 
     | 
    
         
            -
             
     | 
| 
       92 
     | 
    
         
            -
                             
     | 
| 
       93 
     | 
    
         
            -
             
     | 
| 
       94 
     | 
    
         
            -
             
     | 
| 
       95 
     | 
    
         
            -
             
     | 
| 
       96 
     | 
    
         
            -
             
     | 
| 
       97 
     | 
    
         
            -
             
     | 
| 
       98 
     | 
    
         
            -
             
     | 
| 
       99 
     | 
    
         
            -
             
     | 
| 
       100 
     | 
    
         
            -
             
     | 
| 
       101 
     | 
    
         
            -
             
     | 
| 
       102 
     | 
    
         
            -
             
     | 
| 
       103 
     | 
    
         
            -
             
     | 
| 
       104 
     | 
    
         
            -
             
     | 
| 
       105 
     | 
    
         
            -
                        // echarts 数据渲染更新
         
     | 
| 
       106 
     | 
    
         
            -
                        setMapDataOptions(option, currentStore.echartsOptionsPool[node.id].data);
         
     | 
| 
       107 
     | 
    
         
            -
                        node.elementRendered = true;
         
     | 
| 
       108 
     | 
    
         
            -
                    })
         
     | 
| 
       109 
     | 
    
         
            -
                }
         
     | 
| 
       110 
     | 
    
         
            -
            }
         
     | 
| 
       111 
     | 
    
         
            -
             
     | 
| 
       112 
     | 
    
         
            -
            //# 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 ' 
     | 
| 
       2 
     | 
    
         
            -
            import { echarts } from './echarts';
         
     | 
| 
       3 
     | 
    
         
            -
            import  
     | 
| 
       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 
     | 
    
         
            -
                 
     | 
| 
       7 
     | 
    
         
            -
                 
     | 
| 
       8 
     | 
    
         
            -
             
     | 
| 
       9 
     | 
    
         
            -
             
     | 
| 
       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,4 +1,4 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            import { Node } from ' 
     | 
| 
      
 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 { registerNode } from ' 
     | 
| 
      
 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
    
    
    
        package/core/index.js
    CHANGED
    
    | 
         @@ -6,8 +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 
     | 
    
         
            -
            export * from './src/element';
         
     | 
| 
       11 
9 
     | 
    
         
             
            //# sourceMappingURL=index.js.map
         
     | 
| 
       12 
10 
     | 
    
         
             
            import axios from 'axios'
         
     | 
| 
       13 
11 
     | 
    
         
             
            if(axios.defaults.headers.common) axios.defaults.headers.common['Authorization'] = getToken();
         
     | 
| 
         @@ -1,7 +1,15 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            import {  
     | 
| 
      
 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[];
         
     |