Enable Glyphs to have an outline
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 35/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Bien especificado
- Estado de actividad
- Estancado
- Stack tecnológico
- go
- Área
- data-visualization
Línea de trabajo
Empieza en vg/draw/canvas.go leyendo GlyphStyle y las implementaciones de DrawGlyph de los glifos; después, revisa el pull request 298 para conocer el enfoque propuesto existente. Se considera terminado cuando los glifos se puedan renderizar con un contorno opcional, manteniendo el comportamiento existente cuando no se configure ningún contorno.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Just in case anyone is wanting to ask why we would do this, 1. other libraries do it, and 2. In my case I need to make my application create a graph that looks like the current ones (with an outline). Consider for example the javascript library, chart.js
A patch for this could be done without altering the API. Here is my current solution:
--- a/vg/draw/canvas.go
+++ b/vg/draw/canvas.go
@@ -55,6 +55,12 @@ type GlyphStyle struct {
// Radius specifies the size of the glyph's radius.
Radius vg.Length
+ // Width of the line around the glyph. If set, LineColour is used to outline the glyph
+ Width vg.Length
+
+ // Outline glyph with this color if Width is set.
+ LineColor color.Color
+
// Shape draws the shape of the glyph.
Shape GlyphDrawer
}
@@ -106,6 +112,11 @@ func (CircleGlyph) DrawGlyph(c *Canvas, sty GlyphStyle, pt vg.Point) {
p.Arc(pt, sty.Radius, 0, 2*math.Pi)
p.Close()
c.Fill(p)
+
+ if sty.Width > 0 {
+ c.SetLineStyle(LineStyle{Color: sty.LineColor, Width: sty.Width})
+ c.Stroke(p)
+ }
}
// RingGlyph is a glyph that draws the outline of a circle.
This simply add's two fields, if you want to set an outline, you can set the new Width field, and the new LineColor field.
- 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 14 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 82/100
eugenioenko/ttt#1206 ·
Los mantenedores suelen responder en 1 día
-
t:urlDecodeUni does not map U+3002 and U+FF61 to a dot, unlike ModSecurityPosiblemente ocupada @fzipi la tomó hoy. Abiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
peasant-labs/peasant#738 ·
Los mantenedores suelen responder en 1 día
-
Duplicate review still bridges two books through a bundle whose first part has a colon subtitlePosiblemente ocupada @vavallee la tomó hoy. Abiertoarea:library-scan bug priority:low
Dificultad 2/5 1-3 horas Aptitud para principiantes 83/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día