From 1e4c49926593b871eb0ce4d0777e5059f774c010 Mon Sep 17 00:00:00 2001 From: cyberbit Date: Sun, 2 Jun 2024 16:54:05 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=93=A6=20document=20maxEntries,=20bump=20?= =?UTF-8?q?version?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/reference/output/ChartLine.md | 11 +++++++++-- docs/reference/output/basalt/Graph.md | 11 +++++++++-- src/telem/init.lua | 4 ++-- 3 files changed, 20 insertions(+), 6 deletions(-) diff --git a/docs/reference/output/ChartLine.md b/docs/reference/output/ChartLine.md index 0026dc1..b29d627 100644 --- a/docs/reference/output/ChartLine.md +++ b/docs/reference/output/ChartLine.md @@ -9,13 +9,14 @@ telem.output.plotter.chartLine ( win: window, filter: string, bg: color, - fg: color + fg: color, + maxEntries: number ) ``` Search the available metrics using the syntax defined in [`find`](/reference/MetricCollection#find) and output a line chart to a specified window. If a matching metric is found, the metric value is pushed to the chart buffer. -The X axis (horizontal value) represents the number of data points recorded, and has a fixed width of `50`. The Y axis (vertical) represents the value of the metric over time. Once the fixed width of the graph is reached, the oldest values will be dropped from the buffer when new values are added. The minimum and maximum range of the Y axis is determined by the minimum and maximum metric values in the graph buffer. The background of the widget and all labels will be `bg`, and the graph/text color will be `fg`. +The X axis (horizontal value) represents the number of data points recorded, and has a default width of `50`, which can be overridden by passing `maxEntries` in the constructor. The Y axis (vertical) represents the value of the metric over time. Once the fixed width of the graph is reached, the oldest values will be dropped from the buffer when new values are added. The minimum and maximum range of the Y axis is determined by the minimum and maximum metric values in the graph buffer. The background of the widget and all labels will be `bg`, and the graph/text color will be `fg`. The minimum and maximum labels are designed to shorten themselves using SI suffixes to fit within the available width. @@ -44,6 +45,12 @@ The minimum and maximum labels are designed to shorten themselves using SI suffi type: 'color', default: 'nil', description: 'Foreground color (colors.*)' + }, + { + name: 'maxEntries', + type: 'number', + default: '50', + description: 'Maximum entries in the chart buffer' } ]" > diff --git a/docs/reference/output/basalt/Graph.md b/docs/reference/output/basalt/Graph.md index 6e67509..6404a8e 100644 --- a/docs/reference/output/basalt/Graph.md +++ b/docs/reference/output/basalt/Graph.md @@ -9,7 +9,8 @@ telem.output.basalt.graph ( frame: Basalt.Container, filter: string, bg: color, - fg: color + fg: color, + maxEntries: number ) ``` @@ -19,7 +20,7 @@ Requires **[Basalt 1.7+](https://basalt.madefor.cc/)**. This is **not** included Search the available metrics using the syntax defined in [`find`](/reference/MetricCollection#find) and output a graph to a specified [Basalt container](https://basalt.madefor.cc/#/objects/Container). If a matching metric is found, the metric value is pushed to the graph buffer. -The X axis (horizontal value) represents the number of data points recorded, and has a fixed width of `50`. The Y axis (vertical) represents the value of the metric over time. Once the fixed width of the graph is reached, the oldest values will be dropped from the buffer when new values are added. The minimum and maximum range of the Y axis is determined by the minimum and maximum metric values in the graph buffer. The background of the widget and all labels will be `bg`, and the graph/text color will be `fg`. +The X axis (horizontal value) represents the number of data points recorded, and has a default width of `50`, which can be overridden by passing `maxEntries` in the constructor. The Y axis (vertical) represents the value of the metric over time. Once the fixed width of the graph is reached, the oldest values will be dropped from the buffer when new values are added. The minimum and maximum range of the Y axis is determined by the minimum and maximum metric values in the graph buffer. The background of the widget and all labels will be `bg`, and the graph/text color will be `fg`. The value label is designed to shorten itself using SI suffixes to fit within the available width. @@ -48,6 +49,12 @@ The value label is designed to shorten itself using SI suffixes to fit within th type: 'color', default: 'nil', description: 'Foreground color (colors.*)' + }, + { + name: 'maxEntries', + type: 'number', + default: '50', + description: 'Maximum entries in the graph buffer' } ]" /> diff --git a/src/telem/init.lua b/src/telem/init.lua index 0630a4a..e45bb4a 100644 --- a/src/telem/init.lua +++ b/src/telem/init.lua @@ -1,9 +1,9 @@ -- Telem by cyberbit -- MIT License --- Version 0.5.2 +-- Version 0.5.3 local _Telem = { - _VERSION = '0.5.2', + _VERSION = '0.5.3', util = require 'telem.lib.util', input = require 'telem.lib.input', output = require 'telem.lib.output',