Repository navigation
Flip feature text on juicebox y-axis tracks - #2118
Merged
Merged
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #2117
Summary
juicebox transposes y-axis tiles, which mirrors any text baked into them. The sequence track already pre-flips its letters for this. The feature track now does the same for feature names and amino-acid letters, flipping each about its own center so it stays on its feature.
renderFeature(feature, ..., options) renderAminoAcidSequence(..., sequenceInterval, options.axis) renderAminoAcidLetter + if axis === 'y': flip about the codon's center fillText(letter) renderFeatureLabel(..., options) + if options.axis === 'y': flip about the label's center fillText(name)Evidence
New
test/testRenderFeature.jsdrivesrenderFeaturewith a fake 2D context that tracks the transform and records each drawn glyph's anchor and horizontal scale.label is mirrored about its center on a y-axis trackfailed withexpected 1 to equal -1, andamino acids are mirrored about their centers on a y-axis trackfailed withexpected [ 'M', 1, 12 ] to deeply equal [ 'M', -1, 18 ].After: 4/4 pass, and the full suite passes (319).
Checked by eye in juicebox, with its
igvdependency pointed at this branch: y-track text renders correctly.Merge Danger
Door: two-way
A revert restores the old rendering.
Blast Radius: juicebox-only
The new code runs only when
options.axis === 'y', which only juicebox sets. igv.js itself never passesaxis, so its rendering and SVG export are unchanged. The flip uses onlytranslateandscale, whichcanvas2svgsupports.🤖 Generated with Claude Code