CT-Data-Collaborative / connect-dashboard

An angular-based dashboard for exporing data relevant to the CONNECT project
0 stars 0 forks source link

Refactor configuration services #5

Open scuerda opened 7 years ago

scuerda commented 7 years ago

Currently we handle the loading of data and the declaration of a graphic in multiple steps (this is a hang-over from the requirements that were developed for the PDF tool).

1) We load a config object in dataConfig.service.js. 2) The config object contains references to the data file, which is loaded separately in dataProvider.service.js. 3) The template partial then repeats over the config objects, looks up the data in data.json and generates the graphic.

What we are missing is the ability to organize the graphics / code in a declarative way. Ordering is dependent on how data is structured in the data file and/or the category ordering.

Moreover, there is a lot of logic in the main content partial that is probably best moved in to a more general graphic directive. Links, footnotes, etc., which are all specified within the config object should be taken out of the markup so that it's a bit easier to see what is happening.

As we rethink other parts of the application and how the visualizations are constructed, devising a more streamlined and easier to modify system for laying the graphics will need to be addressed.