Currently, the script analysis.py generates json files with data for visualisation. These files are loaded by the javascript that creates the charts. A neat solution, but this prevents dynamically loading the charts from another place, say, a blog, because of http restrictions.
Loading the charts from a blog could be done in 2 ways:
Let the blog html load the javascript that creates the charts and let this javascript fetch the json data. (we should tweak the javascript that it first tries to read the data from a local file - because that's what we do while developing - and download it from the github repository if it can't find the file locally - because those files woudn't exist on the blogs server). However, github does not allow other javascript to read files, even from its served branches like gh-pages.
Copy the json files to the blogs server so that the javascript can find these files locally. However, that way those charts won't get updates unless we push them from the github repo to the blog once in a while.
Therefore, we'll go for a hack: let the analysis.py script generate a javascript source file instead of a json data file. In this file, a couple of global variables are declared that contain the data. Instead of letting the javascript file that creates the charts read the json data, we let the html file load 2 javascript files: one that sets variables containing the data, and one that uses those variables downsteam for creating the charts.
Currently, the script
analysis.py
generates json files with data for visualisation. These files are loaded by the javascript that creates the charts. A neat solution, but this prevents dynamically loading the charts from another place, say, a blog, because of http restrictions.Loading the charts from a blog could be done in 2 ways:
Therefore, we'll go for a hack: let the
analysis.py
script generate a javascript source file instead of a json data file. In this file, a couple of global variables are declared that contain the data. Instead of letting the javascript file that creates the charts read the json data, we let the html file load 2 javascript files: one that sets variables containing the data, and one that uses those variables downsteam for creating the charts.