MCPcopy Create free account
hub / github.com/cogentcore/core / tRowXValue

Method tRowXValue

plot/plotcore/tablexy.go:172–190  ·  view source on GitHub ↗

tRowXValue returns an x value at given actual row in table

(row int)

Source from the content-addressed store, hash-verified

170
171// tRowXValue returns an x value at given actual row in table
172func (txy *tableXY) tRowXValue(row int) float32 {
173 if txy.table == nil || txy.table.Table == nil {
174 return 0
175 }
176 xc := txy.table.Table.Columns[txy.xColumn]
177 x := float32(0.0)
178 switch {
179 case xc.IsString():
180 x = float32(row)
181 case xc.NumDims() > 1:
182 _, sz := xc.RowCellSize()
183 if txy.xIndex < sz && txy.xIndex >= 0 {
184 x = float32(xc.FloatRowCell(row, txy.xIndex))
185 }
186 default:
187 x = float32(xc.Float1D(row))
188 }
189 return x
190}
191
192// xValue returns an x value at given row in table
193func (txy *tableXY) xValue(row int) float32 {

Callers 1

filterValuesMethod · 0.95

Calls 5

IsStringMethod · 0.65
NumDimsMethod · 0.65
RowCellSizeMethod · 0.65
FloatRowCellMethod · 0.65
Float1DMethod · 0.65

Tested by

no test coverage detected