Repository navigation
Style library: polymers drawn as polymers again, and five smaller fixes - #21
Merged
Merged
Conversation
From a review of WebsiteAngular's changes since its #373, the version of this library the site now installs from here: - A polymer of a Protein, Molecule or RNA had no offset copy behind it: their background layer is optional (the node's own shape draws the body), and the copy was skipped with it. Every such polymer, and the legend's Polymer key, was drawn as a plain entity since #373. - CROSS was cached on size alone and never cleared, so crossed-out nodes kept the light theme's red after a switch to dark, and two styles on one page shared the first cross; OMMITED_ICON was cached on nothing. Both are keyed on what they draw with, and cleared with the drawers. - The drawing a node gets was remembered by id, classes and selection -- not size or analysis values -- so a node changed without a cache clear kept its old drawing. They are in the key. - interpolate read an exact 0 as "not here" and asserted, and a curve of one point returned 0; ends are inclusive and 0 is an answer. - The gradient cache was keyed on the node id it never uses; nodes with the same values share one. - updateOn 'position style' costs one pass per rendered zoom frame on the molecule layer; kept, and the cost said where it is set. Each behaviour change has a test that failed before it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Cytoscape paints every background layer over the node's own body, so the polymer copy of an optional background (protein, molecule, RNA) was drawn over the body -- shifted and darkened -- not behind it. Before WebsiteAngular #373 the original was pushed again after the copies, which is what made the copy read as behind; #373 dropped that with the double-drawn decorators. The optional background goes in once more after the copies; decorators still once. The test now checks that order, and failed before. 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.
These come from a review of WebsiteAngular's changes since its #373. The site now installs this library from here (
dist/ngx-reactome-cytoscape-style), so these are what it draws with.Fixed
Polymers. A polymer of a Protein, Molecule or RNA had no offset copy behind it. Their background layer is optional, because the node's own shape draws the body, and the polymer copy was skipped along with it. Every such polymer, including the legend's Polymer key, has been drawn as a plain entity since #373. The background is now copied whether it is optional or not, and is still drawn only once.
Cross and omitted-icon caches.
CROSSwas cached on size alone and never cleared. Crossed-out nodes kept the light theme's red after a switch to dark, and two styles on one page shared whichever cross was drawn first.OMMITED_ICONwas cached on nothing at all.clearDrawersCacheclears them.Node drawing cache. A node's drawing was remembered by id, classes and selection only, so a node whose size or analysis values changed, without a cache clear, kept its old drawing. Size and analysis values are now part of the key.
interpolate. It read an exact 0 as "not in this segment" and fired a console assertion, and a curve of one point returned 0 instead of its value. The ends are now inclusive, and 0 counts as an answer.Gradient cache. It was keyed on the node id, which the gradient never uses. Nodes with the same values now share one gradient.
Kept and documented
updateOn: 'position style'on the molecule layer costs one extra pass per rendered zoom frame. The cost is now explained where it is set; avoiding it would need every place that hides a node to report it.Checked
Each behaviour change has a test that failed before it. The full suite passes (40 + 23 + 3), and the lint and dead-code baselines are lower (332 and 17).
🤖 Generated with Claude Code