Replies: 3 comments 9 replies
-
Hey @proItheus, that's a great suggestion! We'll add it to our task list. One UX issue is that it's not clear how to support both selection and pan at the same time. Perhaps Ctrl+Click would pan, and a bare Click would select reactively?
You're very welcome! Even though marimo has been in development for over a year, the repo has been public for a couple months, so perhaps it's not widely known about it. Feel free to spread the word :) |
Beta Was this translation helpful? Give feedback.
-
As far as I can see this is still not possible, right? |
Beta Was this translation helpful? Give feedback.
-
The I needed UI that allows different kinds of zoom bound to different keys and came up with this. Now you can Shift-scroll to zoom on only X, Alt-scroll for only Y, just the wheel is regular zoom. import altair as alt
class Chart(alt.Chart):
"""Modifications of Altair charts."""
wheel_zoom_x_only = alt.selection_interval(
bind="scales", encodings=["x"], zoom="wheel"
)
wheel_zoom_x = alt.selection_interval(
bind="scales", encodings=["x"], zoom="wheel![!event.shiftKey]"
)
wheel_zoom_y = alt.selection_interval(
bind="scales", encodings=["y"], zoom="wheel![!event.altKey]"
)
@property
def zoomable(self):
"""Zoom on both axes (mouse wheel) or X-only (Alt-wheel) or Y-only (Shift-wheel)."""
return self.add_params(self.wheel_zoom_x, self.wheel_zoom_y)
@property
def zoomable_x(self):
return self.add_params(self.wheel_zoom_x_only) |
Beta Was this translation helpful? Give feedback.
-
Currently, marimo supports two kinds of interactive plot:
So what I want is adding zoom and pan to
marimo.ui.altair_chart
, thus enabling one to simultaneously do selection and zoom/pan in one plot.Not sure how difficult this will be, but I think it will greatly add to the usability of the plotting feature.
And thanks for this awesome tool. I'm very surprised when seeing this repo has only ~100 stars, while my expectation is some thousands.
Beta Was this translation helpful? Give feedback.
All reactions