You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: trame_client/widgets/trame.py
+10-6Lines changed: 10 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -375,6 +375,7 @@ def register_external_script(
375
375
Args:
376
376
script_file_path (Path | str):
377
377
The local of the script you want to register. Can be either a local or a remote script. Accepts:
378
+
378
379
- `Path`: local path to your script on the filesystem
379
380
- `str`: an valid URL to the script
380
381
function_names (list[str]): public API of your script that you want to expose to the Handler widget.
@@ -414,13 +415,15 @@ class Handler(AbstractElement):
414
415
It manages the execution flow between the Python state and JavaScript functions,
415
416
providing events to monitor execution status.
416
417
418
+
For usage with the docker setup, please see `README_DOCKER.md <https://github.com/Kitware/trame-client/blob/master/examples/handler/README_DOCKER.md>`_.
419
+
417
420
Args:
418
421
function (UserDefinedFunction | tuple[str, str] | ExternalScript | str):
419
422
The JavaScript function to execute. Accepts:
423
+
420
424
- `UserDefinedFunction`: Obtained from `ExternalScript.function`.
421
425
- `tuple[str, str]`: A `(module_name, function_name)` pair.
422
-
- `ExternalScript`: An object from `register_external_script` (must
423
-
contain exactly one function).
426
+
- `ExternalScript`: An object from `register_external_script` (must contain exactly one function).
424
427
- `str`: The registration identifier of an external script.
425
428
variable (str): The name of the state variable to be passed as the
426
429
primary input to the function.
@@ -430,10 +433,11 @@ class Handler(AbstractElement):
430
433
to be passed as arguments to the function. Defaults to None.
431
434
432
435
Events:
433
-
completed: A generic event emitted regardless of the execution outcome.
434
-
success: Emitted when the function executes and returns successfully.
435
-
failure: Emitted when the function reports a handled error.
436
-
error: Emitted when an unhandled exception occurs during execution.
436
+
437
+
- completed: A generic event emitted regardless of the execution outcome.
438
+
- success: Emitted when the function executes and returns successfully.
439
+
- failure: Emitted when the function reports a handled error.
440
+
- error: Emitted when an unhandled exception occurs during execution.
0 commit comments