htm-community / nupic.visualizations

Web application for interactive graphs, anomaly highlighting and online monitoring.
MIT License
17 stars 11 forks source link

Open remote URLs as input? #39

Closed breznak closed 8 years ago

breznak commented 8 years ago

After #35 I'd like to link a remote URL from our readme as example (in #38 )

jefffohl commented 8 years ago

I am working on this, but there is a problem. PapaParse allows for a URL to be used, but the web host has to support the Range header, which many hosts do not. For example, Github does not. So, this does not seem like a viable approach. The other option is to download the file using Angular, and this works fine, for smaller files. But, for bigger ones, we need to chunk the data (which is what PapaParse uses the Range header for). I am working on a way to do this.

breznak commented 8 years ago

@jefffohl :+1: the upstream for Papa seemed quite responsive, do you think this should be opened upstream? Sound like it would be useful if Papa fallbacked to "normal" download if Range is not supported by the server.

jefffohl commented 8 years ago

@breznak - that might be a good way to go. I am still worried about large files though, and how to deal with them. If I can't figure out another way, I will pursue that.

jefffohl commented 8 years ago

I created a PR #62, which allows users to download a remote file, or choose to load a local file.

There are some issues with this, however. The remote server needs to be CORS enabled and some servers won't have that set up.

The right way to do this is to have a proxy server which does the request on behalf of the app (this can be the same server that serves the app). However, that will mean more setup for the end user. So, we should talk about that.