Opal::UI::EquationViewer
Inherits Opal::UI::Control < Opal::UI::InputHookable < Opal::UI::Element < Opal::UI::Themable < Reference < Object
Mathematical equation viewer and interactive 2D function grapher. Features 2D Unicode mathematical typesetting (fractions, integrals, radicals, summations) and interactive Cartesian graphing f(x) with braille sub-pixel rendering, zoom, and pan.
Constants
SUBSCRIPTS = {'0' => '₀', '1' => '₁', '2' => '₂', '3' => '₃', '4' => '₄', '5' => '₅', '6' => '₆', '7' => '₇', '8' => '₈', '9' => '₉', '+' => '₊', '-' => '₋', '=' => '₌', '(' => '₍', ')' => '₎', 'a' => 'ₐ', 'e' => 'ₑ', 'i' => 'ᵢ', 'j' => 'ⱼ', 'k' => 'ₖ', 'n' => 'ₙ', 'x' => 'ₓ'}
SUPERSCRIPTS = {'0' => '⁰', '1' => '¹', '2' => '²', '3' => '³', '4' => '⁴', '5' => '⁵', '6' => '⁶', '7' => '⁷', '8' => '⁸', '9' => '⁹', '+' => '⁺', '-' => '⁻', '=' => '⁼', '(' => '⁽', ')' => '⁾', 'n' => 'ⁿ', 'i' => 'ⁱ', 'x' => 'ˣ', 'y' => 'ʸ'}
Unicode character map for superscripts and subscripts
Constructors
Class methods
Converts a regular string with ^(exp) or _(sub) into Unicode super/subscripts
Instance methods
axis_color
Sourceaxis_color=(axis_color : Color)
Sourceborder_color
Sourceborder_color=(border_color : Color)
Sourceformula_color
Sourceformula_color=(formula_color : Color)
SourceFunction to graph: receives float x and returns float y = f(x)
function_title
Sourcegrid_color
Sourcegrid_color=(grid_color : Color)
SourceDefault key event handler. Override in subclasses if not using @default_input_proc.
Default mouse event handler. Override in subclasses if not using @default_input_proc.
height
Sourcelast_h
Sourcelast_w
Sourcelast_x
Sourcelast_y
Sourcemath_nodes
Sourcerender(buffer : Buffer) : Nil
Sourceshow_formula?
Sourcewidth
Sourcex_max
Sourcey_max
Sourcey_min
Source