pub struct PluginStaticConfig {Show 14 fields
pub name: String,
pub category: Option<String>,
pub max_columns: Option<usize>,
pub max_cells: Option<usize>,
pub select_mode: ColumnSelectMode,
pub min_config_columns: Option<usize>,
pub config_column_names: Vec<String>,
pub group_rollup_modes: Option<Vec<GroupRollupMode>>,
pub split_rollup_modes: Option<Vec<SplitRollupMode>>,
pub priority: Option<i32>,
pub can_render_column_styles: bool,
pub group_by_role: Option<String>,
pub split_by_role: Option<String>,
pub connects_row_order: bool,
}Expand description
Static, immutable configuration for a plugin.
Returned once per plugin from get_static_config() at registration
time and cached in [crate::renderer::PluginRecord]. Consumers
(renderer, session, queries, components) read these fields off the
renderer’s active-plugin metadata rather than calling back into JS.
<perspective-viewer> reads this exactly once per plugin (at
registerPlugin time) and caches it for the lifetime of the
application. The result must be stable; do not mutate any field
after registration.
Fields§
§name: StringThe unique key for this plugin. Used as the plugin field in a
ViewerConfig and as the display name key in the
<perspective-viewer> UI.
category: Option<String>Category in the plugin picker menu.
max_columns: Option<usize>Soft limit on the number of columns the plugin will render. Triggers the “Rendering N of M” warning when the view exceeds this value (until dismissed).
max_cells: Option<usize>Soft limit on the number of cells (rows × columns) the plugin will render. Triggers the “Rendering N of M” warning when the view exceeds this value (until dismissed).
select_mode: ColumnSelectModeColumn add/remove behavior. "select" exclusively selects the
added column, removing other columns. "toggle" toggles the
column on or off based on its current state, leaving other
columns alone.
min_config_columns: Option<usize>Minimum number of columns the plugin requires to render. Mostly
affects drag/drop and column-remove button behavior. undefined
is treated identically to 1.
config_column_names: Vec<String>Named column slots. Named columns have replace/swap behavior in
drag/drop rather than insert. The length must be at least
min_config_columns.
group_rollup_modes: Option<Vec<GroupRollupMode>>Group-rollup modes the plugin accepts, in preference order. The first entry that matches a feature flag becomes the default.
split_rollup_modes: Option<Vec<SplitRollupMode>>Split-rollup modes the plugin accepts, in preference order. The first entry that matches a feature flag becomes the default.
priority: Option<i32>Plugin load priority. Higher numbers win; ties resolve in
registration order. The highest-priority plugin is loaded by
default unless restore({ plugin }) overrides it.
can_render_column_styles: boolWhether this plugin opts into per-column style controls in the
settings sidebar. When true, the StyleTab is shown for active
columns and the plugin’s column_config_schema is queried for
the per-column field set. When false or omitted, no StyleTab
is shown.
group_by_role: Option<String>What group_by MEANS visually for this plugin, e.g. "X Axis"
for the Y-series charts or "Hierarchy" for treemap/sunburst.
None where the field has no visual role of its own and is a
plain aggregation key (the X/Y charts, whose axes both come from
columns).
This is the group_by counterpart of Self::config_column_names:
the same declaration that names the positional columns slots
should say what the other view fields draw, so that consumers —
the settings UI’s field labels, and the agent’s list_plugins
contract — read one source instead of restating the mapping.
split_by_role: Option<String>What split_by MEANS visually for this plugin, e.g. "Series".
See Self::group_by_role.
connects_row_order: booltrue when this plugin CONNECTS its points in row order, so the
View’s row order is visible in the drawing: an unsorted config
renders the table’s natural order, which reads as a tangle unless
the rows already arrive ordered along the axis. Declared rather
than inferred, because “unsorted” is not itself a mistake — a
pre-ordered table needs no sort, and the point plugins
(scatter, density) do not care at all.
Implementations§
Source§impl PluginStaticConfig
impl PluginStaticConfig
Sourcepub fn positional_columns(&self) -> usize
pub fn positional_columns(&self) -> usize
The number of leading columns slots that are POSITIONAL: a drop
there swaps with the column already present, and the slot’s
meaning is fixed by Self::config_column_names. Everything from
this index on is the insert TAIL, which repeats the last named
role — which is why a Y Line (named slots: ["Y Axis"]) takes
any number of columns as additional Y series, while an
X/Y Line (["X Axis", "Y Axis", "Tooltip"]) pins its two axes
and treats the rest as further tooltips.
The single definition of that rule: Self::is_swap and the
agent’s list_plugins contract both derive from it, so the
convention cannot be read two different ways.
Sourcepub fn tail_column_role(&self) -> Option<&str>
pub fn tail_column_role(&self) -> Option<&str>
The role that columns past the positional slots repeat, i.e.
the last named slot. None when the plugin names no slots.
Sourcepub fn is_swap(&self, index: usize) -> bool
pub fn is_swap(&self, index: usize) -> bool
true if dropping a column at index should swap with the
column already there rather than insert.
pub fn get_group_rollups( &self, rollup_features: &[GroupRollupMode], ) -> Vec<GroupRollupMode>
pub fn get_split_rollups( &self, rollup_features: &[SplitRollupMode], ) -> Vec<SplitRollupMode>
Trait Implementations§
Source§impl Clone for PluginStaticConfig
impl Clone for PluginStaticConfig
Source§fn clone(&self) -> PluginStaticConfig
fn clone(&self) -> PluginStaticConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for PluginStaticConfig
impl Debug for PluginStaticConfig
Source§impl Default for PluginStaticConfig
impl Default for PluginStaticConfig
Source§fn default() -> PluginStaticConfig
fn default() -> PluginStaticConfig
Source§impl<'de> Deserialize<'de> for PluginStaticConfig
impl<'de> Deserialize<'de> for PluginStaticConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for PluginStaticConfig
impl PartialEq for PluginStaticConfig
impl StructuralPartialEq for PluginStaticConfig
Source§impl TS for PluginStaticConfig
impl TS for PluginStaticConfig
Source§type WithoutGenerics = PluginStaticConfig
type WithoutGenerics = PluginStaticConfig
WithoutGenerics should just be Self.
If the type does have generic parameters, then all generic parameters must be replaced with
a dummy type, e.g ts_rs::Dummy or ().
The only requirement for these dummy types is that EXPORT_TO must be None. Read moreSource§type OptionInnerType = PluginStaticConfig
type OptionInnerType = PluginStaticConfig
std::option::Option<T>, then this associated type is set to T.
All other implementations of TS should set this type to Self instead.Source§fn docs() -> Option<String>
fn docs() -> Option<String>
TS is derived, docs are
automatically read from your doc comments or #[doc = ".."] attributesSource§fn decl_concrete() -> String
fn decl_concrete() -> String
TS::decl().
If this type is not generic, then this function is equivalent to TS::decl().Source§fn decl() -> String
fn decl() -> String
type User = { user_id: number, ... }.
This function will panic if the type has no declaration. Read moreSource§fn inline() -> String
fn inline() -> String
{ user_id: number }.
This function will panic if the type cannot be inlined.Source§fn inline_flattened() -> String
fn inline_flattened() -> String
This function will panic if the type cannot be flattened.
Source§fn visit_generics(v: &mut impl TypeVisitor)where
Self: 'static,
fn visit_generics(v: &mut impl TypeVisitor)where
Self: 'static,
Source§fn output_path() -> Option<PathBuf>
fn output_path() -> Option<PathBuf>
T should be exported.The returned path does not include the base directory from
TS_RS_EXPORT_DIR. Read moreSource§fn visit_dependencies(v: &mut impl TypeVisitor)where
Self: 'static,
fn visit_dependencies(v: &mut impl TypeVisitor)where
Self: 'static,
Source§fn dependencies() -> Vec<Dependency>where
Self: 'static,
fn dependencies() -> Vec<Dependency>where
Self: 'static,
Source§fn export() -> Result<(), ExportError>where
Self: 'static,
fn export() -> Result<(), ExportError>where
Self: 'static,
TS::export_all. Read moreSource§fn export_all() -> Result<(), ExportError>where
Self: 'static,
fn export_all() -> Result<(), ExportError>where
Self: 'static,
To export only this type, without its dependencies, use
TS::export. Read moreSource§fn export_all_to(out_dir: impl AsRef<Path>) -> Result<(), ExportError>where
Self: 'static,
fn export_all_to(out_dir: impl AsRef<Path>) -> Result<(), ExportError>where
Self: 'static,
To export only this type, without its dependencies, use
TS::export. Read moreSource§fn export_to_string() -> Result<String, ExportError>where
Self: 'static,
fn export_to_string() -> Result<String, ExportError>where
Self: 'static,
Auto Trait Implementations§
impl Freeze for PluginStaticConfig
impl RefUnwindSafe for PluginStaticConfig
impl Send for PluginStaticConfig
impl Sync for PluginStaticConfig
impl Unpin for PluginStaticConfig
impl UnsafeUnpin for PluginStaticConfig
impl UnwindSafe for PluginStaticConfig
Blanket Implementations§
impl<Token, Builder, How> AllPropsFor<Builder, How> for Tokenwhere
Builder: Buildable<Token>,
<Builder as Buildable<Token>>::WrappedToken: HasAllProps<<Builder as Buildable<Token>>::Output, How>,
impl<T> Allocation for T
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> FromQuery for Twhere
T: DeserializeOwned,
impl<T> FromQuery for Twhere
T: DeserializeOwned,
impl<T> HasAllProps<(), T> for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoPropValue<Option<T>> for T
impl<T> IntoPropValue<Option<T>> for T
Source§fn into_prop_value(self) -> Option<T>
fn into_prop_value(self) -> Option<T>
self to a value of a Properties struct.Source§impl<T> IntoPropValue<T> for T
impl<T> IntoPropValue<T> for T
Source§fn into_prop_value(self) -> T
fn into_prop_value(self) -> T
self to a value of a Properties struct.