Skip to content

Commit

Permalink
Fix rendering test
Browse files Browse the repository at this point in the history
  • Loading branch information
cmdcolin committed Feb 1, 2025
1 parent 286c36e commit 42fda64
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
2 changes: 1 addition & 1 deletion plugins/wiggle/src/XYPlotRenderer/XYPlotRenderer.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ test('several features', async () => {
domain: [0, 100],
scaleType: 'linear',
},
config: {},
config: configSchema.create(),
bpPerPx: 3,
highResolutionScaling: 1,
height: 100,
Expand Down
8 changes: 2 additions & 6 deletions plugins/wiggle/src/XYPlotRenderer/XYPlotRenderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import WiggleBaseRenderer from '../WiggleBaseRenderer'
import { YSCALEBAR_LABEL_OFFSET } from '../util'

import type { RenderArgsDeserializedWithFeatures } from '../WiggleBaseRenderer'
import type { Feature } from '@jbrowse/core/util'

export default class XYPlotRenderer extends WiggleBaseRenderer {
async draw(
Expand All @@ -24,11 +23,8 @@ export default class XYPlotRenderer extends WiggleBaseRenderer {
return drawXY(ctx, {
...props,
colorCallback: !config.color.isCallback
? (_: Feature, score: number) =>
score < pivotValue ? negColor : posColor
: (feature: Feature, _score: number) => {
return readConfObject(config, 'color', { feature })
},
? (_feature, score) => (score < pivotValue ? negColor : posColor)
: (feature, _score) => readConfObject(config, 'color', { feature }),
offset: YSCALEBAR_LABEL_OFFSET,
features: [...features.values()],
inverted,
Expand Down

0 comments on commit 42fda64

Please sign in to comment.