Class: Vega::LiteChart

Inherits:
BaseChart show all
Defined in:
lib/vega/lite_chart.rb

Instance Method Summary collapse

Methods inherited from BaseChart

#embed_options!, #to_html, #to_iruby, #to_iruby_mimebundle, #to_json

Constructor Details

#initializeLiteChart

Returns a new instance of LiteChart.



13
14
15
16
# File 'lib/vega/lite_chart.rb', line 13

def initialize
  @schema = "https://vega.github.io/schema/vega-lite/v5.json"
  super()
end

Instance Method Details

#data!(value) ⇒ Object



18
19
20
21
# File 'lib/vega/lite_chart.rb', line 18

def data!(value)
  @spec[:data] = data_value(value)
  self
end

#spec(*args) ⇒ Object



25
26
27
28
29
30
31
# File 'lib/vega/lite_chart.rb', line 25

def spec(*args)
  if args.empty?
    @spec
  else
    dup.spec!(*args)
  end
end

#to_pdfObject



41
42
43
# File 'lib/vega/lite_chart.rb', line 41

def to_pdf
  export("vl2pdf")
end

#to_pngObject



33
34
35
# File 'lib/vega/lite_chart.rb', line 33

def to_png
  export("vl2png")
end

#to_svgObject



37
38
39
# File 'lib/vega/lite_chart.rb', line 37

def to_svg
  export("vl2svg")
end