GMOD / jbrowse-components

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

QuantitativeTrack+LinearWiggleDisplay+WiggleRenderer ignores color setting in config.json #4475

Closed heavywatal closed 4 months ago

heavywatal commented 4 months ago

Describe the bug

I can set the default color for FeatureTrack + LinearBasicDisplay via color1 slot of SvgFeatureRenderer in config.json (out of defaultSession) so that the track is shown in a specified color from the beginning, and also closing-reopening the track shows the same color. But it does not work for QuantitativeTrack + LinearWiggleDisplay. Setting color and posColor slots in WiggleRenderer is ignored, and the wiggle tracks are always shown in blue. The only way I can change the color of wiggle tracks is to modify them in defaultSession part, but of course they turn to blue once the tracks are closed and reopened.

To Reproduce

Expected behavior

color, posColor, negColor slots in WiggleRenderer are respected as color1 in SvgFeatureRenderer.

Screenshots

Version:

jbrowse 2.12.3, Chrome/Firefox/Safari, macOS 14.5 Sonoma

Additional context

cmdcolin commented 4 months ago

the wiggle track color config is quite a bit annoyingly nested. it looks like this

{
  "type": "QuantitativeTrack",
  "trackId": "mytrack",
  "name": "mytrack",
  "assemblyNames": [ "volvox"  ],
  "adapter": {
    "type": "BigWigAdapter",
    "bigWigLocation": {
      "uri": "volvox_microarray.bw"
    }
  },
  "displays": [
    {
      "type": "LinearWiggleDisplay",
      "displayId": "mytrack-LinearWiggleDisplay",
      "renderers": {
        "XYPlotRenderer": {
          "type": "XYPlotRenderer",
          "color": "orange" <-- your color here
        }
      }
    }
  ]
}

i'd like the config to be less nested than that just to change simple color but that is what it is now!

the way that i got this was using the config editor and then going to about track->copy config.

heavywatal commented 4 months ago

Thank you very much for the quick response as always. Now I can configure LinearWiggleDisplay as you suggested.

using the config editor and then going to about track->copy config.

And thank you again for this great hint! I can live with the heavily nested configuration as long as it is searchable like this.