Module core.Filter

Visualization filter.

Functions

Filter.load (tbl) Loads a filter from a pre-built table.
Filter.new () Constructor.
Filter:add (value, label) Adds a pair to the filter values.
Filter:foreach (f) Runs a functions for every value pair in the filter.
Filter:get_label (value, label) Gets the label relative to the specified value.
Filter:serialize () Serializes the filter to a Lua table.
Filter:sort () Sorts the filter.


Functions

Filter.load (tbl)
Loads a filter from a pre-built table.

Parameters

  • tbl: Pre-build table
Filter.new ()
Constructor.

Return value:

New Filter instance
Filter:add (value, label)
Adds a pair to the filter values.

Parameters

  • value: Value of the pair
  • label: Label of the pair
Filter:foreach (f)
Runs a functions for every value pair in the filter.

Parameters

  • f: Callback function, in the form function f(value, label)
Filter:get_label (value, label)
Gets the label relative to the specified value.

Parameters

  • value: Value to be searched
  • label: Label referenced by the specified value
Filter:serialize ()
Serializes the filter to a Lua table.

Return value:

The serialized filter
Filter:sort ()
Sorts the filter.

Valid XHTML 1.0!