Examples
Examples
Last updated
Examples
Last updated
There are a number of example applications in the cmd
folder which demonstrate features of the code. In order to build the examples, you'll need a working go compiler. There is a makefile in the repository which can be used to compile the examples:
A temporary build
folder is created for intermediate and binary data. You can remove the build folder and any other intermediate data using the make clean
command.
The csvreader
command can be used to extract CSV data and transform to ASCII, CSV, SQL or XML format:
These screenshots demonstrate ASCII and SQL output:
The command line arguments are as follows:
The colorswatch
command demonstrates:
Enumerating a swatch into a palette of colors;
Generating an SVG canvas and writing to stdout;
Using color distance to set an appropriate foreground colour.
For example, the following command produces a palette of red, blue and green colours:
The tiger
command takes a set of input instructions and generates an SVG file. The instructions come from an example on the Raspberry Pi and are stored in etc/dataset/tiger_data.txt
. In order to generate the SVG file, use the following command:
The resultant output is as follows: