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

flow-path

v0.1.1

Published

A vue3 component that can quickly create flowcharts.

Downloads

6

Readme

Flow Path

A vue3 component that can quickly create flowcharts.

appearance.png

Install

yarn add flow-path

Usage

<template>
  <FlowPath :nodes="nodes" :role-order="roleOrder"></FlowPath>
</template>

<script setup lang="ts">
import { defineComponent } from 'vue'

import { FlowPath } from 'flow-path'

import type { NodeOptions } from 'flow-path'

const nodes: NodeOptions[] = [
  { id: 1, name: 'Start', role: 'role5', nextId: 2, state: 'success' },
  { id: 2, name: 'Compile mission', role: 'role5', nextId: 3, state: 'success', problem: '5 day later' },
  { id: 3, name: 'Review mission', role: 'role2', nextId: 4, state: 'success' },
  { id: 4, name: 'Confirm mission', role: 'role1', nextId: 5, state: 'pending' },
  { id: 5, name: 'Plan', role: 'role5', nextId: 6, state: 'fail' },
  { id: 6, name: 'Review plan', role: 'role2', nextId: 7 },
  { id: 7, name: 'Confirm plan', role: 'role1', nextId: 8 },
  { id: 8, name: 'Survey', role: 'role5', nextId: 9 },
  { id: 9, name: 'Design', role: 'role5', nextId: 10 },
  { id: 10, name: 'Estimate', role: 'role5', nextId: 11 },
  { id: 11, name: 'Review estimate', role: 'role4', nextId: 12 },
  { id: 12, name: 'Expert evaluation', role: 'role2', nextId: 13 },
  { id: 13, name: 'Confirm estimate', role: 'role1', nextId: 14 },
  { id: 14, name: 'Report estimate', role: 'role2', nextId: 15 },
  { id: 15, name: 'file', role: 'role3' }
]

const roleOrder = ['role1', 'role2', 'role3', 'role4', 'role5']
</script>

Props

import type { PropType } from 'vue'

type Key = string | number
type NodeState = 'success' | 'fail' | 'pending' | 'waiting'

interface NodeOptions {
  id: Key
  name: string
  role: string
  prevId?: Key | null
  nextId?: Key | null
  state?: NodeState
  problem?: string
}

const props: {
  nodes: {
    type: Array as PropType<NodeOptions[]>,
    default: () => []
  },
  roleOrder: {
    type: [Array, Function] as PropType<string[] | ((prev: string, next: string) => number)>,
    default: () => []
  },
  rowHeight: {
    type: Number,
    default: 100
  },
  nodeWidth: {
    type: Number,
    default: 120
  },
  nodeGap: {
    type: Number,
    default: 30
  },
  roleWidth: {
    type: Number,
    default: 72
  },
  autoState: {
    type: Boolean,
    default: false
  }
}

Play

Clone and run yarn run serve, and check src/__serve__.

License

MIT License.