Class: Vis::DataView
- Inherits:
-
Object
- Object
- Vis::DataView
- Includes:
- Native, DataCommon, EventSupport, Utilities
- Defined in:
- lib/vis/data_view.rb
Instance Attribute Summary collapse
-
#event_handlers ⇒ Object
readonly
Returns the value of attribute event_handlers.
Instance Method Summary collapse
- #get_data_set ⇒ Object
-
#initialize(data_set_or_view, options = {}) ⇒ DataView
constructor
A new instance of DataView.
- #set_data(data_set_or_view) ⇒ Object
Methods included from DataCommon
#[], #get, #get_ids, #off, #on, #options_to_native
Methods included from EventSupport
Methods included from Utilities
#hash_array_to_native, included, #lower_camelize, #lower_camelize_hash, #native_to_hash_array
Constructor Details
#initialize(data_set_or_view, options = {}) ⇒ DataView
Returns a new instance of DataView.
13 14 15 16 17 18 |
# File 'lib/vis/data_view.rb', line 13 def initialize(data_set_or_view, = {}) = () @data_set_or_view = data_set_or_view @event_handlers = {} @native = `new vis.DataView(data_set_or_view.$to_n(), native_options)` end |
Instance Attribute Details
#event_handlers ⇒ Object (readonly)
Returns the value of attribute event_handlers.
11 12 13 |
# File 'lib/vis/data_view.rb', line 11 def event_handlers @event_handlers end |
Instance Method Details
#get_data_set ⇒ Object
20 21 22 |
# File 'lib/vis/data_view.rb', line 20 def get_data_set @data_set_or_view end |
#set_data(data_set_or_view) ⇒ Object
24 25 26 27 |
# File 'lib/vis/data_view.rb', line 24 def set_data(data_set_or_view) @data_set_or_view = data_set_or_view @native.JS.setData(data_set_or_view.to_n) end |