Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
dream
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
dream
Commits
11931df4
Commit
11931df4
authored
Apr 16, 2015
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
GUI: New widget to display bottlenecks in demand planning
parent
d177534c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
89 additions
and
0 deletions
+89
-0
dream/platform/src/dream/Output_viewBottleneckGraph.html
dream/platform/src/dream/Output_viewBottleneckGraph.html
+23
-0
dream/platform/src/dream/Output_viewBottleneckGraph.js
dream/platform/src/dream/Output_viewBottleneckGraph.js
+66
-0
No files found.
dream/platform/src/dream/Output_viewBottleneckGraph.html
0 → 100644
View file @
11931df4
<!DOCTYPE html>
<html>
<head>
<meta
charset=
"utf-8"
>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1"
>
<title>
Graph
</title>
<script
src=
"../<%= copy.rsvp.relative_dest %>"
type=
"text/javascript"
></script>
<script
src=
"../<%= copy.renderjs.relative_dest %>"
type=
"text/javascript"
></script>
<script
src=
"../<%= curl.jquery.relative_dest %>"
type=
"text/javascript"
></script>
<script
src=
"../<%= curl.jqueryflot.relative_dest %>"
></script>
<script
src=
"../<%= curl.jqueryflotstack.relative_dest %>"
></script>
<script
src=
"../<%= curl.jqueryflottime.relative_dest %>"
></script>
<script
src=
"mixin_gadget.js"
type=
"text/javascript"
></script>
<script
src=
"Output_viewBottleneckGraph.js"
type=
"text/javascript"
></script>
</head>
<body>
<div
class=
"graph_container"
style=
"float:left; width: 100%; height:300px"
></div>
<div>
<label
for=
"choices"
>
Please select bottleneck:
</label>
<select
class=
"choices"
name=
"choices"
></select>
</div>
</body>
</html>
dream/platform/src/dream/Output_viewBottleneckGraph.js
0 → 100644
View file @
11931df4
/*global rJS, jQuery, initGadgetMixin, console */
/*jslint unparam: true */
(
function
(
window
,
rJS
,
$
,
initGadgetMixin
)
{
"
use strict
"
;
var
gadget_klass
=
rJS
(
window
);
initGadgetMixin
(
gadget_klass
);
gadget_klass
/////////////////////////////////////////////////////////////////
// Acquired methods
/////////////////////////////////////////////////////////////////
.
declareAcquiredMethod
(
"
aq_getAttachment
"
,
"
jio_getAttachment
"
)
/**
* Similar to Output_viewGraph, but to display a set of series with a drop down.
* XXX Can be renamed to something more generic !
*/
/////////////////////////////////////////////////////////////////
// declared methods
/////////////////////////////////////////////////////////////////
.
declareMethod
(
"
render
"
,
function
(
options
)
{
var
jio_key
=
options
.
id
,
gadget
=
this
;
gadget
.
props
.
jio_key
=
jio_key
;
gadget
.
props
.
result
=
options
.
result
;
return
gadget
.
aq_getAttachment
({
"
_id
"
:
gadget
.
props
.
jio_key
,
"
_attachment
"
:
"
body.json
"
})
.
push
(
function
(
simulation_json
)
{
var
json_data
=
JSON
.
parse
(
simulation_json
);
gadget
.
props
.
data
=
json_data
.
result
.
result_list
[
options
.
result
][
options
.
action_definition
.
configuration
.
output_id
];
});
})
.
declareMethod
(
"
startService
"
,
function
()
{
var
first_option
,
datasets
=
this
.
props
.
data
,
graph_container
=
this
.
props
.
element
.
querySelector
(
"
.graph_container
"
),
select
=
$
(
this
.
props
.
element
.
querySelector
(
"
select.choices
"
));
function
plotAccordingToChoices
()
{
var
data
;
if
(
select
.
val
())
{
data
=
datasets
[
select
.
val
()];
$
.
plot
(
graph_container
,
data
.
series
,
data
.
options
);
}
}
// insert options in the select
$
.
each
(
datasets
,
function
(
key
,
val
)
{
select
.
append
(
"
<option value='
"
+
key
+
"
'>
"
+
key
+
"
</option>
"
);
});
first_option
=
$
(
$
(
"
option
"
,
select
).
get
(
0
));
first_option
.
attr
(
'
selected
'
,
'
selected
'
);
select
.
selectmenu
(
'
refresh
'
,
true
);
select
.
bind
(
"
change
"
,
plotAccordingToChoices
);
plotAccordingToChoices
();
});
}(
window
,
rJS
,
jQuery
,
initGadgetMixin
));
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