Commit 724e32f1 authored by Flavio TARSETTI's avatar Flavio TARSETTI

Merge branch 'plotter' into 'new'

[general][doc] added plotter and plotterparameters to the general documentation

See merge request !8
parents 22647ca1 9623e593
Pipeline #25177 passed with stages
in 10 minutes and 48 seconds
......@@ -198,6 +198,8 @@ interface to interact with the BEAT platform efficiently.
databases
toolchains
experiments
plotters
plotterparameters
......
.. _beat-system-plotterparameters:
===================
Plotterparameters
===================
Plotterparameters are a subset of parameters defined in the ``parameter`` section of a specified ``plotter`` (see :ref:`beat-system-plotters`) \. They can be used to manipulate the appearance of the produced figure by that plotter, such as font size, legends, etc. They consist of only `JSON`_ declaration since there is no source code needed for such functionality. Here is an example of plotterparameter created for a bar plotter:
.. code-block:: json
{
"plotter": "plot/bar/1",
"data": {
"title-fontsize": 12,
"bar-norm": true,
"axis-fontsize": 10,
"height": 600,
"width": 800,
"grid": true,
"bar-alpha": 0.75,
"legend-fontsize": 8,
"legend-loc": "best",
"dpi": 120
},
"description": "Default parameters for bar plots"
}
In the example above the **data** are the parameters which are going to be set in the *parameter* section of ``plot/bar/1`` plotter.
.. include:: links.rst
.. _beat-system-plotters:
==========
Plotters
==========
The plotters are the building blocks of BEAT that provide the visualization for the output result of BEAT experiments, such as bar plots or ROC curves.
.. _beat-system-plotters-definition:
Definition of a Plotter
=======================
A plotter just like other building blocks of BEAT consists of two main components:
* a `JSON`_ object with several fields, specifying the inputs, the produced figure, the parameters and additional information such as the language in which it is implemented.
* source code describing how to produce the desired figure using the given parameters. They are mostly implemented in python and use matplotlib library.
.. _beat-system-plotters-definition-json:
JSON Declaration
----------------
The `JSON`_ declaration of plotters consists of several field. Here is an example of a plotter that produces bar plots:
.. code-block:: json
{
"dataformat": "plot/bar/1",
"description": "Basic bar plotter for simple histograms",
"language": "python",
"parameters": {
"axis-fontsize": {
"default": 10,
"description": "Controls the axis font size (labels and values)",
"type": "uint16"
},
"bar-norm": {
"default": true,
"description": "If set to true will normalize the distribution between 0-1",
"type": "bool"
},
...
},
"uses": {
"baselib": "plot/baselib/1"
}
}
Here are the description for each of the fields in the example above:
* **dataformat** is the specific dataformat in the input of a plotter.
* **description** gives a small description of the plotter.
* **language** is the language in which the source code is implemented.
* **parameters** are the given parameters to the source code to produce the figure. These parameters can be manipulated by the :ref:`beat-system-plotterparameters`. Default values for some of the parameters can be defined in a separate text file in the same directory as the `JSON`_ file. This text file has key/value format similar to a `JSON`_ file.
* **uses** are the libraries used by the plotter.
The graphical interface of BEAT provides user-friendly editors to configure the `JSON`_ declaration definition of plotters when using BEAT locally. At the moment, defining new plotters on the platform is possible only under administrative privilege.
.. _beat-system-plotters-types:
Plotter Types and Dataformats
-----------------------------
At the moment there are three different types of plotters provided by BEAT platform; bar plots, ROC/DET plots, and scatter plots. However users can make their own plotters when using BEAT locally.
Each plotter accepts only a specific type of dataformat in their input. For example a **bar** plot only accepts ``plot/bar/1`` dataformat. Here is the `JSON`_ declaration for this dataformat.
.. code-block:: json
{
"#description": "Array of bar plots",
"data": [
0,
{
"label": "string",
"x": [
0,
"float64"
],
"y": [
0,
"float64"
]
}
]
}
and the **scatter** plot only accepts ``plot/scatter/1`` dataformat which has the following `JSON`_ declaration:
.. code-block:: json
{
"#description": "A set of 2-D scatter plots with X/Y and a label",
"data": [
0,
{
"label": "string",
"x": [
0,
"float64"
],
"y": [
0,
"float64"
]
}
]
}
.. include:: links.rst
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment