module Diorite::ChartBuilder

Overview

Algorithmic geometry synthesizer for data visualization (Pie/Donut charts, Bar charts, Gauges).

Emits line-list vertices and colors directly to immediate-mesh vertex arrays with zero GC pressure.

Included Modules

Defined in:

diorite/core/chart_builder.cr

Class Method Summary

Class methods inherited from module Diorite::MathHelpers

deg_to_rad(degrees : Number) : Float32 deg_to_rad, find_perpendicular(normal : Godot::Vector3) : Godot::Vector3 find_perpendicular, orthonormal_plane(normal : Godot::Vector3) : Tuple(Godot::Vector3, Godot::Vector3) orthonormal_plane, rad_to_deg(radians : Number) : Float32 rad_to_deg, rotate_around_axis(point : Godot::Vector3, axis : Godot::Vector3, theta : Float32) : Godot::Vector3 rotate_around_axis

Class Method Detail

def self.build_bar_chart_2d(rect : Godot::Rect2, bars : Array(BarData), horizontal : Bool, verts : Array(Godot::Vector2), cols : Array(Godot::Color)) : Void #

Builds a 2D Bar chart with axis frame and bar outlines.


[View source]
def self.build_gauge_2d(center : Godot::Vector2, radius : Float32, value : Float32, min_val : Float32, max_val : Float32, color : Godot::Color, verts : Array(Godot::Vector2), cols : Array(Godot::Color), start_angle : Float32 = 2.3561945_f32, end_angle : Float32 = 7.0685834_f32, ticks : Int32 = 6) : Void #

Builds a 2D radial gauge with scale ticks and needle indicator.


[View source]
def self.build_gauge_3d(center : Godot::Vector3, normal : Godot::Vector3, radius : Float32, value : Float32, min_val : Float32, max_val : Float32, color : Godot::Color, verts : Array(Godot::Vector3), cols : Array(Godot::Color), start_angle : Float32 = 2.3561945_f32, end_angle : Float32 = 7.0685834_f32, ticks : Int32 = 6) : Void #

Builds a 3D radial gauge oriented on a plane by normal.


[View source]
def self.build_pie_chart_2d(center : Godot::Vector2, radius : Float32, inner_radius : Float32, slices : Array(PieSlice), verts : Array(Godot::Vector2), cols : Array(Godot::Color), segments_per_full_turn : Int32 = 64) : Void #

Builds a 2D Pie or Donut chart on the canvas overlay.


[View source]
def self.build_pie_chart_3d(center : Godot::Vector3, normal : Godot::Vector3, radius : Float32, inner_radius : Float32, slices : Array(PieSlice), verts : Array(Godot::Vector3), cols : Array(Godot::Color), segments_per_full_turn : Int32 = 64) : Void #

Builds a 3D Pie or Donut chart oriented by normal.


[View source]