开发者

Loading external data in processingjs

开发者 https://www.devze.com 2023-02-06 16:58 出处:网络
We want to create a web-based interactive visualization tool to make sense of data that we work with (for thos开发者_高级运维e interested: it\'s about next-generation DNA sequencing data). One of the

We want to create a web-based interactive visualization tool to make sense of data that we work with (for thos开发者_高级运维e interested: it's about next-generation DNA sequencing data). One of the issues we bump into at the moment is how to get the data to the tool. Apparently this javascript library cannot load external data, and as far as I understand the data would actually have to be embedded in the html itself. This is however out of the question as we're dealing with patient data here...

Does anyone have any pointers as to how we can access external data (basically .csv files) from processing.js?

Thanks! jan.


There's no reason you couldn't load it via another library, such as jQuery, and then integrate it into your app. Here's an example of this. Basically, you would load the data, and then access it via PJS once it is available.

PJS is parsed to javascript, so the opportunities for integrating with any regular JS code are very good.


Processing.js can load external data, for example using the function loadStrings.

To make data available to your script, create a Data directory in your processing project, put your data files in there, and then load them up using loadStrings or loadXML.


Note that the documentation page is a little confused about whether its talking about processing.org (java) or processing.js (JavaScript backend). Just ignore the stuff about signed applets; there's no special reason processing.js can only read from the same site.

0

精彩评论

暂无评论...
验证码 换一张
取 消