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
3f41e9df
Commit
3f41e9df
authored
Dec 15, 2016
by
LE GAC Renaud
Browse files
Remove obsolete controller/view graph_extjs.
parent
71a97705
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
1 addition
and
123 deletions
+1
-123
controllers/plugin_event.py
controllers/plugin_event.py
+0
-31
static/plugin_event/CHANGELOG
static/plugin_event/CHANGELOG
+1
-0
views/plugin_event/graph_extjs.html
views/plugin_event/graph_extjs.html
+0
-92
No files found.
controllers/plugin_event.py
View file @
3f41e9df
...
...
@@ -24,37 +24,6 @@ MSG = T(" - %s entry(ies) modified in the history table. <br>"
MSG_CVT
=
T
(
" - Conversion error: %s."
)
def
graph_extjs
():
"""Plot 2D metric as a C{Ext.char.series.Area} using the ExtJS library.
This action is kept as a test bench of ExtJS chart classes.
Deprecated: use the more generic graph_mpl
"""
ui_table
=
virtdb
.
selector
selector
=
EvtSelector
(
ui_table
,
exclude_fields
=
(
"metric"
,))
# homomorphism between metric2D and graph
config
=
db
.
graphs
[
request
.
vars
.
id_graphs
]
config
.
group_field_y
=
config
.
field_horizontal
config
.
group_field_x
=
config
.
field_stacked
config
.
metric_field_z
=
"people.id"
config
.
aggregation_z
=
"size"
# generate the metric according to user specification
report
=
Metric2D
(
config
,
selector
)
# extract the configurations for the Ext.data.Store
store
=
report
.
to_store
()
# Extra the stack keys (value for metric.field_vertical)
stack_keys
=
[
el
for
el
in
report
.
df
.
columns
]
# delegate the rendering of the graph to the view
return
dict
(
cfg_store
=
json
.
dumps
(
store
),
stack_keys
=
stack_keys
,
view
=
config
)
def
graph_mpl
():
"""Plot list or metric using the matplotlib library
...
...
static/plugin_event/CHANGELOG
View file @
3f41e9df
...
...
@@ -14,6 +14,7 @@ HEAD
- Rename the class MySelector as EvtSelector.
- Add the method EvtSelector._active_period to compute properly
EvtSelector._is_start, _is_end as well as is_over.
- Remove the obsolete controller and view, graph_extjs.
- Factorize the application around the plugin_event.
0.6.2 (Nov 2016)
...
...
views/plugin_event/graph_extjs.html
deleted
100644 → 0
View file @
71a97705
{{
#--------------------------------------------------------------------------
#
# The python controller return the variables:
# - cfg_store (string)
# - stack_keys (list)
# - view (Storage)
#
#--------------------------------------------------------------------------
#
# prepare the data
# - build unique DIV identifier
# - Title and DIV block
#
#--------------------------------------------------------------------------
import json
#
# unique identifier for the DIV block associated to the grid
#
divchart = "chart-%s" % id(cfg_store)
response.write(H2(view.title, _class="dbui-h2 dbui-small-cap"))
response.write(DIV(_id=divchart))
#
# Export python variables to the javascript
#
jsvars = ["axes",
"cfgStore = %s" % cfg_store,
"chart",
"divchart = '%s'" % divchart,
"series",
"seriesKeys = %s" % json.dumps(stack_keys)]
jsvars = " var %s;" % ',\n'.join(jsvars)
response.write(SCRIPT(jsvars), escape=False)
}}
<script>
// the axes
axes
=
[{
type
:
'
Numeric
'
,
fields
:
seriesKeys
,
grid
:
true
,
minimum
:
0
,
minorTickSteps
:
1
,
position
:
'
left
'
},
{
type
:
'
Category
'
,
fields
:
[
'
year
'
],
grid
:
true
,
label
:
{
rotate
:
{
degrees
:
270
}
},
position
:
'
bottom
'
}];
// how to display the series
series
=
[{
type
:
'
area
'
,
//type: 'column',
style
:
{
opacity
:
0.8
},
xField
:
'
group
'
,
yField
:
seriesKeys
}];
// instantiate the chart
chart
=
Ext
.
create
(
'
Ext.chart.Chart
'
,
{
axes
:
axes
,
legend
:
{
labelFont
:
'
8px Helvetica, sans-serif
'
,
position
:
'
right
'
},
series
:
series
,
store
:
cfgStore
,
width
:
600
,
height
:
400
,
renderTo
:
divchart
});
// inhibit context menu on the rest of the panel
chart
.
getEl
().
up
(
'
.x-panel-body
'
).
on
(
'
contextmenu
'
,
function
(
event
)
{
event
.
stopEvent
();
});
</script>
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