Skip to content

Finishing up remaining TODOs in panel's demo #1144

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

Merged
merged 32 commits into from
Jun 19, 2025
Merged

Conversation

b-yogesh
Copy link
Contributor

@b-yogesh b-yogesh commented Apr 1, 2025

This PR finishes up the TODOs in both the Hist2D demo panels and Spectrum View.

  • CircularProgress for Histogram 2D panel: After investigating, it seems infeasible within the current Chartlets architecture. Chartlets executes callbacks sequentially and returns all responses together, preventing timely progress updates. To yield responses as they complete would require changes on the Chartlets.js side. If real-time updates are needed, we may need to rethink the callback execution architecture. As an alternative, skeleton component in Chartlets (currently in development) could be used to indicate progress.

  • Other TODOs: All other TODOs for Histogram 2D and Spectrum View have been completed. However, dynamic resizing of the chart when the side panel width changes requires an update to the VegaChart component in Chartlets (Add dynamic resizing for Vega charts bcdev/chartlets#121).

  • Spectrum View TODO: Add new State properties xcube-viewer#512
    Added exploration modes

    • Update: Clear the chart but the current selection if any.
    • Add: Current spectrum is added and new point selections will be added as new spectra
    • Keeps only last 10 spectra in Add mode(to keep server alive)

Chartlets PR (bcdev/chartlets#122) required to make radio buttons styled for this demo.

Checklist:

  • Add unit tests and/or doctests in docstrings
  • Add docstrings and API docs for any new/modified user-facing classes and functions
  • New/modified features documented in docs/source/*
  • Changes documented in CHANGES.md
  • GitHub CI passes
  • AppVeyor CI passes
  • Test coverage remains or increases (target 100%)

Copy link

codecov bot commented Apr 1, 2025

Codecov Report

Attention: Patch coverage is 22.22222% with 7 lines in your changes missing coverage. Please review.

Project coverage is 89.28%. Comparing base (4596adf) to head (7595e94).
Report is 82 commits behind head on main.

Files with missing lines Patch % Lines
xcube/webapi/viewer/contrib/helpers.py 22.22% 7 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1144      +/-   ##
==========================================
- Coverage   89.31%   89.28%   -0.03%     
==========================================
  Files         279      279              
  Lines       21378    21387       +9     
==========================================
+ Hits        19093    19095       +2     
- Misses       2285     2292       +7     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@b-yogesh b-yogesh changed the title Yogesh xxx demo todos Finishing up remaining TODOs in panel's demo Apr 2, 2025
@b-yogesh b-yogesh self-assigned this Apr 2, 2025
@b-yogesh b-yogesh removed their assignment Apr 4, 2025
@b-yogesh b-yogesh marked this pull request as ready for review April 4, 2025 14:00
Copy link
Collaborator

@clarasb clarasb left a comment

Choose a reason for hiding this comment

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

Review from a user perspective:

  1. Resizing works great !
  2. Demopanels: With no available places, the demo panels show the confusing error message, that the panel is disabled. More context might be useful for a user like: Panel diables due to 0 places available

grafik

  1. Visualisation problem in dark mode:
    • Sidebar: background colour doesn't adjust to theme, hence the text is not readable
    • some text in the horizontal Controlbar above the map and Colourbar Menu do not adjust in font colour, therefore the text is not readable either

grafik

  1. The seperation in the horizontal menubar looks nice and organizes the menu bar really well, however, the dropdown menus and buttons on the left side are not leveled with the ones on the right side.

grafik

@b-yogesh
Copy link
Contributor Author

b-yogesh commented Apr 7, 2025

Thanks for the user review. Please find my comments below.

2. Demopanels: With no available places, the demo panels show the confusing error message, that the panel is disabled. More context might be useful for a user like: Panel diables due to 0 places available

I decided to just convert the print statements to these messages as is. We plan on aligning all these tabs xcube-dev/xcube-viewer#483 so they all have the same UI design which would then also take care of what is missing for each tab to be useful. Regarding the error message, it is of the user's choice, and as mentioned I used the content from the print statements , but I can change it for now.

Visualisation problem in dark mode:

* Sidebar: background colour doesn't adjust to theme, hence the text is not readable

* some text in the horizontal Controlbar above the map and Colourbar Menu do not adjust in font colour, therefore the text is not readable either

I am not able to replicate this issue. Please see the screenshot attached.
Screenshot from 2025-04-07 16-48-09

The seperation in the horizontal menubar looks nice and organizes the menu bar really well, however, the dropdown menus and buttons on the left side are not leveled with the ones on the right side.

Unable to replicate this as well. See screenshot above!

@b-yogesh
Copy link
Contributor Author

b-yogesh commented Apr 8, 2025

I am not able to replicate this issue. Please see the screenshot attached.

This issue was being caused by using npm link to use local chartlets build for testing and is not an issue created by this PR.
PR to fix npm link issue -> xcube-dev/xcube-viewer#516

"paddingTop": 6,
# Since for dynamic resizing we use `container` as width and height for
# this chart during updates, it is necessary that we provide the width
# and the height here. This is for its parent div.
Copy link
Member

Choose a reason for hiding this comment

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

This is for its parent div.

It is not clear to what "its parent" is referring too: container of the chart or parent of the chart container.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It refers to the container of the chart. Will update the comment.

chart=None,
style={
"paddingTop": 6,
# Since for dynamic resizing we use `container` as width and height for
Copy link
Member

Choose a reason for hiding this comment

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

What container?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Collaborator

@clarasb clarasb left a comment

Choose a reason for hiding this comment

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

Review from a user perspective:

Spectrum View:

  • Plot format:

    • I prefer the representation of reflectances in point and line format. The bar chart makes it difficult to compare the spectra with each other
  • Exploration mode:

    • The feature works as described in the tooltip, but the name/wording of the features can be misleading.
    • Example: The clearing of the plot when switching from add-mode to update-mode. This is not what I would expect as a user.
  • Spelling/ Wording:

    • for coherence: "legend" -> "Legend"
    • Suggestion for descriptive text: "Choose an exploration mode and select points to visualize their spectral reflectance across available wavelengths in the Spectrum View."

Histogram View:

  • The info text is centred. For coherence: position should be left-bound.

@b-yogesh
Copy link
Contributor Author

Thanks for the review Clara.

I have updated the text and fixed the wording as requested.
Regarding other points:

Plot format:

* I prefer the representation of reflectances in point and line format. The bar chart makes it difficult to compare the spectra with each other

This was discussed with Norman to keep the bar plots as line chart does not provide the real information when the distance between the wavelengths is too high.

  • Example: The clearing of the plot when switching from add-mode to update-mode. This is not what I would expect as a user.

This was done to keep the demo simple.

@forman
Copy link
Member

forman commented Jun 18, 2025

Good, so far. Here are my remaining requests:

  1. This looks cluttered. Either use a Select widget or have the mode radios in a row. Make Add the first mode.

image

  1. Use smaller, secondary typography for the explanation of the panel. Also use markdown widget and don't but the button labels in quotes. Instead use bold letters. Same for the other panels.

image

  1. Please move the legend to the bottom so right-side space becomes available:

image

Copy link
Member

@forman forman left a comment

Choose a reason for hiding this comment

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

See my comments.

@b-yogesh
Copy link
Contributor Author

  1. This looks cluttered. Either use a Select widget or have the mode radios in a row.

Yes, this was already in row mode, but was waiting for the release from chartlets.

Make Add the first mode.

Done

2. Use smaller, secondary typography for the explanation of the panel. Also use markdown widget and don't but the button labels in quotes. Instead use bold letters. Same for the other panels.

Done

  1. Please move the legend to the bottom so right-side space becomes available:

Done

I assume it was number 3, if you had missed any, let me know.

Screenshots below showing the panels:
image

image

Screenshot from 2025-06-18 16-13-42

I have also created a PR for xcube-viewer to use the latest Chartlets and pin the versions for vega libraries that are defined as peerDeps in chartlets. Pinning is required to avoid dep issue when npm installs the latest version. This might be removed in the future when we dont have dep issues.

Please also review this tiny PR in xcube-viewer: xcube-dev/xcube-viewer#531

@b-yogesh b-yogesh requested a review from forman June 18, 2025 14:39
Copy link
Member

@forman forman left a comment

Choose a reason for hiding this comment

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

Thanks @b-yogesh

@forman forman merged commit 4e6305f into main Jun 19, 2025
3 of 5 checks passed
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

Successfully merging this pull request may close these issues.

3 participants