@logicflow/core 2.2.0 → 2.2.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/dist/docs/api/logicflow-constructor/index.en.md +106 -0
- package/dist/docs/api/logicflow-constructor/index.zh.md +106 -0
- package/dist/docs/api/logicflow-constructor/use.en.md +61 -0
- package/dist/docs/api/logicflow-constructor/use.zh.md +61 -0
- package/dist/docs/api/logicflow-instance/canvas.en.md +197 -0
- package/dist/docs/api/logicflow-instance/canvas.zh.md +199 -0
- package/dist/docs/api/logicflow-instance/edge.en.md +273 -0
- package/dist/docs/api/logicflow-instance/edge.zh.md +273 -0
- package/dist/docs/api/logicflow-instance/edit-config.en.md +59 -0
- package/dist/docs/api/logicflow-instance/edit-config.zh.md +59 -0
- package/dist/docs/api/logicflow-instance/element.en.md +375 -0
- package/dist/docs/api/logicflow-instance/element.zh.md +379 -0
- package/dist/docs/api/logicflow-instance/event.en.md +326 -0
- package/dist/docs/api/logicflow-instance/event.zh.md +406 -0
- package/dist/docs/api/logicflow-instance/history.en.md +38 -0
- package/dist/docs/api/logicflow-instance/history.zh.md +38 -0
- package/dist/docs/api/logicflow-instance/index.en.md +41 -0
- package/dist/docs/api/logicflow-instance/index.zh.md +41 -0
- package/dist/docs/api/logicflow-instance/node.en.md +308 -0
- package/dist/docs/api/logicflow-instance/node.zh.md +308 -0
- package/dist/docs/api/logicflow-instance/register.en.md +76 -0
- package/dist/docs/api/logicflow-instance/register.zh.md +76 -0
- package/dist/docs/api/logicflow-instance/render-and-data.en.md +179 -0
- package/dist/docs/api/logicflow-instance/render-and-data.zh.md +181 -0
- package/dist/docs/api/logicflow-instance/text.en.md +60 -0
- package/dist/docs/api/logicflow-instance/text.zh.md +60 -0
- package/dist/docs/api/logicflow-instance/theme.en.md +179 -0
- package/dist/docs/api/logicflow-instance/theme.zh.md +179 -0
- package/dist/docs/api/runtime-model/edgeModel.en.md +29 -0
- package/dist/docs/api/runtime-model/edgeModel.zh.md +325 -0
- package/dist/docs/api/runtime-model/graphModel.en.md +275 -0
- package/dist/docs/api/runtime-model/graphModel.zh.md +1153 -0
- package/dist/docs/api/runtime-model/nodeModel.en.md +37 -0
- package/dist/docs/api/runtime-model/nodeModel.zh.md +644 -0
- package/dist/docs/api/type/MainTypes.en.md +598 -0
- package/dist/docs/api/type/MainTypes.zh.md +867 -0
- package/dist/docs/api/type/Theme.en.md +187 -0
- package/dist/docs/api/type/Theme.zh.md +187 -0
- package/dist/docs/api/type/canvas-types.en.md +25 -0
- package/dist/docs/api/type/canvas-types.zh.md +25 -0
- package/dist/docs/api/type/index.en.md +96 -0
- package/dist/docs/api/type/index.zh.md +99 -0
- package/dist/docs/api/type/node-types.en.md +21 -0
- package/dist/docs/api/type/node-types.zh.md +21 -0
- package/dist/docs/api/type/plugin-types.en.md +24 -0
- package/dist/docs/api/type/plugin-types.zh.md +24 -0
- package/dist/docs/index.md +11 -0
- package/dist/docs/tutorial/about.en.md +38 -0
- package/dist/docs/tutorial/about.zh.md +65 -0
- package/dist/docs/tutorial/advanced/dnd.en.md +62 -0
- package/dist/docs/tutorial/advanced/dnd.zh.md +52 -0
- package/dist/docs/tutorial/advanced/edge.en.md +64 -0
- package/dist/docs/tutorial/advanced/edge.zh.md +66 -0
- package/dist/docs/tutorial/advanced/keyboard.en.md +70 -0
- package/dist/docs/tutorial/advanced/keyboard.zh.md +67 -0
- package/dist/docs/tutorial/advanced/node.en.md +338 -0
- package/dist/docs/tutorial/advanced/node.zh.md +338 -0
- package/dist/docs/tutorial/advanced/react.en.md +106 -0
- package/dist/docs/tutorial/advanced/react.zh.md +114 -0
- package/dist/docs/tutorial/advanced/silent-mode.en.md +75 -0
- package/dist/docs/tutorial/advanced/silent-mode.zh.md +71 -0
- package/dist/docs/tutorial/advanced/snapline.en.md +54 -0
- package/dist/docs/tutorial/advanced/vue.en.md +249 -0
- package/dist/docs/tutorial/advanced/vue.zh.md +248 -0
- package/dist/docs/tutorial/ai.en.md +64 -0
- package/dist/docs/tutorial/ai.zh.md +64 -0
- package/dist/docs/tutorial/basic/background.en.md +50 -0
- package/dist/docs/tutorial/basic/canvas.en.md +164 -0
- package/dist/docs/tutorial/basic/canvas.zh.md +183 -0
- package/dist/docs/tutorial/basic/class.en.md +106 -0
- package/dist/docs/tutorial/basic/class.zh.md +103 -0
- package/dist/docs/tutorial/basic/edge.en.md +151 -0
- package/dist/docs/tutorial/basic/edge.zh.md +152 -0
- package/dist/docs/tutorial/basic/event.en.md +70 -0
- package/dist/docs/tutorial/basic/event.zh.md +66 -0
- package/dist/docs/tutorial/basic/grid.en.md +77 -0
- package/dist/docs/tutorial/basic/node.en.md +358 -0
- package/dist/docs/tutorial/basic/node.zh.md +318 -0
- package/dist/docs/tutorial/basic/theme.en.md +154 -0
- package/dist/docs/tutorial/basic/theme.zh.md +157 -0
- package/dist/docs/tutorial/extension/adapter.en.md +446 -0
- package/dist/docs/tutorial/extension/adapter.zh.md +429 -0
- package/dist/docs/tutorial/extension/bpmn-element.en.md +1427 -0
- package/dist/docs/tutorial/extension/bpmn-element.zh.md +1472 -0
- package/dist/docs/tutorial/extension/control.en.md +117 -0
- package/dist/docs/tutorial/extension/control.zh.md +118 -0
- package/dist/docs/tutorial/extension/curved-edge.en.md +46 -0
- package/dist/docs/tutorial/extension/curved-edge.zh.md +46 -0
- package/dist/docs/tutorial/extension/custom.en.md +142 -0
- package/dist/docs/tutorial/extension/custom.zh.md +138 -0
- package/dist/docs/tutorial/extension/dnd-panel.en.md +109 -0
- package/dist/docs/tutorial/extension/dnd-panel.zh.md +109 -0
- package/dist/docs/tutorial/extension/dynamic-group.en.md +606 -0
- package/dist/docs/tutorial/extension/dynamic-group.zh.md +606 -0
- package/dist/docs/tutorial/extension/group.en.md +217 -0
- package/dist/docs/tutorial/extension/group.zh.md +209 -0
- package/dist/docs/tutorial/extension/highlight.en.md +50 -0
- package/dist/docs/tutorial/extension/highlight.zh.md +50 -0
- package/dist/docs/tutorial/extension/insert-node-in-polyline.en.md +52 -0
- package/dist/docs/tutorial/extension/insert-node-in-polyline.zh.md +47 -0
- package/dist/docs/tutorial/extension/intro.en.md +72 -0
- package/dist/docs/tutorial/extension/intro.zh.md +95 -0
- package/dist/docs/tutorial/extension/label.en.md +136 -0
- package/dist/docs/tutorial/extension/label.zh.md +135 -0
- package/dist/docs/tutorial/extension/layout.en.md +156 -0
- package/dist/docs/tutorial/extension/layout.zh.md +156 -0
- package/dist/docs/tutorial/extension/menu.en.md +319 -0
- package/dist/docs/tutorial/extension/menu.zh.md +377 -0
- package/dist/docs/tutorial/extension/minimap.en.md +164 -0
- package/dist/docs/tutorial/extension/minimap.zh.md +180 -0
- package/dist/docs/tutorial/extension/node-resize.en.md +199 -0
- package/dist/docs/tutorial/extension/node-resize.zh.md +221 -0
- package/dist/docs/tutorial/extension/pool.en.md +227 -0
- package/dist/docs/tutorial/extension/pool.zh.md +227 -0
- package/dist/docs/tutorial/extension/proximity-connect.en.md +104 -0
- package/dist/docs/tutorial/extension/proximity-connect.zh.md +107 -0
- package/dist/docs/tutorial/extension/selection.en.md +166 -0
- package/dist/docs/tutorial/extension/selection.zh.md +150 -0
- package/dist/docs/tutorial/extension/snapshot.en.md +276 -0
- package/dist/docs/tutorial/extension/snapshot.zh.md +276 -0
- package/dist/docs/tutorial/get-started.en.md +501 -0
- package/dist/docs/tutorial/get-started.zh.md +139 -0
- package/dist/docs/tutorial/update.en.md +213 -0
- package/dist/docs/tutorial/update.zh.md +212 -0
- package/dist/index.css +3 -2
- package/dist/index.min.js +1 -1
- package/dist/index.min.js.map +1 -1
- package/es/LogicFlow.d.ts +9 -0
- package/es/LogicFlow.js +0 -1
- package/es/constant/index.d.ts +1 -1
- package/es/constant/index.js +1 -1
- package/es/constant/theme.d.ts +136 -0
- package/es/constant/theme.js +680 -0
- package/es/index.css +3 -2
- package/es/model/GraphModel.d.ts +10 -2
- package/es/model/GraphModel.js +48 -14
- package/es/model/TransformModel.js +9 -9
- package/es/model/edge/BaseEdgeModel.js +7 -2
- package/es/model/edge/PolylineEdgeModel.d.ts +7 -0
- package/es/model/edge/PolylineEdgeModel.js +136 -7
- package/es/model/node/BaseNodeModel.d.ts +12 -1
- package/es/model/node/BaseNodeModel.js +9 -2
- package/es/model/node/HtmlNodeModel.d.ts +12 -0
- package/es/model/node/HtmlNodeModel.js +19 -0
- package/es/model/node/PolygonNodeModel.js +3 -3
- package/es/options.d.ts +4 -2
- package/es/style/index.css +3 -2
- package/es/style/index.less +3 -2
- package/es/style/raw.d.ts +1 -1
- package/es/style/raw.js +1 -1
- package/es/tool/MultipleSelectTool.js +10 -5
- package/es/util/drag.js +0 -1
- package/es/util/edge.d.ts +40 -1
- package/es/util/edge.js +43 -9
- package/es/util/geometry.d.ts +8 -0
- package/es/util/geometry.js +79 -0
- package/es/util/theme.d.ts +2 -65
- package/es/util/theme.js +4 -281
- package/es/view/Anchor.d.ts +1 -0
- package/es/view/Anchor.js +24 -21
- package/es/view/Control.d.ts +5 -0
- package/es/view/Control.js +44 -57
- package/es/view/edge/BaseEdge.js +9 -0
- package/es/view/edge/PolylineEdge.js +13 -2
- package/es/view/node/BaseNode.d.ts +1 -0
- package/es/view/node/BaseNode.js +23 -11
- package/es/view/node/HtmlNode.js +2 -4
- package/es/view/overlay/CanvasOverlay.js +5 -2
- package/es/view/overlay/Grid.d.ts +12 -1
- package/es/view/overlay/Grid.js +85 -23
- package/es/view/overlay/OutlineOverlay.d.ts +1 -0
- package/es/view/overlay/OutlineOverlay.js +18 -17
- package/es/view/overlay/gridConfig.d.ts +46 -0
- package/es/view/overlay/gridConfig.js +99 -0
- package/es/view/shape/Polygon.d.ts +0 -7
- package/es/view/shape/Polygon.js +12 -43
- package/lib/LogicFlow.d.ts +9 -0
- package/lib/LogicFlow.js +0 -1
- package/lib/constant/index.d.ts +1 -1
- package/lib/constant/index.js +16 -2
- package/lib/constant/theme.d.ts +136 -0
- package/lib/constant/theme.js +683 -0
- package/lib/index.css +3 -2
- package/lib/model/GraphModel.d.ts +10 -2
- package/lib/model/GraphModel.js +49 -15
- package/lib/model/TransformModel.js +9 -9
- package/lib/model/edge/BaseEdgeModel.js +7 -2
- package/lib/model/edge/PolylineEdgeModel.d.ts +7 -0
- package/lib/model/edge/PolylineEdgeModel.js +136 -7
- package/lib/model/node/BaseNodeModel.d.ts +12 -1
- package/lib/model/node/BaseNodeModel.js +9 -2
- package/lib/model/node/HtmlNodeModel.d.ts +12 -0
- package/lib/model/node/HtmlNodeModel.js +19 -0
- package/lib/model/node/PolygonNodeModel.js +3 -3
- package/lib/options.d.ts +4 -2
- package/lib/style/index.css +3 -2
- package/lib/style/index.less +3 -2
- package/lib/style/raw.d.ts +1 -1
- package/lib/style/raw.js +1 -1
- package/lib/tool/MultipleSelectTool.js +10 -5
- package/lib/util/drag.js +0 -1
- package/lib/util/edge.d.ts +40 -1
- package/lib/util/edge.js +43 -9
- package/lib/util/geometry.d.ts +8 -0
- package/lib/util/geometry.js +81 -1
- package/lib/util/theme.d.ts +2 -65
- package/lib/util/theme.js +15 -292
- package/lib/view/Anchor.d.ts +1 -0
- package/lib/view/Anchor.js +24 -21
- package/lib/view/Control.d.ts +5 -0
- package/lib/view/Control.js +44 -57
- package/lib/view/edge/BaseEdge.js +9 -0
- package/lib/view/edge/PolylineEdge.js +13 -2
- package/lib/view/node/BaseNode.d.ts +1 -0
- package/lib/view/node/BaseNode.js +22 -10
- package/lib/view/node/HtmlNode.js +1 -3
- package/lib/view/overlay/CanvasOverlay.js +5 -2
- package/lib/view/overlay/Grid.d.ts +12 -1
- package/lib/view/overlay/Grid.js +83 -21
- package/lib/view/overlay/OutlineOverlay.d.ts +1 -0
- package/lib/view/overlay/OutlineOverlay.js +18 -17
- package/lib/view/overlay/gridConfig.d.ts +46 -0
- package/lib/view/overlay/gridConfig.js +104 -0
- package/lib/view/shape/Polygon.d.ts +0 -7
- package/lib/view/shape/Polygon.js +13 -45
- package/package.json +9 -2
- package/scripts/postinstall-ai-prompt.js +67 -0
- package/.turbo/turbo-build$colon$dev.log +0 -10
- package/.turbo/turbo-build.log +0 -33
- package/CHANGELOG.md +0 -1849
- package/__tests__/algorithm/egde.test.ts +0 -131
- package/__tests__/algorithm/index.test.ts +0 -74
- package/__tests__/algorithm/outline.test.ts +0 -43
- package/__tests__/bugs/1545-spec.test.ts +0 -42
- package/__tests__/event/event.test.ts +0 -22
- package/__tests__/history/history.test.ts +0 -28
- package/__tests__/logicflow.test.ts +0 -575
- package/__tests__/model/graphmodel.test.ts +0 -87
- package/__tests__/util/compatible.test.ts +0 -48
- package/__tests__/util/edge.test.ts +0 -224
- package/__tests__/util/geometry.test.ts +0 -14
- package/__tests__/util/graph.test.ts +0 -16
- package/__tests__/util/matrix.test.ts +0 -41
- package/__tests__/util/node.test.ts +0 -68
- package/__tests__/util/sampling.test.ts +0 -12
- package/__tests__/util/vector.test.ts +0 -50
- package/__tests__/util/zIndex.test.ts +0 -10
- package/src/LogicFlow.tsx +0 -2008
- package/src/algorithm/edge.ts +0 -67
- package/src/algorithm/index.ts +0 -70
- package/src/algorithm/outline.ts +0 -77
- package/src/algorithm/rotate.ts +0 -55
- package/src/common/drag.ts +0 -219
- package/src/common/history.ts +0 -108
- package/src/common/index.ts +0 -6
- package/src/common/keyboard.ts +0 -108
- package/src/common/matrix.ts +0 -122
- package/src/common/vector.ts +0 -93
- package/src/constant/index.ts +0 -179
- package/src/event/event.md +0 -66
- package/src/event/eventArgs.ts +0 -643
- package/src/event/eventEmitter.ts +0 -156
- package/src/history/index.ts +0 -119
- package/src/index.less +0 -1
- package/src/index.ts +0 -26
- package/src/keyboard/index.ts +0 -112
- package/src/keyboard/shortcut.ts +0 -200
- package/src/model/BaseModel.ts +0 -250
- package/src/model/EditConfigModel.ts +0 -334
- package/src/model/GraphModel.ts +0 -1788
- package/src/model/NestedTransformModel.ts +0 -121
- package/src/model/SnaplineModel.ts +0 -256
- package/src/model/TransformModel.ts +0 -258
- package/src/model/edge/BaseEdgeModel.ts +0 -777
- package/src/model/edge/BezierEdgeModel.ts +0 -197
- package/src/model/edge/LineEdgeModel.ts +0 -36
- package/src/model/edge/PolylineEdgeModel.ts +0 -672
- package/src/model/edge/index.ts +0 -4
- package/src/model/index.ts +0 -9
- package/src/model/node/BaseNodeModel.ts +0 -949
- package/src/model/node/CircleNodeModel.ts +0 -91
- package/src/model/node/DiamondNodeModel.ts +0 -132
- package/src/model/node/EllipseNodeModel.ts +0 -98
- package/src/model/node/HtmlNodeModel.ts +0 -50
- package/src/model/node/PolygonNodeModel.ts +0 -150
- package/src/model/node/RectNodeModel.ts +0 -69
- package/src/model/node/TextNodeModel.ts +0 -54
- package/src/model/node/index.ts +0 -8
- package/src/options.ts +0 -145
- package/src/style/index.less +0 -261
- package/src/style/raw.ts +0 -220
- package/src/tool/MultipleSelectTool.tsx +0 -132
- package/src/tool/TextEditTool.tsx +0 -193
- package/src/tool/index.ts +0 -101
- package/src/typings.d.ts +0 -5
- package/src/util/animation.ts +0 -29
- package/src/util/browser.ts +0 -4
- package/src/util/compatible.ts +0 -15
- package/src/util/drag.ts +0 -220
- package/src/util/edge.ts +0 -1060
- package/src/util/geometry.ts +0 -55
- package/src/util/graph.ts +0 -46
- package/src/util/index.ts +0 -17
- package/src/util/matrix.ts +0 -129
- package/src/util/mobx.ts +0 -23
- package/src/util/node.ts +0 -543
- package/src/util/raf.ts +0 -28
- package/src/util/resize.ts +0 -606
- package/src/util/sampling.ts +0 -85
- package/src/util/theme.ts +0 -375
- package/src/util/uuid.ts +0 -26
- package/src/util/vector.ts +0 -93
- package/src/util/zIndex.ts +0 -6
- package/src/view/Anchor.tsx +0 -445
- package/src/view/Control.tsx +0 -512
- package/src/view/Graph.tsx +0 -141
- package/src/view/Rotate.tsx +0 -113
- package/src/view/behavior/dnd.ts +0 -162
- package/src/view/behavior/index.ts +0 -2
- package/src/view/behavior/snapline.ts +0 -16
- package/src/view/edge/AdjustPoint.tsx +0 -425
- package/src/view/edge/Arrow.tsx +0 -54
- package/src/view/edge/BaseEdge.tsx +0 -650
- package/src/view/edge/BezierEdge.tsx +0 -101
- package/src/view/edge/LineEdge.tsx +0 -81
- package/src/view/edge/PolylineEdge.tsx +0 -299
- package/src/view/edge/index.ts +0 -6
- package/src/view/index.ts +0 -8
- package/src/view/node/BaseNode.tsx +0 -571
- package/src/view/node/CircleNode.tsx +0 -21
- package/src/view/node/DiamondNode.tsx +0 -24
- package/src/view/node/EllipseNode.tsx +0 -22
- package/src/view/node/HtmlNode.tsx +0 -95
- package/src/view/node/PolygonNode.tsx +0 -28
- package/src/view/node/RectNode.tsx +0 -30
- package/src/view/node/TextNode.tsx +0 -39
- package/src/view/node/index.ts +0 -8
- package/src/view/overlay/BackgroundOverlay.tsx +0 -34
- package/src/view/overlay/BezierAdjustOverlay.tsx +0 -150
- package/src/view/overlay/CanvasOverlay.tsx +0 -288
- package/src/view/overlay/Grid.tsx +0 -162
- package/src/view/overlay/ModificationOverlay.tsx +0 -31
- package/src/view/overlay/OutlineOverlay.tsx +0 -170
- package/src/view/overlay/SnaplineOverlay.tsx +0 -44
- package/src/view/overlay/ToolOverlay.tsx +0 -65
- package/src/view/overlay/getTransformHoc.tsx +0 -50
- package/src/view/overlay/index.ts +0 -8
- package/src/view/shape/Circle.tsx +0 -41
- package/src/view/shape/Ellipse.tsx +0 -42
- package/src/view/shape/Line.tsx +0 -39
- package/src/view/shape/Path.tsx +0 -22
- package/src/view/shape/Polygon.tsx +0 -91
- package/src/view/shape/Polyline.tsx +0 -31
- package/src/view/shape/Rect.tsx +0 -44
- package/src/view/shape/Text.tsx +0 -169
- package/src/view/shape/index.ts +0 -8
- package/src/view/text/BaseText.tsx +0 -134
- package/src/view/text/LineText.tsx +0 -168
- package/src/view/text/index.ts +0 -2
- package/stats.html +0 -4842
- package/tsconfig.json +0 -18
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
---
|
|
2
|
+
nav: Guide
|
|
3
|
+
group:
|
|
4
|
+
title: Plug-in functionality
|
|
5
|
+
order: 3
|
|
6
|
+
title: MiniMap
|
|
7
|
+
order: 4
|
|
8
|
+
toc: content
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
<style>
|
|
12
|
+
table td:first-of-type {
|
|
13
|
+
word-break: normal;
|
|
14
|
+
}
|
|
15
|
+
</style>
|
|
16
|
+
|
|
17
|
+
LogicFlow's canvas MiniMap is a thumbnail view that helps users quickly navigate and locate different areas of large or complex diagrams.
|
|
18
|
+
|
|
19
|
+
This article covers the latest syntax for version 2.0. For versions before 2.0, please visit the [old version](https://docs.logic-flow.cn/docs/#/zh/guide/extension/component-minimap).
|
|
20
|
+
|
|
21
|
+
## Demonstration
|
|
22
|
+
|
|
23
|
+
<code id="react-portal" src="@/src/tutorial/extension/mini-map"></code>
|
|
24
|
+
|
|
25
|
+
## Usage
|
|
26
|
+
|
|
27
|
+
### 1. Registration
|
|
28
|
+
|
|
29
|
+
There are two registration methods: global registration and local registration. The difference is that global registration allows every `lf` instance to use it.
|
|
30
|
+
|
|
31
|
+
```tsx | pure
|
|
32
|
+
import LogicFlow from "@logicflow/core";
|
|
33
|
+
import { MiniMap } from "@logicflow/extension";
|
|
34
|
+
|
|
35
|
+
// Global registration
|
|
36
|
+
LogicFlow.use(MiniMap);
|
|
37
|
+
|
|
38
|
+
// Local registration
|
|
39
|
+
const lf = new LogicFlow({
|
|
40
|
+
...config,
|
|
41
|
+
plugins: [MiniMap]
|
|
42
|
+
});
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
### 2. Configuration
|
|
46
|
+
|
|
47
|
+
When initializing the `lf` instance, you can customize the MiniMap's capabilities through `pluginsOptions`.
|
|
48
|
+
|
|
49
|
+
```tsx | pure
|
|
50
|
+
const miniMapOptions: MiniMap.MiniMapOption = {
|
|
51
|
+
...options
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
const lf = new LogicFlow({
|
|
55
|
+
...config,
|
|
56
|
+
plugins: [MiniMap],
|
|
57
|
+
pluginsOptions: {
|
|
58
|
+
miniMap: miniMapOptions,
|
|
59
|
+
},
|
|
60
|
+
});
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
The `miniMapOptions` configuration is as follows:
|
|
64
|
+
|
|
65
|
+
| Property Name | Type | Default Value | Required | Description |
|
|
66
|
+
| --------------- | ------- | ------------- | -------- | ----------------------------------------------------------------------------------------------------- |
|
|
67
|
+
| width | number | 150 | - | The width of the canvas in the MiniMap |
|
|
68
|
+
| height | number | 220 | - | The height of the canvas in the MiniMap |
|
|
69
|
+
| showEdge | boolean | false | - | Whether to render edges in the MiniMap |
|
|
70
|
+
| headerTitle | string | Navigation | - | The text content of the MiniMap's title bar; defaults to not showing |
|
|
71
|
+
| isShowHeader | boolean | false | - | Whether to show the MiniMap's title bar |
|
|
72
|
+
| isShowCloseIcon | boolean | false | - | Whether to show the close button |
|
|
73
|
+
| leftPosition | number | - | - | The left margin of the MiniMap from the canvas's left boundary; takes precedence over `rightPosition` |
|
|
74
|
+
| rightPosition | number | 0 | - | The right margin of the MiniMap from the canvas's right boundary; lower priority than `leftPosition` |
|
|
75
|
+
| topPosition | number | - | - | The top margin of the MiniMap from the canvas's top boundary; takes precedence over `bottomPosition` |
|
|
76
|
+
| bottomPosition | number | 0 | - | The bottom margin of the MiniMap from the canvas's bottom boundary; lower priority than `topPosition` |
|
|
77
|
+
|
|
78
|
+
## API
|
|
79
|
+
|
|
80
|
+
### show
|
|
81
|
+
|
|
82
|
+
By default, the MiniMap is not displayed after being included; you need to manually enable it.
|
|
83
|
+
|
|
84
|
+
```tsx | pure
|
|
85
|
+
lf.extension.miniMap.show(left?: number, top?: number): void
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
`show()` supports passing `left` and `top` style properties to determine the MiniMap's position relative to the top-left corner of the canvas. If not provided, it defaults to the bottom-right corner of the canvas.
|
|
89
|
+
|
|
90
|
+
Providing only `left` and `top` values allows integration with the `lf.getPointByClient` API. For more flexible styling, you can directly set styles via class names:
|
|
91
|
+
|
|
92
|
+
- `lf-mini-map` - MiniMap root element
|
|
93
|
+
- `lf-mini-map-header` - MiniMap header element
|
|
94
|
+
- `lf-mini-map-graph` - MiniMap canvas element
|
|
95
|
+
- `lf-mini-map-close` - MiniMap close icon element
|
|
96
|
+
|
|
97
|
+
:::warning
|
|
98
|
+
`MiniMap.show()` must be called after `lf.render()`. Otherwise, the console will always show a warning.
|
|
99
|
+
:::
|
|
100
|
+
|
|
101
|
+
### hide
|
|
102
|
+
|
|
103
|
+
Hide the MiniMap.
|
|
104
|
+
|
|
105
|
+
```tsx | pure
|
|
106
|
+
lf.extension.miniMap.hide(): void
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
### reset
|
|
110
|
+
|
|
111
|
+
Reset the MiniMap's zoom and translation, essentially resetting the canvas's zoom and translation.
|
|
112
|
+
|
|
113
|
+
```tsx | pure
|
|
114
|
+
lf.extension.miniMap.reset(): void
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
Internal implementation:
|
|
118
|
+
|
|
119
|
+
```tsx | pure
|
|
120
|
+
lf.resetTranslate()
|
|
121
|
+
lf.resetZoom()
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
### updatePosition
|
|
125
|
+
|
|
126
|
+
Update the MiniMap's position on the canvas.
|
|
127
|
+
|
|
128
|
+
```tsx | pure
|
|
129
|
+
lf.extension.miniMap.updatePosition(MiniMapPosition): void
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
`MiniMapPosition` parameter is as follows:
|
|
133
|
+
|
|
134
|
+
```tsx | pure
|
|
135
|
+
export type AbsolutePosition = Partial<
|
|
136
|
+
Record<'left' | 'right' | 'top' | 'bottom', number>
|
|
137
|
+
>
|
|
138
|
+
|
|
139
|
+
export type MiniMapPosition =
|
|
140
|
+
| 'left-top' // Indicates the MiniMap is located at the top-left corner of the container
|
|
141
|
+
| 'right-top' // Indicates the MiniMap is located at the top-right corner of the container
|
|
142
|
+
| 'left-bottom' // Indicates the MiniMap is located at the bottom-left corner of the container
|
|
143
|
+
| 'right-bottom' // Indicates the MiniMap is located at the bottom-right corner of the container
|
|
144
|
+
| AbsolutePosition // Custom position of the MiniMap on the canvas
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
### setShowEdge
|
|
148
|
+
|
|
149
|
+
Set whether the edges are displayed in the MiniMap's canvas.
|
|
150
|
+
|
|
151
|
+
```tsx | pure
|
|
152
|
+
lf.extension.miniMap.setShowEdge(showEdge: boolean): void
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
`showEdge`: `true` to display, `false` to hide.
|
|
156
|
+
|
|
157
|
+
## Events
|
|
158
|
+
|
|
159
|
+
MiniMap events.
|
|
160
|
+
|
|
161
|
+
| Event Name | Description | Event Object |
|
|
162
|
+
| ------------- | -------------- | ------------ |
|
|
163
|
+
| miniMap:close | MiniMap hidden | {} |
|
|
164
|
+
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
---
|
|
2
|
+
nav: 指南
|
|
3
|
+
group:
|
|
4
|
+
title: 插件功能
|
|
5
|
+
order: 3
|
|
6
|
+
title: 小地图 (MiniMap)
|
|
7
|
+
order: 4
|
|
8
|
+
toc: content
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
<style>
|
|
12
|
+
table td:first-of-type {
|
|
13
|
+
word-break: normal;
|
|
14
|
+
}
|
|
15
|
+
</style>
|
|
16
|
+
|
|
17
|
+
LogicFlow 的画布小地图是一个缩略图视图,帮助用户快速导航和定位大型或复杂图表的不同区域。
|
|
18
|
+
|
|
19
|
+
本文是 2.0 版本最新语法,2.0 版本以前请移步<a href="https://docs.logic-flow.cn/docs/#/zh/guide/extension/component-minimap" target="_blank">旧版</a>。
|
|
20
|
+
|
|
21
|
+
## 演示
|
|
22
|
+
|
|
23
|
+
<code id="react-portal" src="@/src/tutorial/extension/mini-map"></code>
|
|
24
|
+
|
|
25
|
+
## 使用
|
|
26
|
+
|
|
27
|
+
### 1. 注册
|
|
28
|
+
|
|
29
|
+
两种注册方式,全局注册和局部注册,区别是全局注册每一个 `lf` 实例都可以使用。
|
|
30
|
+
|
|
31
|
+
```tsx | pure
|
|
32
|
+
import LogicFlow from "@logicflow/core";
|
|
33
|
+
import { MiniMap } from "@logicflow/extension";
|
|
34
|
+
|
|
35
|
+
// 全局注册
|
|
36
|
+
LogicFlow.use(MiniMap);
|
|
37
|
+
|
|
38
|
+
// 局部注册
|
|
39
|
+
const lf = new LogicFlow({
|
|
40
|
+
...config,
|
|
41
|
+
plugins: [MiniMap]
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
### 2. 配置
|
|
47
|
+
|
|
48
|
+
在初始化 `lf` 实例时可以通过 `pluginsOptions` 自定义配置 mini-map 的能力。
|
|
49
|
+
|
|
50
|
+
```tsx | pure
|
|
51
|
+
|
|
52
|
+
const miniMapOptions: MiniMap.MiniMapOption = {
|
|
53
|
+
...options
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
const lf = new LogicFlow({
|
|
57
|
+
...config,
|
|
58
|
+
plugins: [MiniMap],
|
|
59
|
+
pluginsOptions: {
|
|
60
|
+
miniMap: miniMapOptions,
|
|
61
|
+
},
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
`miniMapOptions` 配置如下:
|
|
67
|
+
|
|
68
|
+
| 属性名 | 类型 | 默认值 | 必填 | 描述 |
|
|
69
|
+
| --------------- | ------- | ------ | ---- | ------------------------------------------------------ |
|
|
70
|
+
| width | number | 150 | - | 小地图中画布的宽度 |
|
|
71
|
+
| height | number | 220 | - | 小地图中画布的高度 |
|
|
72
|
+
| showEdge | boolean | false | - | 在小地图的画布中是否渲染边 |
|
|
73
|
+
| headerTitle | string | 导航 | - | 小地图标题栏的文本内容,默认不显示 |
|
|
74
|
+
| isShowHeader | boolean | false | - | 是否显示小地图的标题栏 |
|
|
75
|
+
| isShowCloseIcon | boolean | false | - | 是否显示关闭按钮 |
|
|
76
|
+
| leftPosition | number | - | - | 小地图与画布左边界的左边距,优先级高于`rightPosition` |
|
|
77
|
+
| rightPosition | number | 0 | - | 小地图与画布右边界的右边距,优先级低于`leftPosition` |
|
|
78
|
+
| topPosition | number | - | - | 小地图与画布上边界的上边距,优先级高于`bottomPosition` |
|
|
79
|
+
| bottomPosition | number | 0 | - | 小地图与画布下边界的下边距,优先级低于`topPosition` |
|
|
80
|
+
|
|
81
|
+
## API
|
|
82
|
+
|
|
83
|
+
### show
|
|
84
|
+
|
|
85
|
+
引入 mini-map 后默认不展示,需要手动开启显示。
|
|
86
|
+
|
|
87
|
+
```tsx | pure
|
|
88
|
+
|
|
89
|
+
lf.extension.miniMap.show(left?: number, top?: number): void
|
|
90
|
+
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
`show()` 支持传入样式属性 left 和 top 的值,用来确定 mini-map 在画布中相对于左上角的位置,不传默认显示在画布右下角。
|
|
94
|
+
|
|
95
|
+
只提供 left 和 top 这两个值是因为可以与`lf.getPointByClient` API 配合使用,如果想实现更加灵活的样式,可以直接通过类名设置样式。
|
|
96
|
+
|
|
97
|
+
- `lf-mini-map` - mini-map 根元素
|
|
98
|
+
- `lf-mini-map-header` - mini-map 头部元素
|
|
99
|
+
- `lf-mini-map-graph` - mini-map 画布元素
|
|
100
|
+
- `lf-mini-map-close` - mini-map 关闭图标元素
|
|
101
|
+
|
|
102
|
+
:::warning
|
|
103
|
+
`MiniMap.show()`必须在`lf.render()`后调用。否则控制台会一直有警告
|
|
104
|
+
:::
|
|
105
|
+
|
|
106
|
+
### hide
|
|
107
|
+
|
|
108
|
+
隐藏 mini-map。
|
|
109
|
+
|
|
110
|
+
```tsx | pure
|
|
111
|
+
|
|
112
|
+
lf.extension.miniMap.hide(): void
|
|
113
|
+
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
### reset
|
|
117
|
+
|
|
118
|
+
重置 mini-map 的缩放和平移,本质是重置画布的缩放和平移。
|
|
119
|
+
|
|
120
|
+
```tsx | pure
|
|
121
|
+
|
|
122
|
+
lf.extension.miniMap.reset(): void
|
|
123
|
+
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
内部实现:
|
|
127
|
+
|
|
128
|
+
```tsx | pure
|
|
129
|
+
|
|
130
|
+
lf.resetTranslate()
|
|
131
|
+
lf.resetZoom()
|
|
132
|
+
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
### updatePosition
|
|
136
|
+
|
|
137
|
+
更新小地图在画布中的位置。
|
|
138
|
+
|
|
139
|
+
```tsx | pure
|
|
140
|
+
|
|
141
|
+
lf.extension.miniMap.updatePosition(MiniMapPosition): void
|
|
142
|
+
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
`MiniMapPosition` 参数如下:
|
|
146
|
+
|
|
147
|
+
```tsx | pure
|
|
148
|
+
|
|
149
|
+
export type AbsolutePosition = Partial<
|
|
150
|
+
Record<'left' | 'right' | 'top' | 'bottom', number>
|
|
151
|
+
>
|
|
152
|
+
|
|
153
|
+
export type MiniMapPosition =
|
|
154
|
+
| 'left-top' // 表示迷你地图位于容器的左上角
|
|
155
|
+
| 'right-top' // 表示迷你地图位于容器的右上角
|
|
156
|
+
| 'left-bottom' // 表示迷你地图位于容器的左下角
|
|
157
|
+
| 'right-bottom' // 表示迷你地图位于容器的右下角。
|
|
158
|
+
| AbsolutePosition // 自定义小地图在画布上的位置
|
|
159
|
+
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
### setShowEdge
|
|
163
|
+
|
|
164
|
+
设置小地图的画布中是否显示边。
|
|
165
|
+
|
|
166
|
+
```tsx | pure
|
|
167
|
+
|
|
168
|
+
lf.extension.miniMap.setShowEdge(showEdge: boolean): void
|
|
169
|
+
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
`showEdge`: `true` 显示,`false` 隐藏。
|
|
173
|
+
|
|
174
|
+
## 事件
|
|
175
|
+
|
|
176
|
+
mini-map 事件。
|
|
177
|
+
|
|
178
|
+
| 事件名 | 说明 | 事件对象 |
|
|
179
|
+
| ------------- | ---------- | -------- |
|
|
180
|
+
| miniMap:close | 小地图隐藏 | {} |
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
---
|
|
2
|
+
nav: Guide
|
|
3
|
+
group:
|
|
4
|
+
title: Plug-in functionality
|
|
5
|
+
order: 3
|
|
6
|
+
title: NodeResize
|
|
7
|
+
order: 16
|
|
8
|
+
toc: content
|
|
9
|
+
tag: Deprecated
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
## Use
|
|
13
|
+
|
|
14
|
+
LogicFlow provides `RectResize`, `EllipseResize`, `DiamondResize`, `HtmlResize` in the extension package, each node has `view` and `model` attributes. The scaling of nodes is also achieved by using LogicFlow's custom node mechanism, which allows developers to inherit from these 4 types of nodes that can be scaled to achieve node scaling.
|
|
15
|
+
|
|
16
|
+
For example, if we need a rectangle that can be scaled, when we didn't support node scaling before, we customize the node in the following way:
|
|
17
|
+
|
|
18
|
+
```tsx | pure
|
|
19
|
+
import { RectNode, RectNodeModel } from '@logicflow/core'
|
|
20
|
+
|
|
21
|
+
class CustomNode extends RectNode {
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
class CustomNodeModel extends RectNodeModel {
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export default {
|
|
28
|
+
type: 'custom-node',
|
|
29
|
+
model: CustomNodeModel,
|
|
30
|
+
view: CustomNode,
|
|
31
|
+
}
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
If we expect the custom node to be scaled, then change it to:
|
|
35
|
+
|
|
36
|
+
```tsx | pure
|
|
37
|
+
import { RectResize } from '@logicflow/extension'
|
|
38
|
+
|
|
39
|
+
class CustomNode extends RectResize.view {
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
class CustomNodeModel extends RectResize.model {
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export default {
|
|
46
|
+
type: 'custom-node',
|
|
47
|
+
model: CustomNodeModel,
|
|
48
|
+
view: CustomNode,
|
|
49
|
+
}
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
### Setting shape attributes of a node
|
|
53
|
+
|
|
54
|
+
LogicFlow calls the attributes of a node such as width, height, radius, etc. as [ShapeAttributes](../../api/runtime-model/nodeModel.en.md#shape-attributes), we can override the [initNodeData](../../api/runtime-model/nodeModel.en.md#initnodedata) or [ setAttributes](../../api/runtime-model/nodeModel.en.md#setattributes) methods to set the shape attributes of a node. But when the node can be scaled, we can't set the width and height in `setAttributes`, only in `initNodeData`.
|
|
55
|
+
|
|
56
|
+
```tsx | pure
|
|
57
|
+
class ResizableRectModel extends RectResize.model {
|
|
58
|
+
initNodeData(data) {
|
|
59
|
+
super.initNodeData(data);
|
|
60
|
+
this.width = 100;
|
|
61
|
+
this.height = 40;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
### Customizing the view of a node
|
|
67
|
+
|
|
68
|
+
As mentioned in Customizing Nodes, for nodes with complex style attributes, we can override the `getShape` method in `view` to achieve the real rendered appearance of the custom node. However, since custom nodes need to populate the node's appearance with adjustment points for scaling, we need to override `getResizeShape`, not `getShape`, for the view of a custom scalable node.
|
|
69
|
+
|
|
70
|
+
```tsx | pure
|
|
71
|
+
import { RectResize } from "@logicflow/extension";
|
|
72
|
+
|
|
73
|
+
class ResizableRectModel extends RectResize.model {
|
|
74
|
+
initNodeData(data) {
|
|
75
|
+
super.initNodeData(data);
|
|
76
|
+
this.width = 100;
|
|
77
|
+
this.height = 40;
|
|
78
|
+
this.text.draggable = true;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
class ResizableRectView extends RectResize.view {
|
|
82
|
+
getResizeShape() {
|
|
83
|
+
const { model } = this.props;
|
|
84
|
+
const { x, y, width, height, radius, properties } = model;
|
|
85
|
+
const style = model.getNodeStyle();
|
|
86
|
+
return h("g", {}, [
|
|
87
|
+
h("rect", {
|
|
88
|
+
...style,
|
|
89
|
+
x: x - width / 2,
|
|
90
|
+
y: y - height / 2,
|
|
91
|
+
rx: radius,
|
|
92
|
+
ry: radius,
|
|
93
|
+
width,
|
|
94
|
+
height,
|
|
95
|
+
}),
|
|
96
|
+
]);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
export default {
|
|
101
|
+
type: "resizable-rect",
|
|
102
|
+
view: ResizableRectView,
|
|
103
|
+
model: ResizableRectModel,
|
|
104
|
+
};
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
:::info{title=tip}
|
|
108
|
+
For nodes that inherit `HtmlResize`, customize `view` by continuing to use the `setHtml` method of the `view` of the custom HTML node.
|
|
109
|
+
:::
|
|
110
|
+
|
|
111
|
+
## Event `node:resize` is thrown after node resizing.
|
|
112
|
+
|
|
113
|
+
Throw event `node:resize` after node resizing, the data include node position and node size before and after node resizing, the data is {preData, data}, the details are as follows.
|
|
114
|
+
| Name | Type | Description |
|
|
115
|
+
| :-------- | :----- | :---------------------------------- |
|
|
116
|
+
| id | string | Node id |
|
|
117
|
+
| type | string | Node type |
|
|
118
|
+
| modelType | string | Node graph type, internally defined |
|
|
119
|
+
| x | number | Node center x-axis coordinates |
|
|
120
|
+
| y | number | Node center y-axis coordinate |
|
|
121
|
+
| rx | number | x-axis radius (ellipse, rhombus) |
|
|
122
|
+
| ry | number | y-axis radius (ellipse, diamond) |
|
|
123
|
+
| width | number | Node width (rectangle) |
|
|
124
|
+
| height | number | Node height (rectangle) |
|
|
125
|
+
|
|
126
|
+
```tsx | pure
|
|
127
|
+
lf.on("node:resize", ({ preData, data }) => {
|
|
128
|
+
console.log(preData, data);
|
|
129
|
+
});
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
## Setting the maximum and minimum values for zoom-in and zoom-out
|
|
133
|
+
|
|
134
|
+
After `v1.1.8`, the zoom-in/zoom-out of a node supports setting the maximum and minimum values.
|
|
135
|
+
|
|
136
|
+
```tsx | pure
|
|
137
|
+
class ResizableRectModel extends RectResize.model {
|
|
138
|
+
initNodeData(data) {
|
|
139
|
+
super.initNodeData(data);
|
|
140
|
+
this.width = 100;
|
|
141
|
+
this.height = 40;
|
|
142
|
+
this.maxWidth = 400;
|
|
143
|
+
this.maxHeight = 400;
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
## Setting the adjustment default distance for zooming in and out
|
|
149
|
+
|
|
150
|
+
After `v1.1.8`, it is supported to set the `girdSize` property of a node, which is used to control how much distance to move the mouse before starting to zoom the node.
|
|
151
|
+
|
|
152
|
+
```tsx | pure
|
|
153
|
+
class ResizableRectModel extends RectResize.model {
|
|
154
|
+
initNodeData(data) {
|
|
155
|
+
super.initNodeData(data);
|
|
156
|
+
this.gridSize = 400;
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
```
|
|
160
|
+
:::info{title=gridSize on node scaling}
|
|
161
|
+
In most cases, to keep the nodes `neat` and to facilitate top/bottom/right/left/right alignment between nodes. `logicflow` defaults to change the size of nodes when zooming in and out, only when the mouse movement distance reaches twice the `gridSize` passed to the initialization canvas. But this has the disadvantage of a laggy feeling when adjusting. You can set the `gridSize` of each node individually without changing the initialized `gridSize` to make zooming in and out smoother.
|
|
162
|
+
:::
|
|
163
|
+
|
|
164
|
+
## Settings to adjust the border style
|
|
165
|
+
|
|
166
|
+
The resizable node displays a dashed box against the node when it is selected (the rectangle does not). Customizing its style can be achieved by overriding the `getResizeOutlineStyle` method.
|
|
167
|
+
|
|
168
|
+
```tsx | pure
|
|
169
|
+
class ResizableRectModel extends RectResize.model {
|
|
170
|
+
getResizeOutlineStyle() {
|
|
171
|
+
return {
|
|
172
|
+
stroke: "#000000",
|
|
173
|
+
strokeWidth: 1,
|
|
174
|
+
strokeDasharray: "3,3",
|
|
175
|
+
};
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
## Setting the resize point style
|
|
181
|
+
|
|
182
|
+
When the zoom-in/zoom-out node is selected, action points for resizing the node are generated at the four corners of the dashed box, which can be customized by overriding the `getControlPointStyle` method.
|
|
183
|
+
|
|
184
|
+
```tsx | pure
|
|
185
|
+
class ResizableRectModel extends RectResize.model {
|
|
186
|
+
getControlPointStyle() {
|
|
187
|
+
return {
|
|
188
|
+
width: 7,
|
|
189
|
+
height: 7,
|
|
190
|
+
fill: "#FFFFFF",
|
|
191
|
+
stroke: "#000000",
|
|
192
|
+
};
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
address: [https://codesandbox.io/s/prod-resonance-ztpvtv](https://codesandbox.io/s/prod-resonance-ztpvtv?file=/step_26_nodeResize/index.js)
|
|
198
|
+
|
|
199
|
+
<a href="https://codesandbox.io/embed/prod-resonance-ztpvtv?fontsize=14&hidenavigation=1&theme=dark&view=preview" target="_blank"> Go to CodeSandbox for examples </a>
|