summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSaloniGoyal2016-06-21 11:10:26 +0530
committerSaloniGoyal2016-06-21 11:10:26 +0530
commitdfc342ff023d7b01dea839bf37d980e58cdb6170 (patch)
tree2ea6b0069e225944897d2ed90759d4a5b633339f
parentcc7dea1d7c9530927ef91de28716a44dfa912e20 (diff)
downloadeSimWebApp-dfc342ff023d7b01dea839bf37d980e58cdb6170.tar.gz
eSimWebApp-dfc342ff023d7b01dea839bf37d980e58cdb6170.tar.bz2
eSimWebApp-dfc342ff023d7b01dea839bf37d980e58cdb6170.zip
plot size increased
-rw-r--r--views/script/form.js47
-rw-r--r--views/script/gui.js2
-rw-r--r--views/style/schematic.css4
3 files changed, 47 insertions, 6 deletions
diff --git a/views/script/form.js b/views/script/form.js
index 2198a50..1902507 100644
--- a/views/script/form.js
+++ b/views/script/form.js
@@ -4,14 +4,57 @@ socket.on("plotData",function(data){
var keys = Object.keys(data);
var traceObj = {};
var traces = [];
- var abscissa, ordinate;
+
console.log(Object.keys(data));
$('webtronics_plot_keys').innerHTML = "Available keys: " + Object.keys(data);
//Dynamically creating traces
+ for(var i=0; i<keys.length; i++){
+ if(keys[i]=='x-axis'){
+ continue;
+ }
+ else{
+ var trace = {
+ x: data['x-axis'],
+ y: data[keys[i]],
+ name:keys[i],
+ type: 'scatter'
+ };
+ traceObj[keys[i]] = trace;
+ }
+ }
+
+ var traceKey = Object.keys(traceObj);
+ for (var i=0;i<traceKey.length;i++) {
+ var value = traceObj[traceKey[i]];
+ traces.push(value);
+ }
+
+ console.log("traces :"+traces);
+
+ var dataForPlotly = traces;
+
+ var layout = {
+ title:'Simulation Output',
+ yaxis: { title: "Voltage(Volts) / Current(Amp)"}, // set the y axis title
+ xaxis: {
+ title:"time(Sec) / Frequency(Hz)",
+ showgrid: true // remove the x-axis grid lines
+ },
+ margin: { // update the left, bottom, right, top margin
+ l: 60, b: 35, r: 10, t: 25
+ }
+ };
+
+ Plotly.newPlot(document.getElementById('webtronics_graph_display'), dataForPlotly, layout);
+
+
jQuery("#plot_graph").click(function(){
+ var traceObj = {};
+ var traces = [];
+ var abscissa, ordinate;
abscissa = $('abscissa_value').value;
ordinate = $('ordinate_value').value;
if(abscissa == "" || ordinate == ""){
@@ -58,8 +101,6 @@ socket.on("plotData",function(data){
l: 60, b: 35, r: 10, t: 25
}
};
- $('plot_details').style.display = "none";
- $('webtronics_graph_display').style.display = "block";
Plotly.newPlot(document.getElementById('webtronics_graph_display'), dataForPlotly, layout);
}
}
diff --git a/views/script/gui.js b/views/script/gui.js
index 2793b29..231dd28 100644
--- a/views/script/gui.js
+++ b/views/script/gui.js
@@ -1419,7 +1419,7 @@ Event.observe($('webtronics_netlist_simulate'), 'click', function() {
$('plot_details').style.display = "block";
$('abscissa_value').value = "";
$('ordinate_value').value = "";
- $('webtronics_graph_display').style.display = "none";
+ // $('webtronics_graph_display').style.display = "none";
webtronics.center($('webtronics_plot_box'));
webtronics.disablepage();
});
diff --git a/views/style/schematic.css b/views/style/schematic.css
index d8f49e8..2cd7ae3 100644
--- a/views/style/schematic.css
+++ b/views/style/schematic.css
@@ -256,8 +256,8 @@ div.modal>*{
}
#webtronics_graph_display{
- width:520px;
- height:310px;
+ width:620px;
+ height:400px;
}
/*
#webtronics_plot_cancel{