Commit 96dbaed5 authored by Xiaowu Zhang's avatar Xiaowu Zhang

ors_wendelin: resize

parent c1e3fd26
/*global window, rJS, RSVP, console, Plotly */ /*global window, rJS, RSVP, console, Plotly */
/*jslint nomen: true, indent: 2 */ /*jslint nomen: true, indent: 2 */
(function (window, rJS, RSVP, Plotly, wendelin) { (function (window, rJS, RSVP, Plotly, wendelin, loopEventListener) {
"use strict"; "use strict";
var gadget_klass = rJS(window); var gadget_klass = rJS(window);
...@@ -10,8 +10,13 @@ ...@@ -10,8 +10,13 @@
.declareAcquiredMethod("getSetting", "getSetting") .declareAcquiredMethod("getSetting", "getSetting")
.declareAcquiredMethod("jio_get", "jio_get") .declareAcquiredMethod("jio_get", "jio_get")
.declareAcquiredMethod("jio_getAttachment", "jio_getAttachment") .declareAcquiredMethod("jio_getAttachment", "jio_getAttachment")
.ready(function (gadget) { .declareService(function () {
gadget.property_dict = {}; var gadget = this;
return loopEventListener(window, 'resize', false, function () {
Plotly.Plots.resize(gadget.element.querySelector('.graph-initial-success-rate'));
Plotly.Plots.resize(gadget.element.querySelector('.graph-added-success-rate'));
});
}) })
.declareMethod('render', function (option_dict) { .declareMethod('render', function (option_dict) {
var gadget = this, var gadget = this,
...@@ -96,7 +101,8 @@ ...@@ -96,7 +101,8 @@
*/ */
'title' : 'Initial E-RAB establishment success rate', 'title' : 'Initial E-RAB establishment success rate',
'xaxis': { 'xaxis': {
'autorange': true 'autorange': true,
'autosize': true
}, },
'yaxis': { 'yaxis': {
title: { title: {
...@@ -117,7 +123,8 @@ ...@@ -117,7 +123,8 @@
},*/ },*/
'title' : 'Added E-RAB establishment success rate', 'title' : 'Added E-RAB establishment success rate',
'xaxis': { 'xaxis': {
'autorange': true 'autorange': true,
'autosize': true
}, },
'yaxis': { 'yaxis': {
title: { title: {
...@@ -129,4 +136,4 @@ ...@@ -129,4 +136,4 @@
}); });
}); });
}(window, rJS, RSVP, Plotly, wendelin)); }(window, rJS, RSVP, Plotly, wendelin, loopEventListener));
...@@ -242,7 +242,7 @@ ...@@ -242,7 +242,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>1007.27183.21155.35225</string> </value> <value> <string>1007.32863.55523.57719</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -262,7 +262,7 @@ ...@@ -262,7 +262,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1680269791.01</float> <float>1680610679.89</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -71,8 +71,13 @@ ...@@ -71,8 +71,13 @@
.declareAcquiredMethod("getSetting", "getSetting") .declareAcquiredMethod("getSetting", "getSetting")
.declareAcquiredMethod("jio_get", "jio_get") .declareAcquiredMethod("jio_get", "jio_get")
.declareAcquiredMethod("jio_getAttachment", "jio_getAttachment") .declareAcquiredMethod("jio_getAttachment", "jio_getAttachment")
.ready(function (gadget) { .declareService(function () {
gadget.property_dict = {}; var gadget = this;
return loopEventListener(window, 'resize', false, function () {
Plotly.Plots.resize(gadget.element.querySelector('.upload-link'));
Plotly.Plots.resize(gadget.element.querySelector('.download-link'));
});
}) })
.declareMethod('render', function (option_dict) { .declareMethod('render', function (option_dict) {
var gadget = this, var gadget = this,
...@@ -136,7 +141,8 @@ ...@@ -136,7 +141,8 @@
},*/ },*/
'title' : 'Download Link', 'title' : 'Download Link',
'xaxis': { 'xaxis': {
'autorange': true 'autorange': true,
'autosize': true
/* /*
'rangeslider': { 'rangeslider': {
//range: [date[0], date[date.length - 1]] //range: [date[0], date[date.length - 1]]
...@@ -161,7 +167,8 @@ ...@@ -161,7 +167,8 @@
},*/ },*/
'title' : 'Upload Link', 'title' : 'Upload Link',
'xaxis': { 'xaxis': {
'autorange': true 'autorange': true,
'autosize': true
/* /*
'rangeslider': { 'rangeslider': {
'range': [date[0], date[date.length - 1]] 'range': [date[0], date[date.length - 1]]
......
...@@ -242,7 +242,7 @@ ...@@ -242,7 +242,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>1007.27304.20791.50176</string> </value> <value> <string>1007.32864.56533.30259</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -262,7 +262,7 @@ ...@@ -262,7 +262,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1680277088.07</float> <float>1680610637.0</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
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