Table of Contents

Class BOBChartFilterContext

Namespace
BlazOrbit.Charts.Components
Assembly
BlazOrbit.Charts.dll
public class BOBChartFilterContext : ComponentBase
Inheritance
object
ComponentBase
BOBChartFilterContext

Constructors

BOBChartFilterContext()

public BOBChartFilterContext()

Properties

ChildContent

Charts and other Blazor content that share this filter context.

[Parameter]
[EditorRequired]
public RenderFragment? ChildContent { get; set; }

Property Value

RenderFragment

Filters

Snapshot of the active filters keyed by dimension name.

public IReadOnlyDictionary<string, object?> Filters { get; }

Property Value

IReadOnlyDictionary<string, object>

OnFiltersChanged

Raised after every SetFilter(string, object?) / ClearFilter(string) / ClearAll() mutation. Subscribers receive the snapshot of active filters keyed by dimension name; null values are skipped from the dictionary.

[Parameter]
public EventCallback<IReadOnlyDictionary<string, object?>> OnFiltersChanged { get; set; }

Property Value

EventCallback<IReadOnlyDictionary<string, object>>

Methods

BuildRenderTree(RenderTreeBuilder)

Renders the component to the supplied Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder.

protected override void BuildRenderTree(RenderTreeBuilder __builder)

Parameters

__builder RenderTreeBuilder

ClearAll()

Drops every active filter. Subscribed charts return to their unfiltered view.

public Task ClearAll()

Returns

Task

ClearFilter(string)

Removes the filter for a single dimension. No-op when none was set.

public Task ClearFilter(string dimension)

Parameters

dimension string

Returns

Task

GetFilter(string)

Returns the active value for dimension, or null when the dimension has no filter set.

public object? GetFilter(string dimension)

Parameters

dimension string

Returns

object

Matches(string, object?)

Returns true when the supplied value matches the active filter for dimension, or when the dimension has no active filter (no filter = "everything passes"). Charts use this to dim non-matching geometry without removing it from the render tree.

public bool Matches(string dimension, object? value)

Parameters

dimension string
value object

Returns

bool

SetFilter(string, object?)

Sets the filter value for a named dimension (e.g. "region", "product"). Passing null as value removes the dimension from the active set - equivalent to ClearFilter(string). Triggers a notification and a re-render via the cascading parameter.

public Task SetFilter(string dimension, object? value)

Parameters

dimension string
value object

Returns

Task