Svgbob
Svgbob can create a nice graphical representation of your text diagrams.
Svgbob provides a cli which takes text as an input and creates an svg image as an output.
Svgbob can create a nice graphical representation of your text diagrams.
Svgbob provides a cli which takes text as an input and creates an svg image as an output.
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:
.---------. .-----------.
( Alice {a} ) ----> / Bob {b,c} /
`---------' '-----------'
.---------. .----------.
( Apple {a} ) ----> / Ball {b} /
`---------' '----------'
# Legend:
a: { color: red }
b: { color: blue }
c: { opacity: 0.5 }
Also, what about people wanting to style lines? Maybe we leave that as a separate topic.
enhancementIn some cases svgbob will take a letter inside a word and transform it to a symbol instead for letting it be a character that's part of the word; the examples I have seen where mainly with V, inside a word, be transformed in a down arrow.
svg bob could do a first pass and mark, with the help of a dictionary, the character that are not to be transformed, it should also be possible to input wors or whole dictionary of word to use if one has a technical name not part of the dictionary or uses a foreign language.
Words should be able to contain underscores and dashes.
E.g. these should be rendered as text, not lines: product_id
, 2019-10-31
, +10-15V
. A good test case is the product table in demo.bob.
This PR achieves this by
ascii_map.rs
and subsequentlyOld product table: New product table:
Improvements in product table:
product_id
and other headersSelected other improvements:
+10-15V
Derived_A
, FS-Cache
, e-mails
, 1M-1Watt
There are no negative effects for the examples.
(
, )
, /
, :
.ascii_map.rs
.Hello !
Is there a way to display crossing diagonals ? Example:
------------.
\ .-------------
\
/ '------------>
------------'
The diagonal crossing is incomplete. It would be nice to have access to X
for that job:
------------.
\ .-------------
X
/ '------------>
------------'
Thanks,
I would like to make a pandoc filter that does basically what spongedown does with ascii drawings. But I can't find how to properly pass a multiline string to svgbob
through the command line.
How is this done ?
On Windows, I have tried things like :
echo "+--+\n| |\n+--+" | svgbob
but the \n
are kept as they are, and trying to pass the raw string from python actually ends the command in the middle of the string, effectively yielding an echo of the first line of the drawing.
What would be useful would be a method of returning a svg image from a request URL containing the source text, similar to SciWeavers site to return an image from Latex text (http://www.sciweavers.org/tex2img.php?eq=\sum_{i=1}^{n}x_{i}^{2}&bc=cornsilk&fc=black&im=jpg&fs=24&ff=arev).
Normally one CJK character equal two english character width, the following will be closed.
+----+
| 一 |
+----+
If the line contains escape qutoe, the CJK character seems need 3 english character spaces to get the shape closed.
+--------+
|"""一"""|
+--------+
I am using svgbob 0.3.2.
bugSometime a char is treated as diagram char when it was intended to be word char.
Example 1:
co-edit
single-person
Is rendered as:
The hyphen after o
is treated as a horizontal line.
Example 2:
(some remark)
some text
(some remark)
some text
Is rendered as: The open bracket between lines is rendered as a diagram which the close bracket is still rendered as text.
Hi,
I notice a different rendering of the sequence:
. \ \ '--- The::Latest
/| \ \ \
With::Some::fantasy ' \ \ '---- The::Latest::Greatest
/| \ \
More::Stuff ' \ '- I::Am::Running::Out::Of::Ideas
/| \
More::Stuff ' \
/ '--- Last::One
More::Stuff
in svgbob and https://ivanceras.github.io/elm-examples/elm-bot-lines/
In a terminal the use of quote "'" rather than dot "." looks better in ASCII. Could you unify the rendering so both render the same way
If you think I am picky and have an hawk eye, it's because I have drawn most of the example you use in the old version and they grabbed my eye today when I saw this project for the first time.
I think I may steal from you one or two stencils, I like the circles rendering, in fact I like this project very much.
Hi there! Awesome project. I wanted to ask if it is possible to somehow tell renderer that "this character is just text"? I am trying to render Ruby's object diagram from the official book:
+---------+ +-...
| | |
BasicObject-----|-->(BasicObject)-------|-...
^ | ^ |
| | | |
Object---------|----->(Object)---------|-...
^ | ^ |
| | | |
+-------+ | +--------+ |
| | | | | |
| Module-|---------|--->(Module)-|-...
| ^ | | ^ |
| | | | | |
| Class-|---------|---->(Class)-|-...
| ^ | | ^ |
| +---+ | +----+
| |
obj--->OtherClass---------->(OtherClass)-----------...
...and the SvgBobRus understands it pretty well, but replaces most of the "O"s with special symbols (note also it can't guess two arrows under the "Class" at the bottom):
With using rsvglib(as rsvg-convert)
on Mac, conversion is not great; output is dropping "lines".
I am not sure this is rsvglib
matter or svgbob
.
input.txt
:
o VDD
|
+++
| |
+++ +
THRESHOLD | + |\ +-------+ +
o------------------+ \ | | |\
| | +--| R | | \
*-----+ / | | +---------------+ +o----------o
| - |/ | | | | / OUTPUT
+++ + | | | |/
| | | | | +
+++ + | | | o DISCHARGE
| + |\ | | | |
*-----+ \ | | | |'
nTRIGGER | | +--| S nQ o-*---+ NPN
o------------------+ / | | |`>
| - |/ +---o---+ |
+++ + | |
| | | |
+++ | |
| | |
*---------------------------+
| |
o GND |
nRESET |
o----------------------------+
$ input.txt -o svg.svg
$ rsvg-convert -f png svg.svg -o png.png
SVG output(screenshot) is great like while conversion to png is like
visual-bugHey, just stumbled over this and it looks great! Wondering if one can change the color of the text easily. As far as I understood the configuration of a class like {foo}
is applied to the shape. Could there be something like {text:foo}
to be able to set color for the text?
Thanks a ton and feel free to close if not a good question (or I was simply to blind to figure things out!).
Here is a minimal example:
-- "(A)"
which gives
And this is a greater example:
o--------------o------o "(A)"
/
"(E)" o----o
o
|
| "(M)"
o------o "(A)"
"(E)" o----o-o---------------
o
|
| "(M)"
which gives
svgbob --version => svgbob 0.6.2
To easier the trial, It would be nice to have a docker image. language-independent docker imege makes it much easier to use with CI. (e.g. gitlab, jenkins)
https://github.com/ivanceras/svgbob/issues/93
For users unfamiliar in Rust, getting started with svgbob takes a bit of work.
To easier the trial, It would be nice to have a docker image. language-independent docker imege makes it much easier to use with CI. (e.g. gitlab, jenkins)
Until an official image registry is created, the following unofficial image registry has been prepared. If possible, an official image registry would be better.
https://hub.docker.com/r/arukiidou/svgbob_cli
Hi,
I've tried to fill a triangle, but it does not work.
This is my testcase:
+---+ +-----+ + +---------+ +
|{r}| \{r}/ / \ \ / / \
+---+ \ / /{r}\ \ {r} / / \
+ +-----+ \ / / {r} \
+-----+ \ / / \
| | + +---------+
| {r} |
| |
+-----+
# Legend:
r = {
fill: red;
}
Would it be possible to extend the syntax to draw an arc?
+
/ \ "This would draw a sharp corner"
/ v
.
/ \ "This would dar an arc (a dot at the point where edges meet)"
/ v
.-.
/ \ "This is the current way to draw something like an arc"
/ v
wontfix
Convert UFO glyph files (.glif) to SVG There exists already an svg2glif, but for some reason not the opposite operation. My MFEKglif editor treats .gl
dioxus-free-icons Use free svg icons in your Dioxus projects easily with dioxus-free-icons. More information about this crate can be found in the crat
annict-profile-card ?? Annict の視聴状況などを SVG 画像として出力する API サーバ (WIP) Annict GraphQL API を使用しています。
resvg can be used as a Rust library, a C library and as a CLI application to render SVG files based on a static SVG Full 1.1 subset.
rusty-svg An SVG toolkit based on resvg This module is compiled to WASM and currently only supports Node.js Comparing with the backend ReSVG, this mod
The tool to make svg with triangles by length from two points.
A Rust-implementation of devout’s tutorial to create an SVG graphic device using extendr.
regretti ?? A programming language where comments are the first-class citizen and ASCII art flowcharts are the controls! Made for Lang Jam (jam0001) t
Image to Ascii A Simple Image to Ascii converter in Rust Brief ?? In my way to learn Rust i decided to make this converter. Challenges ?? new to Rust
CLI and utilities for converting media files (images/videos) to ascii outputs (output media file or print to console). Supports most standard image formats, and some video formats.
RDR2 Screenshot converter Convert and save photomode screenshots from Red Dead Redemption 2 to JPEG format. QuickStart Just download the executable fi
What is Lust? Lust is a static image server designed to automatically convert uploaded image to several formats and preset sizes with scaling in mind.
Rust Markdown to graph This program converts a Markdown file into a graph. For now, it creates .dot file which graphviz uses to build graph. It transl
SketchbookTiffConverter Convert Sketchbook Tiff Files to Open Raster Images and retain layer information. This is a command line program that will con
img2utf Transform images to textual line art! Images require pre-processing to come out nice. It's expected that users will do the following: Apply ga
EmojiPix This is a simple command-line utility (and Rust crate!) for converting from a conventional image file (e.g. a PNG file) into a pixel-art vers
WASIMAGE Combines a Javascript and WASM file into a single executable polygot PNG+HTML file. Usage: cargo install wasimage wasimage --wasm-file my.was
nya-exif 中文 | English 介绍 nya-exif 是一个用于匹配照片 GPS 信息, 并写入文件 EXIF 信息的工具, 支持 JPEG 和 PNG 及各大相机厂商的主流RAW格式. 本工具基于 Rust 编写, 支持全平台使用 Features 支持 JPEG 和 PNG 及各大
asciit A more compact and intuitive ASCII table in your terminal: an alternative to man 7 ascii and ascii. Colored numbers and letters are much more e
TAI Terminal Ascii Image A tool to convert images to ascii art written in Rust ?? Notes This tool is still in development stage. Contributions All Con