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

Refactor linear genome view storybook #3646

Merged
merged 4 commits into from
Apr 18, 2023
Merged

Conversation

cmdcolin
Copy link
Collaborator

This 'modularizes' many of the storybook examples, and adds a 'source code' link so that users browsing documentation can find the source code for examples. We had used the 'Canvas' component which can sort of show the source code for an example, but it only shows code inside that single 'function component' where this change aims to show the whole file used to create an example.

image

@github-actions github-actions bot added the needs label triage Needs a label to show in changelog (breaking, enhancement, bug, documentation, or internal) label Apr 16, 2023
@cmdcolin cmdcolin added documentation and removed needs label triage Needs a label to show in changelog (breaking, enhancement, bug, documentation, or internal) labels Apr 16, 2023
@codecov
Copy link

codecov bot commented Apr 16, 2023

Codecov Report

Merging #3646 (66d5b02) into main (c155f5c) will increase coverage by 0.00%.
The diff coverage is 45.00%.

@@           Coverage Diff           @@
##             main    #3646   +/-   ##
=======================================
  Coverage   63.06%   63.07%           
=======================================
  Files         877      877           
  Lines       30167    30167           
  Branches     7272     7277    +5     
=======================================
+ Hits        19026    19027    +1     
+ Misses      10956    10955    -1     
  Partials      185      185           
Impacted Files Coverage Δ
packages/core/util/index.ts 82.04% <0.00%> (-1.05%) ⬇️
products/jbrowse-cli/src/commands/upgrade.ts 76.31% <0.00%> (ø)
...se-react-linear-genome-view/src/createViewState.ts 57.69% <0.00%> (+9.30%) ⬆️
.../alignments/src/LinearReadArcsDisplay/drawFeats.ts 81.65% <100.00%> (ø)
...alignments/src/LinearReadCloudDisplay/drawFeats.ts 86.31% <100.00%> (ø)
plugins/gtf/src/util.ts 97.22% <100.00%> (-0.08%) ⬇️
products/jbrowse-cli/src/testUtil.ts 93.84% <100.00%> (ø)

... and 2 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@cmdcolin cmdcolin force-pushed the new_storybook_organization branch 3 times, most recently from 5b41653 to d4d6691 Compare April 17, 2023 03:55
@cmdcolin cmdcolin force-pushed the new_storybook_organization branch from d4d6691 to 711850b Compare April 17, 2023 15:56
@cmdcolin cmdcolin requested a review from carolinebridge April 17, 2023 17:10
Copy link
Contributor

@carolinebridge carolinebridge left a comment

Choose a reason for hiding this comment

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

Might be relevant to include a section, maybe in Getting Started about data limitations, how JBrowse handles large files with Range Requests, and how to configure the limit;

If we want to have the page in our Storybook, we could also consider constructing an API for the LGV methods like addTrack with this PR

<div>
<JBrowseLinearGenomeView viewState={state} />
<a href="https://github.com/gmod/jbrowse-components/blob/main/products/jbrowse-react-linear-genome-view/stories/HumanExomeExample.stories.tsx">
source code
Copy link
Contributor

Choose a reason for hiding this comment

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

There are a couple of instances where the capitalization of "Source code" isn't consistent...

I think adding a link to the source code is a good idea overall though in the spirit of a more "complete" example.

We might be able to present it more cleanly using this addon: https://storybook.js.org/addons/storybook-source-code-addon .. haven't investigated it fully but may look better than the hyperlink.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

fixed capitalization, good catch. that add-on looks interesting. might be ok to have hyperlink though for now. with the add-on looks like you can have one source per story (we sometimes, even with my modularization, have multiple sometimes), then it is either in a template string (MyComponent.code.js) so might not have good type checking, or linked via url which the hyperlink essentially gives us

<Canvas>
<Story id="linear-view--using-loc-object" name="Using loc object" />
</Canvas>
<Story id="linear-view--using-loc-object" name="Using loc object" />

## Additional resources
Copy link
Contributor

Choose a reason for hiding this comment

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

the guide for creating default sessions has a broken link now?

maybe clarify that "code example" is "Code example embedding react-linear-genome-view into a React page"..or something

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

fixed link for default sessions, added your clarification text, and also added link out to https://jbrowse.org/jb2/docs/embedded_components/

@cmdcolin cmdcolin force-pushed the new_storybook_organization branch from a1d592d to e5ab621 Compare April 18, 2023 17:25
@cmdcolin cmdcolin requested a review from carolinebridge April 18, 2023 17:27
@cmdcolin cmdcolin force-pushed the new_storybook_organization branch 2 times, most recently from 04dbc68 to acc06f6 Compare April 18, 2023 18:37
@cmdcolin cmdcolin force-pushed the new_storybook_organization branch from acc06f6 to 0caede6 Compare April 18, 2023 18:43
@cmdcolin
Copy link
Collaborator Author

cmdcolin commented Apr 18, 2023

new sidebar organization now has less 'blue links'...idea from pairing with @garrettjstevens to simplify the sidebar

collapsed
image

expanded
image

@cmdcolin cmdcolin merged commit 9919073 into main Apr 18, 2023
@cmdcolin cmdcolin deleted the new_storybook_organization branch April 18, 2023 21:31
@cmdcolin cmdcolin changed the title Re-organize linear genome view storybooks Refactor linear genome view storybook May 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants