Skip to content

Error Shows Up When Trying to Output Image #9

@niickkk11212

Description

@niickkk11212

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions