Beispiel #1
0
    def simple(self, parameters):
        x_axis = parameters.x().lower()

        if x_axis == 'd':
            counts = [[i,0] for i in range(4,7)]
        elif x_axis == 'h':
            counts = [[i,0] for i in range(24)]
        elif x_axis == 'c':
            counts = [[i,0] for i in range(1,4)]
        elif x_axis == 'mood':
            counts = [[i,0] for i in range(-100,100)]
        elif x_axis == 'gen':
            counts = [[i,0] for i in range(-100,100)]
        elif x_axis == 'age':
            counts = [[i,0] for i in range(0,100)]
        elif x_axis == 'hap':
            counts = [[i,0] for i in range(0,100)]
        elif x_axis == 'dis':
            counts = [[i,0] for i in range(0,100)]
        elif x_axis == 'ang':
            counts = [[i,0] for i in range(0,100)]
        elif x_axis == 'sur':
            counts = [[i,0] for i in range(0,100)]
        elif x_axis == 'afr':
            counts = [[i,0] for i in range(0,100)]
        elif x_axis == 'sad':
            counts = [[i,0] for i in range(0,100)]
        else:
            counts = []

        count = Person.objects.person_count(x_axis, parameters)
        counts = util.add_counts_multicol(counts, count)

        return counts
Beispiel #2
0
    def filter_ages(self, parameters):
        y_axis = parameters.y().lower()
        x_selected_values = parameters.filter_ages()

        final_counts = [[i,0] for i in [0,10,20,30,40,50,60,70,80,90,100]]

        if y_axis == 'np':
            count = Person.objects.person_count('age_filter', parameters)
            final_counts = util.add_counts_multicol(final_counts, count)

        return util.set_selected_value(final_counts, x_selected_values)
Beispiel #3
0
    def filter_cameras(self, parameters):
        y_axis = parameters.y().lower()
        x_selected_values = parameters.filter_cameras()

        final_counts = [[i,0] for i in range(1,4)]

        if y_axis == 'np':
            count = Person.objects.person_count('c', parameters)
            final_counts = util.add_counts_multicol(final_counts, count)

        return util.set_selected_value(final_counts, x_selected_values)
Beispiel #4
0
    def filter_moods(self, parameters):
        y_axis = parameters.y().lower()
        x_selected_values = parameters.filter_moods()

        final_counts = [[i,0] for i in [-100,-90,-80,-70,-60,-50,-40,-30,-20,-10,0,10,20,30,40,50,60,70,80,90,100]]

        if y_axis == 'np':
            count = Person.objects.person_count('mood_filter', parameters)
            final_counts = util.add_counts_multicol(final_counts, count)
            #final_counts = Person.objects.person_count('mood', parameters)

        return util.set_selected_value(final_counts, x_selected_values)
Beispiel #5
0
    def filter_time(self, x_axis, x_selected_values, parameters):
        y_axis = parameters.y().lower()

        final_counts = []

        if x_axis == 'd':
            final_counts = [[i,0] for i in range(4,7)]
        elif x_axis == 'h':
            final_counts = [[i,0] for i in range(24)]

        if y_axis == 'np':
            count = Person.objects.person_count(x_axis, parameters)
            final_counts = util.add_counts_multicol(final_counts, count)

        return util.set_selected_value(final_counts, x_selected_values)