Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upAbility to style diagram #11
Comments
This comment has been minimized.
This comment has been minimized.
|
Hmn, it's neat. i.e: println!("Hello {arg}!", arg = "world")
Might as well color the emoji faces: |
This comment has been minimized.
This comment has been minimized.
|
Haven't started the ground work for this one, but thinking of something like using css as the syntax for the styling. Using
#Legend: |
This comment has been minimized.
This comment has been minimized.
|
@ivanceras Would the diagram with the class and id specified get more space? Where
Would be render as:
or
|
This comment has been minimized.
This comment has been minimized.
|
@pickfire It would like be the first one, since there could be scribbles connecting to the left side of the box, which means shrinking the box would make the surrounding scribbles out of place. I haven't started any work on this yet, since I hit a wall on recognizing bigger shapes such as circle, rect, etc. This needs a different algorithm than the current implementation. |
This comment has been minimized.
This comment has been minimized.
|
@ivanceras I would like to help out on this project too since there aren't many good alternatives online where the second would be rendered in which I feel like the extra whitespace for style is useless. (I prefer the second) As well, CJK characters without needing to decrease the whitespace would be nice:
From what I know, the current project uses links between characters with neighbour characters to determine what needs to be drawn, doesn't it identify like say box, circle, cloud, some other predefined shapes ... |
This comment has been minimized.
This comment has been minimized.
|
@pickfire, if you prefer the second one, then it would be very difficult to have a coherent render. As for the CJK, CJK are 2 space width in terminals while just ~1.5 space width in browsers and any other GUI-based text editor. I'm sticking with the terminal 2 space width, it's much simpler to deal than ~1.5 width. |
This comment has been minimized.
This comment has been minimized.
|
True for the CJK case, if it would be like a box in the terminal, I rather it be render the same in svg. If there by any chance that the current reader is able to determine the content of the box and render it again without really matching each character that creates the box? Say, identify the box first before the content. |
This comment has been minimized.
This comment has been minimized.
|
No, the current implementation only determine the location of the character relative to the number of character from the left of the line, summing all character widths from the left of it. |
This comment has been minimized.
This comment has been minimized.
|
Have you tried recognizing shapes rather than matching each character to svg? Any downside? As far as I know, I never seen any projects doing this. |
This comment has been minimized.
This comment has been minimized.
|
That's the plan, recognizing the shape at higher level, but the algorithm to use doesn't look very simple. If you can show something like that, then I'd be happy to include it in the project. |
This comment has been minimized.
This comment has been minimized.
|
@ivanceras Well, I need to do some research before that. I might come back to this afterward. |
This comment has been minimized.
This comment has been minimized.
|
The initial issue description said "Also, what about people wanting to style lines? Maybe we leave that as a separate topic." I would definitely like to style lines (in particular, color). |
This comment has been minimized.
This comment has been minimized.
|
This is a must have feature! +1 |
This comment has been minimized.
This comment has been minimized.
|
Took me awhile to get back to work on this, but I think I've completed the needed algorithms to solve this issue. Stay tuned. |
This comment has been minimized.
This comment has been minimized.
|
I'm taking the design route originally proposed by @azriel91 since it is easier to parse.
|
This comment has been minimized.
This comment has been minimized.
|
This was a huge rewrite and a disconnect of the core code. I need help with:
|
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
@ivanceras Is it possible to reuse the same legend? |
This comment has been minimized.
This comment has been minimized.
|
@pickfire , yes it is possible to reuse the legend for other shapes, as it is implemented like a class in html/css. |
This comment has been minimized.
This comment has been minimized.
|
There is another thing, kinda belongs here. Typesetting is horrible atm. It would be nice if that could be styled a bit too. At least set if text is aligned left, centered or right. |

Raising this out of this thread to not digress too much.
Should svgbob allow the ability to style nodes? It would be nice to be able to do it so that diagrams can be represented in text and still support colour. The ascii version of the diagram is not very readable with styling information included in each node. @ivanceras gave an example of using single letters to represent colour, but I foresee potential use cases for additional styling.
I've copied a bit of the post and edited it to see what it may look like:
Also, what about people wanting to style lines? Maybe we leave that as a separate topic.