class UnicodePlot::BarplotGraphics

Defined in:

unicode_plot/graphics/bar_graphics.cr

Constructors

Instance Method Summary

Instance methods inherited from class UnicodePlot::GraphicsArea

blank : Char blank, ncols : Int32 ncols, nrows : Int32 nrows, preprocess(io : IO) : GraphicsArea -> preprocess, print_row(io : IO, row : Int32, use_color : Bool) : Nil print_row, to_s(io : IO) : Nil to_s, visible? : Bool visible?

Constructor Detail

def self.new(bars : Array(Float64), char_width : Int32, *, symbols : Array(Char) = ['■'], color : Symbol | Int32 | Tuple(Int32, Int32, Int32) | Array(Symbol) | Array(Int32) | Array(UInt32) | UInt32 = :green, maximum : Float64 | Nil = nil, formatter : Proc(Float64, String) | Nil = nil, visible : Bool = true, xscale : Symbol | Proc(Float64, Float64) = :identity) #

[View source]

Instance Method Detail

def add_row!(bars : Array(Float64), color : Symbol | Int32 | UInt32 | Tuple(Int32, Int32, Int32) | Nil = nil) : self #

[View source]
def add_row!(bar : Float64, color : Symbol | Int32 | UInt32 | Tuple(Int32, Int32, Int32) | Nil = nil) : self #

[View source]
def bars : Array(Float64) #

[View source]
def blank : Char #

[View source]
def colors : Array(UInt32) #

[View source]
def formatter : Proc(Float64, String) #

[View source]
def max_len : Int32 #

[View source]
def max_len=(max_len : Int32) #

[View source]
def max_val : Float64 #

Computed per-render (set in preprocess, cleared in cleanup)


[View source]
def max_val=(max_val : Float64) #

Computed per-render (set in preprocess, cleared in cleanup)


[View source]
def maximum : Float64 #

[View source]
def ncols : Int32 #

[View source]
def nrows : Int32 #

[View source]
def preprocess(io : IO) : GraphicsArea -> #
Description copied from class UnicodePlot::GraphicsArea

Preprocessing hook (returns cleanup proc). Override in subclasses that need it.


[View source]
def print_row(io : IO, row : Int32, use_color : Bool) : Nil #
Description copied from class UnicodePlot::GraphicsArea

Print a single row. Implementations add ANSI color via use_color.


[View source]
def symbols : Array(Char) #

[View source]
def visible? : Bool #

[View source]
def xscale : Proc(Float64, Float64) #

[View source]