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

Add id to map api #7307

Merged
merged 3 commits into from Sep 11, 2023
Merged

Add id to map api #7307

merged 3 commits into from Sep 11, 2023

Conversation

willhuang1997
Copy link
Collaborator

@willhuang1997 willhuang1997 commented Sep 11, 2023

Describe your changes

  • add id to map api as that was forgotten and only added to pydeck api

GitHub Issue Link (if applicable)

Testing Plan

  • Explanation of why no additional tests are needed
  • Unit Tests (JS and/or Python)
  • added python tests
  • E2E Tests
  • Any manual testing needed?
  • no but here's a video that it works
Screen.Recording.2023-09-11.at.9.58.26.AM.mov

Contribution License Agreement

By submitting this pull request you agree that all contributions to this project are made under the Apache 2.0 license.

@willhuang1997 willhuang1997 added change:bugfix and removed type:bug Something isn't working labels Sep 11, 2023
@willhuang1997 willhuang1997 marked this pull request as ready for review September 11, 2023 16:59
Comment on lines 244 to 252
deck_gl_json = to_deckgl_json(
data, latitude, longitude, size, color, map_style, zoom
)
map_proto.json = deck_gl_json
map_proto.use_container_width = use_container_width
json_string = json.dumps(deck_gl_json)
json_bytes = json_string.encode("utf-8")
id = hashlib.md5(json_bytes).hexdigest()
map_proto.id = id
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be good to move this to a marshall function, to mirror how the pydeck element does it.

map_proto.use_container_width = use_container_width
json_string = json.dumps(deck_gl_json)
json_bytes = json_string.encode("utf-8")
id = hashlib.md5(json_bytes).hexdigest()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would prefer the id field be named something that doesn't make it seem like this is a widget, but the pydeck element already calls it id, so changing it would be a big pain, and probably not worth it.

@sfc-gh-wihuang sfc-gh-wihuang merged commit 47abf16 into develop Sep 11, 2023
50 checks passed
eric-skydio pushed a commit to eric-skydio/streamlit that referenced this pull request Dec 20, 2023
zyxue pushed a commit to zyxue/streamlit that referenced this pull request Mar 22, 2024
zyxue pushed a commit to zyxue/streamlit that referenced this pull request Apr 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

st.map() does not refresh with the new data
3 participants