lewish / asciiflow

ASCIIFlow
https://asciiflow.com
MIT License
4.7k stars 365 forks source link

Support trapezoid / mux shapes for ascii diagrams #134

Open mithro opened 5 years ago

mithro commented 5 years ago

The following shapes are really useful in logic diagrams;

 |\
 | |
 | |
 |/

 +--\
 |  |
 |  |
 +--/

The simplest implementation would be just to do a box with different styles for the corners.

More advanced would be to actually do the one side as an angle like the following;

 |\
 | \
 |  |
 | /
 |/

 +-\
 |  \
 |   |
 |  /
 +-/

 +--\
 |   \
 |    |
 |   /
 +--/

This is an example diagram that I ended up doing with these style of shapes;

   +-------------------------------------------------------------------+
   |                                                                   |
   |       +------------+                                              |
ia1|------>|i1          |                                              |
   |       |   childa  o|-+------------------------------------------->|o0
ia2|-->|\  |            | |                                            |
   |   ||->|i2          | |                                            |
ia3|-->|/  +------------+ |  +----------+                              |
   |                      +->|i childb o|-+-->|\                       |
   |                      |  +----------+ |   ||   +----------+        |
   |                      |               |   ||-->|i childc o|-->|\   |
   |                      +------------------>||   +----------+   ||   |
   |                      |               |   |/                  ||   |
   |                      |               |             /-------->||-->|o1
   |                      |               \-------------/         ||   |
   |                      |                                       ||   |
   |                      \-------------------------------------->|/   |
   |                                                                   |
   +-------------------------------------------------------------------+
Qix- commented 5 years ago

I think custom shapes in general would be a cool feature to have. I need to think about how it would work, though. Might consider this for AF3.

Qix- commented 3 years ago

@lewish do you have any strong opinions on this?