Loading data issue (i think) when translating Processing to Processing.js
in
Processing with Other Languages
•
1 year ago
Hello All,
I'm an architecture student at UC Berkeley and I'm fairly new to processing and brand new to processing.js. I'm working on some processing code that operates on an external data file. It works fine in processing, but it seems to hang at the loading data stage (as indicated in a "println" statement and nothing further happening) when using the javascript mode. I'm wondering if this is an asynchronous I/O issue, or if it's because I am importing some external java files, including java.lang.Math....In fact upon further thought, I'm fairly sure this is the issue as these imported files don't show up in the web-export folder. Any suggestions? Is there a way to concatenate the referenced files onto my own .pde file? I'm not sure what to do and I'm not sure how to go about debugging as there are no errors displayed.
Thank you in advance for any help,
Dustin
The code is really long and multiple tabs, but this is the first tab:
import dParser.*;
import dYear.*;
import java.lang.Math.*;
import controlP5.*;
int curHr; // hour of the year 0-8759
int curDay; // day of the year 0-364
int curMth; // month of the year 0-11
int width = 960, height = 600;
int curMinHr, curMaxHr, curMinDay, curMaxDay; //used to calculate the current min & max hours to be displayed
PVector ahRange = new PVector (0, 20);
PVector dbRange = new PVector (-15, 50);
void setup() {
int curMinHr0, curMaxHr =1;
size(width, height);
loadData();
setupComfort();
teachData();
setupColorbar();
setupPPD();
setupPsychroGraph();
setupBoxPlot();
setupGUI();
textSize(10);
}
void drawUnits(){
int x = 420, y = 414;
textSize(6);
text("o", x, y-6);
textSize(10);
float z = textWidth("o");
text("C", x+z, y);
}
void draw() {
background(0);
drawColorbar(20, 500);
drawPPD(85, 350);
drawPsychroGraph(420, 20);
drawBoxPlot();
drawUnits();
}
1