LuaSTG-x Core API
implot Class Reference

Classes

class  ImPlotInputMap
 
class  ImPlotLimits
 
class  ImPlotPoint
 
class  ImPlotRange
 
class  ImPlotStyle
 

Public Member Functions

static function beginPlot (local title_id, local x_label, local y_label, local size, local flags, local x_flags, local y_flags, local y2_flags, local y3_flags)
 
static function endPlot ()
 
static function getColormapColor (local index)
 
static function getColormapSize ()
 
static function getInputMap ()
 
static function getPlotLimits ()
 
static function getPlotMousePos ()
 
static function getPlotPos ()
 
static function getPlotQuery ()
 
static function getPlotSize ()
 
static function getStyle ()
 
static function isPlotHovered ()
 
static function isPlotQueried ()
 
static function lerpColormap (local t)
 
static function pixelsToPlot (local pix, local y_axis)
 
static function plotBars (local label_id, local values, local count, local width, local shift, local offset)
 
static function plotBarsH (local label_id, local values, local count, local height, local shift, local offset)
 
static function plotDigital (local label_id, local xs, local ys, local count, local offset)
 
static function plotErrorBars (local label_id, local xs, local ys, local err, local count, local offset)
 
static function plotErrorBars (local label_id, local xs, local ys, local neg, local pos, local count, local offset)
 
static function plotErrorBarsH (local label_id, local xs, local ys, local err, local count, local offset)
 
static function plotErrorBarsH (local label_id, local xs, local ys, local neg, local pos, local count, local offset)
 
static function plotHeatmap (local label_id, local values, local rows, local cols, local scale_min, local scale_max, local label_fmt, local bounds_min, local bounds_max)
 
static function plotLine (local label_id, local data, local count, local offset)
 
static function plotLine (local label_id, local values, local count, local offset)
 
static function plotLine (local label_id, local xs, local ys, local count, local offset)
 
static function plotPieChart (local label_ids, local values, local count, local x, local y, local radius, local normalize, local label_fmt, local angle0)
 
static function plotScatter (local label_id, local data, local count, local offset)
 
static function plotScatter (local label_id, local values, local count, local offset)
 
static function plotScatter (local label_id, local xs, local ys, local count, local offset)
 
static function plotShaded (local label_id, local xs, local ys1, local ys2, local count, local offset)
 
static function plotText (local text, local x, local y, local vertical, local pixel_offset)
 
static function plotToPixels (local plt, local y_axis)
 
static function popPlotClipRect ()
 
static function popStyleColor ()
 
static function popStyleVar ()
 
static function pushPlotClipRect ()
 
static function pushStyleColor (local idx, local col)
 
static function pushStyleVar (local idx, local val)
 
static function setColormap (local colormap, local samples)
 
static function setColormap (local colors)
 
static function setNextPlotLimits (local x_min, local x_max, local y_min, local y_max, local cond)
 
static function setNextPlotLimitsX (local x_min, local x_max, local cond)
 
static function setNextPlotLimitsY (local y_min, local y_max, local cond, local y_axis)
 
static function setNextPlotTicksX (local values, local n_ticks, local labels, local show_default)
 
static function setNextPlotTicksX (local x_min, local x_max, local n_ticks, local labels, local show_default)
 
static function setNextPlotTicksY (local values, local n_ticks, local labels, local show_default, local y_axis)
 
static function setNextPlotTicksY (local x_min, local x_max, local n_ticks, local labels, local show_default, local y_axis)
 
static function setPlotYAxis (local y_axis)
 
static function showColormapScale (local scale_min, local scale_max, local height)
 
static function showDemoWindow (local open)
 

Member Function Documentation

◆ beginPlot()

static function beginPlot ( local  title_id,
local  x_label,
local  y_label,
local  size,
local  flags,
local  x_flags,
local  y_flags,
local  y2_flags,
local  y3_flags 
)

Starts a 2D plotting context. If this function returns true, EndPlot() must

be called, e.g. "if (BeginPlot(...)) { ... EndPlot(); }"". #title_id must

be unique. If you need to avoid ID collisions or don't want to display a

title in the plot, use double hashes (e.g. "MyPlot##Hidden"). If #x_label

and/or #y_label are provided, axes labels will be displayed.

Parameters
title_idstring
x_labelstring @optional
y_labelstring @optional
sizeImVec2 @optional
flagsnumber @optional
x_flagsnumber @optional
y_flagsnumber @optional
y2_flagsnumber @optional
y3_flagsnumber @optional

◆ endPlot()

static function endPlot ( )

◆ getColormapColor()

static function getColormapColor ( local  index)

Returns a color from the Color map given an index >= 0 (modulo will be performed)

Parameters
indexnumber
Returns
ImVec4

◆ getColormapSize()

static function getColormapSize ( )

Returns the size of the current colormap.

Returns
number

◆ getInputMap()

static function getInputMap ( )

Allows changing how keyboard/mouse interaction works.

Returns
implot.ImPlotInputMap

◆ getPlotLimits()

static function getPlotLimits ( )

Returns the current or most recent plot axis range. A negative y_axis uses the current value of SetPlotYAxis (0 initially).

Returns
implot.ImPlotLimits

◆ getPlotMousePos()

static function getPlotMousePos ( )

Returns the mouse position in x,y coordinates of the current or most recent plot. A negative y_axis uses the current value of SetPlotYAxis (0 initially).

Returns
implot.ImPlotPoint

◆ getPlotPos()

static function getPlotPos ( )

Get the current Plot position (top-left) in pixels.

Returns
ImVec2

◆ getPlotQuery()

static function getPlotQuery ( )

Returns the current or most recent plot query bounds.

Returns
implot.ImPlotLimits

◆ getPlotSize()

static function getPlotSize ( )

Get the curent Plot size in pixels.

Returns
ImVec2

◆ getStyle()

static function getStyle ( )

Provides access to plot style structure for permanant modifications to colors, sizes, etc.

Returns
implot.ImPlotStyle

◆ isPlotHovered()

static function isPlotHovered ( )

Returns true if the plot area in the current or most recent plot is hovered.

Returns
boolean

◆ isPlotQueried()

static function isPlotQueried ( )

Returns true if the current or most recent plot is being queried.

Returns
boolean

◆ lerpColormap()

static function lerpColormap ( local  t)

Linearly interpolates a color from the current colormap given t between 0 and 1.

Parameters
tnumber
Returns
ImVec4

◆ pixelsToPlot()

static function pixelsToPlot ( local  pix,
local  y_axis 
)

Convert pixels to a position in the current plot's coordinate system. A negative y_axis uses the current value of SetPlotYAxis (0 initially).

Parameters
pixImVec2
y_axisnumber
Returns
implot.ImPlotPoint

◆ plotBars()

static function plotBars ( local  label_id,
local  xs,
local  ys,
local  count,
local  width,
local  offset 
)

Plots a vertical bar graph.

Parameters
label_idstring
valuesnumber[]
countnumber
widthnumber @optional
shiftnumber @optional
offsetnumber @optional

Plots a vertical bar graph.

Parameters
label_idstring
xsnumber[]
ysnumber[]
countnumber
widthnumber
offsetnumber @optional

◆ plotBarsH()

static function plotBarsH ( local  label_id,
local  xs,
local  ys,
local  count,
local  height,
local  offset 
)

Plots a horizontal bar graph.

Parameters
label_idstring
valuesnumber
countnumber
heightnumber @optional
shiftnumber @optional
offsetnumber @optional

Plots a horizontal bar graph.

Parameters
label_idstring
xsnumber
ysnumber
countnumber
heightnumber
offsetnumber @optional

◆ plotDigital()

static function plotDigital ( local  label_id,
local  xs,
local  ys,
local  count,
local  offset 
)

Plots digital data.

Parameters
label_idstring
xsnumber[]
ysnumber[]
countnumber
offsetnumber @optional

◆ plotErrorBars() [1/2]

static function plotErrorBars ( local  label_id,
local  xs,
local  ys,
local  err,
local  count,
local  offset 
)

Plots vertical error bar. The label_id should match the label_id of the associated line or bar plot.

Parameters
label_idstring
xsnumber
ysnumber
errnumber
countnumber
offsetnumber @optional

◆ plotErrorBars() [2/2]

static function plotErrorBars ( local  label_id,
local  xs,
local  ys,
local  neg,
local  pos,
local  count,
local  offset 
)

Plots vertical error bar. The label_id should match the label_id of the associated line or bar plot.

Parameters
label_idstring
xsnumber
ysnumber
negnumber
posnumber
countnumber
offsetnumber @optional

◆ plotErrorBarsH() [1/2]

static function plotErrorBarsH ( local  label_id,
local  xs,
local  ys,
local  err,
local  count,
local  offset 
)

Plots horizontal error bars. The label_id should match the label_id of the associated line or bar plot.

Parameters
label_idstring
xsnumber
ysnumber
errnumber
countnumber
offsetnumber @optional

◆ plotErrorBarsH() [2/2]

static function plotErrorBarsH ( local  label_id,
local  xs,
local  ys,
local  neg,
local  pos,
local  count,
local  offset 
)

Plots horizontal error bars. The label_id should match the label_id of the associated line or bar plot.

Parameters
label_idstring
xsnumber
ysnumber
negnumber
posnumber
countnumber
offsetnumber @optional

◆ plotHeatmap()

static function plotHeatmap ( local  label_id,
local  values,
local  rows,
local  cols,
local  scale_min,
local  scale_max,
local  label_fmt,
local  bounds_min,
local  bounds_max 
)

Plots a 2D heatmap chart. Values are expected to be in row-major order. label_fmt can be set to NULL for no labels.

Parameters
label_idstring
valuesnumber
rowsnumber
colsnumber
scale_minnumber
scale_maxnumber
label_fmtstring @optional
bounds_minimplot.ImPlotPoint @optional
bounds_maximplot.ImPlotPoint @optional

◆ plotLine() [1/3]

static function plotLine ( local  label_id,
local  data,
local  count,
local  offset 
)

Plots a standard 2D line plot.

Parameters
label_idstring
dataImVec2[]
countnumber
offsetnumber @optional

◆ plotLine() [2/3]

static function plotLine ( local  label_id,
local  data,
local  count,
local  offset 
)

Plots a standard 2D line plot.

Parameters
label_idstring
valuesnumber[]
countnumber
offsetnumber @optional

Plots a standard 2D line plot.

Parameters
label_idstring
dataImVec2[]
countnumber
offsetnumber @optional

◆ plotLine() [3/3]

static function plotLine ( local  label_id,
local  xs,
local  ys,
local  count,
local  offset 
)

Plots a standard 2D line plot.

Parameters
label_idstring
xsnumber[]
ysnumber[]
countnumber
offsetnumber @optional

◆ plotPieChart()

static function plotPieChart ( local  label_ids,
local  values,
local  count,
local  x,
local  y,
local  radius,
local  normalize,
local  label_fmt,
local  angle0 
)

Plots a pie chart. If the sum of values > 1 or normalize is true, each value will be normalized. Center and radius are in plot coordinates.

Parameters
label_idsstring[]
valuesnumber[]
countnumber
xnumber
ynumber
radiusnumber
normalizeboolean @optional
label_fmtstring @optional
angle0number @optional

◆ plotScatter() [1/3]

static function plotScatter ( local  label_id,
local  data,
local  count,
local  offset 
)

Plots a standard 2D scatter plot.

Parameters
label_idstring
dataImVec2[]
countnumber
offsetnumber @optional

◆ plotScatter() [2/3]

static function plotScatter ( local  label_id,
local  data,
local  count,
local  offset 
)

Plots a standard 2D scatter plot.

Parameters
label_idstring
valuesnumber[]
countnumber
offsetnumber @optional

Plots a standard 2D scatter plot.

Parameters
label_idstring
dataImVec2[]
countnumber
offsetnumber @optional

◆ plotScatter() [3/3]

static function plotScatter ( local  label_id,
local  xs,
local  ys,
local  count,
local  offset 
)

Plots a standard 2D scatter plot.

Parameters
label_idstring
xsnumber[]
ysnumber[]
countnumber
offsetnumber @optional

◆ plotShaded()

static function plotShaded ( local  label_id,
local  xs,
local  ys,
local  count,
local  y_ret,
local  offset 
)

Plots a shaded (filled) region between two lines, or a line and a horizontal reference.

Parameters
label_idstring
xsnumber[]
ys1number[]
ys2number[]
countnumber
offsetnumber @optional

Plots a shaded (filled) region between two lines, or a line and a horizontal reference.

Parameters
label_idstring
xsnumber[]
ysnumber[]
countnumber
y_retnumber @optional
offsetnumber @optional

◆ plotText()

static function plotText ( local  text,
local  x,
local  y,
local  vertical,
local  pixel_offset 
)

Plots a text label at point x,y.

Parameters
textstring
xnumber
ynumber
verticalboolean
pixel_offsetImVec2

◆ plotToPixels()

static function plotToPixels ( local  plt,
local  y_axis 
)

Convert a position in the current plot's coordinate system to pixels. A negative y_axis uses the current value of SetPlotYAxis (0 initially).

Parameters
pltimplot.ImPlotPoint
y_axisnumber
Returns
ImVec2

◆ popPlotClipRect()

static function popPlotClipRect ( )

Pop plot clip rect.

◆ popStyleColor()

static function popStyleColor ( )

Undo temporary color modification.

◆ popStyleVar()

static function popStyleVar ( )

Undo temporary style modification.

◆ pushPlotClipRect()

static function pushPlotClipRect ( )

Push clip rect for rendering to current plot area.

◆ pushStyleColor()

static function pushStyleColor ( local  idx,
local  col 
)

Temporarily modify a plot color. Don't forget to call PopStyleColor!

Parameters
idxnumber
colnumber|ImVec4

◆ pushStyleVar()

static function pushStyleVar ( local  idx,
local  val 
)

Temporarily modify a style variable. Don't forget to call PopStyleVar!

Parameters
idxnumber
valnumber

◆ setColormap() [1/2]

static function setColormap ( local  colormap,
local  samples 
)

Switch to one of the built-in colormaps. If samples is greater than 1, the map will be linearly resampled.

Parameters
colormapnumber
samplesnumber @optional

◆ setColormap() [2/2]

static function setColormap ( local  colors)

Sets a custom colormap.

Parameters
colorsImVec4[]

◆ setNextPlotLimits()

static function setNextPlotLimits ( local  x_min,
local  x_max,
local  y_min,
local  y_max,
local  cond 
)

Set the axes range limits of the next plot. Call right before BeginPlot(). If ImGuiCond_Always is used, the axes limits will be locked.

Parameters
x_minnumber
x_maxnumber
y_minnumber
y_maxnumber
condnumber

◆ setNextPlotLimitsX()

static function setNextPlotLimitsX ( local  x_min,
local  x_max,
local  cond 
)

Set the X axis range limits of the next plot. Call right before BeginPlot(). If ImGuiCond_Always is used, the X axis limits will be locked.

Parameters
x_minnumber
x_maxnumber
condnumber

◆ setNextPlotLimitsY()

static function setNextPlotLimitsY ( local  y_min,
local  y_max,
local  cond,
local  y_axis 
)

Set the Y axis range limits of the next plot. Call right before BeginPlot(). If ImGuiCond_Always is used, the Y axis limits will be locked.

Parameters
y_minnumber
y_maxnumber
condnumber
y_axisnumber

◆ setNextPlotTicksX() [1/2]

static function setNextPlotTicksX ( local  values,
local  n_ticks,
local  labels,
local  show_default 
)

Set the X axis ticks and optionally the labels for the next plot.

Parameters
valuesnumber[]
n_ticksnumber
labelsstring[] @optional
show_defaultboolean @optional

◆ setNextPlotTicksX() [2/2]

static function setNextPlotTicksX ( local  x_min,
local  x_max,
local  n_ticks,
local  labels,
local  show_default 
)

Set the X axis ticks and optionally the labels for the next plot.

Parameters
x_minnumber
x_maxnumber
n_ticksnumber
labelsstring @optional
show_defaultboolean @optional

◆ setNextPlotTicksY() [1/2]

static function setNextPlotTicksY ( local  values,
local  n_ticks,
local  labels,
local  show_default,
local  y_axis 
)

Set the Y axis ticks and optionally the labels for the next plot.

Parameters
valuesnumber[]
n_ticksnumber
labelsstring[] @optional
show_defaultboolean @optional
y_axisnumber @optional

◆ setNextPlotTicksY() [2/2]

static function setNextPlotTicksY ( local  x_min,
local  x_max,
local  n_ticks,
local  labels,
local  show_default,
local  y_axis 
)

Set the Y axis ticks and optionally the labels for the next plot.

Parameters
x_minnumber
x_maxnumber
n_ticksnumber
labelsstring @optional
show_defaultboolean @optional
y_axisnumber @optional

◆ setPlotYAxis()

static function setPlotYAxis ( local  y_axis)

Select which Y axis will be used for subsequent plot elements. The default is '0', or the first (left) Y axis.

Parameters
y_axisnumber

◆ showColormapScale()

static function showColormapScale ( local  scale_min,
local  scale_max,
local  height 
)

Renders a vertical color scale using the current color map

Parameters
scale_minnumber
scale_maxnumber
heightnumber

◆ showDemoWindow()

static function showDemoWindow ( local  open)

Shows the ImPlot demo.


The documentation for this class was generated from the following files: