okfn/openspending — Issue #444: Query builder for widgets
Author: pudo
Created: 2012-03-06 19:03:52+00:00
State: open

The query builder holds a set of form elements that can be used to compose a query, the precise number and type of parameters may depend on the visualization used.

The basic elements are: Single Drilldown, Multi Drilldown, Equals Cuts, Cuts with other Operators, Select Measure. For each of those, we should use dataset metadata to show labels, drop-down options etc.

Should the interface text for fields be configurable (e.g. instead of asking for a "drilldown", ask for "the breakdown to be used on the outer ring of the bubbles" or sth)?

How exactly does the widget determine when to show the query builder? Do they have mutable/immutable states? It may be great to allow everyone to call up the query builder even for a pre-made view to modify the breakdown they see. For this, we could implement a small, standard div to be displayed at one corner of the widget that has both query builder and embed links.

* (OPT) Auto-complete cut values from dimensions

Examples
--------------

* https://finances.worldbank.org/Loan-and-Credit-Administration/IBRD-Statement-of-Loans-Latest-Available-Snapshot/sfv5-tf7p - under "Filter"
* https://www.google.com/fusiontables/DataSource?docid=1W-qcV_LR2-3ZsSxBB1g6ArmJryg0tIswd2_kKWI&pli=1 - under "options"