-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Implement LayerManager using LitElement + anywidget #2153
Conversation
@giswqs Don't feel like you need to jump in and start reviewing this right away. I want to get feedback from other members of the Earth Engine team (@sufyanAbbasi in particular) and I'm sure there will be several iterations. |
@naschmitz Sure, no problem. I will wait for other team members to review it first. I am not familar with TypeScript yet. Not much help I can provide yet. |
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 is incredible work!! I am sending over some initial comments on the TS code, but I need to look at the Python code a little better.
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.
Thanks so much, this is really great! I'll send up a PR for testing as soon as I get them complete. I have one more nit down below, otherwise, looks good to me!
@giswqs - This pull request is ready for your review |
Tests are done! https://github.com/naschmitz/geemap/tree/anywidget-test |
@naschmitz Sorry for the delay! I just started reviewing the PR. This is tremendous amount of work. Thank you for puttting this together. Here are some feedback I would like to share.
|
@giswqs I think I've fixed both issues. Please take another look when you have time. |
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.
Thank you very much for fixing it. I can confirm that now clicking on the layer name can toggle layer visibility.
One potential improvement would be to change the currsor shape to a pointer rather than text selection. when hoving on the layer name. Anyway, this is just a suggestion. No worries if it is difficult to change.
I fixed the cursor issue. It was as simple as adding |
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
Overview:
package-lock.json
, thepyproject.toml
changes, and the style sheets to replicate legacy ipywidgets styles. Future widget migrations will have much smaller diffs.Files and directories:
geemap/static/*
contains the compiled ECMAScript modules. These files aren't manually written. Each widget must have it's own compiled ECMAScript module. A previous version of this pull request checked in static files, but there are security risks with that and the Python package installers should know how to build the TypeScript into modules.js/*
contains the TypeScript and CSS source files. These files are written manually.js/ipywidgets_styles.ts
implements the legacy styles with the non-custom ipywidgets.js/material_styles.ts
implements new material styles (only fonts right now).How to build and test:
npm install
and thennpm run dev
. This starts a development server that will watch the TypeScript and CSS source files for changes and re-build when necessary.TODOs remaining:
@import url
command and then referenced in the stylesheets, but it involves duplication and brittle URLs. - @sufyanAbbasijslink
working in Colab. It'll make the UI feel so much more responsive. - @sufyanAbbasi