Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
tev
plugin_event
Commits
554c9459
Commit
554c9459
authored
Mar 12, 2017
by
LE GAC Renaud
Browse files
Modify the configuration of the selector to used Graph and Summary widgets.
parent
c71c283a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
47 additions
and
29 deletions
+47
-29
modules/plugin_event/model_report.py
modules/plugin_event/model_report.py
+2
-3
modules/plugin_event/model_selector.py
modules/plugin_event/model_selector.py
+8
-19
modules/plugin_event/ui_selector.py
modules/plugin_event/ui_selector.py
+37
-7
No files found.
modules/plugin_event/model_report.py
View file @
554c9459
...
...
@@ -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. "
\
...
...
modules/plugin_event/model_selector.py
View file @
554c9459
...
...
@@ -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"
)
...
...
modules/plugin_event/ui_selector.py
View file @
554c9459
...
...
@@ -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"
))
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment