openstate / openonderwijsdata-api

Open Onderwijs Data API
http://openonderwijsdata.nl/
11 stars 6 forks source link

Re-design / Angular proof-of-concept #17

Open dsbaars opened 9 years ago

dsbaars commented 9 years ago

I was playing a bit with Angular and in relatively short time it became something quite useful. You can (literally) check it out at the feature-branch. https://github.com/dsbaars/openonderwijsdata-api/tree/angular

I think the progressbar (pace.js) and Angular data-binding contributes in my opinion a lot to the user experience. Also, because it uses the API directly through a XHR.

(The filters on the homepage do not yet work and the code is very "hacky")

open onderwijs api home open onderwijs api

ajslaghu commented 9 years ago

Hi Djuri

This is something in our office I called earlier an 'API browser'. Actually during education data drinks last friday some one asked me and Benno to work on 'Excel' export functions ASAP.

In my opinion an 'api browser' allows you to research and navigate ALL the data, and export a flat view (no nestings) for further desktop use. Also, it should provide an API url so you can easily reproduce the data from a server application.

Using Angular might be a possibility, but I wonder if there are higher level 'modules' we could use for this function. The other way around, how complex is it to make the functions I described?

This kind of stuff could also work for other API's, so generic implementation would be a benefit

dsbaars commented 9 years ago

I was looking for exactly that yesterday for elasticsearch, I needed a way to flatten all VO branches and export them to Excel.

Angular is already quite high level. I also like the elasticsearch.js library which has support for Angular.js as well.

The functionality in the screenshot below is fully working in the commit I just pushed to the feature branch dsbaars/openonderwijsdata-api@fb15fbaf895bec6df2718cdcb28e308bcb6de42e. Adding CSV/Excel export is a small step now.

EDIT 23:00: Now exports the contents of the table to XLS. dsbaars/openonderwijsdata-api@8be7810132f04fcc09e4345f8b9dd39f1e3a04cc

oo-api-onderwijs

It retrieves the indexes and types from app/settings.py via new flask RESTresource methods, the mapping is retrieved using the elasticsearch.js API.

bennokr commented 9 years ago

That looks great! I think this interactive browser is definitely the way to go. You build a certain view of the data, and then export it in the desired format. We'll have to see how to handle cases where it displays so much information that it's not possible to look at it all or render it, and this is a really nice interface to do that in.

bennokr commented 9 years ago

I finally got around to running it myself, and after installing the bower dependencies and removing some lines from ooa.js (the ES filter), it worked fine. The XLS export only seems to work in Chrome, though. I'm going to see if there's a way to make a static csv exporter without js dependencies, for guaranteed cross-platform exports. Anything else you had in mind, @dsbaars ?

dsbaars commented 9 years ago

I think its better to generate the excel/csv-export server side, since it can become quite heavy for the browser to render this. I don't use Python much so I don't know any libraries that can do this.

It might be nice to visualize the geo-queries using LeafletJS and OpenStreetMap

ajslaghu commented 9 years ago

I think browserbased export will be fine. People can be nudged towards proper browsers. Lets focus on new features that add value