ctioga2
provides functions that can be used from command-files (but
not from command-line, unless you choose to run command-file code from
command-line using the --eval
command). They can be used to
evaluate Ruby code, to modify strings or compute values, or to gain
access to information from datasets.
This page describes all the functions known to ctioga2
. It is
generated automatically from the inline documentation of
ctioga2
.
Evaluate its argument as Ruby code
a := $(eval 2 + 2) # a is now 4
Keep in mind that variables in ctioga2
work by plain text replacement. They have no type. In particular, while this will work:
a := 3 b := $(eval $(a) * 3) # b is now 9
However, you need to use quotes if you must call functions:
b := $(eval sqrt(2))
Doing the same kind of things with text will be somewhat not satisfying:
a := "two words" b := $(eval $(a).split(/ /).first)
Running this will give the following syntax error:
[FATAL] (eval):1: syntax error, unexpected $end, expecting ')' two words.split(/ / ^ while processing line 2 in file 'c.ct2'
Doing it right would require the use of a decent amount of quotes.
Returns the requested information about the given point in a dataset. Run this way:
$(point x @234)
The first argument, here x
tells what we want to know about the given point: its x
value (passing x
), its y
value (passing y
), its index
(by passing index
or idx
) both its x
and y
ready to be used as coordinates for drawing commands using xy
. For instance, to draw a circle marker right in the middle of the last dataset plotted, just run
draw-marker $(point xy 0.5) Circle
The second argument specifies a dataset point, just like for data-point.
An optional third argument specifies the dataset from which one wants the point information. Note that the dataset can also be specified within the second argument, but it may be more readable to do it as an optional third. It is parsed as stored-dataset
This is replaced by the the value of 'avg' from the column 'x', applied to the dataset given.
This is replaced by the the value of 'max' from the column 'x', applied to the dataset given.
This is replaced by the the value of 'min' from the column 'x', applied to the dataset given.
This is replaced by the the value of 'range' from the column 'x', applied to the dataset given.
This is replaced by the the value of 'avg' from the column 'y', applied to the dataset given.
This is replaced by the the value of 'max' from the column 'y', applied to the dataset given.
This is replaced by the the value of 'min' from the column 'y', applied to the dataset given.
This is replaced by the the value of 'range' from the column 'y', applied to the dataset given.
This is replaced by the the value of 'avg' from the column 'z', applied to the dataset given.
This is replaced by the the value of 'max' from the column 'z', applied to the dataset given.
This is replaced by the the value of 'min' from the column 'z', applied to the dataset given.
This is replaced by the the value of 'range' from the column 'z', applied to the dataset given.
Generated for ctioga2
version:
0.14.1