Adding upstream version 2.1.2.
Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
parent
c8c64afc61
commit
41a2f19f12
220 changed files with 19814 additions and 0 deletions
24
array.go
Normal file
24
array.go
Normal file
|
@ -0,0 +1,24 @@
|
|||
package chart
|
||||
|
||||
var (
|
||||
_ Sequence = (*Array)(nil)
|
||||
)
|
||||
|
||||
// NewArray returns a new array from a given set of values.
|
||||
// Array implements Sequence, which allows it to be used with the sequence helpers.
|
||||
func NewArray(values ...float64) Array {
|
||||
return Array(values)
|
||||
}
|
||||
|
||||
// Array is a wrapper for an array of floats that implements `ValuesProvider`.
|
||||
type Array []float64
|
||||
|
||||
// Len returns the value provider length.
|
||||
func (a Array) Len() int {
|
||||
return len(a)
|
||||
}
|
||||
|
||||
// GetValue returns the value at a given index.
|
||||
func (a Array) GetValue(index int) float64 {
|
||||
return a[index]
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue