strategy-panel 1.0.1 → 1.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/.fatherrc.ts +11 -26
- package/.umirc.ts +4 -0
- package/README.md +33 -33
- package/es/assets/decive.svg +1 -1
- package/es/assets/hand.svg +1 -1
- package/es/assets/lock.svg +8 -0
- package/es/components/canvas/component-tree-panel/category-tree/category-type.d.ts +1 -0
- package/es/{common/graph-common → components/canvas/component-tree-panel/category-tree}/category-type.js +28 -12
- package/es/{pages → components/canvas}/component-tree-panel/category-tree/index.d.ts +17 -16
- package/es/{pages → components/canvas}/component-tree-panel/category-tree/index.js +14 -14
- package/es/{pages → components/canvas}/component-tree-panel/category-tree/index.less +36 -36
- package/es/{pages → components/canvas}/component-tree-panel/category-tree/node-title.d.ts +12 -12
- package/es/{pages → components/canvas}/component-tree-panel/category-tree/node-title.js +5 -3
- package/es/{pages → components/canvas}/component-tree-panel/index.d.ts +17 -17
- package/es/{pages → components/canvas}/component-tree-panel/index.js +1 -0
- package/es/{pages → components/canvas}/component-tree-panel/index.less +1 -0
- package/es/{pages → components/canvas}/config-panel/components/condition-configuration/configure-modal/data-origin.d.ts +49 -49
- package/es/{pages → components/canvas}/config-panel/components/condition-configuration/configure-modal/data-origin.js +26 -34
- package/es/{pages → components/canvas}/config-panel/components/condition-configuration/configure-modal/index.d.ts +11 -11
- package/es/{pages → components/canvas}/config-panel/components/condition-configuration/configure-modal/index.js +15 -23
- package/es/{pages → components/canvas}/config-panel/components/condition-configuration/configure-modal/style.less +1 -1
- package/es/{pages → components/canvas}/config-panel/components/condition-configuration/cross-line.d.ts +9 -9
- package/es/{pages → components/canvas}/config-panel/components/condition-configuration/cross-line.js +6 -10
- package/es/{pages → components/canvas}/config-panel/components/condition-configuration/index.d.ts +10 -9
- package/es/{pages → components/canvas}/config-panel/components/condition-configuration/index.js +17 -13
- package/es/{pages → components/canvas}/config-panel/components/condition-configuration/style.less +74 -74
- package/es/{pages → components/canvas}/config-panel/components/time-trigger/components/cycle-time.d.ts +9 -9
- package/es/{pages → components/canvas}/config-panel/components/time-trigger/components/cycle-time.js +24 -33
- package/es/{pages → components/canvas}/config-panel/components/time-trigger/components/time-horizon.d.ts +10 -10
- package/es/{pages → components/canvas}/config-panel/components/time-trigger/components/time-horizon.js +18 -28
- package/es/{pages → components/canvas}/config-panel/components/time-trigger/delay-time.d.ts +9 -9
- package/es/components/canvas/config-panel/components/time-trigger/effective-time.d.ts +7 -0
- package/es/components/canvas/config-panel/components/time-trigger/effective-time.js +43 -0
- package/es/{pages → components/canvas}/config-panel/components/time-trigger/index.d.ts +9 -8
- package/es/{pages → components/canvas}/config-panel/components/time-trigger/index.js +18 -17
- package/es/{pages → components/canvas}/config-panel/components/time-trigger/interval-time.d.ts +9 -9
- package/es/{pages → components/canvas}/config-panel/components/time-trigger/interval-time.js +4 -8
- package/es/{pages → components/canvas}/config-panel/components/time-trigger/persistent-time.d.ts +9 -9
- package/es/components/canvas/config-panel/components/time-trigger/section-Detail.d.ts +10 -0
- package/es/components/canvas/config-panel/components/time-trigger/section-Detail.js +125 -0
- package/es/components/canvas/config-panel/components/time-trigger/section-time.d.ts +9 -0
- package/es/components/canvas/config-panel/components/time-trigger/section-time.js +81 -0
- package/es/{pages → components/canvas}/config-panel/components/time-trigger/timing-time.d.ts +9 -9
- package/es/{pages → components/canvas}/config-panel/components/time-trigger/timing-time.js +7 -11
- package/es/{pages → components/canvas}/config-panel/config-common.d.ts +38 -37
- package/es/{pages → components/canvas}/config-panel/config-common.js +9 -15
- package/es/{pages → components/canvas}/config-panel/index.d.ts +14 -13
- package/es/{pages → components/canvas}/config-panel/index.js +2 -2
- package/es/{pages → components/canvas}/config-panel/node-form.d.ts +23 -22
- package/es/{pages → components/canvas}/config-panel/node-form.js +14 -16
- package/es/{pages → components/canvas}/config-panel/style.less +90 -81
- package/es/{pages → components/canvas}/dag-canvas/canvas-content.d.ts +11 -10
- package/es/{pages → components/canvas}/dag-canvas/canvas-content.js +23 -12
- package/es/{pages → components/canvas}/dag-canvas/index.d.ts +23 -18
- package/es/{pages → components/canvas}/dag-canvas/index.js +5 -2
- package/es/{pages → components/canvas}/dag-canvas/preview.d.ts +10 -10
- package/es/components/canvas/dag-canvas/preview.js +53 -0
- package/es/{pages → components/canvas}/index.d.ts +48 -42
- package/es/{pages → components/canvas}/index.js +20 -10
- package/es/{pages → components/canvas}/index.less +2 -2
- package/es/{pages → components/canvas}/strategy-header/index.d.ts +48 -56
- package/es/components/canvas/strategy-header/index.js +210 -0
- package/es/{pages → components/canvas}/strategy-header/style.less +4 -3
- package/es/{pages → components/canvas}/strategy-header/theme-switch/index.d.ts +4 -4
- package/es/{pages → components/canvas}/strategy-header/theme-switch/index.js +2 -3
- package/es/index.d.ts +9 -8
- package/es/index.js +8 -7
- package/es/packages/graph-canvas/graph-common.d.ts +19 -0
- package/es/packages/graph-canvas/graph-common.js +19 -0
- package/es/packages/graph-canvas/graph-model/edge/group-edge/index.d.ts +4 -0
- package/es/packages/graph-canvas/graph-model/edge/group-edge/index.js +63 -0
- package/es/packages/graph-canvas/graph-model/edge/index.d.ts +2 -0
- package/es/packages/graph-canvas/graph-model/edge/index.js +2 -0
- package/es/packages/graph-canvas/graph-model/node/application-node/application-element.d.ts +9 -0
- package/es/packages/graph-canvas/graph-model/node/application-node/application-element.js +20 -0
- package/es/packages/graph-canvas/graph-model/node/application-node/application-element.less +17 -0
- package/es/packages/graph-canvas/graph-model/node/application-node/index.d.ts +7 -0
- package/es/{common/graph-common/shape/nodes/GroupNode.js → packages/graph-canvas/graph-model/node/application-node/index.js} +42 -22
- package/es/{common/graph-common/shape/nodes/CommonNode.d.ts → packages/graph-canvas/graph-model/node/common-node/index.d.ts} +7 -5
- package/es/{common/graph-common/shape/nodes/CommonNode.js → packages/graph-canvas/graph-model/node/common-node/index.js} +8 -7
- package/es/{common/graph-common/node-element → packages/graph-canvas/graph-model/node/common-node}/node-element.d.ts +9 -9
- package/es/{common/graph-common/node-element → packages/graph-canvas/graph-model/node/common-node}/node-element.js +16 -14
- package/es/{common/graph-common/node-element → packages/graph-canvas/graph-model/node/common-node}/node-element.less +4 -4
- package/es/{common/graph-common/node-element → packages/graph-canvas/graph-model/node/condition-node}/condition-element.d.ts +9 -9
- package/es/{common/graph-common/node-element → packages/graph-canvas/graph-model/node/condition-node}/condition-element.js +20 -15
- package/es/{common/graph-common/node-element → packages/graph-canvas/graph-model/node/condition-node}/condition-element.less +76 -81
- package/es/packages/graph-canvas/graph-model/node/condition-node/images/rhombus.svg +3 -0
- package/es/{common/graph-common/shape/nodes/ConditionJudgment.d.ts → packages/graph-canvas/graph-model/node/condition-node/index.d.ts} +5 -5
- package/es/{common/graph-common/shape/nodes/ConditionJudgment.js → packages/graph-canvas/graph-model/node/condition-node/index.js} +7 -6
- package/es/packages/graph-canvas/graph-model/node/index.d.ts +5 -0
- package/es/packages/graph-canvas/graph-model/node/index.js +5 -0
- package/es/packages/graph-canvas/graph-model/node/logical-node/images/AND.svg +11 -0
- package/es/packages/graph-canvas/graph-model/node/logical-node/images/OR.svg +11 -0
- package/es/packages/graph-canvas/graph-model/node/logical-node/images/XOR.svg +11 -0
- package/es/packages/graph-canvas/graph-model/node/logical-node/images/locking.svg +5 -0
- package/es/packages/graph-canvas/graph-model/node/logical-node/images/unlock.svg +5 -0
- package/es/packages/graph-canvas/graph-model/node/logical-node/index.d.ts +6 -0
- package/es/{common/graph-common/shape/nodes/LogicalNode.js → packages/graph-canvas/graph-model/node/logical-node/index.js} +15 -15
- package/es/packages/graph-canvas/graph-model/node/logical-node/logical-element.d.ts +9 -0
- package/es/{common/graph-common/node-element → packages/graph-canvas/graph-model/node/logical-node}/logical-element.js +36 -19
- package/es/{common/graph-common/node-element → packages/graph-canvas/graph-model/node/logical-node}/logical-element.less +4 -9
- package/es/packages/graph-canvas/graph-model/node/style.less +8 -0
- package/es/{common → packages/graph-canvas}/graph-utils/graph.d.ts +87 -83
- package/es/{common → packages/graph-canvas}/graph-utils/graph.js +8 -4
- package/es/{pages/rx-models/experiment-graph.d.ts → packages/graph-canvas/index.d.ts} +79 -82
- package/es/{pages/rx-models/experiment-graph.js → packages/graph-canvas/index.js} +285 -252
- package/es/packages/graph-canvas/node-types.d.ts +6 -0
- package/es/packages/graph-canvas/node-types.js +54 -0
- package/es/packages/graph-canvas/typings.d.ts +5 -0
- package/es/{common/constants → packages/graph-common}/global.d.ts +1 -1
- package/es/{common/constants → packages/graph-common}/graph.d.ts +12 -10
- package/es/{common/constants → packages/graph-common}/graph.js +4 -2
- package/es/{pages/rx-models → packages/graph-core}/graph-util.d.ts +182 -186
- package/es/{pages/rx-models → packages/graph-core}/graph-util.js +8 -15
- package/es/{pages/rx-models/graph-core.d.ts → packages/graph-core/index.d.ts} +96 -96
- package/es/{pages/rx-models/graph-core.js → packages/graph-core/index.js} +119 -87
- package/es/packages/graph-core/typing.d.ts +107 -0
- package/es/{common/graph-common → packages/graph-model}/connector/index.d.ts +1 -1
- package/es/packages/graph-model/connector/index.js +14 -0
- package/es/packages/graph-model/edge/edge.less +8 -0
- package/es/packages/graph-model/edge/index.d.ts +5 -0
- package/es/{common/graph-common/shape/edge.js → packages/graph-model/edge/index.js} +10 -61
- package/es/packages/graph-model/node/index.d.ts +7 -0
- package/es/{common/graph-common/shape/nodes/BaseNode.js → packages/graph-model/node/index.js} +12 -3
- package/es/{common/graph-common/node-element/common-element.less → packages/graph-model/node/node-basic.less} +1 -0
- package/es/{hooks → packages/hooks}/useObservableState.d.ts +3 -3
- package/es/packages/hooks/withMode.d.ts +3 -0
- package/es/packages/hooks/withMode.js +12 -0
- package/es/style/default.less +8 -0
- package/es/style/svgRaw.d.ts +1 -0
- package/es/style/svgRaw.js +1 -0
- package/es/typings.d.ts +2 -8
- package/es/utils/utils.d.ts +1 -1
- package/lib/assets/AND.svg +11 -0
- package/lib/assets/OR.svg +11 -0
- package/lib/assets/XOR.svg +11 -0
- package/lib/assets/add.svg +13 -0
- package/lib/assets/alarm.svg +11 -0
- package/lib/assets/application.svg +11 -0
- package/lib/assets/cancel.svg +13 -0
- package/lib/assets/check.svg +12 -0
- package/lib/assets/condition.svg +12 -0
- package/lib/assets/control.svg +11 -0
- package/lib/assets/decive.svg +11 -0
- package/lib/assets/delete.svg +11 -0
- package/lib/assets/device.svg +11 -0
- package/lib/assets/edit.svg +11 -0
- package/lib/assets/hand.svg +11 -0
- package/lib/assets/link.svg +11 -0
- package/lib/assets/lock.svg +8 -0
- package/lib/assets/logical.svg +12 -0
- package/lib/assets/notice.svg +11 -0
- package/lib/assets/order.svg +11 -0
- package/lib/assets/relation.svg +11 -0
- package/lib/assets/rhombus.svg +3 -0
- package/lib/assets/save.svg +13 -0
- package/lib/assets/time.svg +11 -0
- package/lib/assets/variate.svg +12 -0
- package/lib/components/canvas/component-tree-panel/category-tree/category-type.d.ts +1 -0
- package/lib/components/canvas/component-tree-panel/category-tree/category-type.js +111 -0
- package/lib/components/canvas/component-tree-panel/category-tree/index.d.ts +17 -0
- package/lib/components/canvas/component-tree-panel/category-tree/index.js +115 -0
- package/lib/components/canvas/component-tree-panel/category-tree/index.less +36 -0
- package/lib/components/canvas/component-tree-panel/category-tree/node-title.d.ts +12 -0
- package/lib/components/canvas/component-tree-panel/category-tree/node-title.js +75 -0
- package/lib/components/canvas/component-tree-panel/category-tree/node-title.less +113 -0
- package/lib/components/canvas/component-tree-panel/index.d.ts +17 -0
- package/lib/components/canvas/component-tree-panel/index.js +33 -0
- package/lib/components/canvas/component-tree-panel/index.less +52 -0
- package/lib/components/canvas/config-panel/components/condition-configuration/configure-modal/data-origin.d.ts +49 -0
- package/lib/components/canvas/config-panel/components/condition-configuration/configure-modal/data-origin.js +229 -0
- package/lib/components/canvas/config-panel/components/condition-configuration/configure-modal/index.d.ts +11 -0
- package/lib/components/canvas/config-panel/components/condition-configuration/configure-modal/index.js +187 -0
- package/lib/components/canvas/config-panel/components/condition-configuration/configure-modal/style.less +13 -0
- package/lib/components/canvas/config-panel/components/condition-configuration/cross-line.d.ts +9 -0
- package/lib/components/canvas/config-panel/components/condition-configuration/cross-line.js +57 -0
- package/lib/components/canvas/config-panel/components/condition-configuration/index.d.ts +10 -0
- package/lib/components/canvas/config-panel/components/condition-configuration/index.js +216 -0
- package/lib/components/canvas/config-panel/components/condition-configuration/style.less +74 -0
- package/lib/components/canvas/config-panel/components/time-trigger/components/cycle-time.d.ts +9 -0
- package/lib/components/canvas/config-panel/components/time-trigger/components/cycle-time.js +108 -0
- package/lib/components/canvas/config-panel/components/time-trigger/components/time-horizon.d.ts +10 -0
- package/lib/components/canvas/config-panel/components/time-trigger/components/time-horizon.js +78 -0
- package/lib/components/canvas/config-panel/components/time-trigger/delay-time.d.ts +9 -0
- package/lib/components/canvas/config-panel/components/time-trigger/delay-time.js +33 -0
- package/lib/components/canvas/config-panel/components/time-trigger/effective-time.d.ts +7 -0
- package/lib/components/canvas/config-panel/components/time-trigger/effective-time.js +58 -0
- package/lib/components/canvas/config-panel/components/time-trigger/index.d.ts +9 -0
- package/lib/components/canvas/config-panel/components/time-trigger/index.js +114 -0
- package/lib/components/canvas/config-panel/components/time-trigger/interval-time.d.ts +9 -0
- package/lib/components/canvas/config-panel/components/time-trigger/interval-time.js +63 -0
- package/lib/components/canvas/config-panel/components/time-trigger/persistent-time.d.ts +9 -0
- package/lib/components/canvas/config-panel/components/time-trigger/persistent-time.js +33 -0
- package/lib/components/canvas/config-panel/components/time-trigger/section-Detail.d.ts +10 -0
- package/lib/components/canvas/config-panel/components/time-trigger/section-Detail.js +140 -0
- package/lib/components/canvas/config-panel/components/time-trigger/section-time.d.ts +9 -0
- package/lib/components/canvas/config-panel/components/time-trigger/section-time.js +96 -0
- package/lib/components/canvas/config-panel/components/time-trigger/timing-time.d.ts +9 -0
- package/lib/components/canvas/config-panel/components/time-trigger/timing-time.js +65 -0
- package/lib/components/canvas/config-panel/config-common.d.ts +38 -0
- package/lib/components/canvas/config-panel/config-common.js +152 -0
- package/lib/components/canvas/config-panel/index.d.ts +14 -0
- package/lib/components/canvas/config-panel/index.js +68 -0
- package/lib/components/canvas/config-panel/node-form.d.ts +23 -0
- package/lib/components/canvas/config-panel/node-form.js +97 -0
- package/lib/components/canvas/config-panel/style.less +90 -0
- package/lib/components/canvas/dag-canvas/canvas-content.d.ts +11 -0
- package/lib/components/canvas/dag-canvas/canvas-content.js +130 -0
- package/lib/components/canvas/dag-canvas/canvas-content.less +5 -0
- package/lib/components/canvas/dag-canvas/index.d.ts +23 -0
- package/lib/components/canvas/dag-canvas/index.js +53 -0
- package/lib/components/canvas/dag-canvas/index.less +11 -0
- package/lib/components/canvas/dag-canvas/preview.d.ts +10 -0
- package/lib/components/canvas/dag-canvas/preview.js +73 -0
- package/lib/components/canvas/index.d.ts +48 -0
- package/lib/components/canvas/index.js +107 -0
- package/lib/components/canvas/index.less +50 -0
- package/lib/components/canvas/strategy-header/index.d.ts +48 -0
- package/lib/components/canvas/strategy-header/index.js +229 -0
- package/lib/components/canvas/strategy-header/style.less +23 -0
- package/lib/components/canvas/strategy-header/theme-switch/index.d.ts +4 -0
- package/lib/components/canvas/strategy-header/theme-switch/index.js +30 -0
- package/lib/components/canvas/strategy-header/theme-switch/style.less +11 -0
- package/lib/index.d.ts +9 -0
- package/lib/index.js +71 -0
- package/lib/packages/graph-canvas/graph-common.d.ts +19 -0
- package/lib/packages/graph-canvas/graph-common.js +27 -0
- package/lib/packages/graph-canvas/graph-model/edge/group-edge/edge.less +8 -0
- package/lib/packages/graph-canvas/graph-model/edge/group-edge/index.d.ts +4 -0
- package/lib/packages/graph-canvas/graph-model/edge/group-edge/index.js +74 -0
- package/lib/packages/graph-canvas/graph-model/edge/index.d.ts +2 -0
- package/lib/packages/graph-canvas/graph-model/edge/index.js +15 -0
- package/lib/packages/graph-canvas/graph-model/node/application-node/application-element.d.ts +9 -0
- package/lib/packages/graph-canvas/graph-model/node/application-node/application-element.js +31 -0
- package/lib/packages/graph-canvas/graph-model/node/application-node/application-element.less +17 -0
- package/lib/packages/graph-canvas/graph-model/node/application-node/index.d.ts +7 -0
- package/lib/packages/graph-canvas/graph-model/node/application-node/index.js +133 -0
- package/lib/packages/graph-canvas/graph-model/node/common-node/index.d.ts +7 -0
- package/lib/packages/graph-canvas/graph-model/node/common-node/index.js +133 -0
- package/lib/packages/graph-canvas/graph-model/node/common-node/node-element.d.ts +9 -0
- package/lib/packages/graph-canvas/graph-model/node/common-node/node-element.js +69 -0
- package/lib/packages/graph-canvas/graph-model/node/common-node/node-element.less +48 -0
- package/{es/common/graph-common/node-element/logical-element.d.ts → lib/packages/graph-canvas/graph-model/node/condition-node/condition-element.d.ts} +9 -9
- package/lib/packages/graph-canvas/graph-model/node/condition-node/condition-element.js +81 -0
- package/lib/packages/graph-canvas/graph-model/node/condition-node/condition-element.less +76 -0
- package/lib/packages/graph-canvas/graph-model/node/condition-node/images/rhombus.svg +3 -0
- package/{es/common/graph-common/shape/nodes/LogicalNode.d.ts → lib/packages/graph-canvas/graph-model/node/condition-node/index.d.ts} +5 -5
- package/lib/packages/graph-canvas/graph-model/node/condition-node/index.js +143 -0
- package/lib/packages/graph-canvas/graph-model/node/index.d.ts +5 -0
- package/lib/packages/graph-canvas/graph-model/node/index.js +39 -0
- package/lib/packages/graph-canvas/graph-model/node/logical-node/images/AND.svg +11 -0
- package/lib/packages/graph-canvas/graph-model/node/logical-node/images/OR.svg +11 -0
- package/lib/packages/graph-canvas/graph-model/node/logical-node/images/XOR.svg +11 -0
- package/lib/packages/graph-canvas/graph-model/node/logical-node/images/locking.svg +5 -0
- package/lib/packages/graph-canvas/graph-model/node/logical-node/images/unlock.svg +5 -0
- package/lib/packages/graph-canvas/graph-model/node/logical-node/index.d.ts +6 -0
- package/lib/packages/graph-canvas/graph-model/node/logical-node/index.js +143 -0
- package/lib/packages/graph-canvas/graph-model/node/logical-node/logical-element.d.ts +9 -0
- package/lib/packages/graph-canvas/graph-model/node/logical-node/logical-element.js +98 -0
- package/lib/packages/graph-canvas/graph-model/node/logical-node/logical-element.less +49 -0
- package/lib/packages/graph-canvas/graph-model/node/style.less +8 -0
- package/lib/packages/graph-canvas/graph-utils/graph.d.ts +87 -0
- package/lib/packages/graph-canvas/graph-utils/graph.js +124 -0
- package/lib/packages/graph-canvas/index.d.ts +79 -0
- package/lib/packages/graph-canvas/index.js +1292 -0
- package/lib/packages/graph-canvas/node-types.d.ts +6 -0
- package/lib/packages/graph-canvas/node-types.js +66 -0
- package/lib/packages/graph-canvas/typings.d.ts +5 -0
- package/lib/packages/graph-common/global.d.ts +1 -0
- package/lib/packages/graph-common/global.js +8 -0
- package/lib/packages/graph-common/graph.d.ts +12 -0
- package/lib/packages/graph-common/graph.js +37 -0
- package/lib/packages/graph-core/graph-util.d.ts +182 -0
- package/lib/packages/graph-core/graph-util.js +368 -0
- package/lib/packages/graph-core/index.d.ts +96 -0
- package/lib/packages/graph-core/index.js +798 -0
- package/lib/packages/graph-core/typing.d.ts +107 -0
- package/lib/packages/graph-model/connector/index.d.ts +1 -0
- package/lib/packages/graph-model/connector/index.js +17 -0
- package/lib/packages/graph-model/edge/edge.less +8 -0
- package/lib/packages/graph-model/edge/index.d.ts +5 -0
- package/lib/packages/graph-model/edge/index.js +73 -0
- package/lib/packages/graph-model/node/index.d.ts +7 -0
- package/lib/packages/graph-model/node/index.js +63 -0
- package/lib/packages/graph-model/node/node-basic.less +118 -0
- package/lib/packages/hooks/useObservableState.d.ts +3 -0
- package/lib/packages/hooks/useObservableState.js +55 -0
- package/lib/packages/hooks/withMode.d.ts +3 -0
- package/lib/packages/hooks/withMode.js +22 -0
- package/lib/style/basic.less +12 -0
- package/lib/style/default.less +10 -0
- package/lib/style/position.less +25 -0
- package/lib/style/svgRaw.d.ts +1 -0
- package/lib/style/svgRaw.js +8 -0
- package/lib/style/theme-light.less +7 -0
- package/lib/style/variable.less +3 -0
- package/lib/typings.d.ts +8 -0
- package/lib/utils/utils.d.ts +1 -0
- package/lib/utils/utils.js +13 -0
- package/package.json +38 -37
- package/tsconfig.json +1 -1
- package/es/common/graph-common/category-type.d.ts +0 -16
- package/es/common/graph-common/connector/index.js +0 -14
- package/es/common/graph-common/node-element/node-group.d.ts +0 -8
- package/es/common/graph-common/node-element/node-group.js +0 -395
- package/es/common/graph-common/node-element/node-group.less +0 -53
- package/es/common/graph-common/node-popover/index.d.ts +0 -7
- package/es/common/graph-common/node-popover/index.js +0 -11
- package/es/common/graph-common/node-popover/index.less +0 -5
- package/es/common/graph-common/node-types.d.ts +0 -28
- package/es/common/graph-common/node-types.js +0 -60
- package/es/common/graph-common/shape/edge.d.ts +0 -10
- package/es/common/graph-common/shape/node.d.ts +0 -6
- package/es/common/graph-common/shape/node.js +0 -6
- package/es/common/graph-common/shape/nodes/BaseNode.d.ts +0 -4
- package/es/common/graph-common/shape/nodes/GroupNode.d.ts +0 -4
- package/es/component/cut.d.ts +0 -10
- package/es/component/cut.js +0 -34
- package/es/component/cut.less +0 -6
- package/es/component/item-name.d.ts +0 -6
- package/es/component/item-name.js +0 -30
- package/es/component/keyword.d.ts +0 -9
- package/es/component/keyword.js +0 -26
- package/es/component/keyword.less +0 -11
- package/es/component/rx-component/rx-input.d.ts +0 -8
- package/es/component/rx-component/rx-input.js +0 -47
- package/es/hooks/withMode.d.ts +0 -1
- package/es/hooks/withMode.js +0 -16
- package/es/pages/dag-canvas/preview.js +0 -42
- package/es/pages/rx-models/graph-core.less +0 -14
- package/es/pages/rx-models/typing.d.ts +0 -126
- package/es/pages/strategy-header/index.js +0 -154
- /package/es/{pages → components/canvas}/component-tree-panel/category-tree/node-title.less +0 -0
- /package/es/{pages → components/canvas}/config-panel/components/time-trigger/delay-time.js +0 -0
- /package/es/{pages → components/canvas}/config-panel/components/time-trigger/persistent-time.js +0 -0
- /package/es/{pages → components/canvas}/dag-canvas/canvas-content.less +0 -0
- /package/es/{pages → components/canvas}/dag-canvas/index.less +0 -0
- /package/es/{pages → components/canvas}/strategy-header/theme-switch/style.less +0 -0
- /package/es/{common/graph-common/shape → packages/graph-canvas/graph-model/edge/group-edge}/edge.less +0 -0
- /package/es/{common/constants → packages/graph-common}/global.js +0 -0
- /package/es/{hooks → packages/hooks}/useObservableState.js +0 -0
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = exports.LOGICAL_EDG = void 0;
|
|
9
|
+
|
|
10
|
+
var _x = require("@antv/x6");
|
|
11
|
+
|
|
12
|
+
var _node = _interopRequireDefault(require("../../../../graph-model/node"));
|
|
13
|
+
|
|
14
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
|
+
|
|
16
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
17
|
+
|
|
18
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
19
|
+
|
|
20
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
21
|
+
|
|
22
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
23
|
+
|
|
24
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
25
|
+
|
|
26
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
27
|
+
|
|
28
|
+
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
29
|
+
|
|
30
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
31
|
+
|
|
32
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
33
|
+
|
|
34
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
35
|
+
|
|
36
|
+
var LOGICAL_EDG = 50;
|
|
37
|
+
exports.LOGICAL_EDG = LOGICAL_EDG;
|
|
38
|
+
|
|
39
|
+
var LogicalNode = /*#__PURE__*/function (_BaseNode) {
|
|
40
|
+
_inherits(LogicalNode, _BaseNode);
|
|
41
|
+
|
|
42
|
+
var _super = _createSuper(LogicalNode);
|
|
43
|
+
|
|
44
|
+
function LogicalNode() {
|
|
45
|
+
_classCallCheck(this, LogicalNode);
|
|
46
|
+
|
|
47
|
+
return _super.apply(this, arguments);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
_createClass(LogicalNode, [{
|
|
51
|
+
key: "getInPorts",
|
|
52
|
+
value: function getInPorts() {
|
|
53
|
+
return this.getPortsByGroup('in');
|
|
54
|
+
}
|
|
55
|
+
}, {
|
|
56
|
+
key: "getOutPorts",
|
|
57
|
+
value: function getOutPorts() {
|
|
58
|
+
return this.getPortsByGroup('out');
|
|
59
|
+
}
|
|
60
|
+
}]);
|
|
61
|
+
|
|
62
|
+
return LogicalNode;
|
|
63
|
+
}(_node.default);
|
|
64
|
+
|
|
65
|
+
exports.default = LogicalNode;
|
|
66
|
+
LogicalNode.config({
|
|
67
|
+
width: LOGICAL_EDG,
|
|
68
|
+
height: LOGICAL_EDG,
|
|
69
|
+
shape: 'logical-element',
|
|
70
|
+
ports: {
|
|
71
|
+
groups: {
|
|
72
|
+
in: {
|
|
73
|
+
position: {
|
|
74
|
+
name: 'top'
|
|
75
|
+
},
|
|
76
|
+
zIndex: 2
|
|
77
|
+
},
|
|
78
|
+
out: {
|
|
79
|
+
position: {
|
|
80
|
+
name: 'bottom'
|
|
81
|
+
},
|
|
82
|
+
zIndex: 2
|
|
83
|
+
},
|
|
84
|
+
outLeft: {
|
|
85
|
+
position: {
|
|
86
|
+
name: 'left'
|
|
87
|
+
},
|
|
88
|
+
zIndex: 2
|
|
89
|
+
},
|
|
90
|
+
outRight: {
|
|
91
|
+
position: {
|
|
92
|
+
name: 'right'
|
|
93
|
+
},
|
|
94
|
+
zIndex: 2
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
},
|
|
98
|
+
attrs: {
|
|
99
|
+
body: {
|
|
100
|
+
magnet: false,
|
|
101
|
+
fill: 'none',
|
|
102
|
+
stroke: 'none',
|
|
103
|
+
refWidth: '100%',
|
|
104
|
+
refHeight: '100%',
|
|
105
|
+
zIndex: 1
|
|
106
|
+
}
|
|
107
|
+
},
|
|
108
|
+
portMarkup: [{
|
|
109
|
+
tagName: 'foreignObject',
|
|
110
|
+
selector: 'fo',
|
|
111
|
+
attrs: {
|
|
112
|
+
width: 8,
|
|
113
|
+
height: 8,
|
|
114
|
+
x: -4,
|
|
115
|
+
y: -4,
|
|
116
|
+
zIndex: 10,
|
|
117
|
+
// magnet决定是否可交互
|
|
118
|
+
magnet: 'true'
|
|
119
|
+
},
|
|
120
|
+
children: [{
|
|
121
|
+
ns: _x.Dom.ns.xhtml,
|
|
122
|
+
tagName: 'body',
|
|
123
|
+
selector: 'foBody',
|
|
124
|
+
attrs: {
|
|
125
|
+
xmlns: _x.Dom.ns.xhtml
|
|
126
|
+
},
|
|
127
|
+
style: {
|
|
128
|
+
width: '100%',
|
|
129
|
+
height: '100%'
|
|
130
|
+
},
|
|
131
|
+
children: [{
|
|
132
|
+
tagName: 'span',
|
|
133
|
+
selector: 'content',
|
|
134
|
+
style: {
|
|
135
|
+
width: '100%',
|
|
136
|
+
height: '100%'
|
|
137
|
+
}
|
|
138
|
+
}]
|
|
139
|
+
}]
|
|
140
|
+
}]
|
|
141
|
+
});
|
|
142
|
+
|
|
143
|
+
_x.Graph.registerNode('logical-node', LogicalNode);
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
|
|
10
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
11
|
+
|
|
12
|
+
var _reactSvg = require("react-svg");
|
|
13
|
+
|
|
14
|
+
var _ = require("../../..");
|
|
15
|
+
|
|
16
|
+
var _useObservableState3 = require("../../../../hooks/useObservableState");
|
|
17
|
+
|
|
18
|
+
var _nodeTypes = require("../../../node-types");
|
|
19
|
+
|
|
20
|
+
var _OR = _interopRequireDefault(require("./images/OR.svg"));
|
|
21
|
+
|
|
22
|
+
var _AND = _interopRequireDefault(require("./images/AND.svg"));
|
|
23
|
+
|
|
24
|
+
var _XOR = _interopRequireDefault(require("./images/XOR.svg"));
|
|
25
|
+
|
|
26
|
+
var _locking = _interopRequireDefault(require("./images/locking.svg"));
|
|
27
|
+
|
|
28
|
+
var _unlock = _interopRequireDefault(require("./images/unlock.svg"));
|
|
29
|
+
|
|
30
|
+
require("./logical-element.less");
|
|
31
|
+
|
|
32
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
33
|
+
|
|
34
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
35
|
+
|
|
36
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
37
|
+
|
|
38
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
39
|
+
|
|
40
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
41
|
+
|
|
42
|
+
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
43
|
+
|
|
44
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
45
|
+
|
|
46
|
+
var operatorUrl = {
|
|
47
|
+
'|': _OR.default,
|
|
48
|
+
'&': _AND.default,
|
|
49
|
+
'^': _XOR.default,
|
|
50
|
+
LOCK: _locking.default,
|
|
51
|
+
UNLOCK: _unlock.default
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
var LogicalElement = function LogicalElement(props) {
|
|
55
|
+
var _data$id, _data$id$split;
|
|
56
|
+
|
|
57
|
+
var node = props.node,
|
|
58
|
+
experimentId = props.experimentId;
|
|
59
|
+
var data = (node === null || node === void 0 ? void 0 : node.getData()) || {};
|
|
60
|
+
var id = data.id,
|
|
61
|
+
imgUrl = data.imgUrl;
|
|
62
|
+
var nodeData = typeof (data === null || data === void 0 ? void 0 : data.nodeData) === 'string' ? JSON.parse(data.nodeData) : data.nodeData;
|
|
63
|
+
var operator = nodeData === null || nodeData === void 0 ? void 0 : nodeData.operator;
|
|
64
|
+
var expGraph = (0, _.useExperimentGraph)(experimentId);
|
|
65
|
+
|
|
66
|
+
var _useObservableState = (0, _useObservableState3.useObservableState)(function () {
|
|
67
|
+
return expGraph.activeNodeInstance$;
|
|
68
|
+
}),
|
|
69
|
+
_useObservableState2 = _slicedToArray(_useObservableState, 1),
|
|
70
|
+
activeNodeInstance = _useObservableState2[0];
|
|
71
|
+
|
|
72
|
+
var nodeId = activeNodeInstance && activeNodeInstance.id;
|
|
73
|
+
var nodeType = data === null || data === void 0 ? void 0 : (_data$id = data.id) === null || _data$id === void 0 ? void 0 : (_data$id$split = _data$id.split('-')) === null || _data$id$split === void 0 ? void 0 : _data$id$split[0];
|
|
74
|
+
console.log('operatorxxxxxx666', nodeType, operator, data);
|
|
75
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
76
|
+
className: (0, _classnames.default)('logical-element', {
|
|
77
|
+
selected: !!nodeId && nodeId === id
|
|
78
|
+
})
|
|
79
|
+
}, /*#__PURE__*/_react.default.createElement(_reactSvg.ReactSVG, {
|
|
80
|
+
src: operator ? (operatorUrl === null || operatorUrl === void 0 ? void 0 : operatorUrl[operator]) || imgUrl : imgUrl,
|
|
81
|
+
className: "icon",
|
|
82
|
+
style: {
|
|
83
|
+
marginLeft: operator === 'UNLOCK' ? 4 : 0
|
|
84
|
+
},
|
|
85
|
+
beforeInjection: function beforeInjection(svg) {
|
|
86
|
+
if (nodeType === _nodeTypes.COMMONLY_USED.LOCKED) {
|
|
87
|
+
svg.setAttribute('width', operator === 'UNLOCK' ? '35px' : '25px');
|
|
88
|
+
svg.setAttribute('height', operator === 'UNLOCK' ? '35px' : '30px');
|
|
89
|
+
svg.setAttribute('viewBox', operator === 'UNLOCK' ? '0 0 35 35' : '0 0 25 30');
|
|
90
|
+
} else {
|
|
91
|
+
svg.setAttribute('viewBox', '0 0 28 28');
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}));
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
var _default = LogicalElement;
|
|
98
|
+
exports.default = _default;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
@import "../style.less";
|
|
2
|
+
|
|
3
|
+
.logical-element {
|
|
4
|
+
display: flex;
|
|
5
|
+
align-items: center;
|
|
6
|
+
justify-content: center;
|
|
7
|
+
box-sizing: border-box;
|
|
8
|
+
width: @logical-bg-edg;
|
|
9
|
+
height: @logical-bg-edg;
|
|
10
|
+
overflow: hidden;
|
|
11
|
+
background-color: fade(@node-element-primary-color, 20%);
|
|
12
|
+
border: 1px solid @node-element-primary-color;
|
|
13
|
+
border-radius: 4px;
|
|
14
|
+
|
|
15
|
+
&.selected,
|
|
16
|
+
&:hover {
|
|
17
|
+
background-color: @node-element-primary-color;
|
|
18
|
+
.icon {
|
|
19
|
+
svg path {
|
|
20
|
+
fill: #fff !important;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
.name {
|
|
24
|
+
color: #ffffff;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
.icon {
|
|
28
|
+
width: @logical-edg;
|
|
29
|
+
height: @logical-edg;
|
|
30
|
+
div, svg {
|
|
31
|
+
width: @logical-edg;
|
|
32
|
+
height: @logical-edg;
|
|
33
|
+
path {
|
|
34
|
+
fill: @node-element-primary-color !important;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.name {
|
|
40
|
+
overflow-x: hidden;
|
|
41
|
+
color: @node-element-primary-color;
|
|
42
|
+
//font-size: 12px;
|
|
43
|
+
white-space: nowrap;
|
|
44
|
+
text-overflow: ellipsis;
|
|
45
|
+
vertical-align: middle;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
interface NodeParams {
|
|
2
|
+
id: string;
|
|
3
|
+
name: string;
|
|
4
|
+
imgUrl: string;
|
|
5
|
+
x: number;
|
|
6
|
+
y: number;
|
|
7
|
+
applicationImgUrl?: string;
|
|
8
|
+
}
|
|
9
|
+
export declare const createNodePorts: (id: string, timestamp: string) => {
|
|
10
|
+
inPorts: {
|
|
11
|
+
id: string;
|
|
12
|
+
sequence: number;
|
|
13
|
+
}[];
|
|
14
|
+
outPorts: ({
|
|
15
|
+
id: string;
|
|
16
|
+
sequence: number;
|
|
17
|
+
group?: undefined;
|
|
18
|
+
} | {
|
|
19
|
+
id: string;
|
|
20
|
+
sequence: number;
|
|
21
|
+
group: string;
|
|
22
|
+
})[];
|
|
23
|
+
};
|
|
24
|
+
export declare const createNode: ({ id, name, imgUrl, applicationImgUrl, x, y }: NodeParams) => {
|
|
25
|
+
inPorts: {
|
|
26
|
+
id: string;
|
|
27
|
+
sequence: number;
|
|
28
|
+
}[];
|
|
29
|
+
outPorts: ({
|
|
30
|
+
id: string;
|
|
31
|
+
sequence: number;
|
|
32
|
+
group?: undefined;
|
|
33
|
+
} | {
|
|
34
|
+
id: string;
|
|
35
|
+
sequence: number;
|
|
36
|
+
group: string;
|
|
37
|
+
})[];
|
|
38
|
+
id: string;
|
|
39
|
+
name: string;
|
|
40
|
+
imgUrl: string;
|
|
41
|
+
applicationImgUrl: string | undefined;
|
|
42
|
+
positionX: number;
|
|
43
|
+
positionY: number;
|
|
44
|
+
};
|
|
45
|
+
export declare const copyNode: ({ id, name, imgUrl, applicationImgUrl, x, y }: NodeParams) => {
|
|
46
|
+
inPorts: {
|
|
47
|
+
id: string;
|
|
48
|
+
sequence: number;
|
|
49
|
+
}[];
|
|
50
|
+
outPorts: ({
|
|
51
|
+
id: string;
|
|
52
|
+
sequence: number;
|
|
53
|
+
group?: undefined;
|
|
54
|
+
} | {
|
|
55
|
+
id: string;
|
|
56
|
+
sequence: number;
|
|
57
|
+
group: string;
|
|
58
|
+
})[];
|
|
59
|
+
id: string;
|
|
60
|
+
name: string;
|
|
61
|
+
imgUrl: string;
|
|
62
|
+
applicationImgUrl: string | undefined;
|
|
63
|
+
positionX: number;
|
|
64
|
+
positionY: number;
|
|
65
|
+
};
|
|
66
|
+
export declare const addNode: (params: NodeParams) => {
|
|
67
|
+
inPorts: {
|
|
68
|
+
id: string;
|
|
69
|
+
sequence: number;
|
|
70
|
+
}[];
|
|
71
|
+
outPorts: ({
|
|
72
|
+
id: string;
|
|
73
|
+
sequence: number;
|
|
74
|
+
group?: undefined;
|
|
75
|
+
} | {
|
|
76
|
+
id: string;
|
|
77
|
+
sequence: number;
|
|
78
|
+
group: string;
|
|
79
|
+
})[];
|
|
80
|
+
id: string;
|
|
81
|
+
name: string;
|
|
82
|
+
imgUrl: string;
|
|
83
|
+
applicationImgUrl: string | undefined;
|
|
84
|
+
positionX: number;
|
|
85
|
+
positionY: number;
|
|
86
|
+
};
|
|
87
|
+
export {};
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.createNodePorts = exports.createNode = exports.copyNode = exports.addNode = void 0;
|
|
7
|
+
|
|
8
|
+
var _random = _interopRequireDefault(require("lodash/random"));
|
|
9
|
+
|
|
10
|
+
var _nodeTypes = require("../node-types");
|
|
11
|
+
|
|
12
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
|
+
|
|
14
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
15
|
+
|
|
16
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
17
|
+
|
|
18
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
19
|
+
|
|
20
|
+
var createNodePorts = function createNodePorts(id, timestamp) {
|
|
21
|
+
// 条件判断
|
|
22
|
+
if (id === _nodeTypes.SIGN_OPERATION.CONDITION) {
|
|
23
|
+
return {
|
|
24
|
+
inPorts: [{
|
|
25
|
+
id: id ? "".concat(id, "-IN-").concat(timestamp) : "in-".concat(timestamp),
|
|
26
|
+
sequence: 1
|
|
27
|
+
}],
|
|
28
|
+
outPorts: [{
|
|
29
|
+
id: id ? "".concat(id, "-IS-").concat(timestamp) : "out-".concat(timestamp),
|
|
30
|
+
sequence: 1
|
|
31
|
+
}, {
|
|
32
|
+
id: id ? "".concat(id, "-NOT-LEFT-").concat(timestamp) : "out-".concat(timestamp),
|
|
33
|
+
sequence: 2,
|
|
34
|
+
group: 'outLeft'
|
|
35
|
+
}, {
|
|
36
|
+
id: id ? "".concat(id, "-NOT-RIGHT-").concat(timestamp) : "out-".concat(timestamp),
|
|
37
|
+
sequence: 3,
|
|
38
|
+
group: 'outRight'
|
|
39
|
+
}]
|
|
40
|
+
};
|
|
41
|
+
} // 逻辑判断
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
if (id === _nodeTypes.SIGN_OPERATION.LOGICAL) {
|
|
45
|
+
return {
|
|
46
|
+
inPorts: [{
|
|
47
|
+
id: id ? "".concat(id, "-IN-").concat(timestamp) : "in-".concat(timestamp),
|
|
48
|
+
sequence: 1
|
|
49
|
+
}],
|
|
50
|
+
outPorts: [{
|
|
51
|
+
id: id ? "".concat(id, "-OUT-").concat(timestamp) : "out-".concat(timestamp),
|
|
52
|
+
sequence: 1
|
|
53
|
+
}, {
|
|
54
|
+
id: id ? "".concat(id, "-OUT-LEFT-").concat(timestamp) : "out-".concat(timestamp),
|
|
55
|
+
sequence: 2,
|
|
56
|
+
group: 'outLeft'
|
|
57
|
+
}, {
|
|
58
|
+
id: id ? "".concat(id, "-OUT-RIGHT-").concat(timestamp) : "out-".concat(timestamp),
|
|
59
|
+
sequence: 3,
|
|
60
|
+
group: 'outRight'
|
|
61
|
+
}]
|
|
62
|
+
};
|
|
63
|
+
} // 普通节点
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
return {
|
|
67
|
+
inPorts: [{
|
|
68
|
+
id: id ? "".concat(id, "-IN-").concat(timestamp) : "in-".concat(timestamp),
|
|
69
|
+
sequence: 1
|
|
70
|
+
}],
|
|
71
|
+
outPorts: [{
|
|
72
|
+
id: id ? "".concat(id, "-OUT-").concat(timestamp) : "out-".concat(timestamp),
|
|
73
|
+
sequence: 1
|
|
74
|
+
}]
|
|
75
|
+
};
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
exports.createNodePorts = createNodePorts;
|
|
79
|
+
|
|
80
|
+
var createNode = function createNode(_ref) {
|
|
81
|
+
var id = _ref.id,
|
|
82
|
+
name = _ref.name,
|
|
83
|
+
imgUrl = _ref.imgUrl,
|
|
84
|
+
applicationImgUrl = _ref.applicationImgUrl,
|
|
85
|
+
x = _ref.x,
|
|
86
|
+
y = _ref.y;
|
|
87
|
+
var timestamp = "".concat(Date.now());
|
|
88
|
+
var portsParams = createNodePorts(id, timestamp);
|
|
89
|
+
return _objectSpread({
|
|
90
|
+
id: id ? "".concat(id, "-").concat(timestamp) : "".concat(timestamp),
|
|
91
|
+
name: name,
|
|
92
|
+
imgUrl: imgUrl,
|
|
93
|
+
applicationImgUrl: applicationImgUrl,
|
|
94
|
+
positionX: x,
|
|
95
|
+
positionY: y
|
|
96
|
+
}, portsParams);
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
exports.createNode = createNode;
|
|
100
|
+
|
|
101
|
+
var copyNode = function copyNode(_ref2) {
|
|
102
|
+
var id = _ref2.id,
|
|
103
|
+
name = _ref2.name,
|
|
104
|
+
imgUrl = _ref2.imgUrl,
|
|
105
|
+
applicationImgUrl = _ref2.applicationImgUrl,
|
|
106
|
+
x = _ref2.x,
|
|
107
|
+
y = _ref2.y;
|
|
108
|
+
return createNode({
|
|
109
|
+
id: id,
|
|
110
|
+
name: name,
|
|
111
|
+
imgUrl: imgUrl,
|
|
112
|
+
applicationImgUrl: applicationImgUrl,
|
|
113
|
+
x: x + 200 + (0, _random.default)(20, false),
|
|
114
|
+
y: y + 15 + (0, _random.default)(20, false)
|
|
115
|
+
});
|
|
116
|
+
};
|
|
117
|
+
|
|
118
|
+
exports.copyNode = copyNode;
|
|
119
|
+
|
|
120
|
+
var addNode = function addNode(params) {
|
|
121
|
+
return createNode(params);
|
|
122
|
+
};
|
|
123
|
+
|
|
124
|
+
exports.addNode = addNode;
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import type { Subscription } from 'rxjs';
|
|
2
|
+
import { BehaviorSubject } from 'rxjs';
|
|
3
|
+
import type { ConnectionRemovedArgs } from "../graph-core";
|
|
4
|
+
import { GraphCore } from "../graph-core";
|
|
5
|
+
import { CommonNode } from './graph-model/node';
|
|
6
|
+
import type BaseNode from "../graph-model/node";
|
|
7
|
+
import type BaseEdge from "../graph-model/edge";
|
|
8
|
+
import GuideEdge from "../graph-model/edge";
|
|
9
|
+
import type { NExecutionStatus, NExperiment, NExperimentGraph } from "../graph-core/typing";
|
|
10
|
+
import { formatGraphData } from "../graph-core/graph-util";
|
|
11
|
+
declare type NodeMeta = ReturnType<typeof formatGraphData>['nodes'][number];
|
|
12
|
+
declare type EdgeMeta = ReturnType<typeof formatGraphData>['edges'][number];
|
|
13
|
+
declare class ExperimentGraph extends GraphCore<BaseNode, BaseEdge> {
|
|
14
|
+
nodeMetas?: NodeMeta[];
|
|
15
|
+
edgeMetas?: EdgeMeta[];
|
|
16
|
+
pendingNodes: BaseNode[];
|
|
17
|
+
experimentId: string;
|
|
18
|
+
loading$: BehaviorSubject<boolean>;
|
|
19
|
+
experiment$: BehaviorSubject<NExperiment.Experiment>;
|
|
20
|
+
experimentGraph$: BehaviorSubject<NExperimentGraph.ExperimentGraph>;
|
|
21
|
+
activeNodeInstance$: BehaviorSubject<NExecutionStatus.ActiveNode>;
|
|
22
|
+
experimentGraphSub?: Subscription;
|
|
23
|
+
executionStatusQuerySub?: Subscription;
|
|
24
|
+
reRenderSub?: Subscription;
|
|
25
|
+
constructor(expId: string);
|
|
26
|
+
initialize(): Promise<void>;
|
|
27
|
+
resetGraphData(): Promise<void>;
|
|
28
|
+
initPreviewData(graphRes: any): Promise<void>;
|
|
29
|
+
loadExperimentGraph(graphRes: any): Promise<void>;
|
|
30
|
+
updateExperimentGraph(nodes?: NExperimentGraph.Node[], links?: NExperimentGraph.Link[]): Promise<void>;
|
|
31
|
+
delExperimentGraphElement(nodes?: string[], links?: NExperimentGraph.Link[]): Promise<void>;
|
|
32
|
+
isGraphReady(): boolean;
|
|
33
|
+
renderGraph: (wrapper: HTMLElement, container: HTMLElement, options?: any) => void;
|
|
34
|
+
registerEdge: () => void;
|
|
35
|
+
createTypeNodeMeta: (nodeMeta: NodeMeta, nodeType: any, experimentId: string) => BaseNode | undefined;
|
|
36
|
+
renderNode(nodeMeta: NodeMeta): BaseNode | undefined;
|
|
37
|
+
afterLayout(): void;
|
|
38
|
+
renderEdge(edgeMeta: EdgeMeta): BaseEdge | undefined;
|
|
39
|
+
validateContextMenu: (info: NExperimentGraph.ContextMenuInfo) => boolean;
|
|
40
|
+
onSelectNodes(nodes: BaseNode[]): void;
|
|
41
|
+
onClearSelectNodes(): void;
|
|
42
|
+
handlerResize: (e: CustomEvent<string>) => void;
|
|
43
|
+
onConnectNode(args: any): Promise<{
|
|
44
|
+
success: boolean;
|
|
45
|
+
}>;
|
|
46
|
+
onConnectionRemoved(args: ConnectionRemovedArgs): void;
|
|
47
|
+
onMoveNodeStart(args: any): void;
|
|
48
|
+
onMoveNodes(movedNodes: any[]): Promise<void>;
|
|
49
|
+
onDeleteNodeOrEdge(args: {
|
|
50
|
+
nodes: BaseNode[];
|
|
51
|
+
edges: GuideEdge[];
|
|
52
|
+
}): void;
|
|
53
|
+
validateNodeCopyable(cell: BaseNode): boolean;
|
|
54
|
+
onCopyNode(node: CommonNode): void;
|
|
55
|
+
setActiveAlgoData: (data: any) => void;
|
|
56
|
+
requestAddNode: (param: {
|
|
57
|
+
nodeMeta: any;
|
|
58
|
+
clientX: number;
|
|
59
|
+
clientY: number;
|
|
60
|
+
}) => Promise<any>;
|
|
61
|
+
requestDeleteNodes: (ids: string[] | string) => Promise<{
|
|
62
|
+
success: boolean;
|
|
63
|
+
}>;
|
|
64
|
+
requestDeleteEdges: (edges: BaseEdge | BaseEdge[]) => Promise<{
|
|
65
|
+
success: boolean;
|
|
66
|
+
}>;
|
|
67
|
+
undoDeleteNode: () => Promise<void>;
|
|
68
|
+
updateNodeData: (nodeInstanceId: string, nodeData: any) => Promise<void>;
|
|
69
|
+
zoomGraph: (factor: number) => void;
|
|
70
|
+
zoomGraphToFit: () => void;
|
|
71
|
+
zoomGraphRealSize: () => void;
|
|
72
|
+
deleteEdgeFromContextMenu: (edge: BaseEdge) => Promise<void>;
|
|
73
|
+
unSelectNode: () => void;
|
|
74
|
+
dispose(): void;
|
|
75
|
+
}
|
|
76
|
+
export declare const gModelMap: Map<string, ExperimentGraph>;
|
|
77
|
+
export declare const useExperimentGraph: (experimentId: string) => ExperimentGraph;
|
|
78
|
+
export declare const useUnmountExperimentGraph: (experimentId: string) => void;
|
|
79
|
+
export {};
|