Skip to content

fix(graph): stack all series when stacked equals label - #44

Open
mguellsegarra wants to merge 1 commit into
mainfrom
fix/stacked-same-as-label
Open

mguellsegarra wants to merge 1 commit into
mainfrom
fix/stacked-same-as-label

Conversation

@mguellsegarra

Copy link
Copy Markdown
Member

Refs gisce/webclient#4323

Since #30, a stacked attribute that names a field groups series by its value. When stacked is the same field as label (for example label="name" stacked="name"), every series got its own stack, so bars were drawn side by side with cnc_active - cnc_active labels instead of stacked.

Group by the stacked value only when stacked is a field other than label. When they match, every series shares the stack named by the attribute. This matches what the webclient processor already returns for the same view.

Validation:

  • Added a regression spec for label="name" stacked="name". It failed before the change and passes now.
  • Full suite: 154 examples passed (Python 3.11, mamba).
  • Before and after rendering in the webclient: gisce/webclient#4324.

@giscebot giscebot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

He revisado el contrato de stacked, el flujo completo de GraphChart.process y la cobertura añadida.

El cambio distingue correctamente los dos significados existentes del atributo:

  • si stacked referencia un campo distinto de label, conserva el agrupado dinámico por ambos campos;
  • si stacked == label, agrupa una sola vez por la etiqueta y emite el nombre del atributo como stack común, evitando que cada serie acabe en un stack propio.

La regresión reproduce el caso real con varios valores de x y varias etiquetas, y comprueba tanto la separación de series (type) como el stack compartido. El resto de rutas (stack literal, stack por otro campo y series sin label) quedan intactas. También he comprobado diff --check y la CI del SHA 53a7fd9: 154 ejemplos pasan con Python 3.11.

No veo regresiones ni cambios de contrato accidentales. Aprobado.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants