plot/palette: clean up API
@kortschak já está trabalhando nisso.
Desde 30/4/2017.
Avaliação
Esta issue ainda não foi avaliada.
Descrição
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 }
}
- Linguagem predominante
- Go
- Estrelas
- 3k
- Forks
- 202
- Métricas de merge de PRs
- Nenhum PR com merge em 30d
Preparar o ambiente
- Sem Dockerfile nem arquivo Docker Compose
- Tem um modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de gonum/plot
-
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 35/100
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 52/100
-
Dificuldade 5/5 Mais de uma semana Facilidade para iniciantes 32/100
-
plot/plotter: NewHist(binPoints) panic when a small negative number is usedTalvez já em andamento @SashaMIT assumiu há 18 dias. Aberta
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 55/100
-
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 35/100
Issues semelhantes
-
Type: Bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
projectdiscovery/notify#569 ·
-
internal
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 70/100
Mantenedores costumam responder em até 1 dia
-
Results from sources can contain invalid host namesTalvez já em andamento @Mzack9999 assumiu hoje. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
projectdiscovery/subfinder#1983 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 75/100
Mantenedores costumam responder em até 1 dia
-
bug triaged
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 80/100
radius-project/radius#13566 · 2 comentários ·
Mantenedores costumam responder em até 1 dia