Debian Codegraph @

array.go

raw symbols SCIP
1 package chart
2
3 var (
4 _ Sequence = (*Array)(nil)
5 )
6
7 // NewArray returns a new array from a given set of values.
8 // Array implements Sequence, which allows it to be used with the sequence helpers.
9 func NewArray(values ...float64) Array {
10 return Array(values)
11 }
12
13 // Array is a wrapper for an array of floats that implements `ValuesProvider`.
14 type Array []float64
15
16 // Len returns the value provider length.
17 func (a Array) Len() int {
18 return len(a)
19 }
20
21 // GetValue returns the value at a given index.
22 func (a Array) GetValue(index int) float64 {
23 return a[index]
24 }