The Picviz language
Introduction
The Picviz language is a graph description language, similar to graphviz dot language. With Picviz, the language can be divided in four sections:
- header (optional): contains the graph title, default background etc..
- engine (optional): changes Picviz engine internals (not recommended)
- axes : variable and properties setting for each axis
- data : plot your data on previously defined axes
header {
title = "Plot my IP";
}
axes {
timeline t;
ipv4 i;
}
data {
t="14:42", i="123.2.3.4";
t="15:45", i="200.123.4.6";
t="15:45", i="255.255.255.255";
}
Properties
Properties can be set for each axis and for each line. They are a set of key = "values" coma separated between brackets:
[label="foobar",color="orange"]
Axis properties
In the axes section, following properties are available: label,relative and print. That you can use like this:
axes {
timeline t [label="Time"];
ipv4 src [label="Source IP",print="false"];
string data [label="Data",relative="true"];
}
- label is the text that is written on top of the axis on the generated image.
- relative spreads the string variable as far possible from each other (incompatible with the basic string algorithm).
- print will not print values on this axis when asking to print values (option -a in the pcv binary)
Variables
Each axis must have a variable. Choose among:
| Type | Range | Description |
| timeline | "00:00:00" - "23:59:59" | 24 hours time value |
| years | "1970-01-01 00:00:00" - "2023-12-31 23:59:59" | Years of time value |
| integer | 0 - 65535 | Integer number |
| string | "" - "No specific limit" | A string value |
| short | 0 - 32767 | Short number |
| ipv4 | 0.0.0.0 - 255.255.255.255 | IPv4 address |
| gold | 0 - 1433 | Small value |
| char | 0 - 255 | Tiny value |
| enum | anything | Enumeration |
| ln | 0 - N | ln(x) |
Line properties
In the data section, only the following property is available: color, penwidth. That you can use like this:
data {
t="12:30", src="192.168.1.1" [color="red"];
t="12:42", src="192.168.1.23" [color="blue",penwidth="3"];
}
Following colors are available: "white","black", "red", "green", "blue", "yellow", "grey", "turquoise", "pink", "orange", "darkblue", "darkgreen", "darkred", "brown".
