Skip to content

Commit

Permalink
Merge pull request #39 from cyberbit/hotfix/basaltgraph
Browse files Browse the repository at this point in the history
🐛 fix GraphOutput symbology and colors
  • Loading branch information
cyberbit authored Jan 2, 2024
2 parents 86911ca + d38b9f9 commit bddc385
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 18 deletions.
4 changes: 2 additions & 2 deletions src/telem/init.lua
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
-- Telem by cyberbit
-- MIT License
-- Version 0.4.0
-- Version 0.4.1

local _Telem = {
_VERSION = '0.4.0',
_VERSION = '0.4.1',
util = require 'telem.lib.util',
input = require 'telem.lib.input',
output = require 'telem.lib.output',
Expand Down
32 changes: 16 additions & 16 deletions src/telem/lib/output/basalt/GraphOutputAdapter.lua
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,18 @@ local function graphtrackrange (self)
return min,max
end

function GraphOutputAdapter:constructor (frame, filter, bg, fg, fontSize)
function GraphOutputAdapter:constructor (frame, filter, bg, fg)
self:super('constructor')

self.bBaseFrame = assert(frame, 'Frame is required')
self.filter = assert(filter, 'Filter is required')

self.graphdata = {}

self:register(bg, fg, fontSize)
self:register(bg, fg)
end

function GraphOutputAdapter:register (bg, fg, fontSize)
function GraphOutputAdapter:register (bg, fg)
local currentmin = 0
local currentmax = 1000

Expand All @@ -43,35 +43,35 @@ function GraphOutputAdapter:register (bg, fg, fontSize)
:setBackground(bg)
:setSize('{parent.w}', '{parent.h}')

local fGraph = self.bInnerFrame:addFrame('fGraph'):setBackground(colors.black)
local fGraph = self.bInnerFrame:addFrame('fGraph'):setBackground(bg)
:setPosition(1,1)
:setSize('{parent.w - 2}', '{parent.h - 6}')

local fLabel = self.bInnerFrame:addFrame('fLabel'):setBackground(colors.black)
local fLabel = self.bInnerFrame:addFrame('fLabel'):setBackground(bg)
:setSize('{parent.w - 2}', 4)
:setPosition(1,'{parent.h - 5}')

local fLabelMax = self.bInnerFrame:addFrame('fLabelMax'):setBackground(colors.black)
local fLabelMax = self.bInnerFrame:addFrame('fLabelMax'):setBackground(bg)
:setSize(6, 1)
:setPosition('{parent.w - 7}',1)

local fLabelMin = self.bInnerFrame:addFrame('fLabelMin'):setBackground(colors.black)
local fLabelMin = self.bInnerFrame:addFrame('fLabelMin'):setBackground(bg)
:setSize(6, 1)
:setPosition('{parent.w - 7}','{fLabel.y - 2}')

self.label = fLabel:addLabel()
:setText("-----")
:setPosition('{parent.w/2-self.w/2}', 2)
:setForeground(colors.white)
:setBackground(colors.black)
:setForeground(fg)
:setBackground(bg)

self.graph = fGraph:addGraph()
:setPosition(1,1)
:setSize('{parent.w - 1}', '{parent.h - 1}')
:setMaxEntries(self.MAX_ENTRIES)
:setBackground(colors.black)
:setGraphColor(colors.red)
:setGraphSymbol('\127')
:setBackground(bg)
:setGraphColor(fg)
:setGraphSymbol(' ')

self.graphscale = fGraph:addGraph()
:setGraphType('scatter')
Expand All @@ -84,14 +84,14 @@ function GraphOutputAdapter:register (bg, fg, fontSize)
self.labelmax = fLabelMax:addLabel()
:setPosition(1,1)
:setText('-----')
:setForeground(colors.white)
:setBackground(colors.black)
:setForeground(fg)
:setBackground(bg)

self.labelmin = fLabelMin:addLabel()
:setPosition(1,1)
:setText('-----')
:setForeground(colors.white)
:setBackground(colors.black)
:setForeground(fg)
:setBackground(bg)

self.graph:setMinValue(currentmin):setMaxValue(currentmax)
end
Expand Down

0 comments on commit bddc385

Please sign in to comment.