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

Flipping Stacked Barcharts fails #1041

Closed
mwittep opened this issue Feb 15, 2024 · 2 comments · Fixed by #1042
Closed

Flipping Stacked Barcharts fails #1041

mwittep opened this issue Feb 15, 2024 · 2 comments · Fixed by #1042
Labels
bug🐛 Something isn't working

Comments

@mwittep
Copy link

mwittep commented Feb 15, 2024

I am building a viewer with stacked bars, one row for each strand (+,-). I wanted to flip the reserve strand, but this returned a weird visualization.

[...]
"y": {
                    "field": "count",
                    "type": "quantitative",
                    axis: "left",
                    domain: [0, maxValueBin[strand]],
                    range: [0, 90], flip: strand === "-"
                } 
[...]
image

I was able to reproduce the problem with the semantic zooming example (https://gosling.js.org/?example=SEQUENCE), where similar stacked bar charts are used.

image

Is this expected behavior, and I am just not understanding the flip-key correctly, or is it a bug?

@mwittep mwittep added the bug🐛 Something isn't working label Feb 15, 2024
@etowahadams
Copy link
Contributor

Hi @mwittep, thanks for submitting an issue! I was able to reproduce it and can confirm that the axis is not being flipped as expected.

Here is a Gosling specification with the issue

{"arrangement": "vertical","views": [{"layout": "linear","xDomain": {"chromosome": "chr1", "interval": [1000000, 3000010]},"alignment": "overlay","data": {"url": "https://server.gosling-lang.org/api/v1/tileset_info/?d=sequence-multivec","type": "multivec","row": "base","column": "position","value": "count","categories": ["A", "T", "G", "C"],"start": "start","end": "end"},"tracks": [{"mark": "bar","y": {"field": "count", "type": "quantitative", "axis": "none", "flip": true}}],"x": {"field": "position", "type": "genomic"},"color": {"field": "base","type": "nominal","domain": ["A", "T", "G", "C"],"legend": true},"text": {"field": "base", "type": "nominal"},"style": {"textFontWeight": "bold"},"width": 800,"height": 100}]}

I'll look into this and will get back with you!

@etowahadams
Copy link
Contributor

This has been fixed in the latest gosling release!

image

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

Successfully merging a pull request may close this issue.

2 participants