Skip to content

Commit 4991d06

Browse files
committed
Save user trend chart to local file
1 parent 9ee0ee2 commit 4991d06

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,5 @@ coverage
2626

2727
package-lock.json
2828
aaa
29+
30+
user-chart.svg

script/user-chart/render.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,10 @@ import {
77
GistForm,
88
updateGist
99
} from "@api/gist"
10-
import { filenameOf, getExistGist, validateTokenFromEnv } from "./common"
1110
import { EChartsType, init } from "echarts"
11+
import { writeFileSync } from "fs"
1212
import { exit } from "process"
13+
import { filenameOf, getExistGist, validateTokenFromEnv } from "./common"
1314

1415
const ALL_BROWSERS: Browser[] = ['firefox', 'edge', 'chrome']
1516

@@ -210,6 +211,7 @@ async function main(): Promise<void> {
210211
const chartData = preProcess(originData)
211212
// 3. render csv
212213
const svg = render2Svg(chartData)
214+
writeFileSync('user-chart.svg', svg, 'utf-8')
213215
// 4. upload
214216
await upload2Gist(token, svg)
215217
// 5. finish

0 commit comments

Comments
 (0)