lewish / asciiflow

ASCIIFlow
https://asciiflow.com
MIT License
4.66k stars 358 forks source link

Diagonal lines #43

Open waveform80 opened 8 years ago

waveform80 commented 8 years ago

I realize this may be asking way too much (especially given the complexity of auto-routing connections which works fantastically at the moment), but are there any plans to support diagonals (presumably / and )? I would suggest that if such support is added that there's an option on export to double-up backslashes for target environments where this would be necessary.

tobia commented 7 years ago

That would be nice indeed.

One idea would be to have a separate tool that can draw diagonal lines, filling in with orthogonal characters when needed.

It would add dashes when the space is too wide:

+---+
| A +--+
+---+   \
         \
          \   +---+
           +--+ B |
              +---+

Pipes when the space is too tall:

+---+
| A |
+-+-+
  |
  +
   \
    \
     \
      +
      |
    +-+-+
    | B |
    +---+

And nothing when it's just right:

+---+
| A |
+-+-+
   \
    \
     \
    +-+-+
    | B |
    +---+

And then with the Move tool you should be able to move the various line segments around.

But I have a feeling it would be quite difficult to code! One day I'll give it a try...

Qix- commented 4 years ago

Woof, I must admit I didn't like the idea when I read the title but @tobia's examples do look nice.

I'll tag this as an enhancement for consideration in AF3 but I can't promise anything.

Also, sorry for the noise 4 years later :)

adishavit commented 3 years ago

I would really like this feature! I just drew this for some code comments:

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

I had to add the diagonals manually. It would have been nice to do it with asciiflow.
Textik has this feature, but ASCIIFLOW is way better and nicer - would be great to have this addition (even without the full blown connector facility as suggested in issue #43). I don't see what Unicode would be an issue. Slash and Backslash are regular ASCII and hence a subset of the Unicode set, no?

Qix- commented 3 years ago

@lewish I'm conflicted because if we limited ourselves to 45 degree angles it could look nice with ASCII but as I mentioned earlier the diagonal unicode box drawing characters are quirky depending on where they're displayed. Plus, they don't line up nicely with the other box drawing characters.

Should we just always use ascii characters for diagonals and restrict to 45 degree angles?

adishavit commented 3 years ago

IMO, “45” deg. diagonals would already be a very significant improvement in and of themselves (and UI UC are independent of Unicode encoding).

The caveats of ASCII diagrams (like the rectangular grid) are understood by anyone using asciiflow.

mlgarchery commented 2 years ago

Would be a nice feature. I just tried to draw a triangle ^^. Nice project, I was looking for something similar for creating little drawings in my docstrings