Skip to content

Commit

Permalink
compatibility with canvas 1-2
Browse files Browse the repository at this point in the history
  • Loading branch information
Fil committed Aug 26, 2020
1 parent f8a36c7 commit 76ade30
Show file tree
Hide file tree
Showing 3 changed files with 394 additions and 21 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
},
"sideEffects": false,
"devDependencies": {
"canvas": "1",
"canvas": "1 - 2",
"d3-format": "1",
"eslint": "5",
"rollup": "0.64",
Expand Down
3 changes: 3 additions & 0 deletions test/render-world
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ var fs = require("fs"),
Canvas = require("canvas"),
d3 = Object.assign({}, require("d3-geo"), require("../"));

// canvas@2 compatibility check
if (Canvas.Canvas) Canvas = Canvas.Canvas;

var canvas = new Canvas(width, height),
context = canvas.getContext("2d");

Expand Down
Loading

0 comments on commit 76ade30

Please sign in to comment.