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 🙏

© 2026 – Pkg Stats / Ryan Hefner

flot-range-cursors-plugin

v0.0.8

Published

Range cursors for flot charting

Readme

flot-range-cursors-plugin

Build Status

This is a plugin for flot to create range cursors. Range cursors are used to measure various values on the graphs and charts. Multiple cursors are supported.

This plugin is based on another plugin flot-cursors-plugin.js which can be found in the flot chart package an adjacent repo in this org

Options

The plugin supports these options:

    cursors: [
        {
            name: string,
            position: {
                relativeStart: number
                relativeEnd: number
                start: number
                end: number
            },
            show: true or false,
            selected: true or false,
            highlighted: true or false,
            orientation: 'vertical' or 'horizontal',
            halign: 'above' or 'below',
            transparentRange: 'outside' or 'inside',
            showLabel: true or false,
            showValue: true or false,
            showBorders: true or false,
            color: color,
            fillColor: color,
            fontSize: '<number>px',
            fontFamily: string,
            fontStyle: string,
            fontWeight: string,
            lineWidth: number,
            movable: true or false,
            dashes: number,
            defaultxaxis: number,
            defaultyaxis: number
        },
        <more range cursors if needed>
    ]

name is a string containing the name/label of the cursor.

position position of the cursor. It can be specified relative to the canvas, using a relativeStart, relativeEnd pair of coordinates which are expressed as a number between 0 and 1. It can be also specified using axis based coordinates ( start, end ).

show is the cursor visible

selected is the cursor selected

highlighted is the cursor highlighted

orientation are the cursor edges vertical (in that case the range is along the x axis) or horizontal (in that case the range is along the y axis)

halign The position of the label relative to the value. 'Above' means the label is above the value

transparentRange The area of the range cursor that is transparent. Inside means the inside is transparent and the outside is opaque

showLabel if true the name of the cursor will be displayed next to the cursor manipulator.

showValue the value of the range the cursor spans (relative to the specified plot or axis) will be displayed inside the cursor range.

showBorders Show the borders and and arrow across the range

color is the color of the cursor (default is "gray")

fillColor is the color of the non-transparent part of (default is "#4F4F4F4F")

fontSize sets the font size of the cursor labels and intersection value labels. Default is '10px'.

fontFamily sets the font size of the cursor labels and intersection value labels. Default is 'sans-serif'.

fontStyle sets the font size of the cursor labels and intersection value labels. Default is ''.

fontWeight sets the font size of the cursor labels and intersection value labels. Default is ''.

lineWidth is the width of the drawn lines (default is 1). Setting lineWidth to zero creates an invisible cursor.

movable if true, the cursor can be moved with the mouse. Default is true.

dashes see: https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/setLineDash. The property here is analogous to the referenced 'segments' argument. This property affects any line that is rendered for the cursor.

defaultxaxis: the one-based index of the x axis to follow when the cursor is snapping to no plot

defaultyaxis: the one-based index of the y axis to follow when the cursor is snapping to no plot


Public Methods and events
-------------------------


The plugin adds some public methods to the plot:

* plot.getRangeCursors()

    Returns a list containing all the range cursors

* plot.addRangeCursor(options)

    creates a new range cursor with the parameters specified in options.

* plot.removeRangeCursor(cursorToRemove)

    remove the specified range cursor from the plot. cursorToRemove is a cursor
    reference to one of the cursors obtained with getCursors()

* plot.setRangeCursor(cursor , options)

    changes one or more range cursor properties.

How to use
----------

```javascript
var myFlot = $.plot( $("#graph"), ...,
{
    ...
    rangecursors: [
        { name: 'Green cursor', orientation: 'vertical', color: 'green', position { start: 0.5, end: 0.6} },
        { name: 'Red cursor', mode: 'xy', color: 'red' }
    ]
    ...
});