tuanchauict / MonoSketch

An ASCII graph drawing app
https://monosketch.io
Apache License 2.0
389 stars 11 forks source link

Feature: plain ASCII support #586

Open SPYFF opened 9 months ago

SPYFF commented 9 months ago

Hello!

Great tool, very useful for my notes. However I would like to use it for internet draft illustration (https://www.ietf.org/standards/rfcs/, for example: https://www.rfc-editor.org/rfc/rfc9526.txt) which sadly only a plain ASCII thing. It would be possible to support plain ASCII (without Unicode characters)? Yes, that renderes poorly however it would be still huge help for me (and for the internet engineering community).

tuanchauict commented 9 months ago

Sorry for the late response. Actually, this request is one of my plans because sometimes, I also prefer simple characters like -+| rather than characters like ┐┌.

Luckily, this is not hard, we can add a new stroke style (see PredefinedStraightStrokeStyle).

We can also add a mask to replace the stroke characters with the equivalent ones when doing export.

However, I'm busy with porting the Kotlin code into TypeScript recently (#584) (it sounds crazy but for the future of MonoSketch and also for me to learn new stuffs - MonoSketch is purely a place for practicing engineering).

Sorry for making you keep waiting longer but this request will definitely be implemented.

SPYFF commented 9 months ago

Thank you for the detailed response.

No need to hurry, I will be happy when its done. I just recently found this tool and I'm very happy with it as is for illustrating personal notes. Sometimes my colleagues and I need to illustrate internet drafts (every 3-6 months or so) and the ASCII mode would help with that.

A question about the typescript code. Will the whole project be converted to Typescript or just a part of it? From the output it looks like you are rewriting it from scratch. Anyway, keep up the good work and have fun learning!

tuanchauict commented 9 months ago

I didn't want to, but, unfortunately, I'm porting from scratch. The number of codes of MonoSketch is not big (~19k), so, this is not a heavy task so far. Only some parts are more complicated than others, and most of the code is quite straightforward.

SPYFF commented 9 months ago

I see. Hopefully on the long run it might attract more contributors, I assume TS is more popular than Kotlin these days.

klausdk commented 5 months ago

Not sure its related, but I would love to have the arrows like asciiflow. This ► instead of ▶

It makes the vertical lines misaligned

You can notice it in the example on the README.md page and below.

Example : Current :

                 ─       │           ├───────○──┤/  547 │                    
                GND      │           │       │  │ ▶     │                    
                         │           │      ╭┴╮   │     │                    

With suggested arrow :

                 ─       │           ├───────○──┤/  547 │                    
                GND      │           │       │  │ ►     │                    
                         │           │      ╭┴╮   │     │                    

I like the idea that we can keep it as vanilla as possible without having to use fonts like jetbrains mono (even if its a cool font), but can use fonts like monospace or courier.

tuanchauict commented 5 months ago

For ► or ▶, it really depends on the font and there are no correct answers. For example, ► is in monospace font while ▶ is

On my PC, the font used on GitHub for monospace renders correct size for both text:

image

But this is what it is displayed on my email

image

Btw, let me add a new kinds of arrow later

klausdk commented 5 months ago

Sounds great!

Up and down arrows are fine :

From notepad++

image

klausdk commented 5 months ago

Yes.

Seems to work. Thanks ☺