@syhr/sy-threed-graph 1.0.0-bate6 → 1.0.0-bate7
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/README.md +7 -17
- package/lib-threed/draco/draco_decoder.js +34 -0
- package/lib-threed/draco/draco_decoder.wasm +0 -0
- package/lib-threed/draco/draco_encoder.js +33 -0
- package/lib-threed/draco/draco_wasm_wrapper.js +117 -0
- package/lib-threed/sy-threed-graph.cjs +21 -21
- package/lib-threed/sy-threed-graph.mjs +5224 -5196
- package/lib-threed/sy-threed-graph.umd.js +23 -23
- package/lib-threed/threed-graph.css +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -99,13 +99,9 @@ const handleGraphEvent = (errorInfo) => {
|
|
|
99
99
|
console.error('Graph error:', errorInfo);
|
|
100
100
|
};
|
|
101
101
|
|
|
102
|
-
//
|
|
103
|
-
const
|
|
104
|
-
graphRef.value?.
|
|
105
|
-
};
|
|
106
|
-
|
|
107
|
-
const batchUpdate = (dataList) => {
|
|
108
|
-
graphRef.value?.batchUpdatePen(dataList);
|
|
102
|
+
// 获取实例
|
|
103
|
+
const getEditorInstance = () => {
|
|
104
|
+
graphRef.value?.getEditorInstance();
|
|
109
105
|
};
|
|
110
106
|
</script>
|
|
111
107
|
```
|
|
@@ -131,32 +127,26 @@ const batchUpdate = (dataList) => {
|
|
|
131
127
|
|
|
132
128
|
通过 ref 获取组件实例后可调用以下方法:
|
|
133
129
|
|
|
134
|
-
- `
|
|
135
|
-
- `getStage()` - 获取 Meta2D 实例
|
|
136
|
-
- `getAllPens()` - 获取所有图元
|
|
137
|
-
- `getCustomPenType()` - 获取所有图元类型
|
|
138
|
-
- `batchUpdatePen(dataList)` - 批量更新图元
|
|
139
|
-
- `handleLineCross()` - 处理线条交叉
|
|
140
|
-
- `changeVisibleByLevel(level, isStrict = false)` - 切换显示层级
|
|
130
|
+
- `getEditorInstance()` - 获取编辑器实例
|
|
141
131
|
|
|
142
132
|
## 使用场景
|
|
143
133
|
|
|
144
134
|
### 1. 基础三维图纸展示
|
|
145
135
|
|
|
146
136
|
```vue
|
|
147
|
-
<SyThreedGraph :
|
|
137
|
+
<SyThreedGraph :data="graphData" />
|
|
148
138
|
```
|
|
149
139
|
|
|
150
140
|
### 2. 图纸id
|
|
151
141
|
|
|
152
142
|
```vue
|
|
153
|
-
<SyThreedGraph :
|
|
143
|
+
<SyThreedGraph :url="'https://ip:port/cockpit/threed/xxx.json'" />
|
|
154
144
|
```
|
|
155
145
|
|
|
156
146
|
### 3. 直接传入数据
|
|
157
147
|
|
|
158
148
|
```vue
|
|
159
|
-
<SyThreedGraph :
|
|
149
|
+
<SyThreedGraph :id="'111111111'" />
|
|
160
150
|
```
|
|
161
151
|
|
|
162
152
|
### 4. 完整配置示例
|