Skip to content
This repository has been archived by the owner on Aug 7, 2018. It is now read-only.

Issue #452 - Exibir a porcentagem da variância explicada pelas duas dimensões do mapa de votações #464

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ Plot = (function ($) {
// Creates the SVG container and sets the origin.
var svg_base = d3.select("#animacao").append("svg")
.attr("width", width + margin.left + margin.right)
.attr("height", height + margin.top + margin.bottom + space_between_graph_and_control)
.attr("height", height + margin.top + margin.bottom + space_between_graph_and_control + 50)
.style("position", "relative");

var grupo_controle_periodos = svg_base.append("g")
Expand Down Expand Up @@ -539,7 +539,7 @@ Plot = (function ($) {
label_periodo.text(periodos[periodo_atual].nome);
quantidade_votacoes = periodos[periodo_atual].nvotacoes;
label_nvotacoes.text(quantidade_votacoes + " votações");

$("#varexp").html(periodos[periodo_atual].var_explicada)
sortAll();

if (periodo_para == periodo_max) mouseout_next();
Expand Down
30 changes: 30 additions & 0 deletions radar_parlamentar/radar_parlamentar/templates/analise.html
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,25 @@ <h3> {{casa_legislativa.nome}}</h3>
<input type="submit" value="Buscar">
</form>


<div style="width: 40%">
<p style="background: none;border: none; color: #1292db; font-weight:bold;cursor:pointer; font-size: 15px;"
onmouseover="this.style.color='#555';"
onmouseout="this.style.color='#1292db';"
onclick="mostrarDadosAvancados();"
id="botao_dados_avancados"> &rarr; Informações estatísticas avançadas</p>
</div>

<div style="display: none" id="dadosAvancados">
<li>
<ul>
<p style="background: none;border: none; color: #1292db; font-weight:bold; cursor:pointer; font-size: 15px;">
Variância explicada pelos componentes principais: <span id="varexp"> </span>
</p>
</ul>
</li>
</div>

<!-- Popup windows content -->
<div id="popup-content">
<div class="row">
Expand Down Expand Up @@ -150,6 +169,17 @@ <h4>Entenda o gráfico</h4>
}
}

function mostrarDadosAvancados(){
var visibilidade = document.getElementById("dadosAvancados").style.display;
if(visibilidade == 'none'){
document.getElementById("dadosAvancados").style.display = 'block';
document.getElementById("botao_dados_avancados").innerHTML = "&darr; Informações estatísticas avançadas";
}else{
document.getElementById("dadosAvancados").style.display = 'none';
document.getElementById("botao_dados_avancados").innerHTML = "&rarr; Informações estatísticas avançadas";
}
}

</script>
{% endblock extrajsend %}

Expand Down