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

zamba-charts

v0.2.2

Published

## General Components

Downloads

12

Readme

Zamba Charts

General Components

Legend

props:
    className: String
    data: [
        color: String
        label: String
    ]

XAxis

props:
    x: d3.scale
    position: 'bottom' | 'top'
    format: FormatFunction
    hidden: Boolean
    ticks: Int # Number of ticks to render
    label: String # Label the axis and / or add units
    labels: # Dictionary of custom labels to put at the given axis values
        Int: String

YAxis

props:
    y: d3.scale
    position: 'left' | 'right'
    format: FormatFunction
    hidden: Boolean
    zero: Boolean # Start axis domain at 0
    ticks: Int # Number of ticks to render
    label: String # Label the axis and / or add units
    label_values: # Dictionary of custom labels to put at the given axis values
        Int: String

Follower

Overlay that follows the mouse position to display points on a given line or bar graph.

props:
    format: FormatFunction
    color: ColorFunction

Chart Types

Every Chart has height and width in its props. You can also override the default x and y axes (scaled 0 to the axis' maximum value) by passing a configured d3 scale x or y into props. You can also pass in color, or do this on each respective datapoint. Decorate your data with color based off of a color key while you are slicing it into series and/or configuring the legend.

Some chart types allow you to flip horizontally, which transforms the data, SVG rendering functions, and labels between axes.

You can also pass in onClick, a function of one entry of data, to be triggered when a slice, bar, line, or scatter plot element for a datapoint is clicked.

ChartMixin

A mixin for rendering a chart, resizing it, and managing rendering of axes and followers.

props:
    title: String
    width: Int
    height: Int
    axis_size: Int
    padding: Int | {left: Int, right: Int, top: Int, bottom: Int}
    color: String | (String) -> String
    follower: Bool | Options # Passed to Follower as props
    x: d3.scale
    y: d3.scale
    x_axis: # Passed to XAxis as props
    y_axis: # Passed to YAxis as props

BarChart

Bar chart to display counts (range) over discrete values or bins of a domain.

props:
    data: [
        x: Number
        y: Number
    ]

Histogram

props:
    data: [
        x: Number
        y: Number
    ]
    n_bins: Int
    group_key: String | (String) -> String

Labeled Bar

Histogram chart to display counts over a set of labeled bins.

props:
    data: [
        y: Int
        label: String
    ]
    bar_padding: Int

LineChart

props:
    data: [
        x: Number
        y: Number
    ]
    curve: Boolean
    fill: Boolean

MultiLineChart

props:
    data: [
        [
            x: Number
            y: Number
        ]
    ]
    curve: Boolean
    fill: Boolean

Scatter

props:
    fill: String #color
    data: [
        x: Int
        y: Int
    ]
    options:
        renderPoint: (d) -> <PointComponent />

Pie

props:
    data: [
        label: String
        count: Int
    ]
    onClick: (d) -> 

Gauge

Displaying a value produced within a set range. Optionally pass in markers to display baselines, averages, or other comparisons. Override the default range of 0 to 100 with options.{min, max}. You can also pass in options to configure start_angle and end_angle. Default is 12 o clock, or 0 radians.

props:
    data: [
        type: ['value', 'marker'] # value of the gauge or a marker
        value: Int
        label: String
    ]
    options:
        min: Int
        max: Int
        start_angle: rad
        end_angle: rad

        # Display the value as a number in the middle of the gauge
        show_value: Boolean

        # Don't show lighter guide filling in entirety of gauge
        guide:
            hidden: Boolean
        bar:
            radius: Int
            thickness: int
        # Padding around the gauge to give space for marker labels
        label_padding: Int