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

scintilla

v0.7.3

Published

React sparklines ๐Ÿ“ˆ

Downloads

279

Readme

scintilla โ†’ react sparklines

sparklines

Node.js CI


Demo

See: https://amoradi.github.io/scintilla

Donate:

  • BTC: bc1qejny2ddag2phmyndq78hq2uxuxkh38t5v4k9mt
  • ETH: 0x16cC9a598a3817F32c5B794C9391B14Ff93bd87e

Install

$ yarn add scintilla
$ or
$ npm install scintilla --save

Quick Start

import React from "react";
import { Frame, Line } from "scintilla";

const RedLine = () => (
  {/* wrap sparkline in a container to constrain width */}
  <div style={{ width: '100px' }}>
    <Frame>
      <Line
        data={[40, 50, 60, 70]}
        stroke={{
          color: { solid: [255, 0, 0, 1] },
          width: 2,
          style: "solid"
        }}
      />
    </Frame>
  <div>
);

Features

  • composeable: mix and match as many Line's within a single Frame
  • SVG-based
  • flexible intra-data color options
  • fluid width. Wrap Frame in your own container to constrain width.

API

See: https://amoradi.github.io/scintilla/documentation

Types

type Color = {
  gradient?: RGBA | RGBA[];
  solid?: RGBA | RGBA[];
};
type RGBA = [0-255, 0-255, 0-255, 0-1]
type Stroke = {
  width: number;
  style: "dash" | "solid";
  color: Color;
};

Components

<Frame />

Responsive container for all data-needy child components. Wrap Frame in your own container to constrain width.

  • height?: number Optionally specify height in pixels. Defaults to 50px.

  • yRange?: [min<number>, max<number>] Optionally plot children components with this y axis constraint.

Example

<div style={{ width: "100px" }}>
  <Frame height={100} yRange={[0, 500]}>
    <Line />
  </Frame>
</div>

<Line />

Plot your series data as a line. Style line with stroke, fill or both.

  • data: number[] The list of y data to plot.

  • stroke?: Stroke Set width in pixels, style as 'dash' or 'solid' and color option.

  • fill?: Color Solid or gradient fill, with one or many colors. Fills area from data line to bottom axis.

Example

<div style={{ width: "100px" }}>
  <Frame>
    <Line
      data={[-1, 2, 6, 9, 11, 21]}
      stroke={{
        width: 1,
        style: "dash",
        color: {
          solid: [
            [255, 0, 0, 0.25],
            [255, 0, 0, 0.5],
            [255, 0, 0, 0.1]
          ]
        }
      }}
      fill={{
        gradient: [
          [255, 0, 0, 0.1],
          [255, 0, 0, 1]
        ]
      }}
    />
  </Frame>
</div>

<Marker />

Circular marker positioned at data[index]. Make as many as you like.

  • data: number[] The list of y data Marker will render from.

  • color?: RGBA The rgba fill color. Defaults to red.

  • index?: number position marker at data[index]. If ommited, defaults to last index.

  • size?: number<1-10> Diameter of Marker circle in pixels. Defaults to 4px.

Example

<div style={{ width: "100px" }}>
  <Frame>
    <Line
      data={[-1, 2, 6, 9, 11, 21]}
      fill={{
        gradient: [
          [255, 0, 0, 0.1],
          [255, 0, 0, 1]
        ]
      }}
    />
    {/* 2 red markers, at 5th and last index */}
    <Marker
      data={[-1, 2, 6, 9, 11, 21]}
      color={[255, 0, 0, 1]}
      size={5}
      index={5}
    />
    <Marker data={[-1, 2, 6, 9, 11, 21]} color={[255, 0, 0, 1]} size={5} />
  </Frame>
</div>

Examples

See: https://amoradi.github.io/scintilla

License

MIT