Commit 554c9459 authored by LE GAC Renaud's avatar LE GAC Renaud
Browse files

Modify the configuration of the selector to used Graph and Summary widgets.

parent c71c283a
......@@ -72,9 +72,8 @@ DEF_PLOT = \
}"""
DEF_SUMMARY = {
"compute": False,
"function(s)": '["sum"]',
"label(s)": '["Sum"]'}
"functions": "",
"labels": ""}
TP_AGG = \
"The aggregation function applies on the metric field. " \
......
......@@ -71,25 +71,14 @@ class Selector(object):
Field("query", "text"),
Field("summary_x",
"json",
default=DEF_SUMMARY,
label="Supersede the summary configurations.<br><br>"
"Possible functions are: max, mean, median, min, sem, "
"size, sum, std, var.<br><br>"
"Summary(ies) per row"),
Field("summary_y",
"json",
default=DEF_SUMMARY,
label="Summary(ies) per column"),
Field("graph",
"json",
default=DEF_GRAPH,
label="Supersede the summary configurations.<br><br>"
"Possible plot (kind) are: line, bar, barh, hist, "
"box, kde, area, pie, scatter, hexbin"))
Field("is_summary_x", "boolean"),
Field("summary_x", "json", default=DEF_SUMMARY),
Field("is_summary_y", "boolean"),
Field("summary_y", "json", default=DEF_SUMMARY),
Field("is_graph", "boolean"),
Field("graph", "json", default=DEF_GRAPH))
table.id_object_categories.requires = \
IS_IN_DB(db, "alias_object_categories.category")
......
......@@ -82,9 +82,9 @@ class SelectorUi(object):
"operators are in, not in, and, or, "
"&, |, ...")
mdf.configure_field("summary_x", labelAlign="top")
mdf.configure_field("summary_y", labelAlign="top")
mdf.configure_field("graph", labelAlign="top")
mdf.configure_field("summary_x", hideLabel=True, xtype="xsummaryfield")
mdf.configure_field("summary_y", hideLabel=True, xtype="xsummaryfield")
mdf.configure_field("graph", hideLabel=True, xtype="xgraphfield")
# ....................................................................
#
......@@ -161,8 +161,27 @@ class SelectorUi(object):
title=T("Select"))
# SUMMARY TAB ........................................................
items = [mapfields["SelectorSummary_x"],
mapfields["SelectorSummary_y"]]
items = [
{
"checkbox": {
"name": "SelectorIs_summary_x"
},
"checkboxToggle": True,
"collapsed": True,
"items": mapfields["SelectorSummary_x"],
"title": "summary per row",
"xtype": "fieldset"
}, {
"checkbox": {
"name": "SelectorIs_summary_y"
},
"checkboxToggle": True,
"collapsed": True,
"items": mapfields["SelectorSummary_y"],
"title": "summary per column",
"xtype": "fieldset"
}
]
fieldset2 = dbui.FieldSet(
defaults=dict(frame=True),
......@@ -172,12 +191,23 @@ class SelectorUi(object):
title=T("Metric2D"))
# GRAPH TAB ..........................................................
items = [mapfields["SelectorGraph"]]
items = [
{
"checkbox": {
"name": "SelectorIs_graph"
},
"checkboxToggle": True,
"collapsed": True,
"items": [mapfields["SelectorGraph"]],
"title": "tune graph",
"xtype": "fieldset"
}
]
fieldset3 = dbui.FieldSet(
defaults=dict(frame=True),
items=items,
layout="fit",
layout="anchor",
plugins=["pFormToolTip"],
title=T("Graph"))
......
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