ggerganov/dot-to-ascii

Graphviz to ASCII converter using Graph::Easy

HTML

513

39 commits

updated Jun 27, 2022

See the code

See what people are saying

SourceMessageScoreDate

Also: https://dot-to-ascii.ggerganov.com/

on Show HN: Mermaid ASCII Diagrams

0

Oct 15, 2024

The way I use ASCII art diagrams in my source-code is through this simple web service that I hosted: https://dot-to-ascii.ggerganov.com I generate the ASCII graph and then paste it in the comments together with a link to the service. This way I can go back later and update it if needed: /* Link:…

on Explaining Code Using ASCII Art

0

Jun 27, 2022

Another tool similar to this is https://dot-to-ascii.ggerganov.com

on Ask HN: How does a CPU communicate with a GPU?

0

Mar 31, 2022

For the ASCII lovers, I made this simple web page to help convert dot to text diagrams: https://dot-to-ascii.ggerganov.com It's useful to embed diagrams directly in source code for example. Here is a sample [0]: 0.6 ┌─────────────────────────┐ ▼ │ ┌───┐ 0.8 ┌───┐ 0.1 ┌───┐ 0.7 ┌───┐ 0.2 ┌───┐ │ d │…

on Graphviz: Open-source graph visualization software

0

Jan 17, 2022

The answer at the very bottom does include a browser-based link to do this: https://dot-to-ascii.ggerganov.com/ Seems to work well..!

on ASCIIFlow Diagram Tool

0

Jun 19, 2021

I actually like using ascii diagrams for relatively simple graphs, because I can incorporate them directly in my source code comments. Recently I even made a simple web page where you can create easily ascii diagrams using dot [0] [0] https://dot-to-ascii.ggerganov.com/

on Markdeep – plain text documents with diagrams, equations, and Markdown syntax

0

Feb 17, 2020

Here is a very quick "sed" hack to replace vertical and horizontal lines: https://dot-to-ascii.ggerganov.com/staging/ Definitely looks better. Might look into fixing the corners and arrows as well before merging in master.

on Show HN: Dot-to-ASCII – Graphviz to ASCII Converter

0

Nov 30, 2019

Show HN: Dot-to-ASCII – Graphviz to ASCII Converter

152

Nov 30, 2019

README

dot-to-ascii

Try it here: https://dot-to-ascii.ggerganov.com

dot-to-ascii

How it works?

API

Dot-to-ascii can be easily used in your code by performing https requests to the api.

Python

import requests


def dot_to_ascii(dot: str, fancy: bool = True):

    url = 'https://dot-to-ascii.ggerganov.com/dot-to-ascii.php'
    boxart = 0

    # use nice box drawing char instead of + , | , -
    if fancy:
        boxart = 1

    params = {
        'boxart': boxart,
        'src': dot,
    }

    response = requests.get(url, params=params).text

    if response == '':
        raise SyntaxError('DOT string is not formatted correctly')

    return response
graph_dot = '''
    graph {
        rankdir=LR
        0 -- {1 2}
        1 -- {2}
        2 -- {0 1 3}
        3
    }
'''

graph_ascii = dot_to_ascii(graph_dot)

print(graph_ascii)
                 ┌─────────┐
                 │         │
     ┌───┐     ┌───┐     ┌───┐     ┌───┐
  ┌─ │ 0 │ ─── │ 1 │ ─── │   │ ─── │ 3 │
  │  └───┘     └───┘     │   │     └───┘
  │    │                 │   │
  │    └──────────────── │ 2 │
  │                      │   │
  │                      │   │
  └───────────────────── │   │
                         └───┘

Run locally with docker

This uses the minimal Dockerfile with the default apache config etc. Not suitable for production use.

$ docker build -t dot-to-ascii .
$ docker run --rm -d --name dot-to-ascii -p 8080:80 dot-to-ascii
$ # open localhost:8080 in your browser
ascii
converter
dot
graphviz

ggerganov/dot-to-ascii

Graphviz to ASCII converter using Graph::Easy

HTML

513

39 commits

updated Jun 27, 2022

See the code

See what people are saying

SourceMessageScoreDate

Also: https://dot-to-ascii.ggerganov.com/

on Show HN: Mermaid ASCII Diagrams

0

Oct 15, 2024

The way I use ASCII art diagrams in my source-code is through this simple web service that I hosted: https://dot-to-ascii.ggerganov.com I generate the ASCII graph and then paste it in the comments together with a link to the service. This way I can go back later and update it if needed: /* Link:…

on Explaining Code Using ASCII Art

0

Jun 27, 2022

Another tool similar to this is https://dot-to-ascii.ggerganov.com

on Ask HN: How does a CPU communicate with a GPU?

0

Mar 31, 2022

For the ASCII lovers, I made this simple web page to help convert dot to text diagrams: https://dot-to-ascii.ggerganov.com It's useful to embed diagrams directly in source code for example. Here is a sample [0]: 0.6 ┌─────────────────────────┐ ▼ │ ┌───┐ 0.8 ┌───┐ 0.1 ┌───┐ 0.7 ┌───┐ 0.2 ┌───┐ │ d │…

on Graphviz: Open-source graph visualization software

0

Jan 17, 2022

The answer at the very bottom does include a browser-based link to do this: https://dot-to-ascii.ggerganov.com/ Seems to work well..!

on ASCIIFlow Diagram Tool

0

Jun 19, 2021

I actually like using ascii diagrams for relatively simple graphs, because I can incorporate them directly in my source code comments. Recently I even made a simple web page where you can create easily ascii diagrams using dot [0] [0] https://dot-to-ascii.ggerganov.com/

on Markdeep – plain text documents with diagrams, equations, and Markdown syntax

0

Feb 17, 2020

Here is a very quick "sed" hack to replace vertical and horizontal lines: https://dot-to-ascii.ggerganov.com/staging/ Definitely looks better. Might look into fixing the corners and arrows as well before merging in master.

on Show HN: Dot-to-ASCII – Graphviz to ASCII Converter

0

Nov 30, 2019

Show HN: Dot-to-ASCII – Graphviz to ASCII Converter

152

Nov 30, 2019

README

dot-to-ascii

Try it here: https://dot-to-ascii.ggerganov.com

dot-to-ascii

How it works?

API

Dot-to-ascii can be easily used in your code by performing https requests to the api.

Python

import requests


def dot_to_ascii(dot: str, fancy: bool = True):

    url = 'https://dot-to-ascii.ggerganov.com/dot-to-ascii.php'
    boxart = 0

    # use nice box drawing char instead of + , | , -
    if fancy:
        boxart = 1

    params = {
        'boxart': boxart,
        'src': dot,
    }

    response = requests.get(url, params=params).text

    if response == '':
        raise SyntaxError('DOT string is not formatted correctly')

    return response
graph_dot = '''
    graph {
        rankdir=LR
        0 -- {1 2}
        1 -- {2}
        2 -- {0 1 3}
        3
    }
'''

graph_ascii = dot_to_ascii(graph_dot)

print(graph_ascii)
                 ┌─────────┐
                 │         │
     ┌───┐     ┌───┐     ┌───┐     ┌───┐
  ┌─ │ 0 │ ─── │ 1 │ ─── │   │ ─── │ 3 │
  │  └───┘     └───┘     │   │     └───┘
  │    │                 │   │
  │    └──────────────── │ 2 │
  │                      │   │
  │                      │   │
  └───────────────────── │   │
                         └───┘

Run locally with docker

This uses the minimal Dockerfile with the default apache config etc. Not suitable for production use.

$ docker build -t dot-to-ascii .
$ docker run --rm -d --name dot-to-ascii -p 8080:80 dot-to-ascii
$ # open localhost:8080 in your browser
ascii
converter
dot
graphviz

Significant stargazers

Matt Pocock

51,134 followers · starred Aug 2021

Fangjun Kuang

763 followers · starred Mar 2025

Aslak Hellesøy

820 followers · starred Jan 2022

Indragie Karunaratne

1,291 followers · starred Aug 2025