Skip to content

Commit

Permalink
Status callback for rendering
Browse files Browse the repository at this point in the history
  • Loading branch information
cmdcolin committed Jan 29, 2025
1 parent 17c3d6a commit ecada63
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 2 deletions.
4 changes: 4 additions & 0 deletions plugins/hic/src/HicRenderer/makeImageData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ export async function makeImageData(
regions,
pluginManager,
} = props

const { statusCallback = () => {} } = props
// @ts-expect-error
statusCallback('Drawing Hi-C matrix')
const region = regions[0]!
const { dataAdapter } = await getAdapter(
pluginManager,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ export function makeImageData({
sources,
features,
} = renderArgs

const { statusCallback = () => {} } = renderArgs
// @ts-expect-error
statusCallback('Drawing variant matrix')
const h = canvasHeight / sources.length
const mafs = getFeaturesThatPassMinorAlleleFrequencyFilter(
features.values(),
Expand Down
2 changes: 1 addition & 1 deletion plugins/variants/src/VcfTabixAdapter/VcfTabixAdapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export default class VcfTabixAdapter extends BaseFeatureDataAdapter {
public getFeatures(query: NoAssemblyRegion, opts: BaseOptions = {}) {
return ObservableCreate<Feature>(async observer => {
const { refName, start, end } = query
const { statusCallback = () => {} } = opts || {}
const { statusCallback = () => {} } = opts
const { vcf, parser } = await this.configure()

await updateStatus('Downloading variants', statusCallback, () =>
Expand Down
2 changes: 1 addition & 1 deletion plugins/variants/src/shared/ColorLegend.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ const ColorLegend = observer(function ({
<Fragment key={`${label}-${idx}`}>
{color ? (
<RectBg
y={idx * rowHeight + 1}
y={idx * rowHeight}
x={0}
width={colorBoxWidth + 0.5}
height={rowHeight + 0.5}
Expand Down

0 comments on commit ecada63

Please sign in to comment.