Skip to content

Commit 3ffc838

Browse files
committed
add canvas for unit tests
1 parent 0009036 commit 3ffc838

File tree

5 files changed

+358
-19
lines changed

5 files changed

+358
-19
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
"@observablehq/plot": "./src/index.js"
3030
},
3131
"devDependencies": {
32+
"canvas": "^2.6.1",
3233
"d3": "^6.3.1",
3334
"eslint": "^7.12.1",
3435
"esm": "^3.2.25",

src/legend.js

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -39,16 +39,6 @@ export class ColorLegend {
3939
tickValues
4040
} = {}
4141
} = {} } = this;
42-
console.warn({
43-
title,
44-
tickSize,
45-
width,
46-
height,
47-
top,
48-
bottom,
49-
left,
50-
right
51-
});
5242
const tx = left !== undefined ? left : canvasWidth - width + right;
5343
const ty = bottom !== undefined ? canvasHeight - bottom - height : top;
5444
return create("svg:g")

test/output/gistempAnomaly.svg

Lines changed: 17 additions & 0 deletions
Loading

test/plots/gistemp-anomaly.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ export default async function() {
1313
grid: true
1414
},
1515
color: {
16-
type: "diverging"
16+
type: "diverging",
17+
legend: true
1718
},
1819
marks: [
1920
Plot.ruleY([0]),

0 commit comments

Comments
 (0)