Area plot not working on single point despite strokeLinecap: square
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 55/100
- Tipo de issue
- Error
- Claridad
- Bastante claro
- Estado de actividad
- Activo
- Stack tecnológico
- d3, javascript
- Área
- data-visualization
Línea de trabajo
Empieza por la documentación de la API de area mark y reproduce el ejemplo del cuaderno de Observable usando Plot.areaY con gaps y strokeLinecap: "square". Inspecciona la ruta SVG generada y compárala con la solución alternativa de CSS mostrada en el informe. Se considera terminado cuando un segmento de área de un solo punto se renderiza visiblemente con la opción documentada, sin estilos adicionales.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Describing the bug
As the title implies either I didn't understand the docs for this use case or there is a bug:
Excerpt from the API docs on area marks:
The area mark supports curve options to control interpolation between points. If any of the x1, y1, x2, or y2 values are invalid (undefined, null, or NaN), the baseline and topline will be interrupted, resulting in a break that divides the area shape into multiple segments. (See d3-shape’s area.defined for more.) If an area segment consists of only a single point, it may appear invisible unless rendered with rounded or square line caps. In addition, some curves such as cardinal-open only render a visible segment if it contains multiple points.
Expected behavior
If my plot contains gaps which creates single points, I don't need to do anything else but define the mark option strokeLinecap: 'square' so that I still see an area rendered at this data point.
Steps how to reproduce
Here is my minimal working example in an Observable notebook
data = [
{
"time": 2009,
"value": 74.08,
"lowerBounds": 73.25,
"upperBounds": 74.89,
"age": "A0000",
"sex": 0
}, {
"time": 2010,
"value": 75.17,
"lowerBounds": 74.37,
"upperBounds": 75.96,
"age": "A0000",
"sex": 0
}, {
"time": 2011,
"value": null
}, {
"time": 2012,
"value": 75.95,
"lowerBounds": 75.06,
"upperBounds": 76.82,
"age": "A0000",
"sex": 0
}, {
"time": 2016,
"value": null
}, {
"time": 2022,
"value": 66.4,
"lowerBounds": 63.23,
"upperBounds": 69.44,
"age": "A0000",
"sex": 0
}, {
"time": 2023,
"value": 67.98,
"lowerBounds": 66.23,
"upperBounds": 69.68,
"age": "A0000",
"sex": 0
}
]
Plot.plot({
x: {
interval: 1,
tickFormat: ''
},
y: {
label: 'Proportion of people who have had a dental check-up in the last 12 months',
tickFormat: d => `${d} %`
},
inset: 8,
grid: true,
marks: [
Plot.areaY(data, {x: "time", y1: "lowerBounds", y2: "upperBounds", fill: "#DD1A1E", fillOpacity: 0.2, strokeLinecap: "square"}),
Plot.lineY(data, {x: "time", y: "value", stroke: "#DD1A1E", marker: "circle"})
]
})
This is what it looks like at this point in time:
Only after adding styles to the area (SVG <path> Element) do I see the area for a single point. Is this the desired method?
- Lenguaje dominante
- HTML
- Estrellas
- 5.4k
- Forks
- 246
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin 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 observablehq/plot
-
[Types] Wrong recursion in Mark’s _tip_ optionQuizá libre de nuevo Un pull request para esta issue se cerró sin fusionarse. Abiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
observablehq/plot#2459 · 1 reacción ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
observablehq/plot#2453 ·
-
Inconsistent type definition of _scale_._transform_Posiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abiertobug
Dificultad 1/5 Menos de una hora Aptitud para principiantes 85/100
observablehq/plot#2451 ·
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 85/100
observablehq/plot#2447 · 2 comentarios ·
-
Channel documentation with a section describing zQuizá libre de nuevo @LeonxLJX la tomó hace 37 días y no hay ningún pull request abierto. Abiertodocumentation
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
observablehq/plot#1533 · 3 comentarios · 1 reacción ·
Todos los issues de observablehq/plot
Issues similares
-
[Bug]: `graphify export svg` writes a graph.svg that is not well-formed XML when a label contains a control characterPosiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Graphify-Labs/graphify#4241 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Websites list sparkline drops to zero after a DST transitionPosiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
umami-software/umami#4606 ·
Los mantenedores suelen responder en 4 días
-
[Bug] Report tables drop a metric's trailing zeros and cap it at two decimalsPosiblemente ocupada @lansow la tomó hoy. AbiertoPotential Bug triaged
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
matomo-org/matomo#25474 ·
Los mantenedores suelen responder en 2 días
-
bug :bug:
Dificultad 2/5 1-3 horas Aptitud para principiantes 79/100
Los mantenedores suelen responder en 1 día
-
Bar mouse events report the wrong data index for sparse data (onMouseMove/Down/Up/Over/Out)Posiblemente ocupada @charan-rathore la tomó hace 1 día. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día