Class: RatatuiRuby::Widgets::Axis

Inherits:
Object
  • Object
show all
Includes:
CoerceableWidget
Defined in:
lib/ratatui_ruby/widgets/chart.rb

Overview

Defines an Axis for a Chart

title

String

bounds

Array<Float> [min, max]

labels

Array<String>

style

Style

labels_alignment

Symbol (:left, :center, :right)

Instance Method Summary collapse

Methods included from CoerceableWidget

included

Constructor Details

#initialize(title: "", bounds: [0.0, 10.0], labels: [], style: nil, labels_alignment: nil) ⇒ Axis

Creates a new Axis.

title

String.

bounds

Array [min, max].

labels

Array of Strings.

style

Style.

labels_alignment

Symbol (:left, :center, :right).



46
47
48
49
50
51
52
53
54
# File 'lib/ratatui_ruby/widgets/chart.rb', line 46

def initialize(title: "", bounds: [0.0, 10.0], labels: [], style: nil, labels_alignment: nil)
  super(
    title:,
    bounds: [Float(bounds[0]), Float(bounds[1])],
    labels:,
    style:,
    labels_alignment:
  )
end