Class: Vis::DataView

Inherits:
Object
  • Object
show all
Includes:
Native, DataCommon, EventSupport, Utilities
Defined in:
lib/vis/data_view.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from DataCommon

#[], #get, #get_ids, #off, #on, #options_to_native

Methods included from EventSupport

#off, #on

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, options = {})
  native_options = options_to_native(options)
  @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_handlersObject (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_setObject



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