Skip to content

Commit

Permalink
Merge pull request #54 from el/master
Browse files Browse the repository at this point in the history
Add devicePixelRatio support
  • Loading branch information
Steven Edouard committed Apr 27, 2018
2 parents a69ca5a + 6dabecf commit 072796f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,11 @@ class ChartjsNode extends EventEmitter {
* @param {number} width The width of the chart canvas.
* @param {number} height The height of the chart canvas.
*/
constructor(width, height) {
constructor(width, height, devicePixelRatio) {
super();
this._width = width;
this._height = height;
this._devicePixelRatio = devicePixelRatio || 1;
}
/**
* @returns {Number} the width of the chart/canvas in pixels
Expand Down Expand Up @@ -55,6 +56,7 @@ class ChartjsNode extends EventEmitter {
</body>
</html>`,[]).then(window => {

window.devicePixelRatio = this._devicePixelRatio;
this._window = window;
const canvas = require('canvas');
const canvasMethods = ['HTMLCanvasElement'];
Expand Down

0 comments on commit 072796f

Please sign in to comment.