forked from denisvieiradev/grade-ideal
-
Notifications
You must be signed in to change notification settings - Fork 0
/
view.py
45 lines (39 loc) · 1.18 KB
/
view.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import numpy as np
from bokeh.charts import Histogram
from bokeh.charts import defaults, vplot, hplot, show, output_file
# Visualização dos dados gerados
class View():
def __init__(self):
self.dados = None
def exibir(self):
for i in self.dados.keys():
if len(self.dados[i]) > 0: continue
else: return
defaults.width, defaults.height = 400, 300
# prepare some data
# input options
hist_pontuacao = Histogram(self.dados["pontos"],
title="Grades por pontuação",
xlabel="Pontuação",
ylabel="Número de grades",
responsive=True,
bins=30)
hist_tamanho = Histogram(self.dados["tamanhos"],
title="Grades por quantidade de disciplinas",
xlabel="Número de disciplinas",
ylabel="Número de grades",
responsive=True,
bins=8)
hist_pop = Histogram(self.dados["popularidade"],
title="Ocorrências da disciplina x",
xlabel="Disciplina",
ylabel="Ocorrências nas grades",
responsive=True,
bins=46)
output_file("html/histograms.html")
show(hplot( hist_pontuacao,
hist_tamanho,
hist_pop
))