Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Toggle view fix #90

Closed
wants to merge 4 commits into from
Closed
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
14 changes: 11 additions & 3 deletions backend/app/dashboard/static/dashboard-progress.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,14 @@ function createHandsontable(data, columns_list) {

function updateHandsontable(data, columns_list) {
data = filterStudentsInClass(data);

ret = generateMatrix(data, columns_list)
usernames = ret[0]
zvals = ret[1]
data_h[0]['x'] = columns_list.slice(1);
data_h[0]['y'] = usernames;
data_h[0]['z'] = zvals;
Plotly.redraw('chart');

ret = generateMatrix(data, columns_list)
zvals = ret[1]
Expand Down Expand Up @@ -167,7 +175,6 @@ function generateMatrix(tableData, columns){
});
zvals.push(studentvals)
});
console.log(usernames)
return [usernames.reverse(), zvals.reverse()]
}

Expand Down Expand Up @@ -210,7 +217,8 @@ document.addEventListener("DOMContentLoaded", function () {

createHandsontable(tableData, columns);

ret = generateMatrix(tableData, columns)
data = filterStudentsInClass(tableData);
ret = generateMatrix(data, columns)
usernames = ret[0]
zvals = ret[1]
data_h = [
Expand Down Expand Up @@ -238,7 +246,7 @@ document.addEventListener("DOMContentLoaded", function () {
},
xaxis: {showticklabels: false, ticks: "", side:"top"},
showlegend: false,
height: usernames.length * 20,
height: Math.max(400, usernames.length * 25),
autosize: true
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ <h1>Class Progress</h1>
{% endfor %}
</datalist>
</div>
<button onclick="toggleVisibility()" class="btn btn-secondary">Alternar visualização</button>
<button onclick="toggleVisibility()" class="btn btn-secondary">Toggle visualization</button>
</div>
{% endif %}

Expand Down
Loading