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

Potentially Malfunctioning Highlighting #708

Open
Hamzu24 opened this issue Mar 7, 2025 · 1 comment
Open

Potentially Malfunctioning Highlighting #708

Hamzu24 opened this issue Mar 7, 2025 · 1 comment

Comments

@Hamzu24
Copy link

Hamzu24 commented Mar 7, 2025

In the Google Colab notebook linked from the idl.uw.edu/mosaic website that displays Seattle weather data as a MosaicWidget, the interactive highlighting of the points seems to be malfunctioning.

Link: https://colab.research.google.com/drive/1Txy6L_of8_lJFImKEkhUCqZX70yKpYnv#scrollTo=leuzblN47K-T

Excerpt code for the specification and widget creation:

`spec = {
"params": {
"click": { "select": "single" },
"domain": ["sun", "fog", "drizzle", "rain", "snow"],
"colors": ["#e7ba52", "#a7a7a7", "#aec7e8", "#1f77b4", "#9467bd"]
},
"vconcat": [
{
"hconcat": [
{
"plot": [
{
"mark": "dot",
"data": { "from": "weather", "filterBy": "$click" },
"x": { "dateMonthDay": "date" },
"y": "temp_max",
"fill": "weather",
"r": "precipitation",
"opacity": 0.7
},
{ "select": "intervalX", "as": "$range" },
{ "select": "highlight", "by": "$range", "fill": "#eee" },
{ "legend": "color", "as": "$click", "columns": 1 }
],
"xyDomain": "Fixed",
"xTickFormat": "%b",
"colorDomain": "$domain",
"colorRange": "$colors",
"rDomain": "Fixed",
"rRange": [2, 10],
"width": 800
}
]
},
{
"plot": [
{
"mark": "barX",
"data": { "from": "weather" },
"x": { "count": None },
"y": "weather",
"fill": "#f5f5f5"
},
{
"mark": "barX",
"data": { "from": "weather", "filterBy": "$range" },
"x": { "count": None },
"y": "weather",
"fill": "weather",
"order": "weather"
},
{ "select": "toggleY", "as": "$click" },
{ "select": "highlight", "by": "$click" }
],
"xDomain": "Fixed",
"yDomain": "$domain",
"yLabel": None,
"colorDomain": "$domain",
"colorRange": "$colors",
"width": 800
}
]
}

MosaicWidget(spec, data = {"weather": weather})`

With the default spec above only the points aligned with the x position of the cursor are highlighted when a portion of the graph is selected. These points alone remain highlighted even upon further interactions.

I'm not 100% sure if this is a bug, but thought I would flag it to make sure.

@eleanorpd
Copy link

I think you're right. If you change the interval to XY in the upper plot, it works as expected.

from
{ "select": "intervalX", "as": "$range" },

to
{ "select": "intervalXY", "as": "$range" },

You can make this change in the collab directly. @domoritz in case you want to change the collab file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants