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

timing-diagram-generator

v1.3.1

Published

Generate timing diagrams

Downloads

12

Readme

UML Timing Diagram Generator

Generate UML timing diagrams from text-based descriptions

Setup

npm i -g timing-diagram-generator
tdg my_diagram.tdg > output.svg

Installing the Vim syntax

With vim-plug:

Plug 'jayden-chan/timing-diagram-generator', { 'branch': 'vim-plugin' }

Examples

Website Example (source)

Simple

Simple (source)

Simple

Task Scheduler (source)

Simple

Full Usage

Config

Syntax

config VARIABLE_NAME value

Example

config TICK_WIDTH 50
config LEGEND_FREQUENCY 5

# label the axis every `LEGEND_FREQUENCY` ticks
config LEGEND_MODE freq

# label the axis on each state change
config LEGEND_MODE significant

Title

Syntax

title "<title>"

Example

title "My Diagram Title"

Lifeline

Syntax

lifeline "<lifeline>"

Example

lifeline "My Lifeline"

State

Syntax

state "<lifeline>" "<state name>" <index>

Example

state "My Lifeline" "My First State" 0
state "My Lifeline" "My Second State" 1

Tick

Syntax

T<index> "<lifeline>" <state index>

Example

T0 "My Lifeline" 0
T7 "My Lifeline" 1
T9 "My Lifeline" 0

Span

Syntax

span "<lifeline>" T<start index>:T<end index> "<label text>"

Example

span "My Lifeline" T0:T7 "{0...400 ms}"

Arrow

Syntax

# Simple
T<start index>:"<start lifeline>" -> T<end index>:"<end lifeline>"

# Dashed line
T<start index>:"<start lifeline>" => T<end index>:"<end lifeline>"

# With label at % of arrow length
T<start index>:"<start lifeline>" -> T<end index>:"<end lifeline>" "<label>":<label %>

# Label on left/right side
T<start index>:"<start lifeline>" -> T<end index>:"<end lifeline>" "<label>":<label %>:L/R

# Arrow connecting to the upper part of the timeline
T<start index>:"<start lifeline>" -> T<end index>:"<end lifeline>":<connection point>

Examples

# Simple Arrow
T6:"DNS Resolver" -> T7:"Web Browser"

# Dashed line arrow
T6:"DNS Resolver" => T7:"Web Browser"

# With label "URL" at 40% of the arrow length
T2:"Web User" -> T2:"Web Browser" "URL":40

# With label at 38% of the arrow length on the left side
T3:"Web Browser" -> T4:"DNS Resolver" "Resolve URL":38:L

# Arrow connecting to the upper part of the timeline at T12
T11:"Web Server" => T12:"Web Browser":1 "HTTP Response":45

Lifeline Timeline Style

Syntax

style "<lifeline>" Normal|Simplified|Slice

Example

# display a line graph representing the changes in state
style "My Lifeline" Normal

# only display one state at a time
style "My Lifeline" Simplified

# Display color-coded slices representing the current state
style "My Lifeline" Slice

Macros

Syntax

macro <name> <value>

Example

macro MyMacro "Sending update to server"

# expands to `lifeline "Sending update to server"`
lifeline MyMacro

state MyMacro "My First State" 0
state MyMacro "My Second State" 1