Skip to content

Commit ca9f662

Browse files
committed
Fix an issue with ghost graphs, additional snapshot test images
1 parent 9287a8b commit ca9f662

13 files changed

+218
-11
lines changed

.github/workflows/build-and-test.yml

Lines changed: 35 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,24 @@ on:
66
types: [opened, reopened, synchronize]
77

88
jobs:
9-
build-and-test:
9+
build:
1010
runs-on: ubuntu-latest
1111

12-
env:
13-
FOSSA_API_KEY: ${{ secrets.FOSSA_API_KEY }}
12+
steps:
13+
- uses: actions/checkout@v2
14+
with:
15+
fetch-depth: 0
16+
17+
- uses: actions/[email protected]
18+
19+
- name: Install dependencies
20+
run: npm install
21+
22+
- name: Build
23+
run: npm run build
24+
25+
test:
26+
runs-on: ubuntu-latest
1427

1528
steps:
1629
- uses: actions/checkout@v2
@@ -25,11 +38,28 @@ jobs:
2538
- name: Test
2639
run: npm run test
2740

28-
- name: Build
29-
run: npm run build
41+
- name: Archive test artifacst
42+
uses: actions/upload-artifact@v3
43+
with:
44+
name: test images
45+
path: |
46+
test/e2e/**/*.png
47+
48+
49+
license:
50+
runs-on: ubuntu-latest
51+
52+
env:
53+
FOSSA_API_KEY: ${{ secrets.FOSSA_API_KEY }}
54+
55+
steps:
56+
- uses: actions/checkout@v2
57+
with:
58+
fetch-depth: 0
3059

3160
- name: Run Fossa and upload data
3261
if: env.FOSSA_API_KEY != ''
3362
uses: fossa-contrib/fossa-action@v1
3463
with:
3564
fossa-api-key: ${{ env.FOSSA_API_KEY }}
65+

site/jest-function-plot.html

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@
44
<meta charset="UTF-8">
55
<title>Function Plot</title>
66
<link rel="stylesheet" type="text/css" rel="noopener" target="_blank" href="./css/reset.css">
7+
<style>
8+
body, text {
9+
font-family: Arial, sans-serif;
10+
color: black;
11+
font-size: 14px;
12+
}
13+
</style>
714
</head>
815
<body>
916
<div id="playground"></div>

src/chart.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -534,7 +534,9 @@ export class Chart extends EventEmitter.EventEmitter {
534534
const graphs = content
535535
.merge(contentEnter)
536536
.selectAll(':scope > g.graph')
537-
.data((d: FunctionPlotOptions) => d.data.map(datumDefaults))
537+
.data((d: FunctionPlotOptions) => {
538+
return d.data.map(datumDefaults)
539+
})
538540

539541
// enter
540542
const graphsEnter = graphs.enter().append('g').attr('class', 'graph')
@@ -548,6 +550,9 @@ export class Chart extends EventEmitter.EventEmitter {
548550
selection.call(globals.graphTypes[d.graphType](self))
549551
selection.call(helpers(self))
550552
})
553+
554+
// exit
555+
graphs.exit().remove()
551556
}
552557

553558
buildZoomHelper() {
47.8 KB
Loading
39.3 KB
Loading
29.7 KB
Loading
49.6 KB
Loading
35.9 KB
Loading
64.7 KB
Loading
73.1 KB
Loading

0 commit comments

Comments
 (0)