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

pict-section-histogram

v1.0.0

Published

Pict histogram section with vertical/horizontal orientation, browser/consoleui/CLI rendering, and interactive selection

Readme

pict-section-histogram

License: MIT

A histogram visualization section for the Pict MVC framework. Renders interactive vertical or horizontal bar charts in three modes: browser (HTML/CSS), terminal UI (blessed-compatible text art), and CLI (ANSI-colored stdout). Supports single-click, multi-toggle, and draggable range selection.

Features

  • Three Render Modes -- Browser (HTML/CSS with DOM events), ConsoleUI (Unicode block art via ContentAssignment), CLI (ANSI-colored text to stdout)
  • Orientation -- Vertical (bars grow upward) or horizontal (bars grow rightward), switchable at runtime
  • Interactive Selection -- Single click, multi-toggle, or range slider with draggable handles
  • Data Binding -- Read bins from Pict AppData via manifest address resolution; write selection state back automatically
  • Config-Driven -- All layout, color, and behavior options controlled via a JSON configuration object
  • Extensible -- Override onSelectionChange for custom reactions; swap renderers at runtime with setRenderMode()

Installation

npm install pict-section-histogram

Quick Start

const libPictSectionHistogram = require('pict-section-histogram');

const histogramView = _Pict.addView('MyHistogram',
{
	DataAddress: 'AppData.HistogramBins',
	Orientation: 'vertical',
	Selectable: true,
	SelectionMode: 'range',
	InitialSelection: { Start: 2, End: 7 },
	TargetElementAddress: '#Histogram-Container-Div',
	DefaultDestinationAddress: '#Histogram-Container-Div',
	Renderables:
	[
		{
			RenderableHash: 'Histogram-Wrap',
			TemplateHash: 'Histogram-Container',
			DestinationAddress: '#Histogram-Container-Div'
		}
	]
}, libPictSectionHistogram);

histogramView.onSelectionChange = function(pSelection)
{
	console.log('Range:', pSelection.StartLabel, '-', pSelection.EndLabel);
};

Configuration Options

| Option | Type | Default | Description | |--------|------|---------|-------------| | DataAddress | string/false | false | AppData address for bin array | | Bins | array | [] | Static bin data [{ Label, Value }] | | Orientation | string | "vertical" | "vertical" or "horizontal" | | RenderMode | string | "browser" | "browser", "consoleui", or "cli" | | MaxBarSize | number | 200 | Maximum bar length in px or characters | | BarThickness | number | 30 | Bar width in px or characters | | BarGap | number | 4 | Space between bars | | Selectable | boolean | false | Enable selection mode | | SelectionMode | string | "range" | "single", "multiple", or "range" | | BarColor | string | "#4A90D9" | Default bar color | | SelectedBarColor | string | "#2ECC71" | Selected bar color |

See the full configuration reference for all options.

Lifecycle Hooks

class MyHistogram extends libPictSectionHistogram
{
	onSelectionChange(pSelection)
	{
		// React to selection changes
	}

	onAfterInitialRender()
	{
		// Customize after first render
		super.onAfterInitialRender();
	}
}

Documentation

Full documentation is available at https://stevenvelozo.github.io/pict-section-histogram/

Related Packages

License

MIT

Contributing

Pull requests are welcome. For details on our code of conduct, contribution process, and testing requirements, see the Retold Contributing Guide.