Skip to content

Commit

Permalink
calculation for evenly sized layers + groups
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewlawrenceklein committed Jul 6, 2021
1 parent 428c203 commit b2409c0
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions anvio/data/interactive/js/genomeview.js
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ function loadAll() {

// Find max length genome
calculateMaxGenomeLength()
calculateSpacingForGroups()
let calculatedSpacing = calculateSpacingForGroups()

var scaleWidth = canvas.getWidth();
var scaleHeight = 200;
Expand Down Expand Up @@ -855,7 +855,8 @@ function calculateSpacingForGroups(){ // to be used for setting vertical spacing
stateData['additional-data-layers'].map(group => {
Object.keys(group).length > maxGroupSize ? maxGroupSize = Object.keys(group).length : null
})
return maxGroupSize
let spacing = 500 / [maxGroupSize * genomeData.genomes.length] // 500 is hardcoded main canvas height
return spacing
}

var fixHelperModified = function(e, tr) { // ripped from utils.js instead of importing the whole file
Expand Down

0 comments on commit b2409c0

Please sign in to comment.