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,210 @@
|
|
|
1
|
+
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); }
|
|
2
|
+
|
|
3
|
+
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return generator._invoke = function (innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; }(innerFn, self, context), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; this._invoke = function (method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); }; } function maybeInvokeDelegate(delegate, context) { var method = delegate.iterator[context.method]; if (undefined === method) { if (context.delegate = null, "throw" === context.method) { if (delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel; context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method"); } return ContinueSentinel; } var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) { if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; } return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, define(Gp, "constructor", GeneratorFunctionPrototype), define(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (object) { var keys = []; for (var key in object) { keys.push(key); } return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) { "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); } }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, catch: function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
|
|
4
|
+
|
|
5
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
6
|
+
|
|
7
|
+
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
8
|
+
|
|
9
|
+
import React from 'react';
|
|
10
|
+
import { DataUri } from '@antv/x6';
|
|
11
|
+
import { content } from '@antv/x6/es/style/raw';
|
|
12
|
+
import { useExperimentGraph } from "../../../packages/graph-canvas";
|
|
13
|
+
import saveSvg from "../../../assets/save.svg";
|
|
14
|
+
import cancelSvg from "../../../assets/cancel.svg";
|
|
15
|
+
import checkSvg from "../../../assets/check.svg";
|
|
16
|
+
import { raw } from "../../../style/svgRaw";
|
|
17
|
+
import "../../../style/position.less";
|
|
18
|
+
import "./style.less";
|
|
19
|
+
|
|
20
|
+
var Index = function Index(props) {
|
|
21
|
+
var _props$isActive = props.isActive,
|
|
22
|
+
isActive = _props$isActive === void 0 ? false : _props$isActive,
|
|
23
|
+
onActiveSwitch = props.onActiveSwitch,
|
|
24
|
+
onCancel = props.onCancel,
|
|
25
|
+
onSave = props.onSave,
|
|
26
|
+
experimentId = props.experimentId,
|
|
27
|
+
extraHeaderData = props.extraHeaderData,
|
|
28
|
+
title = props.title;
|
|
29
|
+
var expGraph = useExperimentGraph(experimentId);
|
|
30
|
+
|
|
31
|
+
var getNodes = function getNodes() {
|
|
32
|
+
var _expGraph$graph, _expGraph$graph2;
|
|
33
|
+
|
|
34
|
+
var nodes = expGraph === null || expGraph === void 0 ? void 0 : (_expGraph$graph = expGraph.graph) === null || _expGraph$graph === void 0 ? void 0 : _expGraph$graph.getNodes();
|
|
35
|
+
var nodesData = nodes === null || nodes === void 0 ? void 0 : nodes.map(function (item) {
|
|
36
|
+
return item === null || item === void 0 ? void 0 : item.store.data;
|
|
37
|
+
});
|
|
38
|
+
var edges = expGraph === null || expGraph === void 0 ? void 0 : (_expGraph$graph2 = expGraph.graph) === null || _expGraph$graph2 === void 0 ? void 0 : _expGraph$graph2.getEdges();
|
|
39
|
+
var edgesData = edges === null || edges === void 0 ? void 0 : edges.map(function (item) {
|
|
40
|
+
return item === null || item === void 0 ? void 0 : item.store.data;
|
|
41
|
+
});
|
|
42
|
+
return {
|
|
43
|
+
nodes: nodesData,
|
|
44
|
+
links: edgesData
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
var getNodePng = function getNodePng(options) {
|
|
49
|
+
var width = options.width,
|
|
50
|
+
height = options.height;
|
|
51
|
+
return new Promise(function (resolve) {
|
|
52
|
+
var _expGraph$graph3;
|
|
53
|
+
|
|
54
|
+
expGraph === null || expGraph === void 0 ? void 0 : (_expGraph$graph3 = expGraph.graph) === null || _expGraph$graph3 === void 0 ? void 0 : _expGraph$graph3.toSVG(function (dataUri) {
|
|
55
|
+
// DataUri.downloadDataUri(DataUri.svgToDataUrl(dataUri), 'chart.svg');
|
|
56
|
+
var img = new Image();
|
|
57
|
+
img.src = DataUri.svgToDataUrl(dataUri);
|
|
58
|
+
|
|
59
|
+
img.onload = function () {
|
|
60
|
+
var canvas = document.createElement('canvas');
|
|
61
|
+
canvas.width = width * 2;
|
|
62
|
+
canvas.height = height * 2;
|
|
63
|
+
var context = canvas.getContext('2d');
|
|
64
|
+
context.drawImage(img, 0, 0, width * 2, height * 2);
|
|
65
|
+
resolve(canvas.toDataURL('image/png'));
|
|
66
|
+
};
|
|
67
|
+
}, {
|
|
68
|
+
stylesheet: content + raw,
|
|
69
|
+
copyStyles: false,
|
|
70
|
+
preserveDimensions: {
|
|
71
|
+
width: width * 2,
|
|
72
|
+
height: height * 2
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
});
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
var ownerGetNodes = /*#__PURE__*/function () {
|
|
79
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
80
|
+
var node, pngBase64;
|
|
81
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
82
|
+
while (1) {
|
|
83
|
+
switch (_context.prev = _context.next) {
|
|
84
|
+
case 0:
|
|
85
|
+
node = getNodes();
|
|
86
|
+
_context.next = 3;
|
|
87
|
+
return getNodePng({
|
|
88
|
+
width: 400,
|
|
89
|
+
height: 150
|
|
90
|
+
});
|
|
91
|
+
|
|
92
|
+
case 3:
|
|
93
|
+
pngBase64 = _context.sent;
|
|
94
|
+
console.log('NODE STRUCTURE', node);
|
|
95
|
+
console.log('pngBase64', pngBase64);
|
|
96
|
+
|
|
97
|
+
case 6:
|
|
98
|
+
case "end":
|
|
99
|
+
return _context.stop();
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}, _callee);
|
|
103
|
+
}));
|
|
104
|
+
|
|
105
|
+
return function ownerGetNodes() {
|
|
106
|
+
return _ref.apply(this, arguments);
|
|
107
|
+
};
|
|
108
|
+
}();
|
|
109
|
+
|
|
110
|
+
var handleSave = /*#__PURE__*/function () {
|
|
111
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(type) {
|
|
112
|
+
var node, imgUrl;
|
|
113
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
114
|
+
while (1) {
|
|
115
|
+
switch (_context2.prev = _context2.next) {
|
|
116
|
+
case 0:
|
|
117
|
+
node = getNodes();
|
|
118
|
+
_context2.next = 3;
|
|
119
|
+
return getNodePng({
|
|
120
|
+
width: 400,
|
|
121
|
+
height: 150
|
|
122
|
+
});
|
|
123
|
+
|
|
124
|
+
case 3:
|
|
125
|
+
imgUrl = _context2.sent;
|
|
126
|
+
// await expGraph?.graph?.clearCells();
|
|
127
|
+
onSave === null || onSave === void 0 ? void 0 : onSave(type, {
|
|
128
|
+
node: node,
|
|
129
|
+
imgUrl: imgUrl
|
|
130
|
+
});
|
|
131
|
+
|
|
132
|
+
case 5:
|
|
133
|
+
case "end":
|
|
134
|
+
return _context2.stop();
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
}, _callee2);
|
|
138
|
+
}));
|
|
139
|
+
|
|
140
|
+
return function handleSave(_x) {
|
|
141
|
+
return _ref2.apply(this, arguments);
|
|
142
|
+
};
|
|
143
|
+
}();
|
|
144
|
+
|
|
145
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
146
|
+
className: "strategyHeader"
|
|
147
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
148
|
+
className: "pos-btw"
|
|
149
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
150
|
+
onDoubleClick: ownerGetNodes
|
|
151
|
+
}, title), /*#__PURE__*/React.createElement("div", {
|
|
152
|
+
className: "pos-end"
|
|
153
|
+
}, extraHeaderData === null || extraHeaderData === void 0 ? void 0 : extraHeaderData.map(function (item, index) {
|
|
154
|
+
return (
|
|
155
|
+
/*#__PURE__*/
|
|
156
|
+
// eslint-disable-next-line react/no-array-index-key
|
|
157
|
+
React.createElement("span", {
|
|
158
|
+
key: index,
|
|
159
|
+
onClick: item === null || item === void 0 ? void 0 : item.onClick,
|
|
160
|
+
className: "header-btn"
|
|
161
|
+
}, /*#__PURE__*/React.createElement("img", {
|
|
162
|
+
alt: "",
|
|
163
|
+
className: "header-btn-img",
|
|
164
|
+
src: item.imgUrl
|
|
165
|
+
}), item.name)
|
|
166
|
+
);
|
|
167
|
+
}), /*#__PURE__*/React.createElement("span", {
|
|
168
|
+
className: "header-btn",
|
|
169
|
+
onClick: onCancel
|
|
170
|
+
}, /*#__PURE__*/React.createElement("img", {
|
|
171
|
+
alt: "",
|
|
172
|
+
className: "header-btn-img",
|
|
173
|
+
src: cancelSvg
|
|
174
|
+
}), "\u53D6\u6D88"), /*#__PURE__*/React.createElement("span", {
|
|
175
|
+
className: "header-btn",
|
|
176
|
+
onClick: function onClick() {
|
|
177
|
+
handleSave('data');
|
|
178
|
+
}
|
|
179
|
+
}, /*#__PURE__*/React.createElement("img", {
|
|
180
|
+
alt: "",
|
|
181
|
+
className: "header-btn-img",
|
|
182
|
+
src: saveSvg
|
|
183
|
+
}), "\u4FDD\u5B58"), isActive ? /*#__PURE__*/React.createElement("span", {
|
|
184
|
+
className: "header-btn",
|
|
185
|
+
style: {
|
|
186
|
+
marginRight: 0
|
|
187
|
+
},
|
|
188
|
+
onClick: function onClick() {
|
|
189
|
+
onActiveSwitch === null || onActiveSwitch === void 0 ? void 0 : onActiveSwitch(false);
|
|
190
|
+
}
|
|
191
|
+
}, /*#__PURE__*/React.createElement("img", {
|
|
192
|
+
alt: "",
|
|
193
|
+
className: "header-btn-img",
|
|
194
|
+
src: cancelSvg
|
|
195
|
+
}), "\u505C\u7528") : /*#__PURE__*/React.createElement("span", {
|
|
196
|
+
className: "header-btn",
|
|
197
|
+
style: {
|
|
198
|
+
marginRight: 0
|
|
199
|
+
},
|
|
200
|
+
onClick: function onClick() {
|
|
201
|
+
onActiveSwitch === null || onActiveSwitch === void 0 ? void 0 : onActiveSwitch(true);
|
|
202
|
+
}
|
|
203
|
+
}, /*#__PURE__*/React.createElement("img", {
|
|
204
|
+
alt: "",
|
|
205
|
+
className: "header-btn-img",
|
|
206
|
+
src: checkSvg
|
|
207
|
+
}), "\u542F\u7528"))));
|
|
208
|
+
};
|
|
209
|
+
|
|
210
|
+
export default Index;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
@import (reference) '
|
|
1
|
+
@import (reference) '../../../style/theme-light';
|
|
2
2
|
|
|
3
3
|
.header-btn {
|
|
4
4
|
display: flex;
|
|
5
5
|
align-items: center;
|
|
6
|
-
margin-right:
|
|
6
|
+
margin-right: 25px;
|
|
7
7
|
font-size: 12px;
|
|
8
8
|
cursor: pointer;
|
|
9
9
|
.header-btn-img {
|
|
@@ -18,5 +18,6 @@
|
|
|
18
18
|
line-height: 45px !important;
|
|
19
19
|
padding: 0 15px;
|
|
20
20
|
background: @light-gray-bg;
|
|
21
|
-
|
|
21
|
+
border: 1px solid #DCDCDC;
|
|
22
|
+
|
|
22
23
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import './style.less';
|
|
3
|
-
declare const Index: React.FC;
|
|
4
|
-
export default Index;
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import './style.less';
|
|
3
|
+
declare const Index: React.FC;
|
|
4
|
+
export default Index;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import "antd/es/switch/style";
|
|
2
|
-
import _Switch from "antd/es/switch";
|
|
3
1
|
import React from 'react';
|
|
2
|
+
import { Switch } from 'antd';
|
|
4
3
|
import "./style.less";
|
|
5
4
|
|
|
6
5
|
var Index = function Index() {
|
|
@@ -10,7 +9,7 @@ var Index = function Index() {
|
|
|
10
9
|
|
|
11
10
|
return /*#__PURE__*/React.createElement("div", {
|
|
12
11
|
className: "theme-switch"
|
|
13
|
-
}, /*#__PURE__*/React.createElement(
|
|
12
|
+
}, /*#__PURE__*/React.createElement(Switch, {
|
|
14
13
|
defaultChecked: false,
|
|
15
14
|
onChange: handleThemeChange
|
|
16
15
|
}));
|
package/es/index.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
/// <reference types="@/typings" />
|
|
2
|
-
export { default as StrategyCanvas } from './
|
|
3
|
-
export { default as StrategyHeader } from './
|
|
4
|
-
export { default as ComponentTreePanel } from './
|
|
5
|
-
export { default as DAGCanvas } from './
|
|
6
|
-
export { default as ConfigPanel } from './
|
|
7
|
-
export { useExperimentGraph } from './
|
|
8
|
-
export { useObservableState } from './hooks/useObservableState';
|
|
1
|
+
/// <reference types="@/typings" />
|
|
2
|
+
export { default as StrategyCanvas } from './components/canvas';
|
|
3
|
+
export { default as StrategyHeader } from './components/canvas/strategy-header';
|
|
4
|
+
export { default as ComponentTreePanel } from './components/canvas/component-tree-panel';
|
|
5
|
+
export { default as DAGCanvas } from './components/canvas/dag-canvas';
|
|
6
|
+
export { default as ConfigPanel } from './components/canvas/config-panel';
|
|
7
|
+
export { useExperimentGraph } from './packages/graph-canvas';
|
|
8
|
+
export { useObservableState } from './packages/hooks/useObservableState';
|
|
9
|
+
export { PanelType } from './packages/graph-canvas/node-types';
|
package/es/index.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
// eslint-disable-next-line @typescript-eslint/triple-slash-reference
|
|
2
2
|
/// <reference path="./typings.d.ts" />
|
|
3
|
-
export { default as StrategyCanvas } from "./
|
|
4
|
-
export { default as StrategyHeader } from "./
|
|
5
|
-
export { default as ComponentTreePanel } from "./
|
|
6
|
-
export { default as DAGCanvas } from "./
|
|
7
|
-
export { default as ConfigPanel } from "./
|
|
8
|
-
export { useExperimentGraph } from "./
|
|
9
|
-
export { useObservableState } from "./hooks/useObservableState";
|
|
3
|
+
export { default as StrategyCanvas } from "./components/canvas";
|
|
4
|
+
export { default as StrategyHeader } from "./components/canvas/strategy-header";
|
|
5
|
+
export { default as ComponentTreePanel } from "./components/canvas/component-tree-panel";
|
|
6
|
+
export { default as DAGCanvas } from "./components/canvas/dag-canvas";
|
|
7
|
+
export { default as ConfigPanel } from "./components/canvas/config-panel";
|
|
8
|
+
export { useExperimentGraph } from "./packages/graph-canvas";
|
|
9
|
+
export { useObservableState } from "./packages/hooks/useObservableState";
|
|
10
|
+
export { PanelType } from "./packages/graph-canvas/node-types";
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export declare const initGraphData: {
|
|
2
|
+
nodes: never[];
|
|
3
|
+
links: never[];
|
|
4
|
+
};
|
|
5
|
+
export declare const basicEdgeAttrs: {
|
|
6
|
+
attrs: {
|
|
7
|
+
line: {
|
|
8
|
+
strokeDasharray: number;
|
|
9
|
+
stroke: string;
|
|
10
|
+
strokeWidth: number;
|
|
11
|
+
targetMarker: {
|
|
12
|
+
name: string;
|
|
13
|
+
args: {
|
|
14
|
+
size: string;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export var initGraphData = {
|
|
2
|
+
nodes: [],
|
|
3
|
+
links: []
|
|
4
|
+
};
|
|
5
|
+
export var basicEdgeAttrs = {
|
|
6
|
+
attrs: {
|
|
7
|
+
line: {
|
|
8
|
+
strokeDasharray: 5,
|
|
9
|
+
stroke: '#00A6FF',
|
|
10
|
+
strokeWidth: 1,
|
|
11
|
+
targetMarker: {
|
|
12
|
+
name: 'block',
|
|
13
|
+
args: {
|
|
14
|
+
size: '6'
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
};
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
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); }
|
|
2
|
+
|
|
3
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
4
|
+
|
|
5
|
+
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); } }
|
|
6
|
+
|
|
7
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
8
|
+
|
|
9
|
+
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); }
|
|
10
|
+
|
|
11
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
12
|
+
|
|
13
|
+
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); }; }
|
|
14
|
+
|
|
15
|
+
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); }
|
|
16
|
+
|
|
17
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
18
|
+
|
|
19
|
+
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; } }
|
|
20
|
+
|
|
21
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
22
|
+
|
|
23
|
+
import BaseEdge from "../../../../graph-model/edge";
|
|
24
|
+
import { Graph } from '@antv/x6';
|
|
25
|
+
|
|
26
|
+
var GroupEdge = /*#__PURE__*/function (_BaseEdge) {
|
|
27
|
+
_inherits(GroupEdge, _BaseEdge);
|
|
28
|
+
|
|
29
|
+
var _super = _createSuper(GroupEdge);
|
|
30
|
+
|
|
31
|
+
function GroupEdge() {
|
|
32
|
+
_classCallCheck(this, GroupEdge);
|
|
33
|
+
|
|
34
|
+
return _super.apply(this, arguments);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
_createClass(GroupEdge, [{
|
|
38
|
+
key: "isGroupEdge",
|
|
39
|
+
value: // eslint-disable-next-line class-methods-use-this
|
|
40
|
+
function isGroupEdge() {
|
|
41
|
+
return true;
|
|
42
|
+
}
|
|
43
|
+
}]);
|
|
44
|
+
|
|
45
|
+
return GroupEdge;
|
|
46
|
+
}(BaseEdge);
|
|
47
|
+
|
|
48
|
+
export { GroupEdge as default };
|
|
49
|
+
GroupEdge.config({
|
|
50
|
+
shape: 'group-edge',
|
|
51
|
+
attrs: {
|
|
52
|
+
line: {
|
|
53
|
+
stroke: '#00A6FF',
|
|
54
|
+
strokeWidth: 1,
|
|
55
|
+
strokeDasharray: 5,
|
|
56
|
+
targetMarker: {
|
|
57
|
+
stroke: 'none',
|
|
58
|
+
fill: 'none'
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
Graph.registerEdge('group-edge', GroupEdge);
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import "./application-element.less";
|
|
3
|
+
|
|
4
|
+
var ApplicationElement = function ApplicationElement(props) {
|
|
5
|
+
var node = props.node;
|
|
6
|
+
var data = (node === null || node === void 0 ? void 0 : node.getData()) || {};
|
|
7
|
+
var applicationImgUrl = data.applicationImgUrl,
|
|
8
|
+
name = data.name;
|
|
9
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
10
|
+
className: "application-element"
|
|
11
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
12
|
+
className: "application-name"
|
|
13
|
+
}, name), /*#__PURE__*/React.createElement("img", {
|
|
14
|
+
alt: "",
|
|
15
|
+
src: applicationImgUrl,
|
|
16
|
+
className: "icon"
|
|
17
|
+
}));
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export default ApplicationElement;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import BaseNode from "../../../../graph-model/node";
|
|
2
|
+
export declare const APPLICATION_NODE_WIDTH = 400;
|
|
3
|
+
export declare const APPLICATION_NODE_HEIGHT = 300;
|
|
4
|
+
export default class ApplicationNode extends BaseNode {
|
|
5
|
+
getInPorts(): import("@antv/x6/lib/model/port").PortManager.PortMetadata[];
|
|
6
|
+
getOutPorts(): import("@antv/x6/lib/model/port").PortManager.PortMetadata[];
|
|
7
|
+
}
|
|
@@ -8,7 +8,7 @@ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _d
|
|
|
8
8
|
|
|
9
9
|
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); }
|
|
10
10
|
|
|
11
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf
|
|
11
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
12
12
|
|
|
13
13
|
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); }; }
|
|
14
14
|
|
|
@@ -18,35 +18,44 @@ function _assertThisInitialized(self) { if (self === void 0) { throw new Referen
|
|
|
18
18
|
|
|
19
19
|
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; } }
|
|
20
20
|
|
|
21
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
21
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
22
22
|
|
|
23
|
-
import
|
|
24
|
-
import
|
|
23
|
+
import { Dom, Graph } from '@antv/x6';
|
|
24
|
+
import BaseNode from "../../../../graph-model/node";
|
|
25
|
+
export var APPLICATION_NODE_WIDTH = 400;
|
|
26
|
+
export var APPLICATION_NODE_HEIGHT = 300;
|
|
25
27
|
|
|
26
|
-
var
|
|
27
|
-
_inherits(
|
|
28
|
+
var ApplicationNode = /*#__PURE__*/function (_BaseNode) {
|
|
29
|
+
_inherits(ApplicationNode, _BaseNode);
|
|
28
30
|
|
|
29
|
-
var _super = _createSuper(
|
|
31
|
+
var _super = _createSuper(ApplicationNode);
|
|
30
32
|
|
|
31
|
-
function
|
|
32
|
-
_classCallCheck(this,
|
|
33
|
+
function ApplicationNode() {
|
|
34
|
+
_classCallCheck(this, ApplicationNode);
|
|
33
35
|
|
|
34
36
|
return _super.apply(this, arguments);
|
|
35
37
|
}
|
|
36
38
|
|
|
37
|
-
_createClass(
|
|
38
|
-
key: "
|
|
39
|
-
value:
|
|
40
|
-
|
|
41
|
-
|
|
39
|
+
_createClass(ApplicationNode, [{
|
|
40
|
+
key: "getInPorts",
|
|
41
|
+
value: function getInPorts() {
|
|
42
|
+
return this.getPortsByGroup('in');
|
|
43
|
+
}
|
|
44
|
+
}, {
|
|
45
|
+
key: "getOutPorts",
|
|
46
|
+
value: function getOutPorts() {
|
|
47
|
+
return this.getPortsByGroup('out');
|
|
42
48
|
}
|
|
43
49
|
}]);
|
|
44
50
|
|
|
45
|
-
return
|
|
51
|
+
return ApplicationNode;
|
|
46
52
|
}(BaseNode);
|
|
47
53
|
|
|
48
|
-
export {
|
|
49
|
-
|
|
54
|
+
export { ApplicationNode as default };
|
|
55
|
+
ApplicationNode.config({
|
|
56
|
+
width: APPLICATION_NODE_WIDTH,
|
|
57
|
+
height: APPLICATION_NODE_HEIGHT,
|
|
58
|
+
inherit: 'react-shape',
|
|
50
59
|
ports: {
|
|
51
60
|
groups: {
|
|
52
61
|
in: {
|
|
@@ -63,14 +72,24 @@ GroupNode.config({
|
|
|
63
72
|
}
|
|
64
73
|
}
|
|
65
74
|
},
|
|
75
|
+
attrs: {
|
|
76
|
+
body: {
|
|
77
|
+
magnet: false,
|
|
78
|
+
fill: 'none',
|
|
79
|
+
stroke: 'none',
|
|
80
|
+
refWidth: '100%',
|
|
81
|
+
refHeight: '100%',
|
|
82
|
+
zIndex: 1
|
|
83
|
+
}
|
|
84
|
+
},
|
|
66
85
|
portMarkup: [{
|
|
67
86
|
tagName: 'foreignObject',
|
|
68
87
|
selector: 'fo',
|
|
69
88
|
attrs: {
|
|
70
|
-
width:
|
|
71
|
-
height:
|
|
72
|
-
x: -
|
|
73
|
-
y: -
|
|
89
|
+
width: 8,
|
|
90
|
+
height: 8,
|
|
91
|
+
x: -4,
|
|
92
|
+
y: -4,
|
|
74
93
|
zIndex: 10,
|
|
75
94
|
// magnet决定是否可交互
|
|
76
95
|
magnet: 'true'
|
|
@@ -96,4 +115,5 @@ GroupNode.config({
|
|
|
96
115
|
}]
|
|
97
116
|
}]
|
|
98
117
|
}]
|
|
99
|
-
});
|
|
118
|
+
});
|
|
119
|
+
Graph.registerNode('application-node', ApplicationNode);
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import BaseNode from
|
|
2
|
-
export
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import BaseNode from "../../../../graph-model/node";
|
|
2
|
+
export declare const NODE_WIDTH = 180;
|
|
3
|
+
export declare const NODE_HEIGHT = 43;
|
|
4
|
+
export default class CommonNode extends BaseNode {
|
|
5
|
+
getInPorts(): import("@antv/x6/lib/model/port").PortManager.PortMetadata[];
|
|
6
|
+
getOutPorts(): import("@antv/x6/lib/model/port").PortManager.PortMetadata[];
|
|
7
|
+
}
|