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

ha-chart

v0.0.1

Published

beautiful auto layout flowchart

Downloads

2

Readme

Hachart

HaHa, this is a flowchart generator.

online edit website

example

install

npm install ha-chart --save

quick start

<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title>flow-draw</title>
  </head>
  <body>
    <div id="container"></div>
  </body>
</html>
const {compiler, layout, Container} = require('Hachart')

const code = `
type CondStyle struct{
  "extend": "deafultShape",
  "fill": "#fcb738"
}

def start("action")
  () -> cond
end

def cond:CondStyle("is 10?")
  ("yes") -> step1
  ("no") -> step2
end

def step1("step 1")
end

def step2("step 2")
end
`

const output = layout(compiler(code))
const container = new Container({containerID: "container"})
container.draw(output)

example

API

compiler(code, options)

code

//create new style, you can extends default style to create new style
type style struct{
  "extend": "deafultShape",
  "fill": "#fcb738"
}

// create a chart
def name:style("string")
  () -> nextShape
end

options

you can change the default style at compiler code using options.

{
  type: {
    deafultShape: {
      fill: '#3ab882',
      cornerRadius: 10,
      maxWidth: 180,
      fontType: {
        fontSize: 16,
        fontFamily: 'Calibri',
        padding: 20,
        fill: '#fff',
        fontStyle: 'bold',
        align: 'center'
      }
    },
    defaultAnnotation: {
      fill: '#fff',
      fontType: {
        fontSize: 16,
        fontFamily: 'Calibri',
        padding: 5,
        fill: '#8699a3',
        fontStyle: 'bold',
        align: 'center'
      }
    },
    defaultFontType: {
      'fontSize': 16,
      'fontFamily': 'Calibri',
      'fill': '#fff',
      'fontStyle': 'bold',
      'align': 'center',
      'padding': 20
    },
    defaultArrow: {
      stroke: '#8699a3',
      strokeWidth: 3,
      lineCap: 'round',
      lineJoin: 'round'
    }
  }
}

layout(input, options)

input

const input = compiler(code)

options

name | defaultValue | description -----|---------------|------------ rankdir | TB | Direction for rank nodes. Can be TB, BT, LR, or RL, where T = top, B = bottom, L = left, and R = right. align | TB | Alignment for rank nodes. Can be UL, UR, DL, or DR, where U = up, D = down, L = left, and R = right. nodesep | 50 | Number of pixels that separate nodes horizontally in the layout. edgesep | 10 | Number of pixels that separate edges horizontally in the layout. ranksep | 50 | Number of pixels between each rank in the layout. marginx | 0 | Number of pixels to use as a margin around the left and right of the graph. marginy | 0 | Number of pixels to use as a margin around the top and bottom of the graph. acyclicer | undefined | If set to greedy, uses a greedy heuristic for finding a feedback arc set for a graph. A feedback arc set is a set of edges that can be removed to make a graph acyclic. ranker | network-simplex | Type of algorithm to assigns a rank to each node in the input graph. Possible values: network-simplex, tight-tree or longest-path

Container

constructor({containerID: "string"})

containerID: the id of document node.

draw(input)

draw the compiler code