Просмотр исходного кода

docs: update concepts and core docs

xiamidaxia 10 месяцев назад
Родитель
Сommit
c3bda71713

+ 4 - 4
apps/docs/src/en/api/core/flow-node-entity.mdx

@@ -1,6 +1,6 @@
 # FlowNodeEntity/WorkflowNodeEntity
 
-Node entity, `WorkflowNodeEntity` is the alias for the node used for free layout nodes, the node entity uses the [ECS](/flowgram.ai/guide/concepts/ECS.html) architecture, is `Entity`
+Node entity, `WorkflowNodeEntity` is the alias for the node used for free layout nodes, the node entity uses the [ECS](/guide/concepts/ecs.html) architecture, is `Entity`
 
 [> API Detail](https://flowgram.ai/auto-docs/document/classes/FlowNodeEntity-1.html)
 
@@ -57,7 +57,7 @@ const nodeRegistry = node.getNodeRegistry<FlowNodeRegistry>()
 
 ### getData
 
-Equivalent to getting the Component of Entity in the [ECS](/flowgram.ai/guide/concepts/ECS.html) architecture, currently built-in two core Components
+Equivalent to getting the Component of Entity in the [ECS](/guide/concepts/ecs.html) architecture, currently built-in two core Components
 
 ```ts pure
 node.getData(FlowNodeTransformData) // transform matrix data, including the node's x, y, width, height, etc.
@@ -67,7 +67,7 @@ node.getData(FlowNodeRenderData) // node render data, including render status
 
 ### addData
 
-Equivalent to adding the Component of Entity in the [ECS](/flowgram.ai/guide/concepts/ECS.html) architecture
+Equivalent to adding the Component of Entity in the [ECS](/guide/concepts/ecs.html) architecture
 
 ```ts pure
 
@@ -92,7 +92,7 @@ node.getData(CustomEntityData).update({ key0: 'new value' })
 
 ### getService
 
-Node access [IOC](/flowgram.ai/guide/concepts/IOC.html) service
+Node access [IOC](/guide/concepts/ioc.html) service
 
 ```ts pure
 node.getService(SelectionService)

+ 1 - 1
apps/docs/src/en/api/hooks/use-service.mdx

@@ -1,6 +1,6 @@
 # useService
 
-Get all singleton modules of the underlying [IOC](/flowgram.ai/guide/concepts/IOC.html)
+Get all singleton modules of the underlying [IOC](/guide/concepts/ioc.html)
 
 ```ts pure
 

+ 4 - 4
apps/docs/src/zh/api/core/flow-node-entity.mdx

@@ -1,6 +1,6 @@
 # FlowNodeEntity/WorkflowNodeEntity
 
-节点实体,`WorkflowNodeEntity` 为节点别名用于自由布局节点, 节点实体采用 [ECS](/flowgram.ai/guide/concepts/ECS.html) 架构, 为 `Entity`
+节点实体,`WorkflowNodeEntity` 为节点别名用于自由布局节点, 节点实体采用 [ECS](/guide/concepts/ecs.html) 架构, 为 `Entity`
 
 [> API Detail](https://flowgram.ai/auto-docs/document/classes/FlowNodeEntity-1.html)
 
@@ -56,7 +56,7 @@ const nodeRegistry = node.getNodeRegistry<FlowNodeRegistry>()
 
 ### getData
 
-等价于 [ECS](/flowgram.ai/guide/concepts/ECS.html) 架构 里获取 Entity 的 Component
+等价于 [ECS](/guide/concepts/ecs.html) 架构 里获取 Entity 的 Component
 
 ```ts pure
 node.getData(FlowNodeTransformData) // transform 矩阵数据, 包含节点的 x,y,width,height 等信息
@@ -67,7 +67,7 @@ node.getData(WorkflowNodeLinesData) // 自由布局的线条数据
 
 ### addData
 
-等价于 [ECS](/flowgram.ai/guide/concepts/ECS.html) 架构 里添加 Entity 的 Component
+等价于 [ECS](/guide/concepts/ecs.html) 架构 里添加 Entity 的 Component
 
 ```ts pure
 
@@ -92,7 +92,7 @@ node.getData(CustomEntityData).update({ key0: 'new value' })
 
 ### getService
 
-节点访问 [IOC](/flowgram.ai/guide/concepts/IOC.html) 服务
+节点访问 [IOC](/guide/concepts/ioc.html) 服务
 
 ```ts pure
 node.getService(SelectionService)

+ 1 - 1
apps/docs/src/zh/api/hooks/use-service.mdx

@@ -1,6 +1,6 @@
 # useService
 
-获取底层 [IOC](/flowgram.ai/guide/concepts/IOC.html) 的所有单例模块
+获取底层 [IOC](/guide/concepts/ioc.html) 的所有单例模块
 
 ```ts pure
 

+ 7 - 3
apps/docs/src/zh/guide/concepts/canvas-engine.mdx

@@ -1,6 +1,7 @@
 
 # 画布引擎
 
+## Playground
 画布引擎底层会提供一套自己的坐标系, 主要由 Playground 驱动
 
 ```ts
@@ -120,11 +121,12 @@ export class DemoLayer extends Layer {
 ```
 
 ## FlowNodeEntity
-- 节点是一颗树,在自由画布模式,则节点是扁平的,无子节点
+
+- 节点是一颗树, 包含子节点 (blocks) 和父亲节点, 节点采用 ECS 架构
 ```ts
 inteface FlowNodeEntity {
     id: string
-    children?: FlowNodeEntity[]
+    blocks: FlowNodeEntity[]
     pre?: FlowNodeEntity
     next?: FlowNodeEntity
     parent?: FlowNodeEntity
@@ -134,7 +136,7 @@ inteface FlowNodeEntity {
 }
 ```
 
-## 2.4.4 FlowNodeTransformData 节点的bbox
+## FlowNodeTransformData 节点的位置及大小数据
 
 ```ts
 class FlowNodeTransformData {
@@ -145,6 +147,7 @@ class FlowNodeTransformData {
     getBounds(): Rectangle // 由worldMatix及 size 计算得出, 用于最终渲染,该范围也可用于确定高亮选中区域
     inputPoint(): Point // 输入点位置,一般是Block的第一个节点的中上位置(居中布局)
     outputPoint(): Point // 输出点位置,默认是节点中下位置,但条件分支,是由内置结束节点等具体逻辑判断得出
+   // ...others
 }
 ```
 
@@ -156,6 +159,7 @@ class FlowNodeRenderData {
   expanded:boolean // 是否展开
   activated: boolean // 是否激活
   hidden: boolean // 是否隐藏
+  // ...others
 }
 ```
 

+ 1 - 1
apps/docs/src/zh/guide/concepts/reactflow.mdx

@@ -3,7 +3,7 @@
 
 [Reactflow](https://reactflow.dev/) 是很优秀的开源项目,架构及代码清晰,但偏流程渲染引擎的底层架构 (Node、Edge、Handle),需要在上层开发大量功能才能适配复杂场景(如 固定布局,需要对数据建模写布局算法), 高级功能收费。
 
-相比 Reactflow,FlowGram 的目标是提供流程编辑一整套开箱即用的解决方案, 也会专门解决产品中的使用体验问题
+相比 Reactflow,FlowGram 的目标是提供流程编辑一整套开箱即用的解决方案。
 
 - 下边是 Reactflow 官方提供的 pro 收费能力