npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

sharkparty-heatmap

v0.1.2

Published

![Build](https://travis-ci.org/sharkparty/heatmap.svg?branch=master)

Downloads

13

Readme

Build

sharkparty-heatmap

This is a simple react-based heatmap that can be installed as an npm module. It's modestly configurable

Module Installation

npm i -S sharkparty-heatmap 

Run Demo Locally

git clone [email protected]:sharkparty/heatmap.git
cd heatmap/
yarn
yarn start

Requirements

  1. Map the day of week from 1-7 to Sunday-Saturday
    • In my opinion, this should be a zero-based index to conform to Javascript's day, but then I read the docs on Java's day and I caved.
    • Javascript (0-6): https://goo.gl/r3WvDo
    • Java (1-7): https://goo.gl/PGLr9D
    • Golang (0-6): https://goo.gl/BGK1Kt
  2. Map the hour of day from 0-23 to Midnight-11PM
  3. Map the "value" in a relative range (based on the min/max of the data set) into a color in the gradient from (blue, yellow, red)
    • Since this is an evaluation of the data used by the Heatmap, I thought the heatmap should calculate this based on whatever data is passed into it, so there's a function (src/components/utils/calc-meta.ts calcMeta) which takes in the Heatmap data and runs over it calculate max, min, & range.
  4. Render the data as it is supplied, but it should accept a configuration which dictates which values in the "index" field map to which axis. And the name of the property under the "data" object should also be configurable. The widget renderer should not fetch its own data, but rather it should be provided to the renderer.
    • So I default to the schema I was provided with, but it's easy enough to pass in a config to override the mappings. There's an example in the unit test:
    • const subject = heatmapDataMapper(mockData, { ...defaultConfig, path: 'result' });
  5. Appear in two different locations on the page, each of them bound to different keys in the "index" object (you will need to copy and modify the supplied data)
    • There's two mock data files and two implementations in App.tsx. This entire repo is kind of a module demo for the module sharkparty-heatmap, which can be installed as an npm package.
  6. The time period and severity controls in the screenshot are not required to be implemented
    • If I have time, I'll implement them into the little app that uses the module installation of this.
  7. All data mappings to the widget should be configurable.
    • This is discussed above—I think. (#4)