-
Notifications
You must be signed in to change notification settings - Fork 3
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
Convert to Solara #16
base: main
Are you sure you want to change the base?
Conversation
What is the right way to run this for testing? I tried: But this gives me some slightly odd error message (below). Before I try to solve that, is that the right way to try and invoke this?
|
@jfoster17 I've generally been using
|
powerplant_data.add_component(big*9 + med*4 + small*1, label='Size_binned') | ||
|
||
map = cast(IPyLeafletMapViewer, app.new_data_viewer(IPyLeafletMapViewer, data=tempo_data, state=map_state, show=False)) | ||
map.map.add(TileLayer(url=stadia_labels_url, pane='labels')) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You accidentally removed the definition of the custom "pane" for the label layer. Restoring this here:
map.map.panes = {"labels": {"zIndex": 650}}
Will fix the crash that causes zooming and panning to break.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This does not solve the problem that the time slider only updates once and then stops working...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That fixed the zooming/panning for me as well.
src/tempods/pages/__init__.py
Outdated
def update_image(index): | ||
print(f"update_image: {index}") | ||
set_time_index(index) | ||
timestep = time_values[index] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs to be:
timestep = time_values[index].item()
to cast the solara-returned np.int64
down to an int
(otherwise ipyleaflet casts the np.int64
to a string, which breaks things)
src/tempods/pages/__init__.py
Outdated
# Our remote dataset does not have real components representing latitude and longitude. We link to the only components | ||
# it does have so that we can display this on the same viewer without trigger and IncompatibleAttribute error | ||
app.add_link(app.data_collection["Power_Plants"], 'Longitude', app.data_collection["TEMPO"], 'Pixel Axis 0') | ||
app.add_link(app.data_collection["Power_Plants"], 'Latitude', app.data_collection["TEMPO"], 'TEMPO_NO2_L3_V03_HOURLY_TROPOSPHERIC_VERTICAL_COLUMN_BETA') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also the variable name on the server changed, so this needs to be:
TEMPO_NO2_L3_V03_HOURLY_TROPOSPHERIC_VERTICAL_COLUMN
(i.e. just remove the _BETA)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You'll also need the latest glue_map because I hacked the component name there instead of doing it properly. I've now hacked it to the current correct version and next time I'll certainly fix it properly!
This PR moves the story into Solara, using #9 as a starting point but putting the content in the main app page. This also converts the subset control widget to a Solara component.
I'm running into issues just like we saw on #9 - in particular, the interaction between the controls and the image layer on the map viewer seems problematic. I've also noticed that the image layer doesn't update when the map zooms, and I get some errors in the console. Still working on investigating these.