shaky

0.15.0 • Public • Published

shaky

Shaky is a awesome shaky box-and-lines ASCII art diagramming tool. You can generate the diagram from ASCII. All code are compiled from coffee script which port from moe-js.

Dependencies

Because shaky uses node-canvas to draw the diagram, we need to install some dependencies for node-canvas. This page introduces many installations in different system. You can follow these manuals and start to install!

Install

npm install -g shaky

Usage

shaky -i ascii.txt -o diagram.png

Notice: The program only supports the png file extension.

If you want to write ascii.txt file, the following content will be a good example.

       +------------+     +------------+
       |            |     |            |
       |  CONTEXT   |<-+  |  CONTEXT   |<-+
       |            |  |  |            |  |
       +------------+  |  +------------+  |
                       |                  |
       +------------+  |  +------------+  |
       |    getY    |  |  |    getY    |  |
       |            |  |  |            |  |
       |     *------+--+  |     *------+--+
       |            |  |  |            |  |
       +------------+  |  +------------+  |
                       |                  |
       +------------+  |  +------------+  |
       |    getX    |  |  |    getX    |  |
       |            |  |  |            |  |
       |     *------+--+  |     *------+--+
       |            |  |  |            |  |
       +------------+  |  +------------+  |
                       |                  |
       +------------+  |  +------------+  |
       |   getSum   |  |  |   getSum   |  |
       |            |  |  |            |  |
       |     *------+--+  |     *------+--+
       |     *      |     |     *      |
       +-----+------+     +-----+------+
             |                  |
             +----------+-------+
                        |
                        v
             +--------------------+
             |  SharedFunctionInfo|
             |          *         |
             +----------+---------+
                        |
                        v
             +--------------------+
             |  unoptimized Code  |
             |                    |
      ??? <--+---* getX call      |
             |                    |
      ??? <--+---* getY call      |
             |                    |
             +--------------------+
    

This is the output.

Output

Dependencies (2)

Dev Dependencies (1)

Package Sidebar

Install

npm i shaky

Weekly Downloads

0

Version

0.15.0

License

Apache-2.0

Last publish

Collaborators

  • shawnhuang