ground-dashboard/ground/tool/charts/util.go

12 lines
314 B
Go
Raw Permalink Normal View History

2022-12-05 22:25:36 +00:00
package charts
import "github.com/johnjones4/model-rocket-telemetry/dashboard/core"
func singleFlightDataElement(fd []core.DataSegment, accessor func(core.DataSegment) float64) []float64 {
data := make([]float64, len(fd))
for i, segment := range fd {
data[i] = accessor(segment)
}
return data
}