lag-radar

Trace frame rate lag with a sexy performance radar

  • Owner: mobz/lag-radar
  • Platform:
  • License::
  • Category::
  • Topic:
  • Like:
    0
      Compare:

Github stars Tracking Chart

LagRadar

It's a sexy little component for demonstrating performance - or lack of in your javascript application.

Add this to any javascript application and you can see when the app drops below
60fps as the radar sweep changes colour and gets janky.

Get your live demo
Extra awesome as Bookmarklet

Usage

The radar is published as a zero dependency es6 javascript module.


import lagRadar from './lag-radar.js';

const destroy = lagRadar({
  frames: 50,    // number of frames to draw, more = worse performance
  speed: 0.0017, // how fast the sweep moves (rads per ms)
  size: 300,     // outer frame px
  inset: 3,      // circle inset px
  parent: document.body, // DOM node to attach to
});

// later ...
destroy();

It also exposes css class hooks for styling the radar

To run the demo

npm install
npm start
open http://localhost:9080/

Genesis

This version authored by @mobz with ideas and contributions from others
for this talk
by @dan_abramov and shared to the world with love.

Main metrics

Overview
Name With Ownermobz/lag-radar
Primary LanguageJavaScript
Program languageCSS (Language Count: 3)
Platform
License:
所有者活动
Created At2018-03-26 10:34:02
Pushed At2024-04-19 01:09:39
Last Commit At2024-04-19 11:09:00
Release Count0
用户参与
Stargazers Count876
Watchers Count4
Fork Count24
Commits Count10
Has Issues Enabled
Issues Count2
Issue Open Count0
Pull Requests Count1
Pull Requests Open Count0
Pull Requests Close Count1
项目设置
Has Wiki Enabled
Is Archived
Is Fork
Is Locked
Is Mirror
Is Private