Skip to main content

Class: Filter

dg.Filter

Base class for DataFrame-bound filtering controls. Supports collaborative filtering by efficiently working together with other filters.

Hierarchy

Constructors

constructor

new Filter()

Overrides

Widget.constructor

Defined in

src/widgets.ts:342

Properties

_properties

Protected _properties: Property[]

Inherited from

Widget._properties

Defined in

src/widgets.ts:178


_root

Protected _root: HTMLElement

Inherited from

Widget._root

Defined in

src/widgets.ts:177


column

column: null | Column<any> = null

A column this filter is associated with.

Defined in

src/widgets.ts:335


columnName

Optional columnName: string

Defined in

src/widgets.ts:337


controls

controls: HTMLDivElement

Group of control icons on the right of the filter header, after the name. FilterGroup takes care of its visibility.

Defined in

src/widgets.ts:329


dart

dart: any

Inherited from

Widget.dart

Defined in

src/widgets.ts:181


dataFrame

dataFrame: null | DataFrame

A DataFrame this filter is associated with.

Defined in

src/widgets.ts:332


factory

factory: null | Func = null

Constructor function. No parameters, returns [Widget].

Inherited from

Widget.factory

Defined in

src/widgets.ts:175


indicator

indicator: HTMLDivElement

An indicator icon on the left of the filter header, before the name. A filter is responsible for hiding or showing it, depending on its state.

Defined in

src/widgets.ts:325


isDetached

isDetached: boolean = false

Inherited from

Widget.isDetached

Defined in

src/widgets.ts:182


props

props: any

Inherited from

Widget.props

Defined in

src/widgets.ts:179


subs

subs: Subscription[]

Inherited from

Widget.subs

Defined in

src/widgets.ts:180


temp

temp: any

Contains auxiliary information

Inherited from

Widget.temp

Defined in

src/widgets.ts:172

Accessors

caption

get caption(): string

Caption to be shown in the filter group.

Returns

string

Defined in

src/widgets.ts:340


filterSummary

Abstract get filterSummary(): string

Override to provide short filter summary that might be shown on viewers or in the context panel.

Returns

string

Defined in

src/widgets.ts:375


isFiltering

get isFiltering(): boolean

Override to indicate whether the filter actually filters something (most don't in the initial state). This is used to minimize the number of unnecessary computations. Make sure to call super.isFiltering to check whether the filter has been disabled by the user

Returns

boolean

Defined in

src/widgets.ts:366


isReadyToApplyFilter

get isReadyToApplyFilter(): boolean

Whether a filter is ready to apply the filtering mask synchronously.

Returns

boolean

Defined in

src/widgets.ts:372


root

get root(): HTMLElement

Widget's visual root.

Returns

HTMLElement

Inherited from

Widget.root

Defined in

src/widgets.ts:259

set root(r): void

Parameters

NameType
rHTMLElement

Returns

void

Inherited from

Widget.root

Defined in

src/widgets.ts:260


type

get type(): string

Returns

string

Inherited from

Widget.type

Defined in

src/widgets.ts:169

Methods

addProperty

Private addProperty(propertyName, propertyType, defaultValue?, options?): any

Registers an property with the specified type, name, and defaultValue. Registered property gets added to {@see properties}. Returns default value, thus allowing to combine registering a property with the initialization

Parameters

NameTypeDefault value
propertyNamestringundefined
propertyType"string" | "bigint" | "object" | "map" | "file" | "view" | "element" | "int" | "double" | "bool" | "byte_array" | "datetime" | "qnum" | "dataframe" | "num" | "string_list" | "dataframe_list" | "cell" | "column" | "column_list" | "graphics" | "tablerowfiltercall" | "colfiltercall" | "bitset" | "dynamic" | "viewer" | "list" | "semantic_value" | "func" | "funccall" | "property" | "categorical" | "numerical" | "GridCellRenderArgs" | "TableView" | "User" | "Menu" | "Project" | "event_data" | "progressindicator" | "Credentials" | "ScriptEnvironment" | "Notebook"undefined
defaultValueanynull
optionsnull | { [key: string]: any; } & PropertyOptionsnull

Returns

any

Inherited from

Widget.addProperty

Defined in

src/widgets.ts:280


apply

apply(properties): Widget<any>

Parameters

NameType
propertiesobject

Returns

Widget<any>

Inherited from

Widget.apply

Defined in

src/widgets.ts:230


applyFilter

Abstract applyFilter(): void

Override to filter the dataframe. The method should work with this.dataFrame.filter, should disregard false values (these are filtered out already by other filters), and should filter out corresponding indexes.

Returns

void

Defined in

src/widgets.ts:381


applyState

applyState(state): void

Override to load filter state.

Parameters

NameType
stateany

Returns

void

Defined in

src/widgets.ts:393


attach

attach(dataFrame): void

Gets called when a data frame is attached. Make sure to call super.attach(dataFrame) when overriding.

Parameters

NameType
dataFrameDataFrame

Returns

void

Defined in

src/widgets.ts:402


detach

detach(): void

Gets called when a widget is detached and will no longer be used. Typically used for unsubscribing from events. Be sure to call super.detach() if this method is overridden.

Returns

void

Overrides

Widget.detach

Defined in

src/widgets.ts:418


getDartProperties

getDartProperties(): any[]

Returns

any[]

Inherited from

Widget.getDartProperties

Defined in

src/widgets.ts:246


getProperties

getProperties(): Property[]

Returns

Property[]

Inherited from

Widget.getProperties

Defined in

src/widgets.ts:240


onFrameAttached

onFrameAttached(dataFrame): void

Parameters

NameType
dataFrameDataFrame

Returns

void

Inherited from

Widget.onFrameAttached

Defined in

src/widgets.ts:252


onPropertyChanged

onPropertyChanged(property): void

Gets called when viewer's property is changed.

Parameters

NameTypeDescription
propertynull | Propertyor null, if multiple properties were changed.

Returns

void

Inherited from

Widget.onPropertyChanged

Defined in

src/widgets.ts:244


refresh

refresh(): void

Gets called when a previously used filter gets moved in the DOM tree. Normally, you don't need to do anything, but this might be handy for the iframe-based filters.

Returns

void

Defined in

src/widgets.ts:416


saveState

saveState(): any

Override to save filter state.

Returns

any

Defined in

src/widgets.ts:384


sourceRowsChanged

sourceRowsChanged(): void

Returns

void

Inherited from

Widget.sourceRowsChanged

Defined in

src/widgets.ts:250


sub

sub(subscription): void

Registers a subscription to an external event.

Parameters

NameType
subscriptionSubscription

Returns

void

Inherited from

Widget.sub

Defined in

src/widgets.ts:223


toDart

toDart(): any

Returns

any

Inherited from

Widget.toDart

Defined in

src/widgets.ts:215


find

Static find(root): null | Widget<any>

Finds existing widget from its visual root.

Parameters

NameType
rootElement

Returns

null | Widget<any>

Inherited from

Widget.find

Defined in

src/widgets.ts:211


fromRoot

Static fromRoot(root): Widget<any>

Creates a new widget from the root element.

Parameters

NameType
rootHTMLElement

Returns

Widget<any>

Inherited from

Widget.fromRoot

Defined in

src/widgets.ts:303


getAll

Static getAll(): Widget<any>[]

Returns all currently active widgets.

Returns

Widget<any>[]

Inherited from

Widget.getAll

Defined in

src/widgets.ts:206