Ejemplo n.º 1
0
def get_data(request):
    organiser = CompleteMultigroupOrganiser()

    if request.is_ajax():
        if 'countries[]' in request.GET and 'indicators[]' in request.GET:  # We should check that we got exactly two indicators!
            countries = request.GET.getlist('countries[]')
            indicators = request.GET.getlist('indicators[]')
            conf.countries = countries
            conf.indicators = indicators
            representation = organiser.get_representation(conf)
            print("representation is:")
            print(representation)
        # If no countries are required return empty json.
        else:
            representation = []
    # For fetching json from /getdata/ url directly.
    else:
        conf.countries = ["HRV", "USA"]
        representation = organiser.get_representation(conf)

    return HttpResponse(simplejson.dumps(representation),
                        mimetype="application/json")
Ejemplo n.º 2
0
 def get_workers(self):
     vis_str = conf.visualisation
     if vis_str == "TSV":
         #visualisation = TimeSeriesVisualisation()
         raise NotImplementedError
     elif vis_str == "MV":
         #visualisation = MultigroupVisualisation()
         raise NotImplementedError
     elif vis_str == "CMV":
         organiser = CompleteMultigroupOrganiser()
         visualisation = CompleteMultigroupVisualisation()
     else:
         raise ConfigurationFileError
     return organiser, visualisation
Ejemplo n.º 3
0
def get_data(request):
    organiser = CompleteMultigroupOrganiser()

    if request.is_ajax():
        if (
            "countries[]" in request.GET and "indicators[]" in request.GET
        ):  # We should check that we got exactly two indicators!
            countries = request.GET.getlist("countries[]")
            indicators = request.GET.getlist("indicators[]")
            conf.countries = countries
            conf.indicators = indicators
            representation = organiser.get_representation(conf)
            print("representation is:")
            print(representation)
        # If no countries are required return empty json.
        else:
            representation = []
    # For fetching json from /getdata/ url directly.
    else:
        conf.countries = ["HRV", "USA"]
        representation = organiser.get_representation(conf)

    return HttpResponse(simplejson.dumps(representation), mimetype="application/json")
Ejemplo n.º 4
0
def run_matplotlib():
    organiser = CompleteMultigroupOrganiser()
    repr = organiser.get_representation(conf)
Ejemplo n.º 5
0
'''
Created on 26. 6. 2012.

@author: kermit
'''
from foc.visualiser.data_organiser.complete_multigroup import CompleteMultigroupOrganiser
import foc.visualiser.data_presenter.default_vis_conf as conf
from pprint import pprint


def run_matplotlib():
    organiser = CompleteMultigroupOrganiser()
    repr = organiser.get_representation(conf)


if __name__ == '__main__':
    organiser = CompleteMultigroupOrganiser()
    repr = organiser.get_representation(conf)
    pprint(repr)
Ejemplo n.º 6
0
def run_matplotlib():
    organiser = CompleteMultigroupOrganiser()
    repr = organiser.get_representation(conf)
Ejemplo n.º 7
0
'''
Created on 26. 6. 2012.

@author: kermit
'''
from foc.visualiser.data_organiser.complete_multigroup import CompleteMultigroupOrganiser
import foc.visualiser.data_presenter.default_vis_conf as conf
from pprint import pprint

def run_matplotlib():
    organiser = CompleteMultigroupOrganiser()
    repr = organiser.get_representation(conf)

if __name__ == '__main__':
    organiser = CompleteMultigroupOrganiser()
    repr = organiser.get_representation(conf)
    pprint(repr)