plot/palette: clean up API
@kortschak ya está trabajando en esto.
Desde el 30/4/2017.
Evaluación
Este issue todavía no se ha evaluado.
Descripción
I am troubled by the size of the ColorMap interface. It can be reduced in size to
// A ColorMap maps scalar values to colors.
type ColorMap interface {
// At returns the color associated with the given value.
// If the value is not between Max() and Min(), an error is returned.
At(float64) (color.Color, error)
// Min returns the current minimum value of the ColorMap.
Min() float64
// Max returns the current maximum value of the ColorMap.
Max() float64
// Palette returns a new Palette with the specified number of
// colors from the ColorMap.
Palette(colors int) Palette
}
and
// DivergingColorMap maps scalar values to colors that diverge from a central value.
type DivergingColorMap interface {
ColorMap
// ConvergePoint returns the value where the diverging colors meet.
ConvergePoint() float64
}
The Set methods are required because the concrete types are not exported. This can be fixed with minor name juggling on the field names of the concrete types. For example:
// Luminance is a color palette that interpolates between control colors in a way that
// ensures a linear relationship between the luminance of a color and the value it represents.
// NewLuminance must be used to create a usable Luminance.
type Luminance struct {
// colors are the control colors to be interpolated among.
// The colors must be monotonically increasing in luminance.
colors []cieLAB
// scalars are the scalar control points associated with
// each item in colors (above). They are monotonically
// increasing values between zero and one that correspond
// to the luminance of a given control color in relation
// to the minimum and maximum luminance among all control
// colors.
scalars []float64
// Alpha represents the opacity of the returned colors in
// the range (0,1). NewLuminance sets Alpha to 1.
Alpha float64
// Range specifies the minimum and maximum values of the
// range of scalars that can be mapped to colors using this
// ColorMap.
Range struct { Min, Max float64 }
}
- Lenguaje dominante
- Go
- Estrellas
- 3k
- Forks
- 202
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de gonum/plot
-
Dificultad 3/5 1-2 días Aptitud para principiantes 35/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 52/100
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 32/100
-
plot/plotter: NewHist(binPoints) panic when a small negative number is usedPosiblemente ocupada @SashaMIT la tomó hace 15 días. Abierto
Dificultad 3/5 1-2 días Aptitud para principiantes 55/100
-
Dificultad 3/5 1-2 días Aptitud para principiantes 35/100
Todos los issues de gonum/plot
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
kubernetes-sigs/kubebuilder#6131 ·
Los mantenedores suelen responder en 2 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
aquasecurity/libbpfgo#560 ·
-
[BUG]Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
kagent-dev/kagent#3385 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
hashicorp/nomad-autoscaler#1364 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
theagentrouter/agent-router#2926 ·
Los mantenedores suelen responder en 1 día