Skip to content

Commit

Permalink
bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
tejasavkhattar committed Aug 7, 2018
1 parent 78b61f5 commit d085107
Show file tree
Hide file tree
Showing 10 changed files with 41 additions and 109 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ import $ from 'jquery';
import MyBar from './NavBar/MyBar';
import HTable from './HTable';
import Papa from 'papaparse';
import * as d3 from "d3";



class WholeThing extends Component {

Expand All @@ -31,6 +28,7 @@ class WholeThing extends Component {
showTable: false,
multi: true,
plot_count: 4,
visiblehandler: false
};
this.handleClick = this.handleClick.bind(this);
}
Expand Down Expand Up @@ -438,7 +436,7 @@ handleClick (buttonType, functionName, propertyName, plotType) {
case "densityplot":
plot_type = arguments[1];
var_x = arguments[3];
this.setState({multi: false, plot: true});
this.setState({plot: true, visiblehandler: true});
this.setState({plot_type: plot_type, var_x: var_x});
break;

Expand All @@ -448,29 +446,29 @@ handleClick (buttonType, functionName, propertyName, plotType) {
var_y = arguments[4];
let minpts = arguments[5];
let eps = arguments[6];
this.setState({multi: false, plot: true});
this.setState({ plot: true, visiblehandler: true});
this.setState({plot_type: plot_type, var_x: var_x, var_y: var_y, minpts: minpts, eps: eps});
break;

case "pcaplot":
plot_type = arguments[1];
var_x = arguments[3];
this.setState({multi: false, plot: true});
this.setState({plot: true, visiblehandler: true});
this.setState({plot_type: plot_type, var_x: var_x});
break;

case "distributionplot":
plot_type = arguments[1];
var_x = arguments[3];
this.setState({multi: false, plot: true});
this.setState({ plot: true, visiblehandler: true});
this.setState({plot_type: plot_type, var_x: var_x});
break;

case "svmclassification":
plot_type = arguments[1];
let formula = arguments[3];
let kernel = arguments[4];
this.setState({multi: false, plot: true});
this.setState({plot: true, visiblehandler: true});
this.setState({plot_type: plot_type, formula: formula, kernel: kernel});
break;

Expand Down Expand Up @@ -731,8 +729,6 @@ handleClick (buttonType, functionName, propertyName, plotType) {


render() {
console.log("***********Data State****************");
console.table(this.state.data);
if(!this.state.multi)
var thing = <svg id="plot-panel" ref={ref => this.plot_ref = ref}></svg>;
else {
Expand All @@ -746,8 +742,9 @@ handleClick (buttonType, functionName, propertyName, plotType) {

<div>
<MyBar ref={ref => this.top_bar = ref} onClick={this.handleClick} variables={this.state.variables} plotenabled={this.state.plot_type} />
<div>
<div id="plotdiv"></div>

<div style={{display: this.state.visiblehandler ? 'block': 'none', height:1000}} id="plotdiv"></div>
<div>
{thing}
<div id="temp_plot_thing"></div>
<HTable ref={ref => this.data_ref = ref} table={this.state.data_table} table_id={1} />
Expand Down
4 changes: 0 additions & 4 deletions StatisticalPlatform/StatisticalPlatform/static/css/login.css
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,3 @@
.MainPage{
color: #f40035;
}

#plotdiv {
height: 400px;
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ function naiveBayesClassify(bundle, table) {
console.log(JSON.stringify(train_x));
console.log(JSON.stringify(train_y));
*/
ocpu.seturl("//cloud.opencpu.org/ocpu/apps/tejasavkhattar/test/R");
ocpu.seturl("http://localhost:5656/ocpu/apps/tejasavkhattar/testpackage/R");

ocpu.call("classify", {
fn: bundle.classify_type,
Expand Down Expand Up @@ -98,7 +98,7 @@ function evaluate(bundle, bar_ref) {
console.log(JSON.stringify(test_y));
*/

ocpu.seturl("//cloud.opencpu.org/ocpu/apps/tejasavkhattar/test/R");
ocpu.seturl("http://localhost:5656/ocpu/apps/tejasavkhattar/testpackage/R");

ocpu.call("myfn", {
fn: bundle.classify_type,
Expand Down
22 changes: 11 additions & 11 deletions StatisticalPlatform/StatisticalPlatform/static/js/nvd3_plots.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ function makePlot(obj, state) {

if (type === "plotDendogram") {

ocpu.seturl("//cloud.opencpu.org/ocpu/apps/tejasavkhattar/test/R");
ocpu.seturl("http://localhost:5656/ocpu/apps/tejasavkhattar/testpackage/R");

var data = dataJSON;

Expand Down Expand Up @@ -216,7 +216,7 @@ function makePlot(obj, state) {

var var_x = state.var_x, var_y = state.var_y, kvalue = state.kvalue;

ocpu.seturl("//cloud.opencpu.org/ocpu/apps/tejasavkhattar/test/R");
ocpu.seturl("http://localhost:5656/ocpu/apps/tejasavkhattar/testpackage/R");

var data = dataJSON, plotData = {};
plotData.kvalue = kvalue;
Expand All @@ -238,7 +238,7 @@ function makePlot(obj, state) {

if (type === "plotScatterMatrix") {

ocpu.seturl("//cloud.opencpu.org/ocpu/apps/tejasavkhattar/test/R");
ocpu.seturl("http://localhost:5656/ocpu/apps/tejasavkhattar/testpackage/R");

var data = dataJSON;

Expand All @@ -258,7 +258,7 @@ function makePlot(obj, state) {

var var_x = state.var_x, var_y = state.var_y;

ocpu.seturl("//cloud.opencpu.org/ocpu/apps/tejasavkhattar/test/R");
ocpu.seturl("http://localhost:5656/ocpu/apps/tejasavkhattar/testpackage/R");

var data = dataJSON, plotData = {};
plotData.var_x = var_x;
Expand All @@ -279,7 +279,7 @@ function makePlot(obj, state) {

if (type === "plotTimeSeries") {

ocpu.seturl("//cloud.opencpu.org/ocpu/apps/tejasavkhattar/test/R");
ocpu.seturl("http://localhost:5656/ocpu/apps/tejasavkhattar/testpackage/R");

var data = dataJSON, plotData = {};

Expand All @@ -298,7 +298,7 @@ function makePlot(obj, state) {

if (type === "plotComatrix") {

ocpu.seturl("//cloud.opencpu.org/ocpu/apps/tejasavkhattar/test/R");
ocpu.seturl("http://localhost:5656/ocpu/apps/tejasavkhattar/testpackage/R");

var method = state.comatrix;
var data = dataJSON;
Expand Down Expand Up @@ -327,7 +327,7 @@ function makePlot(obj, state) {
if (type == "plotBarChart") {

if (state.simple_bool) {
ocpu.seturl("//cloud.opencpu.org/ocpu/apps/tejasavkhattar/test/R");
ocpu.seturl("http://localhost:5656/ocpu/apps/tejasavkhattar/testpackage/R");

var data = dataJSON, value = state.var_x, plotData = {};

Expand All @@ -345,7 +345,7 @@ function makePlot(obj, state) {
}
if (state.group_bool) {

ocpu.seturl("//cloud.opencpu.org/ocpu/apps/tejasavkhattar/test/R");
ocpu.seturl("http://localhost:5656/ocpu/apps/tejasavkhattar/testpackage/R");

var data = dataJSON;

Expand All @@ -362,7 +362,7 @@ function makePlot(obj, state) {
}
if (state.stack_bool) {

ocpu.seturl("//cloud.opencpu.org/ocpu/apps/tejasavkhattar/test/R");
ocpu.seturl("http://localhost:5656/ocpu/apps/tejasavkhattar/testpackage/R");

var data = dataJSON;

Expand All @@ -381,7 +381,7 @@ function makePlot(obj, state) {

if (type == "plotScatterPlot") {
var var_x = state.var_x, var_y = state.var_y, straight_bool = state.straight_bool, exponential_bool = state.exponential_bool, polynomial_bool = state.polynomial_bool, logarithmic_bool = state.logarithmic_bool;
ocpu.seturl("//cloud.opencpu.org/ocpu/apps/tejasavkhattar/test/R");
ocpu.seturl("http://localhost:5656/ocpu/apps/tejasavkhattar/testpackage/R");
var data = dataJSON, plotData = {};

var req = ocpu.rpc("scatterplot", {data: data, var_x: var_x, var_y: var_y}, function(output){
Expand All @@ -407,7 +407,7 @@ function makePlot(obj, state) {
}

if (type == "plotHeatmap") {
ocpu.seturl("//cloud.opencpu.org/ocpu/apps/tejasavkhattar/test/R");
ocpu.seturl("http://localhost:5656/ocpu/apps/tejasavkhattar/testpackage/R");

var data = dataJSON, plotData = {};

Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
{% load static %}
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">

<!-- d3 v3 -->
<script
src="{% static 'js/vendor/d3.min.js' %}"></script>

<!-- jQuery v1.11.0 -->
<script
src="{% static 'js/vendor/jquery_min.js' %}"></script>
Expand Down Expand Up @@ -33,9 +37,7 @@
<script
src="{% static 'js/vendor/opencpu-0.4.js' %}"></script>

<!-- d3 v3 -->
<script
src="{% static 'js/vendor/d3.min.js' %}"></script>


<!-- Crossfilter -->
<script
Expand Down
2 changes: 1 addition & 1 deletion StatisticalPlatform/webpack-stats.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"status":"done","publicPath":"http://localhost:3000/assets/bundles/","chunks":{"main":[{"name":"main-40f944bcf12cc8c45021.js","publicPath":"http://localhost:3000/assets/bundles/main-40f944bcf12cc8c45021.js","path":"/home/tejasav/Desktop/StatisticalPlatform/StatisticalPlatform/StatisticalPlatform/static/js/bundle/main-40f944bcf12cc8c45021.js"},{"name":"main.bb2194fa12f5170a49d4.hot-update.js","publicPath":"http://localhost:3000/assets/bundles/main.bb2194fa12f5170a49d4.hot-update.js","path":"/home/tejasav/Desktop/StatisticalPlatform/StatisticalPlatform/StatisticalPlatform/static/js/bundle/main.bb2194fa12f5170a49d4.hot-update.js"}]}}
{"status":"done","publicPath":"http://localhost:3000/assets/bundles/","chunks":{"main":[{"name":"main-3f7fc92a43f634a6b3f9.js","publicPath":"http://localhost:3000/assets/bundles/main-3f7fc92a43f634a6b3f9.js","path":"/home/tejasav/Desktop/StatisticalPlatform/StatisticalPlatform/StatisticalPlatform/static/js/bundle/main-3f7fc92a43f634a6b3f9.js"},{"name":"main.4cf8761e4f4d3a4924dc.hot-update.js","publicPath":"http://localhost:3000/assets/bundles/main.4cf8761e4f4d3a4924dc.hot-update.js","path":"/home/tejasav/Desktop/StatisticalPlatform/StatisticalPlatform/StatisticalPlatform/static/js/bundle/main.4cf8761e4f4d3a4924dc.hot-update.js"}]}}
Loading

0 comments on commit d085107

Please sign in to comment.