Add pievisible pipe - #471
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5cb520a34b
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| !!(item as Record<string, unknown>)[key], | ||
| ); | ||
| }, | ||
| pievisible(value) { |
There was a problem hiding this comment.
Regenerate the tracked renderer outputs
This new pipe is only present in source: I checked the tracked generated artifacts and src/prefab_ui/renderer/app.html still has the older pipe registry without pievisible, while renderer/src/playground/bundle.json and docs/protocol/line-chart.mdx still contain the old LineChart Python/schema output. In dev-version fallback or mode="bundled", users will load app.html and the pipe will be unavailable, and the playground/docs will describe the stale API until the prefab dev build-renderers and prefab dev build-docs outputs are committed.
Useful? React with 👍 / 👎.
| !!(item as Record<string, unknown>)[key], | ||
| ); | ||
| }, | ||
| pievisible(value) { |
There was a problem hiding this comment.
Expose the new pipe through Rx
All of the existing built-in renderer pipes are paired with public Rx helpers in src/prefab_ui/rx/__init__.py, but this new pipe is only added to the TypeScript evaluator. Python code following the established style, such as STATE.chart_segments.pievisible(), currently resolves pievisible as a dot path via __getattr__ and then fails because Rx is not callable, forcing users back to hand-written template strings for this one pipe.
Useful? React with 👍 / 👎.
| Args: | ||
| data: Row data or reactive interpolation reference. | ||
| series: Series to render as lines. | ||
| series: Series to render as lines, or a sole ``{{ ... }}`` template |
There was a problem hiding this comment.
Use Markdown backticks in the docstring
/workspace/prefab/AGENTS.md says component docstrings are Markdown and specifically forbids rST double-backtick conventions. This new series line uses {{ ... }} markup, which is surfaced by prefab_ui.generative.search_components() as non-Markdown doc text; use normal Markdown inline backticks instead.
Useful? React with 👍 / 👎.
For charts with lots of data, Pie charts need a computed "Other" slice that shrinks when users toggle individual segments in Options. selectattr:visible cannot aggregate hidden rows, so add a built-in pievisible expression pipe and rebuild the bundled renderer.
Closes #473