typedraw
An experimental visualization of types.
Installation
Install Fira Code. Clone this repository, then:
npm -g install .
Usage
typedraw <typemap.json> <out.png>
typedraw
reads from stdin, i.e. you can do the following:
cat examples/foreach | typedraw examples/typemap2.json out.png
typedraw
replaces all occurences of a type with a visual shape described in
a typemap.
Typemaps
Typemaps are simple json files that describe how to render a given type
(i.e. st
):
Only two shapes are supported currently, rect
s:
[ "rect", color, x, y, width, height ] // coordinates are in the 0 - 1 range
and circle
s:
[ "circle", color, x, y, radius ] // coordinates are in the 0 - 1 range
Check out the example typemap1.json
and typemap2.json
files.