Skip to content

Commit

Permalink
Update gui - v0.19.4
Browse files Browse the repository at this point in the history
  • Loading branch information
nedpeel committed Oct 4, 2023
1 parent b531383 commit cc9052c
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 8 deletions.
12 changes: 8 additions & 4 deletions gui/UI/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,10 +140,10 @@ if (serverOptions["https"].toLowerCase() === 'true') {

const restrictedMode = argv.r || false;

const martiVersion = "0.19.3";
const martiGuiVersion = "0.19.4";

if (argv.v || argv.version) {
console.log(martiVersion);
console.log(martiGuiVersion);
process.exit();
}

Expand Down Expand Up @@ -649,7 +649,11 @@ io.on('connect', function(socket){

clientCount = socket.client.conn.server.clientsCount;
console.log(`[${new Date().toLocaleString()}] Connection added - users connected: ${clientCount}`);
io.sockets.emit('current-client-count', clientCount);
var guiVersionAndClientCount = {
clientCount: clientCount,
guiVersion: martiGuiVersion
}
io.sockets.emit('current-client-count', guiVersionAndClientCount);

socket.on('hb_pong', function(data){
});
Expand Down Expand Up @@ -954,7 +958,7 @@ socket.on('compare-tree-request', request => {
socket.on('disconnect', () => {
clientCount = socket.client.conn.server.clientsCount;
console.log(`[${new Date().toLocaleString()}] Connection removed - users connected: ${clientCount}`);
io.sockets.emit('current-client-count', clientCount);
io.sockets.emit('current-client-count', guiVersionAndClientCount);
});

socket.on('disconnecting', () => {
Expand Down
2 changes: 1 addition & 1 deletion gui/UI/indexNode.html
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ <h3 id="no-js">To use MARTi, please enable JavaScript in your browser.</h3>
</div>

<div class="copyright text-center my-auto">
<span>MARTi GUI v0.19.3</span>
<span id="currentGuiVersion">MARTi GUI v0.0.0</span>
<span id="currentClientCount" style="color:white">0</span>
</div>
</div>
Expand Down
20 changes: 19 additions & 1 deletion gui/UI/public/js/dashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -476,11 +476,17 @@ socket.on('dashboard-meta-response', function(data) {

$("#dashboardInfoCardDatabase").text(classificationDb);

if (dashboardSampleData.analysis.classification.algorithm == "Centrifuge") {
centrifugeClassification = true;
$("#dashboardAmrDonutRow").hide();
}

plotReadsDonut(dashboardSampleData);

});

var centrifugeClassification = false;

var root;
var globDonutData;
var treeMapData;
Expand Down Expand Up @@ -1064,7 +1070,6 @@ socket.on('dashboard-dashboardAmrTable-response', function(data) {
initialisePlotVisibility("dashboardAmrDonut",true);
}


plotAmrDonut(dashboardAmrReponseData);

if (!dashboardChartVisibility.hasOwnProperty("dashboardAmrHitsDonut")) {
Expand Down Expand Up @@ -1290,6 +1295,19 @@ d3.selectAll(".dashboard-amr-chunk-time").text(dashboardAmrTableChunkTime[dashbo

dashboardAmrTable.draw(false);

if (centrifugeClassification) {

if ($('#dashboardAmrTableColCheckbox1').is(':checked')) {
$('#dashboardAmrTableColCheckbox1').click();
}
if ($('#dashboardAmrTableColCheckbox2').is(':checked')) {
$('#dashboardAmrTableColCheckbox2').click();
}

$('#dashboardAmrTableColCheckbox1').prop('disabled', true);
$('#dashboardAmrTableColCheckbox2').prop('disabled', true);
}

};

function sortCounts(array) {
Expand Down
5 changes: 5 additions & 0 deletions gui/UI/public/js/dashboardAmrDonut.js
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,7 @@ var dropdownList = [];

function plotAmrDonut(data) {


var dashboardAmrDonutPlotByListOptions = [{plotByProp:"drugClass",name:"Drug class"},{plotByProp:"resistanceMechanism",name:"Resistance mechanism"}]
dashboardAmrDonutPlotByList = [];

Expand Down Expand Up @@ -652,5 +653,9 @@ for (taxa of plotData) {

});

if (centrifugeClassification) {
$("#dashboardAmrDonutRow").hide();
};


};
6 changes: 4 additions & 2 deletions gui/UI/public/js/universal.js
Original file line number Diff line number Diff line change
Expand Up @@ -293,8 +293,10 @@ socket.on('hb_ping', function(data){
});

socket.on('current-client-count', function(data){
console.log("current number of user: " + data);
$("#currentClientCount").text(data);
console.log("current number of user: " + data.clientCount);
$("#currentClientCount").text(data.clientCount);
let guiVersion = "MARTi GUI v" + data.guiVersion;
$("#currentGuiVersion").text(guiVersion);
});

socket.on('sample-removed', function(data){
Expand Down

0 comments on commit cc9052c

Please sign in to comment.