javascript - loasJSONArray is not defined in Processing.Js -
i've made processing program wich work nice. wanted put on website processing.js. i've used code in demo load pde file
script(src='/javascripts/lib/processing.min.js') canvas(data-processing-sources="processing/paris_tree_viz.pde")
but when launch page, got following error: uncaught referenceerror: loadjsonarray not defined
here setup void in processing pde file, wich contain loadjsonarray method:
void setup() { size(1000, 1000); background(255, 255, 255, 1); colormode(rgb); data = loadjsonarray("http://opendata.paris.fr/explore/dataset/les-arbres/download/?format=json&timezone=europe/berlin"); trees = filterbyspecie(data); }
how can make program work ?
googling error got me duplicate: how access json data in processing.js
according duplicate, processing.js not have loadjsonarray function. , processing.js reference seems confirm this: http://processingjs.org/reference/
that suggest you're running sketch in java mode. don't that- switch javascript mode, can catch errors before deploy.
the solution seems to load strings yourself, or load json javascript , pass them sketch.
Comments
Post a Comment