Module vGraph

vGraph is a class for creating histograms, envelope plots and such things

Functions

compute_peak_value () return the maximum value in our set
update () complete display update, use sparingly
handle_bar_clicked (idx) determine response when clicking bar (invoke click_notifier)
value_to_bitmap (val, part) retrieve the matching for a value between 0-self._height
apply_to_bar (idx, fn) do "something" to the bitmaps that make up a single bar this method allows us to avoid having to update the entire graph
get_bitmap_ids (idx, rpt) return the two bitmaps that together form a single line
add_line_elements (lower_id, middle_id, upper_id, line_id, idx, val, is_selected) add the elements that together form a single line
remove_line_elements (lower_id, middle_id, upper_id, line_id) remove the elements that together form a single line
decide_bitmap_size (val) for a line, compute how large bitmaps we are going to use
selection_handler (changed, added, removed) update display after having called the selection class
get_data () Getters and setters
get_value_quant () [[

Fields

self.selection (vSelection)
self._data (table>number) the numeric data to operate on
self._draw_mode (vGraph.DRAW_MODE)
self._value_max (number) the maximum possible value
self._value_min (number) the minimum possible value
self._select_mode (vSelection.SELECT_MODE)
self.selected_index (int) the index of the (first) selected item
self.selected_indices (table > int) return indices of selected items
self.require_selection (bool) enforce that at least one item remains selected at all times
self.style_normal (vLib.BITMAP_STYLES)
self.style_selected (vLib.BITMAP_STYLES)
self._click_notifier (function) callback function for when a bar is clicked
self._selection_notifier (function) callback function for when selection has changed
self.uid (string) unique identifier for views


Functions

compute_peak_value ()
return the maximum value in our set
update ()
complete display update, use sparingly
handle_bar_clicked (idx)
determine response when clicking bar (invoke click_notifier)

Parameters:

  • idx
value_to_bitmap (val, part)
retrieve the matching for a value between 0-self._height

Parameters:

  • val (number)
  • part (string) "upper" or "lower"
apply_to_bar (idx, fn)
do "something" to the bitmaps that make up a single bar this method allows us to avoid having to update the entire graph

Parameters:

  • idx
  • fn
get_bitmap_ids (idx, rpt)
return the two bitmaps that together form a single line

Parameters:

  • idx
  • rpt
add_line_elements (lower_id, middle_id, upper_id, line_id, idx, val, is_selected)
add the elements that together form a single line

Parameters:

  • lower_id
  • middle_id
  • upper_id
  • line_id
  • idx
  • val
  • is_selected
remove_line_elements (lower_id, middle_id, upper_id, line_id)
remove the elements that together form a single line

Parameters:

  • lower_id
  • middle_id
  • upper_id
  • line_id
decide_bitmap_size (val)
for a line, compute how large bitmaps we are going to use

Parameters:

  • val (number)

Returns:

  1. val_lower
  2. val_middle
  3. val_upper
selection_handler (changed, added, removed)
update display after having called the selection class

Parameters:

  • changed
  • added
  • removed
get_data ()
Getters and setters
get_value_quant ()
[[

Fields

self.selection
(vSelection)
self._data
(table>number) the numeric data to operate on
self._draw_mode
(vGraph.DRAW_MODE)
self._value_max
(number) the maximum possible value
self._value_min
(number) the minimum possible value
self._select_mode
(vSelection.SELECT_MODE)
self.selected_index
(int) the index of the (first) selected item
self.selected_indices
(table > int) return indices of selected items
self.require_selection
(bool) enforce that at least one item remains selected at all times
self.style_normal
(vLib.BITMAP_STYLES)
self.style_selected
(vLib.BITMAP_STYLES)
self._click_notifier
(function) callback function for when a bar is clicked
  • elm (vGraph)
  • index (int) the bar index
self._selection_notifier
(function) callback function for when selection has changed
  • elm (vGraph)
self.uid
(string) unique identifier for views
generated by LDoc 1.4.2