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

Visibility is not working for line marks #1008

Open
dvmoritzschoefl opened this issue Dec 11, 2023 · 1 comment
Open

Visibility is not working for line marks #1008

dvmoritzschoefl opened this issue Dec 11, 2023 · 1 comment
Labels
bug🐛 Something isn't working

Comments

@dvmoritzschoefl
Copy link

zoommark.webm

I am not sure if this intended or not. But it seems that the line mark is not working with semantic visibility.

The relevant section in the spec is this:

"visibility": [ { "measure": "zoomLevel", "target": "mark", "threshold": 1000000, "operation": "LT", "transitionPadding": 1000000 } ]

@dvmoritzschoefl dvmoritzschoefl added the bug🐛 Something isn't working label Dec 11, 2023
@etowahadams
Copy link
Contributor

Thanks for submitting and issue! This does seem to be a bug.

In the short term, you might get a similar desired effect by changing "point" to "bar".

Here is the spec to reproduce. Change "point" to "line" or "bar" to observe the differences. We expect "line" to behave like "point" and"bar" (not visible when zoomed out) but unexpectedly it is visible at all levels of zoom.

{
      "xDomain": {"chromosome": "chr13", "interval": [31500000, 33150000]},
      "centerRadius": 0.1,
      "layout": "linear",
      "spacing": 0,
      "alignment": "stack",
      "tracks": [
        {
          "alignment": "overlay",
          "data": {
            "url": "https://server.gosling-lang.org/api/v1/tileset_info/?d=clinvar-beddb",
            "type": "beddb",
            "genomicFields": [
              {"index": 1, "name": "start"},
              {"index": 2, "name": "end"}
            ],
            "valueFields": [
              {"index": 7, "name": "significance", "type": "nominal"}
            ]
          },
          "tracks": [
            {
              "mark": "bar",
              "x": {"field": "start", "type": "genomic"},
              "y": {
                "field": "significance",
                "type": "nominal",
                "domain": [
                  "Pathogenic",
                  "Pathogenic/Likely_pathogenic",
                  "Likely_pathogenic",
                  "Uncertain_significance",
                  "Likely_benign",
                  "Benign/Likely_benign",
                  "Benign"
                ],
                "baseline": "Uncertain_significance",
                "range": [150, 20]
              },
              "size": {"value": 1},
              "color": {"value": "lightgray"},
              "stroke": {"value": "lightgray"},
              "strokeWidth": {"value": 1},
              "opacity": {"value": 0.3},
              "visibility": [
                {
                  "measure": "zoomLevel",
                  "target": "mark",
                  "threshold": 100000,
                  "operation": "LT",
                  "transitionPadding": 100000
                }
              ]
            },
            {
              "mark": "point",
              "x": {"field": "start", "type": "genomic"},
              "row": {
                "field": "significance",
                "type": "nominal",
                "domain": [
                  "Pathogenic",
                  "Pathogenic/Likely_pathogenic",
                  "Likely_pathogenic",
                  "Uncertain_significance",
                  "Likely_benign",
                  "Benign/Likely_benign",
                  "Benign"
                ]
              },
              "size": {"value": 7},
              "opacity": {"value": 0.8},
              "visibility": [
                {
                  "measure": "zoomLevel",
                  "target": "mark",
                  "threshold": 1000000,
                  "operation": "LT",
                  "transitionPadding": 1000000
                }
              ]
            },
            {
              "data": {
                "url": "https://server.gosling-lang.org/api/v1/tileset_info/?d=clinvar-multivec",
                "type": "multivec",
                "row": "significance",
                "column": "position",
                "value": "count",
                "categories": [
                  "Benign",
                  "Benign/Likely_benign",
                  "Likely_benign",
                  "Uncertain_significance",
                  "Likely_pathogenic",
                  "Pathogenic/Likely_pathogenic",
                  "Pathogenic"
                ],
                "binSize": 4
              },
              "mark": "bar",
              "x": {"field": "start", "type": "genomic"},
              "xe": {"field": "end", "type": "genomic"},
              "y": {"field": "count", "type": "quantitative", "axis": "none"},
              "color": {
                "field": "significance",
                "type": "nominal",
                "domain": [
                  "Pathogenic",
                  "Pathogenic/Likely_pathogenic",
                  "Likely_pathogenic",
                  "Uncertain_significance",
                  "Likely_benign",
                  "Benign/Likely_benign",
                  "Benign"
                ],
                "range": [
                  "#CB3B8C",
                  "#CB71A3",
                  "#CB96B3",
                  "gray",
                  "#029F73",
                  "#5A9F8C",
                  "#5A9F8C"
                ],
                "legend": true
              },
              "visibility": [
                {
                  "measure": "zoomLevel",
                  "target": "mark",
                  "threshold": 500000,
                  "operation": "GT",
                  "transitionPadding": 500000
                }
              ]
            }
          ],
          "color": {
            "field": "significance",
            "type": "nominal",
            "domain": [
              "Pathogenic",
              "Pathogenic/Likely_pathogenic",
              "Likely_pathogenic",
              "Uncertain_significance",
              "Likely_benign",
              "Benign/Likely_benign",
              "Benign"
            ],
            "range": [
              "#CB3B8C",
              "#CB71A3",
              "#CB96B3",
              "gray",
              "#029F73",
              "#5A9F8C",
              "#5A9F8C"
            ]
          },
          "width": 800,
          "height": 150
        }
      ]
    }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug🐛 Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants