Skip to content

Commit

Permalink
fixed display of wrong chrom bands
Browse files Browse the repository at this point in the history
  • Loading branch information
mhkc committed Nov 10, 2023
1 parent ed43f4c commit d3b06b5
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions assets/js/track/ideogram.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { drawRect } from '../draw.js'
import { lightenColor } from './base.js'
import tippy, { followCursor } from 'tippy.js'
import 'tippy.js/dist/tippy.css';
import { isElementOverlapping } from './utils.js';
import { thisExpression } from '@babel/types';

export class CytogeneticIdeogram {
Expand Down Expand Up @@ -67,12 +68,10 @@ export class CytogeneticIdeogram {
// dispatch event to update title
const scaledStart = Math.round(start * scale)
const scaledEnd = Math.round(end * scale)
const bandsWithinMaredRegion = this.drawPaths.bands.filter((band) => {
return (band.start < scaledStart) && (band.end < scaledEnd)
})
const bandsWithinMarkedRegion = this.drawPaths.bands.filter((band) => isElementOverlapping({start: scaledStart, end: scaledEnd}, band))
document.getElementById('visualization-container').dispatchEvent(
new CustomEvent('update-title', {
detail: { bands: bandsWithinMaredRegion, chrom: chrom } })
detail: { bands: bandsWithinMarkedRegion, chrom: chrom } })
)
}
})
Expand Down

0 comments on commit d3b06b5

Please sign in to comment.