Module core.Map

Visualization map.

Functions

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


Functions

Map.load (tbl)
Loads a map from a pre-built table.

Parameters

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

Return value:

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

Parameters

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

Parameters

  • f: Callback function, in the form function f(value, label)
Map: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
Map:serialize ()
Serializes the map to a Lua table.

Return value:

The serialized map
Map:sort ()
Sorts the map.

Valid XHTML 1.0!