You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/assets/guide/en/Getting_Started.md
+44-12Lines changed: 44 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -184,24 +184,56 @@ The generated chart is as follows:
184
184
## Export GIF and Video
185
185
186
186
VMind supports exporting the generated chart as a GIF animation and video, which can be shared anytime and anywhere.
187
-
In order to implement the video export function, you need to additionally introduce VChart and FFMPEG into the project and pass them in as objects to VMind. The following will show how to get the ObjectURL of the chart GIF and video:
187
+
In order to implement the video export function, you need to additionally include VChart, FFMPEG, canvas related content in your project and pass them as objects to VMind. The following will show how to get the ObjectURL of the chart GIF and video:
188
188
189
-
First install VChartand FFMPEG:
189
+
First, install VChart, FFMPEG, and canvas-related content:
190
190
```bash
191
191
# Install with npm
192
192
npm install @visactor/vchart
193
-
npm install @ffmpeg/ffmpeg
194
-
npm install @ffmpeg/util
193
+
npm install @visactor/vrender-core
194
+
npm install @ffmpeg/ffmpeg^0.11.6
195
+
npm install canvas^2.11.2
195
196
```
196
-
197
+
Ensure that the vrender-core version matches the vchart dependency version, for example: `"@visactor/vchart": "1.12.7"` should correspond to `"@visactor/vrender-core": "0.20.7"`.
198
+
Usage is as follows:
197
199
```typescript
198
-
importVChartfrom'@visactor/vchart';
199
-
import { FFmpeg } from"@ffmpeg/ffmpeg";
200
-
import { fetchFile } from"@ffmpeg/util";
201
-
//Export video
202
-
const videoSrc =awaitvmind.exportVideo(spec, time, VChart, FFmpeg, fetchFile); //Pass in chart spec and video duration, return ObjectURL
203
-
//Export GIF image
204
-
const gifSrc =awaitvmind.exportGIF(spec, time, VChart, FFmpeg, fetchFile); //Pass in chart spec and GIF duration, return ObjectURL
0 commit comments