Skip to content

Commit

Permalink
Fix GCs value on SVG export
Browse files Browse the repository at this point in the history
  • Loading branch information
metehaansever committed Jun 13, 2024
1 parent 835600d commit c957c6c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
9 changes: 7 additions & 2 deletions anvio/data/interactive/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -2086,8 +2086,13 @@ async function exportSvg(dontDownload) {
};

if (mode == 'pan') {
_bin_info['gene_clusters'] = $('#completeness_' + bin_id).val();
_bin_info['gene-calls'] = $('#redundancy_' + bin_id).val();
var geneClustersElement = $(bin).find('.num-gene-clusters');
if (geneClustersElement.length > 0) {
_bin_info['gene_clusters'] = geneClustersElement.attr('data-value');
} else {
console.log("geneClustersElement not found");
}
_bin_info['gene-calls'] = $(bin).find('.num-gene-calls input').val();
} else {
_bin_info['contig-length'] = $(bin).find('.length-sum span').text();
_bin_info['contig-count'] = $(bin).find('.num-items input').val();
Expand Down
4 changes: 2 additions & 2 deletions anvio/data/interactive/js/svg-helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ function drawBinLegend(bins_to_draw, top, left) {
drawText('bin_legend', {'x': left + 30, 'y': top}, 'Name', '10px');

if (mode == 'pan') {
drawText('bin_legend', {'x': left + 170, 'y': top}, 'PCs', '10px');
drawText('bin_legend', {'x': left + 170, 'y': top}, 'GCs', '10px');
drawText('bin_legend', {'x': left + 230, 'y': top}, 'Gene Calls', '10px');
} else {
drawText('bin_legend', {'x': left + 170, 'y': top}, 'Contigs', '10px');
Expand All @@ -165,7 +165,7 @@ function drawBinLegend(bins_to_draw, top, left) {
drawText('bin_legend', {'x': left + 30, 'y': top }, bin['name'], '12px');

if (mode == 'pan') {
drawText('bin_legend', {'x': left + 170, 'y': top}, bin['pcs'], '12px');
drawText('bin_legend', {'x': left + 170, 'y': top}, bin['gene_clusters'], '12px');
drawText('bin_legend', {'x': left + 230, 'y': top}, bin['gene-calls'], '12px');
} else {
drawText('bin_legend', {'x': left + 170, 'y': top}, bin['contig-count'], '12px');
Expand Down

0 comments on commit c957c6c

Please sign in to comment.