Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use in a backend Node JS environment? #346

Open
Colton1070 opened this issue Feb 19, 2022 · 1 comment
Open

How to use in a backend Node JS environment? #346

Colton1070 opened this issue Feb 19, 2022 · 1 comment

Comments

@Colton1070
Copy link

Colton1070 commented Feb 19, 2022

I'm not using this on a website.

I am frustrated to worlds end trying to find a working heatmap solution using node.js. This package tells you how to install it - and that's it. What?

How do I actually use it for that use? Is it not possible? I am ideally trying to take an image, take my data, map the data on the image, spit it out of my server. That shouldn't be that hard... Am I going to have to jerry rig my own solution with node-canvas? Why?

I tried the "alternative" npm packages but they have corroded into dust. What am I missing?

It would be nice to be able to do:

const heatmap = require('heatmap.js');
const Canvas = require('canvas');

const canvas = Canvas.createCanvas(1024, 512);
const ctx = canvas.getContext('2d');
let background = await Canvas.loadImage('./assets/image.png');
ctx.drawImage(profilecardbackground, 0, 0, canvas.width, canvas.height);

let map = heatmap.create({
    data: [{ x: 10, y: 15, value: 5}, ...],
    context: ctx
});

Or another way - it doesn't matter to me as long as it's possible!

@asmith169
Copy link

@Colton1070 Did you ever find anything for this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants