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

[Platform] Manhattan plot with Observable Plot #628

Open
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

gjmcn
Copy link
Contributor

@gjmcn gjmcn commented Jan 9, 2025

Description

Recreate the Manhattan plot on the study page using Observable Plot. The basic plot is straight forward, but the interaction is fiddlier since Plot has limited functionality for this. The solution implemented here adds an HTML overlay that includes a tooltip with no restrictions on its content.

This PR adds some reusable components for using Observable Plot on the platform. Using the top-level ObsPlot component avoids explicitly setting up the responsive container and overlay tooltip.

Notes:

  • The tooltip is click-to-stick.
  • The approach is not particularly complicated, but we should add a README with usage instructions to the folder once happy with the approach.

Possible improvements:

  • Requiring resetEelement to undo fade/highlight of marks is ugly since repeating information passed to the mark.
  • Add width options such as "responsive", fixed width and min-width. Currently width is always responsive.
  • Put types into own file since ObsPlot props are mostly passed directly to ObsChart or ObsTooltip.
  • Can remove some props from ObsTooltipRow? Wait until update Phewas plot since it has potentially long row values.
  • Shouldn't have to manually pass width and height to Plot in the renderPlot function.
  • Uncouple highlight/fade from tooltip since could feasibly want to highlight/fade when trigger some other action such as opening a drawer.

Issue: #3662
Deploy preview:

Type of change

Please delete options that are not relevant.

  • New feature (non-breaking change which adds functionality)

How Has This Been Tested?

Checked on study page.

Checklist:

  • I have commented my code, particularly in hard-to-understand areas
  • My changes generate no new warnings
  • I have made corresponding changes to the documentation

@gjmcn gjmcn marked this pull request as ready for review January 16, 2025 16:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant