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

Ease development of server-side viewer panels #451

Merged
merged 11 commits into from
Nov 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 17 additions & 4 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,30 @@
## Changes in version 1.4.0 (in development)

### Enhancements
### New Features

* Added a new "share" action to the app bar.
It creates a permalink URL to restore the view state
It creates a permalink URL to restore the view state
and copies it to the clipboard. (#447)

The restored state includes
- Selected map region, zoom level, and overlays.
- User places including the selected place.
- Opened panels, active tabs, and any selected options.
- Other UI-specific states such as selected items, filters, or toggle states.

* Starting with xcube Server 1.8 and xcube Viewer 1.4 it is possible to enhance
the viewer UI by _server-side contributions_ programmed in Python.
For this to work, service providers can now configure xcube Server to load
one or more Python modules that provide UI-contributions of type
`xcube.webapi.viewer.contrib.Panel`.
Users can create `Panel` objects and use the two decorators
`layout()` and `callback()` to implement the UI and the interaction
behaviour, respectively. The new functionality is provided by the
[Chartlets](https://bcdev.github.io/chartlets/) Python library.

A working example can be found in the
[xcube repository](https://github.com/xcube-dev/xcube/tree/5ebf4c76fdccebdd3b65f4e04218e112410f561b/examples/serve/panels-demo).

### Other changes

* Updated dependencies, development dependencies and updated TypeScript code base accordingly.
Expand All @@ -20,7 +33,7 @@
- `mui` from v5 to v6
- `testing-library/react` from v12 to v16

* Tooltips (incl. translation) have been added to the toogle buttons that
* Tooltips (incl. translation) have been added to the toggle buttons that
control the format of the metadata information in the sidebar.

## Changes in version 1.3.1
Expand Down
111 changes: 88 additions & 23 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"classnames": "^2.2.6",
"codemirror": "^6.0.1",
"color-rgba": "^2.2.3",
"chartlets": "^0.0.16",
"chartlets": "^0.0.29",
"date-fns": "^2.29.3",
"fast-memoize": "^2.5.2",
"fflate": "^0.7.4",
Expand Down
31 changes: 31 additions & 0 deletions public/docs/dev-reference.en.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
## Server-side UI Contributions

Starting with xcube Server 1.8 and xcube Viewer 1.4 it is possible to enhance
the viewer UI by _server-side contributions_ programmed in Python.
For this to work, service providers can now configure xcube Server to load
one or more Python modules that provide UI-contributions of type
`xcube.webapi.viewer.contrib.Panel`.
Users can create `Panel` objects and use the two decorators
`layout()` and `callback()` to implement the UI and the interaction
behaviour, respectively. The new functionality is provided by the
[Chartlets](https://bcdev.github.io/chartlets/) Python library.

A working example can be found in the
[xcube repository](https://github.com/xcube-dev/xcube/tree/5ebf4c76fdccebdd3b65f4e04218e112410f561b/examples/serve/panels-demo).

## Contributions

The following contributions are in use by this instance of xcube Viewer:

${extensions}

## Available State Properties

In the following, xcube Viewer's state properties are listed.
These properties can be accessed in the input and state channels you pass
to the `layout()` and `callback()` decorators. To trigger a callback
call when a state property changes use the input syntax
`Input("@app", <property>)`. To just read a property from the state use
`State("@app", <property>)`.

${derivedState}
Loading