GMOD / jbrowse-components

Source code for JBrowse 2, a modern React-based genome browser
https://jbrowse.org/jb2
Apache License 2.0
206 stars 62 forks source link

Ability to disable assembly/track UI elements for web-deployment #3213

Closed seeholza closed 1 year ago

seeholza commented 2 years ago

Is your feature request related to a problem? Please describe.

I am trying to deploy jbrowse2 to share views on assemblies and annotation tracks without sharing the data files behind them. I have achieved blocking requests by the http server to the data files directly (enforcing referrers, and enforcing regions in the headers) but i would also like to prevent the location of assembly and track data files being disclosed to the user in the UI directly.

I have seen I can add extra information (https://jbrowse.org/jb2/docs/config_guide/#customizing-the-feature-details-panel), but how can I hide existing information?

Describe the solution you'd like

A configuration item for tracks that disables seeing the "about" information for assemblies/tracks. Possibly also prevent copying/modifying them, by disabling UI elements selectively.

I am aware a creative user will still be able to locate the data files by looking at browser activity, but this is primarily to not expose this in the UI readily.

Describe alternatives you've considered

Hacking the CSS to disable visibility on certain items, but there's no unique class/id attached to the items i am interested in.

Resources E.g. gray out the "About track" element image E.g. disable showing of the "location" image

cmdcolin commented 2 years ago

we could probably try to add some config for this :) being able to customize the about track menu in general would be useful (the features for doing this for the "feature details" would not currently be able to be used for about dialog yet, but would be useful...jbrowse 1 had ability to customize about panel)

cmdcolin commented 2 years ago

@flinz possible help here https://github.com/GMOD/jbrowse-components/pull/3230

can run jbrowse create --branch util_gettrackname to get this branch you can add

"formatAbout":{"hideUris":true} to each track you want to hide, or to the entire config e.g.

{
  "configuration": {
    "formatAbout": {
      "hideUris": true,
    }
  },
  "assemblies": ...,
  "tracks": ...
}

(example here) https://github.com/GMOD/jbrowse-components/blob/util_gettrackname/test_data/volvox/config_main_thread.json#L1-L12

seeholza commented 2 years ago

@cmdcolin wow, thanks a lot for the PR! I'll give it a spin as soon as I can, and I think this would be generally useful!

cmdcolin commented 1 year ago

this feature was effectively delivered in v2.1.7

similar thing: can refer to https://github.com/GMOD/jbrowse-components/blob/main/test_data/volvox/config_main_thread.json#L1-L12 as well as more sophisticated modifications to the about/details panels in https://github.com/GMOD/jbrowse-components/blob/main/test_data/volvox/config.json (which refers to a simple "no build" plugin at https://github.com/GMOD/jbrowse-components/blob/main/test_data/volvox/umd_plugin.js)

cmdcolin commented 1 year ago

@flinz let me know if that helps of if there are any questions :)