Value returns the y value at given row in table
(row int)
| 148 | |
| 149 | // Value returns the y value at given row in table |
| 150 | func (txy *tableXY) Value(row int) float32 { |
| 151 | if txy.table == nil || txy.table.Table == nil || row >= txy.table.Len() { |
| 152 | return 0 |
| 153 | } |
| 154 | trow := txy.table.Indexes[row] // true table row |
| 155 | yc := txy.table.Table.Columns[txy.yColumn] |
| 156 | y := float32(0.0) |
| 157 | switch { |
| 158 | case yc.IsString(): |
| 159 | y = float32(row) |
| 160 | case yc.NumDims() > 1: |
| 161 | _, sz := yc.RowCellSize() |
| 162 | if txy.yIndex < sz && txy.yIndex >= 0 { |
| 163 | y = float32(yc.FloatRowCell(trow, txy.yIndex)) |
| 164 | } |
| 165 | default: |
| 166 | y = float32(yc.Float1D(trow)) |
| 167 | } |
| 168 | return y |
| 169 | } |
| 170 | |
| 171 | // tRowXValue returns an x value at given actual row in table |
| 172 | func (txy *tableXY) tRowXValue(row int) float32 { |
no test coverage detected