Skip to content

luxe API (2025.1.2)


luxe: plot module


Plot

import "luxe: plot" for Plot

A service API to plot values for games + debugging. Can plot values from anywhere as a counter or as a running history. Counter plots add values to their total and add the total to the history at the end of the frame.


Plot.define(id: String, type: PlotType) returns unknown

Define a new plot by id, with the given type. The max history defaults to 60 values if not specified.

Plot.define(id: String, type: PlotType, max_history: Num) returns unknown

Define a new plot by id, with the given type and max_history

Plot.update(id: String, value: Num) returns unknown

Update a given plot by id, with the given value. For PlotType.normal this will add the value to the history. For PlotType.counter this will add the value to the total so far this frame.

Plot.list() returns unknown

Get a list of plots defined, as string id (e.g Strings.get(id) is needed)

Plot.history(id: String) returns List

Get the history for a given plot, as a list of values

Plot.latest(id: String) returns Num

Get the latest value for a given plot

Plot.average(id: String) returns Num

Get the average value for a given plot, averaging out the history