Open rufuspollock opened 10 years ago
cc @tryggvib @nickstenning @mihi-tr wdyt?
@rgrp I'd argue the other way around. For usability I'd rather have dependencies down.
e.g.
<script src="d3.v3.js"></script>
<script src="underscore.js"></script>
<script src="openspending.js"></script>
gives you all the visualizations with easy to use code. Even better - just depending on openspending.js...
My main reason for this is to make it as simple as possible to build satellite sites. People who know how to write visualizations can already use the openspending API and wrappers to do so. It's the people who can't who'll need a clear and easy way to do this.
@mihi-tr but what happens if i'm building my own visualization and I just want the core openspending.js (I won't want all the other viz stuff e.g. the treemap, bubbletree etc).
Even for people building a site and wanting the viz may not want all viz - just a few specific ones.
If one really wants an all in one js file compiling down would not be that hard and would be part of stuff like creating the wordpress plugin etc. (I definitely agree we want to make it easier for people building satellite sites but I feel part of the way to get there is making this codebase easier to develop and contribute to).
@rgrp honestly : for some of the stuff I don't even use the Openspending JS API. If you are just going for a specific lightweight viz building on top of the plain aggregation API is easier.
I'm opening this issue as a place to discuss how we evolve openspendingjs going forward.
Current Situation
This is my rough understanding and is likely wrong - please correct and amend!
README states
Note in terms of file structure:
So, basically we have:
src/utils
- common core codesrc/visualisations
- visualisationsSort of deprecated:
lib
Common core code such as JS that wraps the OpenSpending APIapp
- various viz / apps (see below)apps:
The Future
Here's a proposal for discussion:
openspending.{vizname}.js
Lastly some process points:
Why?