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

[draft] refactor: refactor react dependencies #1150

Draft
wants to merge 3 commits into
base: sehilyi/refactor-core
Choose a base branch
from

Conversation

sehilyi
Copy link
Member

@sehilyi sehilyi commented Apr 3, 2023

Description

Currently, HiGlassComponent and its several child components use React. The use of React is to support several UI components in HiGlass when an editable option is set to true in a view config. Gosling does not use such UI components, so it is not ideal to have the React dependencies in Gosling by using HiGlass.

Toward this, this PR tries to enable using the HiGlass Component without including React components on it when demanded.

Screenshot 2023-04-03 at 15 34 32

Thoughts

  • I think we can safely not use all children components of TrackRenderer.jsx, such as TrackControl.jsx and ListWrapper.jsx, which looks like control buttons overlaid on top of a track
<TrackRenderer ...>
-  {topTracks}
-  {leftTracks}
-  {rightTracks}
-  {bottomTracks}
-  {galleryTracks}
-  {centerTrack}
</TrackRenderer>
  • Implementing companion functions of TrackRenderer, TiledPlot, and HiGlassComponent that do not use React (and use pure javascript) might be the easiest way, e.g.,
higlass-embed/
   - index.js
   - TrackRendererPure.js
   - TiledPlotPure.js
   - HiGlassComponentPure.js

Checklist

  • Set proper GitHub labels (e.g. v1.6+, ignore if you don't know)
  • Unit tests added or updated
  • Documentation added or updated
  • Example(s) added or updated
  • Update schema.json if there are changes to the viewconf JSON structure format
  • Screenshot for visual changes (e.g. new tracks or UI changes)
  • Updated CHANGELOG.md

@sehilyi sehilyi marked this pull request as draft April 6, 2023 23:37
@manzt
Copy link
Member

manzt commented Oct 16, 2023

I'm having a look at this for myself, and am surprised to find that:

<TrackRenderer ...>
-  {topTracks}
-  {leftTracks}
-  {rightTracks}
-  {bottomTracks}
-  {galleryTracks}
-  {centerTrack}
</TrackRenderer>

doesn't seem to have any effect on the higlass Demo. What do the *Tracks components do exactly, and what is there relationship to TrackRenderer.

EDIT: Ah, so the *Tracks are transparent DOM elements (i.e., div) that overlay the canvas for the region that a particular track (or set of tracks) encompass. Somehow when they are resized, this information is relayed to the TrackRenderer which redraws the scene.

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.

None yet

2 participants