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

table-flow-graph

v0.2.7

Published

A simple flow graph editor/viewer

Downloads

5

Readme

Table-Flow-Graph

A simple flow graph editor/viewer. (working in progress)

Features

  • Light-weight flow graph based on html table
  • Grid based lines
  • Movable & resizable nodes
  • Fully customizable

Installation

Via npm

  npm install table-flow-graph

Via yarn

  yarn add table-flow-graph

Usage

Step1: add js & css files

option A: Copy table-flow-graph/dist/index.css and table-flow-graph/dist/index.min.js to your project's static, and include them directly into html file:

<link rel="stylesheet" href="./static/table-fow-graph/index.css">
<script src="./static/table-flow-graph/index.min.js"></script>

option B: For libraries like react and vue, first import the css file into your project's entry file(usally the main.js file):

// add css to mian.js/ts/jsx/tsx
import 'table-flow-graph/dist/index.css';

then import TableFlowGraph wherever needed:

import { TableFlowGraph } from 'table-flow-graph';

Step2: prepare the dom element:

<div id="my_flow_graph"></div>

Step3: initiate TableFlowGraph instance:

const el = document.getElementById('my_flow_graph');
// create a table-flow-graph with 10x10 cells
const graphInstance = new TableFlowGraph(el, {
    isEditor: true,
    totalColumns: 10,
    totalRows: 10,
});

Options

| Option | Type | Description | Default | --- | --- | --- | --- | | isEditor | Boolean | If set to true, this flow graph instance will be editable. | false | nodes | Array | nodes(blocks) of the flow graph. | [] | columns | Array | stores data of table header title and column width. | [] | lines | Array | 2D array of anchor point ids to draw lines. | [] | totalRows | positive integer | Total row number of flow graph table. | 8 | totalColumns | positive integer | Total column numbe fo flow graph table. | 8 | maxRows | positive integer | Disable add row functionalitiy when totalRows reaches maxRows. | 30 | maxColumns | positive integer | Disable add column functionalitiy when totalColumns reaches maxColumns. | 12 | tableLayoutFixed | Boolean | If true, the width of each column will be equal. | false | labels | Object | No i18n functionalitiy provided in this project, you can use this option to customize all the texts/labels. | - | onChangeLines | Function | Event hook triggered when new line is drawn or a line is deleted. | - | addColumn | Function | Event hook triggered when 'Add Column' button is pressed. This will overwrite the build in functionalitiy of adding new column(which will trigger onAddColumn). You need to call refresh(newOptions) to refresh the flow graph instance after adding column with this method. | - | onAddColumn | Function | Event hook triggered after adding column with build in method. | - | editColumn | Function | Event hook triggered when 'Edit Column' button is pressed. This will overwrite the build in functionalitiy of editing a column(which will trigger onEditColumn). You need to call refresh(newOptions) to refresh the flow graph instance after editing column with this method. | - | onEditColumn | Function | Event hook triggered after editing column with build in method. | - | deleteColumn | Function | Event hook triggered when 'Delete Column' button is pressed. This will overwrite the build in functionalitiy of deleting a column(which will trigger onDeleteColumn). You need to call refresh(newOptions) to refresh the flow graph instance after deleting column with this method. | - | onDeleteColumn | Function | Event hook triggered after deleting column with build in method. | - | addRow | Function | Event hook triggered when 'Add Row' button is pressed. This will overwrite the build in functionalitiy of adding new row(which will trigger onAddRow). You need to call refresh(newOptions) to refresh the flow graph instance after adding row with this method. | - | onAddRow | Function | Event hook triggered after adding row with build in method. | - | deleteRow | Function | Event hook triggered when 'Delete Row' button is pressed. This will overwrite the build in functionalitiy of deleting a row(which will trigger onDeleteRow). You need to call refresh(newOptions) to refresh the flow graph instance after deleting row with this method. | - | onDeleteRow | Function | Event hook triggered after deleting row with build in method. | - | addNode | Function | Event hook triggered when 'Add Node' button is pressed. This will overwrite the build in functionalitiy of adding a node(which will trigger onAddNode). You need to call refresh(newOptions) to refresh the flow graph instance after adding node with this method. | - | onAddNode | Function | Event hook triggered after adding node with build in method. | - | editNode | Function | Event hook triggered when 'Edit Node' button is pressed. This will overwrite the build in functionalitiy of editing node(which will trigger onEditNode). You need to call refresh(newOptions to refresh the flow graph instance after editing node with this method. | - | onEditNode | Function | Event hook triggered after editing node with build in method. | - | deleteNode | Function | Event hook triggered when 'Delete Node' button is pressed. This will overwrite the build in functionalitiy of deleting a node(which will trigger onDeleteNode). You need to call refresh(newOptions) | - | onDeleteNode | Function | Event hook triggered after deleting node with build in method. | - | onClickNode | Function | Event hook triggered when node is clicked in viewer mode. | - | renderNode | Function | Customize how the node content is rendered. | - | renderNodeHoverPopup | Function | Customize how the node's hover Popup is rendered. | -