class AsciiBarCharter

Defined in:

ascii_bar_charter.cr

Constant Summary

BAR_CHARS = ['▿', '_', '▁', '▂', '▃', '▄', '▅', '▆', '▇', '█', '▴']
BAR_CHARS_ALT = ['■', '□', '▫', '☾', '◵', '◉', '◷', '☽', '▹', '▷', '▶']
BAR_COLORS = [:blue, :light_blue, :cyan, :light_cyan, :green, :light_green, :yellow, :light_magenta, :magenta, :light_red, :red]
BAR_COLORS_ALT = [:magenta, :red, :light_red, :light_yellow, :yellow, :black, :cyan, :light_cyan, :light_green, :green, :blue]
BKGD_COLOR = :white
VERSION = {{ (`shards version \"/srv/crystaldoc.info/github-drhuffman12-ascii_bar_charter-v1.4.1/src\"`).chomp.stringify }}

Constructors

Class Method Summary

Instance Method Summary

Constructor Detail

def self.new(min : Float64, max : Float64, precision : Int8, bar_chars : Array(Char) = BAR_CHARS, bar_colors : Array(Symbol) = BAR_COLORS, bkgd_color : Symbol = BKGD_COLOR, in_bw : Bool = false, inverted_chars : Bool = false, inverted_colors : Bool = false) #

[View source]

Class Method Detail

def self.permutations(min = -1.0, max = 1.0, precision = 3.to_i8, bar_chars = AsciiBarCharter::BAR_CHARS, bar_colors = AsciiBarCharter::BAR_COLORS, bkgd_color = AsciiBarCharter::BKGD_COLOR, in_bw = false, inverted_chars = false, inverted_colors = false) #

[View source]
def self.show_examples #

[View source]
def self.show_examples_with_params #

[View source]

Instance Method Detail

def bar(single_data, as_bar = true) #

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

[View source]
def bar_chars=(bar_chars : Array(Char)) #

[View source]
def bar_colors : Array(Symbol) #

TODO allow usage of colors like Colorize::ColorRGB.new(0, 255, 255) i.e.: getter bar_colors : Array(Symbol | Colorize::ColorRGB)


[View source]
def bar_prefixed_with_number(single_data) #

[View source]
def bar_step_qty : Int32 #

[View source]
def bkgd_color : Symbol #

[View source]
def bkgd_color=(bkgd_color : Symbol) #

[View source]
def in_bw : Bool #

[View source]
def inverted_chars : Bool #

[View source]
def inverted_chars=(inverted_chars : Bool) #

[View source]
def inverted_colors : Bool #

[View source]
def inverted_colors=(inverted_colors : Bool) #

[View source]
def max : Float64 #

[View source]
def min : Float64 #

[View source]
def min_max_delta : Float64 #

[View source]
def plot(data, prefixed = false) #

[View source]
def precision : Int8 #

[View source]
def reset_bar_chars(new_bar_chars : Array(Char) = BAR_CHARS) #

[View source]
def reset_bar_colors(new_bar_colors : Array(Symbol) = BAR_COLORS) #

[View source]
def reset_bars(new_bar_chars : Array(Char) = BAR_CHARS, new_bar_colors : Array(Symbol) = BAR_COLORS) #

[View source]
def toggle_bw #

[View source]
def validate! #

[View source]