-
Notifications
You must be signed in to change notification settings - Fork 15
Open
Description
I tried to generate an image file and save it as 'testimage.png'. However, the following error shows up:
>> Exported "./testimage.html", open in a web browser
ERR: TypeError [ERR_INVALID_CALLBACK]: Callback must be a function
at maybeCallback (fs.js:136:9)
at Object.writeFile (fs.js:1182:14)
at svg2png.then.buffer (C:\Users\Huan\Desktop\Pinetop\itsm-backend\node_modules\d3node-output\index.js:12:24)
at process.internalTickCallback (internal/process/next_tick.js:77:7)
>> Exported: "./testimage.png"
The following is my code:
const output = require('d3node-output');
const d3nBar = require('d3node-barchart');
let data = [{'tommy': 1}, {'adam': 2}];
// create output files
output('./testimage', d3nBar({data: data}));
The html file is saved, but the 'png' file doesn't appear at all. I tried opening the html file, but it only shows the x and y axis, without the data that I passed in.
shellmann
Metadata
Metadata
Assignees
Labels
No labels