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-flow

v0.0.17

Published

Pict Section Flow Diagram

Readme

Pict-Section-Flow

npm version License: MIT

An interactive flow diagram section view for the Pict application framework. Build node-based visual editors, workflow designers, and data pipeline tools with a declarative, configuration-driven API.

Pict-Section-Flow provides a complete graph editing experience — nodes, ports, connections, properties panels, theming, and layout persistence — all composable through the Fable service provider pattern.

Features

  • Node-Based Graph Editor — Drag-and-drop nodes with typed input/output ports and bezier or orthogonal connections
  • Custom Card Types — Define reusable node types with the PictFlowCard base class; register categories, icons, port constraints, and body content
  • Properties Panels — On-graph panels with four built-in types: Template, Markdown, Form, and View
  • Theming — Six built-in themes plus a CSS custom properties API with 70+ design tokens
  • Layout Persistence — Save and restore spatial arrangements to localStorage or any backend
  • Event System — Hook into 20+ lifecycle events for custom behavior without modifying core code
  • Viewport Controls — Pan, zoom, fullscreen, grid snap, zoom-to-fit, and auto-layout

Installation

npm install pict-section-flow

Quick Start

const libPictSectionFlow = require('pict-section-flow');
const libPict = require('pict');

let _Pict = new libPict({ Product: 'MyFlowApp' });

// Register the flow view
_Pict.addView('MyFlow', {}, libPictSectionFlow);

// Add a node programmatically
let tmpFlowView = _Pict.views.MyFlow;
tmpFlowView.addNode('start', 50, 100, 'Begin');
tmpFlowView.addNode('end', 400, 100, 'Finish');

Custom Card Types

Define reusable node types by extending PictFlowCard:

const libPictFlowCard = require('pict-section-flow').PictFlowCard;

class IfThenElseCard extends libPictFlowCard
{
	constructor(pFable, pOptions, pServiceHash)
	{
		super(pFable, Object.assign({},
			{
				Title: 'If-Then-Else',
				Code: 'ITE',
				Category: 'Control Flow',
				TitleBarColor: '#e67e22',
				Inputs: [{ Name: 'Condition', Side: 'left' }],
				Outputs:
				[
					{ Name: 'Then', Side: 'right', PortType: 'event' },
					{ Name: 'Else', Side: 'bottom', PortType: 'error' }
				],
				PropertiesPanel:
				{
					PanelType: 'Markdown',
					Title: 'If-Then-Else',
					Configuration:
					{
						Markdown: '## Conditional Branch\nRoutes flow based on a boolean condition.'
					}
				}
			}, pOptions), pServiceHash);
	}
}

Card Help from Markdown

Store help documentation as markdown files in docs/card-help/ named by card code (e.g. ITE.md, SET.md). The build script converts them to HTML and generates a JavaScript module:

npm run generate-help

Reference the generated content in your card constructor:

const libCardHelp = require('./card-help-content');

// In the constructor options object:
Help: libCardHelp['ITE'] || false,

The || false fallback ensures the build never fails if a markdown file is missing.

Configuration Options

| Option | Type | Default | Description | |--------|------|---------|-------------| | ViewIdentifier | string | 'Pict-Flow' | Unique view identifier | | FlowDataAddress | string/false | false | AppData path for two-way binding | | EnableToolbar | boolean | true | Show the toolbar UI | | EnablePanning | boolean | true | Allow canvas panning | | EnableZooming | boolean | true | Allow canvas zooming | | EnableNodeDragging | boolean | true | Allow node repositioning | | EnableConnectionCreation | boolean | true | Allow port-to-port connections | | EnableGridSnap | boolean | false | Snap nodes to grid | | GridSnapSize | number | 20 | Grid cell size in pixels | | MinZoom | number | 0.1 | Minimum zoom level | | MaxZoom | number | 5.0 | Maximum zoom level | | Theme | string | 'default' | Active theme key |

Built-in Themes

| Theme | Style | |-------|-------| | default | Clean, modern, professional | | sketch | Hand-drawn, informal | | blueprint | Technical blueprint | | mono | Monochrome | | retro-80s | Neon retro | | retro-90s | Vaporwave |

Documentation

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

API Reference (Function Docs)

Detailed per-function documentation with code snippets:

| Function | Description | |----------|-------------| | addNode | Create a node on the canvas | | removeNode | Delete a node and its connections | | addConnection | Connect two ports | | removeConnection | Delete a connection | | getFlowData / setFlowData | Get or load entire flow state | | selectNode / deselectAll | Manage selection state | | openPanel / closePanel / togglePanel | Properties panel lifecycle | | setZoom / zoomToFit | Viewport zoom controls | | autoLayout | Automatic topological layout | | setTheme / registerTheme | Theme management | | registerHandler / fireEvent | Event system | | saveLayout / restoreLayout | Layout persistence | | marshalToView / marshalFromView | AppData two-way binding | | PictFlowCard | Custom node type base class | | PictFlowCardPropertiesPanel | Custom panel base class | | registerNodeType | Node type registry | | screenToSVGCoords | Coordinate conversion | | toggleFullscreen | Fullscreen mode |

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.