Commit d81542db authored by LE GAC Renaud's avatar LE GAC Renaud
Browse files

Merge branch 'master' into 'production'

Release 0.7.0

See merge request !32
parents 1d2efd3a 8d155af3
plugin_event.ViewportUi.source_node
===================================
.. currentmodule:: plugin_event
.. automethod:: ViewportUi.source_node
\ No newline at end of file
......@@ -10,9 +10,10 @@ API Documentation
:maxdepth: 1
callback
model
report
selector
dataframes
matplotlib_tools
models
report_tools
user_interface
Indices and tables
......
Matplotlib tools
----------------
A collection of functions to help in building graph.
.. currentmodule:: plugin_event
.. autosummary::
:toctree: generated/
bicolor
create_pdf
header_footer
plot_references
plot_values
style
table_only
ticks_and_labels
xticks_and_labels
\ No newline at end of file
Model
-----
Models
------
A collection of classes to define the model for the database.
......
Reports
-------
A collection of methods and classes to build report: *list*, *graph* or
*metric*.
Helper functions
^^^^^^^^^^^^^^^^
.. currentmodule:: plugin_event
.. autosummary::
:toctree: generated/
do_title
get_value
split_dbfield
Classes
^^^^^^^
.. currentmodule:: plugin_event
.. autosummary::
:toctree: generated/
BaseReport
Graph
List
Metric1D
Metric2D
\ No newline at end of file
Selector
--------
Report tools
------------
A collection of classes to build report: *list*, *graph* or
*metric*.
Classes
^^^^^^^
.. currentmodule:: plugin_event
.. autosummary::
:toctree: generated/
SelectorActiveItems
EvtSelector
BaseReport
Graph
List
Metric2D
Source
\ No newline at end of file
docs/db_schema/database.png

127 KB | W: | H:

docs/db_schema/database.png

184 KB | W: | H:

docs/db_schema/database.png
docs/db_schema/database.png
docs/db_schema/database.png
docs/db_schema/database.png
  • 2-up
  • Swipe
  • Onion skin
......@@ -178,7 +178,7 @@
<part>id</part>
</key>
</table>
<table x="827" y="22" name="lists">
<table x="1064" y="24" name="lists (obsolete)">
<row name="id" null="0" autoincrement="1">
<datatype>integer</datatype>
</row>
......@@ -210,7 +210,7 @@
<part>id</part>
</key>
</table>
<table x="934" y="193" name="metrics2d">
<table x="1235" y="210" name="metrics2d (obsolete)">
<row name="id" null="0" autoincrement="1">
<datatype>integer</datatype>
</row>
......@@ -242,7 +242,7 @@
<part>id</part>
</key>
</table>
<table x="1065" y="22" name="graphs">
<table x="1057" y="250" name="graphs (obsolete)">
<row name="id" null="0" autoincrement="1">
<datatype>integer</datatype>
</row>
......@@ -268,7 +268,7 @@
<part>id</part>
</key>
</table>
<table x="929" y="19" name="metrics1d">
<table x="1223" y="27" name="metrics1d (obsolete)">
<row name="id" null="0" autoincrement="1">
<datatype>integer</datatype>
</row>
......@@ -342,4 +342,100 @@
<part>id</part>
</key>
</table>
<table x="805" y="20" name="lists2">
<row name="id" null="1" autoincrement="1">
<datatype>integer</datatype>
<default>NULL</default></row>
<row name="name" null="0" autoincrement="0">
<datatype>string</datatype>
</row>
<row name="title" null="1" autoincrement="0">
<datatype>string</datatype>
<default>NULL</default></row>
<row name="definition" null="1" autoincrement="0">
<datatype>text</datatype>
<default>NULL</default></row>
<row name="source" null="0" autoincrement="0">
<datatype>string</datatype>
</row>
<row name="id_events" null="0" autoincrement="0">
<datatype>integer</datatype>
<relation table="events" row="id" />
</row>
<row name="eval" null="1" autoincrement="0">
<datatype>string</datatype>
<default>NULL</default></row>
<row name="query" null="1" autoincrement="0">
<datatype>string</datatype>
<default>NULL</default></row>
<row name="group_field" null="1" autoincrement="0">
<datatype>string</datatype>
<default>NULL</default></row>
<row name="sorters" null="1" autoincrement="0">
<datatype>string</datatype>
<default>NULL</default></row>
<row name="columns" null="0" autoincrement="0">
<datatype>text</datatype>
</row>
<row name="summary_group" null="0" autoincrement="0">
<datatype>boolean</datatype>
<default>NULL</default></row>
<row name="summary_all" null="0" autoincrement="0">
<datatype>boolean</datatype>
<default>NULL</default></row>
<key type="PRIMARY" name="">
<part>id</part>
</key>
</table>
<table x="923" y="21" name="metrics2d2">
<row name="id" null="1" autoincrement="1">
<datatype>integer</datatype>
<default>NULL</default></row>
<row name="name" null="0" autoincrement="0">
<datatype>string</datatype>
<default>'NULL'</default></row>
<row name="title" null="1" autoincrement="0">
<datatype>string</datatype>
<default>NULL</default></row>
<row name="definition" null="1" autoincrement="0">
<datatype>string</datatype>
<default>NULL</default></row>
<row name="source" null="0" autoincrement="0">
<datatype>string</datatype>
</row>
<row name="id_events" null="0" autoincrement="0">
<datatype>integer</datatype>
<relation table="events" row="id" />
</row>
<row name="eval" null="1" autoincrement="0">
<datatype>text</datatype>
<default>NULL</default></row>
<row name="query" null="1" autoincrement="0">
<datatype>text</datatype>
<default>NULL</default></row>
<row name="group_field_x" null="0" autoincrement="0">
<datatype>string</datatype>
</row>
<row name="group_field_y" null="0" autoincrement="0">
<datatype>string</datatype>
</row>
<row name="metric_field_z" null="0" autoincrement="0">
<datatype>string</datatype>
</row>
<row name="aggregate_func_z" null="0" autoincrement="0">
<datatype>string</datatype>
</row>
<row name="summary_x" null="0" autoincrement="0">
<datatype>blob</datatype>
</row>
<row name="summary_y" null="0" autoincrement="0">
<datatype>blob</datatype>
</row>
<row name="graph" null="0" autoincrement="0">
<datatype>blob</datatype>
</row>
<key type="PRIMARY" name="">
<part>id</part>
</key>
</table>
</sql>
......@@ -5,17 +5,17 @@
Appendix C: Column configuration
===================================
Lists and 1-dim Metrics display a collection of columns.
Lists display a set of columns.
The configuration properties of the columns are those of the
``Ext.grid.column.Column`` class. More information can be found in the ExtJS_
documentation.
The column is by default configured to render string. It is possible to handle
``boolean``, ``date`` and ``number`` values by changing the ``xtype`` property.
The mapping between the database field and the column types is the following:
The mapping between the type of the field and the column one is the following:
================ =================
Database ``xtype``
Field ``xtype``
================ =================
boolean ``booleancolumn``
date / datetime ``datecolumn``
......@@ -23,32 +23,8 @@ The mapping between the database field and the column types is the following:
string (default) ``gridcolumn``
================ =================
A column contains the value of the given database field. In that first case,
the mandatory properties depend on the report and are the following:
=============== ===============
List Metric1D
=============== ===============
-- ``aggregate``
``dbfield`` ``dbfield``
``text`` ``text``
``xtype`` ``xtype``
=============== ===============
A column can also contains computed values obtained by applying a mathematical
expression on the cells of the other columns. In that second case, the mandatory
property are the following and do not depend on the report:
.. list-table::
* - **Computed column**
* - ``dataIndex``
* - ``eval``
* - ``text``
* - ``xtype``
The most important properties are defined in the next sections as a function of
the column type.
The most important configuration properties are defined in the next sections
as a function of the column type.
All columns
-----------
......@@ -62,45 +38,11 @@ All columns
The first syntax is the preferred one when running with ``ExtJS 6``.
``dataIndex``
the index of the column used by the ``DataFrame``, the ``Ext.data.store``
and the ``Ext.grid.Panel``. By default, this internal parameter is derived
from the ``dbfield`` property. However, when using the ``eval`` property,
it could be useful to index the column with short name like *a*, *b*, ...
``dbfield``
the address of the database field encoded as ``"tablename.fieldname"`` or
``"tablename.fieldname.keyname"``.
.. warning::
Do not use with the ``eval`` property.
``eval``
the string defining the mathematical operation applied between column cells,
*e.g* ``(a+b*2)/c`` where *a*, *b* and *c* are column indexes.
.. warning::
Do not use the ``dbfield`` and ``aggregate`` properties.
the index of the field defined in the source.
``hidden``
the column is hidden when it is ``true``.
``renderer``
A string pointing to the javascript function rendering the value or
containing the function itself. The possible value is ``reprDuration`` or
``(function(value) {Ext.util.Format.number(value, '0.0')})``. In the last
syntax, the parenthesis at the beginning and at the end are mandatory.
``summaryRenderer``
A string containing the function to render the summary value, *e.g*
``(function(value) {Ext.util.Format.number(value, '0.0')})``. The
parenthesis at the beginning and at the end are mandatory.
See the documentation for more complex strategy.
``summaryType``
Summary are computed over the column values.
Possible functions are ``"count"``, ``"sum"``, ``"min"``, ``"max"`` and
``"average"``.
``text``
the string containing the label of the column.
......@@ -126,15 +68,20 @@ Date column
Number column
-------------
``aggregate``
the aggregation function uses by the 1-dim metric.
Many functions are available: ``count``, ``max``, ``mean``,
``median``, ``min``, ``size``, ``std``, ``sum``, *etc*. In fact, all the
descriptive stats methods of the DataFrame_ class.
``format``
the format string, *e.g.* ``"0,000.00"``.
``formatter``
the function to format the column, *e.g.* "round(2)"
``summaryFormatter``
the function to format the summary of the column, *e.g.* "round(2)"
``summaryType``
Summary are computed over the column values.
Possible functions are ``"count"``, ``"sum"``, ``"min"``, ``"max"`` and
``"average"``.
Row numbered column
-------------------
......
......@@ -46,6 +46,8 @@ History
- integer
* - ``history.id_events``
- integer
* - ``history.id_domains``
- integer
* - ``history.id_teams``
- integer
* - ``history.id_projects``
......@@ -153,8 +155,6 @@ Projects
- integer
* - ``projects.project``
- string
* - ``projects.agencies``
- string
Teams
......@@ -168,5 +168,3 @@ Teams
- integer
* - ``teams.team``
- string
* - ``teams.domain``
- string
......@@ -5,102 +5,50 @@
Appendix D: Graph configuration
===================================
The graph configuration is a JSON_-type object. Its properties are mainly the
The graph configuration is a JSON_-type object. Its properties are the
keywords arguments of the DataFrame.plot_ method.
The basic keywords
------------------
``kind``
select the graph type. The parameters the underlying matplotlib functions
can be used, but not detailed here:
kind
----
select the graph type:
.. list-table::
* - ``line``
- line plot
-
* - ``bar``
- vertical bar plot
- `pyplot.bar`_
* - ``barh``
- horizontal bar plot
- `pyplot.barh`_
* - ``hist``
- histogram
- `pyplot.hist`_
* - ``box``
- box plot
- `pyplot.box`_
* - ``kde``
- density estimation plot
-
* - ``area``
- area plot
-
* - ``pie``
- pie plot
- `pyplot.pie`_
* - ``scatter``
- scatter plot
- `pyplot.scatter`_
* - ``hexbin``
- hexbin plot
- `pyplot.hexbin`_
``stacked``
histograms or bar chart are stacked when it is ``true``.
.. note::
The graph is not plotted when this parameter is empty
``logx``, ``logy``, ``loglog``, ``xlim`` and ``ylim``
fine tuning of the scale and axis boundaries.
stacked
-------
area, line or bar chart are stacked when it is ``true``.
``grid`` or ``legend``
deactivate grid (legend) when it is ``false``.
logx, logy and loglog
---------------------
activated the log scale when it is ``true``.
``colormap``
set the matplotlib.colormap_ identify by its name.
ylim
----
defined the minimum and the maximum value along the *y*-axis.
``xerr`` and ``yerr``
set errors bars.
grid
----
activated the grid when it is ``true``.
``index``, ``x`` and ``y``
The mapping between the columns of the report and the graph is implicit when
all columns of the DataFrame are used. However, it can be reduced to a set
of columns depending on the graph type:
legend
------
activated the legend.
Possible values are ``false``, ``true`` or ``reverse``.
.. list-table::
:widths: 20 30
* - ``index``
- ``bar``, ``barh``, ``hist``
* - ``x`` and ``y``
- ``line plot``, ``scatter plot``, ``hexbin``
``xlabel``, ``ylabel``
set the label along the *x* and *y*-axis respectively
``tranpose``
boolean value to exchange *index* and *column* using the method
``DataFrame.T``.
Column addressing
-----------------
The report is a series of values organized
in columns. In order to:
* histogram the value of one column, use::
index = column label or position
* plot the values of one column against the values of the other one
(line plot, scatter plot, hexbin plot), use::
x = column label or position
y = column label or position
* a stacked histogram/bar with the reduced set of columns, use the list::
index = [column labels, or positions]
colormap
--------
chose a color map among the proposed ones.
.. include:: hyperlinks.txt
.. _Appendix B:
Appendix B: Sources
===================
.. _source-items:
Source items
------------
Contains items belonging to the selected event. All information
is available:
* meta-data:
.. list-table::
* - ``id_domains``
- int
* - ``id_events``
- int
* - ``id_fundings``
- int
* - ``id_objects``
- int
* - ``id_object_categories``
- int
* - ``id_people``
- int
* - ``id_people_categories``
- int
* - ``id_projects``
- int
* - ``id_teams``
- int
* Database fields from tables:
.. list-table::
* - ``domains``
- (``domain``)
* - ``fundings``
- (``agency``)
* - ``objects``
- (``reference``, ``serial_number``, ``batch_number``)
* - ``object_categories``
- (``code``, ``category``)
* - ``people``
- (``first_name``, ``last_name``, ``initials``, ``birth_date``)
* - ``people_categories``
- (``code``, ``category``)
* - ``projects``
- (``project``)
* - ``teams``
- (``team``)
* One field for each property of the user data block associated to the
selected event. The name of the field is the one of the property.
* Date for the event:
.. list-table::
* - ``start_date``
- date
* - ``end_date``
- date
.. _source-items-year:
Source items per year
---------------------
Contains active items belonging to the selected event on a year basis.
Therefore, an item appears several time when it is active during
several years. All information is available:
* meta-data:
.. list-table::
* - ``id_domains``
- int
* - ``id_events``
- int
* - ``id_fundings``
- int
* - ``id_objects``
- int
* - ``id_object_categories``
- int
* - ``id_people``
- int
* - ``id_people_categories``
- int
* - ``id_projects``
- int
* - ``id_teams``
- int
* Database fields from tables: