Coder Social home page Coder Social logo

orlowang / diagrams Goto Github PK

View Code? Open in Web Editor NEW

This project forked from seflless/diagrams

0.0 2.0 0.0 802 KB

Generate Flowcharts, Network Sequence Diagrams, GraphViz Dot Diagrams, and Railroad Diagrams

License: MIT License

JavaScript 78.77% HTML 21.23%

diagrams's Introduction

Build Status

Overview

Command line tool for generating a suite of various types of diagrams, each based on intuitive text DSLs.

Also see Atom Diagrams Plugin that integrates this into the Atom IDE

Documentation

Installation

npm install -g diagrams

Usage

watch

The diagrams CLI provides the watch command that will automatically generate the .svg visualization of each diagram file format it supports. Run the following:

Generates all of the .svg files, then starts watching the current directory and regenerates any diagram file that changes.

diagrams watch

Generates all .svg files, but don't start watching after.

diagrams build

To provide the target directory to watch just pass it as an argument right after the watch command.

diagrams watch somedirectory --build

Diagrams

flowchart

Documentation: Flowchart.js .

To generate flowcharts, run:

diagrams flowchart input.flowchart flowchart.svg
input.flowchart flowchart.svg

st=>start: Start
e=>end
op1=>operation: My Operation
sub1=>subroutine: My Subroutine
cond=>condition: Yes
or No?:>http://www.google.com
io=>inputoutput: catch something

st->op1->cond cond(yes)->io->e cond(no)->sub1(right)->op1

sequence

Documentation: Network Sequence Diagram Syntax .

To generate Network Sequence Diagrams, run:

diagrams sequence input.sequence sequence.svg
input.sequence sequence.svg

Alice->Bob: Hello Bob, how are you?
Note right of Bob: Bob thinks
Bob-->Alice: I am good thanks!

  

dot

Documentation on the dot file format:

To generate diagrams from Graphviz's .dot file format, run:

diagrams dot input.dot dot.svg
input.dot dot.svg

digraph G {
    main -> parse -> execute;
    main -> init;
    main -> cleanup;
    execute -> make_string;
    execute -> printf
    init -> make_string;
    main -> printf;
    execute -> compare;
}

  

railroad

Documentation see railroad-diagrams's documentation':

  • NOTE: There is no real documentation for the input file syntax (PRs welcome), but the examples should help you figure it out a bit
  • Examples
  • Online Generator

To generate Railroad Diagrams, run:

diagrams railroad input.railroad railroad.svg
input.railroad railroad.svg

Diagram(
  Optional('+', 'skip'),
    Choice(0,
      NonTerminal('name-start char'),
      NonTerminal('escape')),
      ZeroOrMore(
        Choice(0,
          NonTerminal('name char'),
          NonTerminal('escape'))))

  

Contributing

Setup

git clone [email protected]:francoislaberge/arbitrary.git
cd arbitrary

Testing

npm test

Publishing to NPM

Do the usual npm version bump then publish.

npm version <major|minor|patch>
git push; git push --tags
npm publish

All tests are run automatically on push via our travis-ci integration.

Credits

TODOs

It's a work in progress. See TODO.md.

diagrams's People

Contributors

jibolaberge avatar seflless avatar lukecarrier avatar edjopato avatar

Watchers

James Cloos avatar Orlo Wang avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.