API ReferenceGE ExtensionseditorvehicleEditorstaticEditor
Vehicle Editor - JBeam Table Visualizer
Visualizes numeric table data from JBeam files as interactive 2D plots with Catmull-Rom curve interpolation, useful for inspecting torque curves, gear ratios, and other tabular data.
Visualizes numeric table data from JBeam files as interactive 2D plots with Catmull-Rom curve interpolation, useful for inspecting torque curves, gear ratios, and other tabular data.
Module Exports
| Export | Type | Description |
|---|---|---|
M.menuEntry | string | "JBeam Table Visualizer" - menu label |
M.open | function | Opens the visualizer window |
M.onUpdate | hook | Renders ImGui window with file picker and graph |
M.onSerialize | hook | Persists window state |
M.onDeserialized | hook | Restores window state |
Key Internals
| Variable | Type | Purpose |
|---|---|---|
windowOpen | BoolPtr | Window visibility |
jbeamFileName | string/nil | Currently loaded file name |
jbeamFilePath | string/nil | Full path to loaded file |
graphableData | table | Sorted list of {pathToData, data} entries |
dataGraphingKey | number/nil | Index into graphableData for current plot |
plotHelperUtil | module | Plot rendering utility with auto-scale and curves |
How It Works
- User opens a JBeam file via file dialog
getGraphableData()recursively scans the parsed JSON:- Finds tables where all sub-entries are equally-sized arrays of numbers
- Strips the header row (first entry with string values)
- Records the hierarchical path (e.g.,
"partName > mainEngine > torque")
- User selects a dataset from a combo box
plotHelperUtilrenders the data as an interactive graph with:- Auto-scaling axes
- Catmull-Rom spline interpolation overlay
- Mouse-interactive zoom/pan
Lua Code Example
-- Open the table visualizer
extensions.editor_vehicleEditor_staticEditor_veJBeamTableVis.open()
-- Click "Open JBeam File..." to load a file via dialog:
-- editor_fileDialog.openFile(loadJBeamFile, {{"JBeam files", ".jbeam"}}, false, "/vehicles/")
-- Data discovery algorithm (getGraphableData):
-- Recursively walks parsed JSON looking for graphable tables:
-- - All children must be equally-sized arrays
-- - All non-first children must have numeric first two elements
-- Path is built hierarchically: "partName > section > subsection"
-- Example of graphable data in JBeam:
-- "torque": [
-- ["rpm", "torque"], <- header (stripped)
-- [0, 0], <- data points
-- [1000, 120],
-- [3000, 200],
-- [6000, 180]
-- ]
-- Select data from combo box dropdown:
-- if im.Selectable1(pathToData) then
-- plotHelperUtil:setData(data)
-- end
-- "Refresh" button reloads the file and updates the current graph:
-- loadJBeamFileInMemory(nil) -- nil = refresh current file
-- Plot utility with auto-scale and Catmull-Rom curves:
-- local plotHelperUtil = require('/lua/ge/extensions/editor/util/plotHelperUtil')(params)
-- plotHelperUtil:draw(width, height, dt)See Also
- Vehicle Editor - JBeam Beautifier - Related reference
- Vehicle Editor - JBeam Modifier Leaking Visualizer - Related reference
- Vehicle Editor - JBeam Spellchecker - Related reference
- World Editor Guide - Guide
Vehicle Editor - JBeam Spellchecker
Validates JBeam modifier names across all vehicle files by checking them against a whitelist of known valid modifiers per section type.
Vehicle Editor - JBeam Variables Checker
Validates that JBeam variable values (both defaults and vehicle configuration overrides) fall within their declared min/max ranges across all vehicle directories.