class UnicodePlot::DotCanvas

Overview

Dot canvas — 2 vertical sub-pixels per character cell. Upper sub-pixel → ''', lower sub-pixel → '.', both → ':', neither → ' '.

Defined in:

unicode_plot/canvas/dot_canvas.cr

Constant Summary

DOT_CHARS = [' ', '\'', '.', ':']

Indexed by bitmask: bit0=upper set, bit1=lower set

EMPTY_CHAR = ' '

Constructors

Instance Method Summary

Instance methods inherited from class UnicodePlot::Canvas

annotate!(x : Float64, y : Float64, char : Char, color : UInt32, blend : Bool) : self
annotate!(x : Float64, y : Float64, text : String, color : UInt32, blend : Bool, halign : Symbol = :center, valign : Symbol = :center) : self
annotate!
, blank : Char blank, blend? : Bool blend?, char_point!(col : Int32, row : Int32, char : Char, color : UInt32, blend : Bool) : Nil char_point!, color_at(row : Int32, col : Int32) : UInt32 color_at, color_set!(row : Int32, col : Int32, color : UInt32) : Nil color_set!, grid_at(row : Int32, col : Int32) : UInt32 grid_at, grid_char_at(row : Int32, col : Int32) : Char grid_char_at, grid_set!(row : Int32, col : Int32, val : UInt32) : Nil grid_set!, height : Float64 height, lines!(x1 : Float64, y1 : Float64, x2 : Float64, y2 : Float64, color : UInt32, blend : Bool) : self
lines!(xs : Array(Float64), ys : Array(Float64), color : UInt32, blend : Bool) : self
lines!(x1 : Float64, y1 : Float64, x2 : Float64, y2 : Float64, *, color : Symbol = :normal) : self
lines!
, ncols : Int32 ncols, nrows : Int32 nrows, origin_x : Float64 origin_x, origin_y : Float64 origin_y, pixel!(pixel_x : Int32, pixel_y : Int32, color : UInt32, blend : Bool) : self
pixel!(pixel_x : Int32, pixel_y : Int32, *, color : UInt32 = INVALID_COLOR) : self
pixel!
, pixel_height : Int32 pixel_height, pixel_width : Int32 pixel_width, points!(x : Float64, y : Float64, color : UInt32, blend : Bool) : self
points!(xs : Array(Float64), ys : Array(Float64), color : UInt32, blend : Bool) : self
points!(x : Float64, y : Float64, *, color : Symbol = :normal) : self
points!
, print_row(io : IO, row : Int32, use_color : Bool) : Nil print_row, scale_x_to_pixel(x : Float64) : Float64 scale_x_to_pixel, scale_y_to_pixel(y : Float64) : Float64 scale_y_to_pixel, set_color!(col : Int32, row : Int32, color : UInt32, blend : Bool) : Nil set_color!, valid_x?(x : Float64) : Bool valid_x?, valid_x_pixel?(px : Int32) : Bool valid_x_pixel?, valid_y?(y : Float64) : Bool valid_y?, valid_y_pixel?(py : Int32) : Bool valid_y_pixel?, visible? : Bool visible?, width : Float64 width, x_pixel_per_char : Int32 x_pixel_per_char, x_to_pixel(x : Float64) : Float64 x_to_pixel, xflip? : Bool xflip?, xscale : Proc(Float64, Float64) xscale, y_pixel_per_char : Int32 y_pixel_per_char, y_to_pixel(y : Float64) : Float64 y_to_pixel, yflip? : Bool yflip?, yscale : Proc(Float64, Float64) yscale

Constructor methods inherited from class UnicodePlot::Canvas

new(nrows : Int32, ncols : Int32, visible : Bool, blend : Bool, yflip : Bool, xflip : Bool, pixel_height : Int32, pixel_width : Int32, origin_y : Float64, origin_x : Float64, height : Float64, width : Float64, yscale : Proc(Float64, Float64), xscale : Proc(Float64, Float64), fill_value : UInt32) new

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(char_height : Int32, char_width : Int32, *, visible : Bool = true, blend : Bool = true, origin_y : Float64 = 0.0, origin_x : Float64 = 0.0, height : Float64 = 1.0, width : Float64 = 1.0, yflip : Bool = false, xflip : Bool = false, yscale : Symbol | Proc(Float64, Float64) = :identity, xscale : Symbol | Proc(Float64, Float64) = :identity) #

[View source]

Instance Method Detail

def blank : Char #

[View source]
def grid_char_at(row : Int32, col : Int32) : Char #
Description copied from class UnicodePlot::Canvas

Map grid value to display character. Must be overridden by subclasses.


[View source]
def pixel!(pixel_x : Int32, pixel_y : Int32, color : UInt32, blend : Bool) : self #

[View source]
def x_pixel_per_char : Int32 #

[View source]
def y_pixel_per_char : Int32 #

[View source]