Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new menu items for show/hide feature labels, set max height, and set compact display mode #1394

Merged
merged 25 commits into from
Feb 24, 2021

Conversation

cmdcolin
Copy link
Collaborator

@cmdcolin cmdcolin commented Nov 4, 2020

This adds

  • Track menu item to show/hide feature labels
  • Set compact setting on the features
  • Also adds a maxDisplayedBpPerPx default, which is otherwise unset on normal BasicTrack, allowing it to not try to render gigantic regions when too far zoomed out (we instead get a prompt where you can force render)

I think these things are helpful add ons to the BasicTrack concept
Since this track type actually works in tandem with the SvgFeatureRenderer closely, it is in the plugins/svg

Possibly we could imagine de-emphasizing the svg'ness, so I just call this a FeatureTrack

@codecov
Copy link

codecov bot commented Nov 4, 2020

Codecov Report

Merging #1394 (aa7b852) into master (d4bd417) will decrease coverage by 0.05%.
The diff coverage is 51.51%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1394      +/-   ##
==========================================
- Coverage   58.83%   58.78%   -0.06%     
==========================================
  Files         450      452       +2     
  Lines       20845    20847       +2     
  Branches     4941     4942       +1     
==========================================
- Hits        12265    12255      -10     
- Misses       8272     8283      +11     
- Partials      308      309       +1     
Impacted Files Coverage Δ
plugins/filtering/src/index.ts 100.00% <ø> (ø)
plugins/lollipop/src/index.ts 100.00% <ø> (ø)
...g/src/SvgFeatureRenderer/components/Subfeatures.js 11.11% <0.00%> (-1.39%) ⬇️
...rc/LinearPileupDisplay/components/SetMaxHeight.tsx 7.69% <7.69%> (ø)
...c/LinearFeatureDisplay/components/SetMaxHeight.tsx 7.69% <7.69%> (ø)
...lugins/alignments/src/LinearPileupDisplay/model.ts 73.25% <54.54%> (+3.76%) ⬆️
...near-genome-view/src/LinearFeatureDisplay/model.ts 67.39% <67.39%> (ø)
...nome-view/src/LinearFeatureDisplay/configSchema.ts 100.00% <100.00%> (ø)
plugins/linear-genome-view/src/index.ts 91.66% <100.00%> (+2.77%) ⬆️
...gFeatureRenderer/components/SvgFeatureRendering.js 55.55% <100.00%> (+0.35%) ⬆️
... and 28 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d4bd417...17188c6. Read the comment docs.

@cmdcolin cmdcolin mentioned this pull request Nov 5, 2020
@rbuels
Copy link
Contributor

rbuels commented Nov 5, 2020

with the merger of #1398, seems like this needs to be updated?

@cmdcolin
Copy link
Collaborator Author

cmdcolin commented Nov 5, 2020

I could update but technically the displaymode took the name FeatureTrack. Should it be renamed back to BasicTrack and then this stays being FeatureTrack?

@garrettjstevens
Copy link
Collaborator

I think this would fit best being converted to a new display of FeatureTrack

@cmdcolin
Copy link
Collaborator Author

cmdcolin commented Nov 5, 2020

Started trying out the conversion to a so called "LinearFeatureDisplay"

Gives an error on opening the track though

@cmdcolin
Copy link
Collaborator Author

cmdcolin commented Nov 5, 2020

index.js:1 Warning: React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: undefined. You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.

Check your code at BaseLinearDisplay.tsx:91.
    in wrappedComponent (at TrackContainer.tsx:128)
    in div (at TrackContainer.tsx:123)
    in div (created by ForwardRef(Paper))
    in ForwardRef(Paper) (created by WithStyles(ForwardRef(Paper)))
    in WithStyles(ForwardRef(Paper)) (at TrackContainer.tsx:111)
    in div (at TrackContainer.tsx:98)
    in TrackContainer (at LinearGenomeView.tsx:83)
    in div (at TracksContainer.tsx:169)
    in TracksContainer (at LinearGenomeView.tsx:69)
    in div (at LinearGenomeView.tsx:46)


@cmdcolin
Copy link
Collaborator Author

cmdcolin commented Nov 5, 2020

Works now...very cool...

Is there a way to make LinearFeatureDisplay the default of FeatureTrack? It seems to be already the default but is there a way to ensure that?

@garrettjstevens
Copy link
Collaborator

By default it goes off the order the displays are registered. If you want to make a display that's registered later the default or want to be extra sure a display is default, you can see an example of how the AlignmentsTrack prioritizes the LinearAlignmentsDisplay in plugins/alignments/src/index.ts (comments in the code).

@cmdcolin
Copy link
Collaborator Author

cmdcolin commented Nov 5, 2020

I think I dont have a handle on the track type whereas the alignments track says track.addDisplayType

@cmdcolin
Copy link
Collaborator Author

Regarding #1398 I mentioned that being able to toggle for example a gene track into a lollipop track was somewhat weird to me

One possibility is that this PR replaces the existing FeatureTrack concept, and then the other things turn back into other track types or display types that are unrelated to featuretrack

@cmdcolin
Copy link
Collaborator Author

This is not implemented yet but could be an option

@cmdcolin
Copy link
Collaborator Author

Note that #1398 had a discuss in meeting tag maybe related to this

Copy link
Collaborator

@garrettjstevens garrettjstevens left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few comments:

  • If this only works with the SvgFeatureRenderer, maybe it should limit it to that renderer only in the config schema instead of all renderers
  • Having "Display mode" and "Display types" in the track menu seems confusing. Maybe call it "feature display mode"?
  • Having the feature display mode and show/hide labels in both the model and in the config seems to make it so that in some cases, changing them in the config doesn't do anything anymore.

@cmdcolin cmdcolin marked this pull request as draft November 13, 2020 20:05
@cmdcolin
Copy link
Collaborator Author

Might end up that we change this from being a new display mode for FeatureTrack to maybe a new track type like GeneTrack, which can implement more specialized logic that helps gene features (e.g. custom widget, maybe other things)

@github-actions github-actions bot added the needs label triage Needs a label to show in changelog (breaking, enhancement, bug, documentation, or internal) label Jan 13, 2021
@cmdcolin
Copy link
Collaborator Author

I refreshed this branch.

It makes it so FeatureTrack by default only has one displaymode registered to it, so that a gene track for example cannot be toggled into a lollipop via the track menu

@cmdcolin cmdcolin added enhancement New feature or request and removed needs label triage Needs a label to show in changelog (breaking, enhancement, bug, documentation, or internal) labels Jan 13, 2021
@cmdcolin cmdcolin changed the title FeatureTrack type Make FeatureTrack type have a LinearFeatureDisplay mode that sets maxDisplayedBpPerPx, compact display mode Jan 13, 2021
@cmdcolin cmdcolin force-pushed the feature_track_type branch 3 times, most recently from 513bdc1 to 63f01d4 Compare January 14, 2021 22:04
@cmdcolin
Copy link
Collaborator Author

Some cases, the max height indicator is not displayed on, for example, the GFF3Tabix volvox track if I use "Set max height" dialog to make it 20. At 40 it does work. Unclear what the reason is, but it does work for the purpose of increasing max height if you hit the limit

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants