-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
1) Revised rendering argument passing design: - Deprecate `pg.View.PresetArgValue` for more straightforward argument passing, which makes code less errorpone. - No longer accept `**kwargs`, instead users need to pass extension-specific args via the `extra_flags` dict. - Allows extension to use `_html_tree_view_config` to define class-level argument overrides and child-nodes overrides. - Introduce a bunch of helper methods to make it easy to deal with rendering arguments in extensions. - `HtmlTreeView.get_kwargs`: Handles rendering arguments override. - `HtmlTreeView.get_passthrough_kwargs`: Handles arguments passthrough. - `HtmlTreeView.get_child_kwargs`: Handles child nodes config override. - `HtmlTreeView.get_collapse_level`: Consolidate parent/child collapse level. - `HtmlTreeView.merge_uncollapse`: Merges KeyPathSet for uncollapsing nodes. - `HtmlTreeView.get_color`: Gets color based on a tuple or a function. 2) Enhanced functionalities: - Added `key_style` (and uses `summary` by default), `key_color`, `summary_color`, `debug` flags. - Deprecated `special_keys`. - Updated the semantics of `include_keys` and `exclude_keys`. 3) Introduce `_html_tree_view_config` and `_html_tree_view_styles` to make it easy for user classes to make new views without coding. (See `langfun.MappingExample` as an example) 4) Upgraded existing HTML views for Langfun components. PiperOrigin-RevId: 687128151
- Loading branch information
Showing
13 changed files
with
534 additions
and
217 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.