New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@danchitnis/react-fps-stats

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@danchitnis/react-fps-stats - npm Package Compare versions

Comparing version 0.3.0 to 0.3.1

32

dist/index.esm.js

@@ -28,17 +28,2 @@ import React, { useState, useRef, useEffect } from 'react';

prevTime = currentTime;
const maxFps = Math.max.apply(Math.max, fpsList);
if (canvasMain.current) {
const ctx = canvasMain.current.getContext("2d");
const w = canvasMain.current.width;
const h = canvasMain.current.height;
if (ctx) {
ctx.clearRect(0, 0, w, h);
ctx.fillStyle = barColor ? barColor : baseBarColor;
fpsList.forEach((e, i) => {
const rh = e / maxFps;
const ri = capacity - i - 1;
ctx.fillRect((ri * w) / capacity, h * (1 - rh), w / capacity, rh * h);
});
}
}
}

@@ -52,2 +37,19 @@ afRequest = requestAnimationFrame(calcFPS);

}, []);
useEffect(() => {
const maxFps = Math.max.apply(Math.max, fps);
if (canvasMain.current) {
const ctx = canvasMain.current.getContext("2d");
const w = canvasMain.current.width;
const h = canvasMain.current.height;
if (ctx) {
ctx.clearRect(0, 0, w, h);
ctx.fillStyle = barColor ? barColor : baseBarColor;
fps.forEach((e, i) => {
const rh = e / maxFps;
const ri = capacity - i - 1;
ctx.fillRect((ri * w) / capacity, h * (1 - rh), w / capacity, rh * h);
});
}
}
}, [fps]);
const wrapperStyle = {

@@ -54,0 +56,0 @@ zIndex: 100,

@@ -33,17 +33,2 @@ 'use strict';

prevTime = currentTime;
const maxFps = Math.max.apply(Math.max, fpsList);
if (canvasMain.current) {
const ctx = canvasMain.current.getContext("2d");
const w = canvasMain.current.width;
const h = canvasMain.current.height;
if (ctx) {
ctx.clearRect(0, 0, w, h);
ctx.fillStyle = barColor ? barColor : baseBarColor;
fpsList.forEach((e, i) => {
const rh = e / maxFps;
const ri = capacity - i - 1;
ctx.fillRect((ri * w) / capacity, h * (1 - rh), w / capacity, rh * h);
});
}
}
}

@@ -57,2 +42,19 @@ afRequest = requestAnimationFrame(calcFPS);

}, []);
React.useEffect(() => {
const maxFps = Math.max.apply(Math.max, fps);
if (canvasMain.current) {
const ctx = canvasMain.current.getContext("2d");
const w = canvasMain.current.width;
const h = canvasMain.current.height;
if (ctx) {
ctx.clearRect(0, 0, w, h);
ctx.fillStyle = barColor ? barColor : baseBarColor;
fps.forEach((e, i) => {
const rh = e / maxFps;
const ri = capacity - i - 1;
ctx.fillRect((ri * w) / capacity, h * (1 - rh), w / capacity, rh * h);
});
}
}
}, [fps]);
const wrapperStyle = {

@@ -59,0 +61,0 @@ zIndex: 100,

{
"name": "@danchitnis/react-fps-stats",
"version": "0.3.0",
"version": "0.3.1",
"description": "FPS Stats in React",

@@ -5,0 +5,0 @@ "repository": "https://github.com/danchitnis/react-fps-stats",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc