forked from wcharczuk/go-chart
-
Notifications
You must be signed in to change notification settings - Fork 0
/
range.go
43 lines (32 loc) · 765 Bytes
/
range.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
package chart
// NameProvider is a type that returns a name.
type NameProvider interface {
GetName() string
}
// StyleProvider is a type that returns a style.
type StyleProvider interface {
GetStyle() Style
}
// IsZeroable is a type that returns if it's been set or not.
type IsZeroable interface {
IsZero() bool
}
// Stringable is a type that has a string representation.
type Stringable interface {
String() string
}
// Range is a common interface for a range of values.
type Range interface {
Stringable
IsZeroable
GetMin() float64
SetMin(min float64)
GetMax() float64
SetMax(max float64)
GetDelta() float64
GetDomain() int
SetDomain(domain int)
IsDescending() bool
// Translate the range to the domain.
Translate(value float64) int
}