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

mg-line-brushing

v0.0.6

Published

A step-wise brushing extension for line charts.

Downloads

22

Readme

mg-line-brushing

A extension to metrics-graphics which adds step-wise brushing support to line charts.

Requires metrics-graphics >= v2.5

Caveats

This addon currently only supports the aggregated rollover. When including this addon, args.aggregate_rollover will automatically be set to true.

While it does work with the voronoi setup, d3 raises a few errors in the console, so additional work is required for that. (A PR is more than welcome!)

Usage

Install using bower:

  • bower install mg-line-brushing --save

Include dist/mg_line_brushing.js in your build, or include it in your HTML:

  • <script src="bower_components/mg-line-brushing/dist/mg_line_brushing.js"></script>

Import the default styles from dist/mg_line_brushing.css, or create your own:

  • <link rel="stylesheet" href="bower_components/mg-line-brushing/dist/mg_line_brushing.css" type="text/css" />

Options

| Option | Default | Notes | |--------|---------|-------| | brushing | true | Enable this addon. | | brushing_history | true | Enables the stepwise zoom-out. This introduces an element of statefulness into the chart, which can be unhelpful in certain cirumstances. If you are managing state manually, set this to false. | | after_brushing | null | An optional callback which is triggered after brushing. E.g. args.after_brushing = function(step) { console.log(step); }. The sole paramter passed to the callback is step, an object consisting of the new bounds for the chart: {min_x: ..., max_x: ..., min_y: ..., max_y: ...} | | brushing_manual_redraw | false | If true, this will prevent the chart being redrawn. Useful if you want to defer the update until you're ready. Simply call MG.data_graphic(args); to trigger a redraw. |

Requirements

Contributing

Found a bug or have an idea for a new feature? File an issue or, better still, submit a PR :

  1. Code your fix / feature.
  2. Write some tests.
  3. Submit a PR.