timwis / vizwit

An interactive data visualization tool
http://vizwit.io
GNU General Public License v2.0
100 stars 35 forks source link

Abstract fields #149

Closed timwis closed 8 years ago

timwis commented 8 years ago

Fixes #147

The changes are a little crowded by a property renaming (options to config in socrata.js) so I'll give a high-level explanation of the changes here.

  1. Providers (ie. the socrata.js collection) implement a public getFields method which returns a promise that is passed a fields collection when it's resolved.
  2. Provider collections are passed a global fieldsCache hash when they're initialized so that getFields can cache its results and share them between collections that use the same dataset

As a result here are the basic requirements for providers. Thoughts?

P.S. @chriswhong I know this would require some changes to the cartodb provider you've been working on. I'm happy to submit those as a pull request but I'd welcome your feedback before it's finalized.