Socket
Socket
Sign inDemoInstall

heatmap-node

Package Overview
Dependencies
66
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.0.3 to 0.0.4

3

blob.js

@@ -5,3 +5,4 @@ var heatmap = require("./index");

var heat = heatmap(1024, 600, { radius: 30 });
heat.addTimestamp("February 16th 2022", "20:32:05");
heat.addTimestamp("XXXX-YYYY-ZZZZ", "February 16th 2022", "20:32:05");
fs.writeFileSync("blob2.png", heat.backgroundCanvas.toBuffer());

@@ -159,3 +159,3 @@ var convert = require("color-convert");

Heat.prototype.addTimestamp = async function (day, time) {
Heat.prototype.addTimestamp = async function (title, day, time) {
var width = this.canvas.width;

@@ -165,5 +165,21 @@ var height = this.canvas.height;

const titleWidth = ctx.measureText(title).width;
const dayWidth = ctx.measureText(day).width;
const timeWidth = ctx.measureText(time).width;
ctx.textAlign = "center";
// const buffer = fs.readFileSync("./bg.png");
// console.log("bu", buffer);
// const localImage = await loadImage(buffer);
// console.log(localImage);
// ctx.drawImage(localImage, 0, 0, width, height);
const boxWidth = Math.max(titleWidth, dayWidth, timeWidth) + 150;
const boxHeight = 60 + 50;
ctx.fillStyle = "#000";
// console.log("a", boxHeight, boxWidth);
ctx.fillRect(0, 0, boxWidth, boxHeight);
ctx.textBaseline = "top";
ctx.textAlign = "left";
ctx.fillStyle = "#fff";

@@ -173,8 +189,8 @@ ctx.strokeStyle = "black";

ctx.font = "bold 13pt Helveric";
ctx.strokeText(time, width - timeWidth / 2 - 150, 570);
ctx.fillText(time, width - timeWidth / 2 - 150, 570);
ctx.strokeText(day, 200, 570);
ctx.fillText(day, 200, 570);
ctx.fillText(title, 25, 10);
ctx.fillText(day, 25, 40);
ctx.fillText(time, 25, 70);
// fs.writeFileSync("blob2.png", this.backgroundCanvas.toBuffer());
return this;
};
{
"name": "heatmap-node",
"version": "0.0.3",
"version": "0.0.4",
"description": "canvas heat maps for node",

@@ -5,0 +5,0 @@ "main": "index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc