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 linkingId field to the y channel #1055

Open
etowahadams opened this issue May 2, 2024 · 1 comment
Open

Add linkingId field to the y channel #1055

etowahadams opened this issue May 2, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@etowahadams
Copy link
Contributor

etowahadams commented May 2, 2024

To address: #399

Proposal: Add linkingId field to the y channel:

Example:

"y": {"field": "peak", "type": "quantitative", "axis": "right", "linkingId": "my-ID"}

Tracks that share the same linking ID will share the same y-axis

Implementation details:

  • Use valueScaleLocks in the HiGlass config to lock the y-axis together. Here is an example:
"valueScaleLocks": {
    "locksByViewUid": {
        "track1": "my-lock-group",
        "track2": "my-lock-group"
    },
    "locksDict": {
        "my-lock-group": {
            "track1": {
                "track": "track1",
                "view": "view1"
            },
            "track2": {
                "track": "track2",
                "view": "view1"
            },
            "uid": "my-lock-group"
        }
    }
},
@etowahadams etowahadams added the enhancement New feature or request label May 2, 2024
@etowahadams
Copy link
Contributor Author

It seems that the proposed strategy, using valueScaleLocks, does not immediately work for linking the y-axis.

I turned on the HiGlass interface and tried to lock the scale values on two Gosling tracks, but didn't see any changes.

Screen.Recording.2024-05-08.at.12.11.00.PM.mov

In HiGlass, value scale locks are handled in handleValueScaleLocked
https://github.com/higlass/higlass/blob/335f4eea6445d07baa5eda2e66077dca461b7777/app/scripts/HiGlassComponent.jsx#L3133

This calls a function to sync value scales, which updates this.valueScale
https://github.com/higlass/higlass/blob/335f4eea6445d07baa5eda2e66077dca461b7777/app/scripts/HiGlassComponent.jsx#L1354

As far as I can tell, most HiGlass tracks use this valueScale to get positions to draw graphics. However, Gosling uses a scale that is stored in GoslingTrackModel to get positions instead. This is why nothing happens even when you select for the value scale to be locked.

We would have to change Gosling so it uses this.valueScale, or change the scale in GoslingTrackModel whenever there is a change in valueScale so that the track draws using this new axis.

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

No branches or pull requests

1 participant