plot/palette: clean up API
@kortschak ci sta già lavorando.
Dal 30/4/2017.
Valutazione
Questa issue non è ancora stata valutata.
Descrizione
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 }
}
- Lingua principale
- Go
- Stelle
- 3k
- Fork
- 202
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di gonum/plot
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 35/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 52/100
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 32/100
-
plot/plotter: NewHist(binPoints) panic when a small negative number is usedForse già presa @SashaMIT l’ha presa 14 giorni fa. Aperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 55/100
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 35/100
Issue simili
-
fix(handlers): explicitly set Content-Type header in static Index handlerForse già presa @kage-zero l’ha presa oggi. Aperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 85/100
I maintainer di solito rispondono entro 1 giorno
-
Quick Open: restore dependency-directory exclusions in filesystem fallbackForse già presa Una pull request collegata a questa issue è aperta o già unita. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
eugenioenko/ttt#1206 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
open-policy-agent/opa#9426 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
rorkai/App-Store-Connect-CLI#3192 ·
I maintainer di solito rispondono entro 1 giorno
-
t:urlDecodeUni does not map U+3002 and U+FF61 to a dot, unlike ModSecurityForse già presa @fzipi l’ha presa oggi. Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno