Module vGraph
vGraph is a class for creating histograms, envelope plots and such things
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 () |
[[ |
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:
-
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:
-
get_bitmap_ids (idx, rpt)
-
return the two bitmaps that together form a single line
Parameters:
-
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:
Returns:
-
val_lower
-
val_middle
-
val_upper
-
selection_handler (changed, added, removed)
-
update display after having called the selection class
Parameters:
-
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
-
self.uid
-
(string) unique identifier for views