Conversation
This commit fixes an issue where chart components (BarChart, LineChart, DonutChart, etc.) in the documentation were not reflecting prop changes made via the playground. The fix involves: - Adding missing watchers for several props in each chart component. - Ensuring watchers trigger data/options updates (e.g., calling mergeChartDataNoSelect). - Updating chartOptions reactively by replacing the object instead of direct property mutation, ensuring vue-chartjs detects the changes. - Addressing feedback from code review by adding immediate:true to new watchers in LineChart.vue. Co-authored-by: IhGori <73910233+IhGori@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
Greptile OverviewGreptile SummaryEste PR corrige problemas de reatividade nos componentes de gráfico da documentação, garantindo que mudanças de props no playground interativo sejam refletidas corretamente nos gráficos. Principais mudanças:
Problema encontrado:
Confidence Score: 4/5
|
| Filename | Overview |
|---|---|
| src/components/BarChart.vue | Adicionados watchers para labels, variant, horizontalBar e barWidth que acionam mergeChartDataNoSelect() para garantir reatividade. Pequenos ajustes de formatação. |
| src/components/DonutChart.vue | Adicionados watchers para theme e colors que disparam mergeChartDataNoSelect(). Watcher variant também atualiza os dados do gráfico. |
| src/components/LineChart.vue | Adicionados múltiplos watchers (theme, showLabelName, fill, borderDash, scales, animation, plugins, xAxisRange, yAxisRange, smoothing) para melhorar reatividade do gráfico. |
| src/components/PieChart.vue | Adicionado watcher para colors e melhorias nos watchers de labels e variant para acionar atualização dos dados do gráfico. |
| src/components/PolarAreaChart.vue | Adicionado watcher para isVisiblePointNames que atualiza chartOptions.scales.r.pointLabels.display para reatividade das labels dos pontos. |
| src/components/RadialBarChart.vue | Adicionados watchers para theme e colors que acionam mergeChartDataNoSelect() para garantir atualização quando essas props mudam. |
| src/components/StackedBarChart.vue | Adicionado watcher para theme e melhorias no watcher barWidth para usar spread operator e garantir reatividade adequada do chartOptions. |
Sequence Diagram
sequenceDiagram
participant User as Usuário (Playground)
participant Comp as Componente de Gráfico
participant Watcher as Watchers
participant Methods as mergeChartDataNoSelect()
participant Chart as Chart.js
User->>Comp: Altera prop (variant, labels, etc.)
Comp->>Watcher: Detecta mudança na prop
Watcher->>Methods: Aciona mergeChartDataNoSelect()
Methods->>Methods: Reconstrói localChartData
Methods->>Chart: Atualiza dados do gráfico
Chart->>User: Renderiza gráfico atualizado
Last reviewed commit: b395477
Additional Comments (1)
|
|
Problemas encontrados: No barChart: |
|
Problemas encontrados: No polarChart:
|
…round - Added watchers for all relevant props in BarChart, LineChart, DonutChart, PieChart, PolarAreaChart, RadialBarChart, and StackedBarChart. - Ensured chartOptions updates are reactive by using object spread to trigger Vue reactivity. - Fixed RadialBarChart prop type and largest value calculation. - Improved LineChart dashed line logic to respect isDashed prop. - Optimized BarChart scale merging to prevent discarding custom configurations. - Verified changes with unit tests and local documentation server. Co-authored-by: IhGori <73910233+IhGori@users.noreply.github.com>


Chart components in the documentation now correctly reflect prop changes made in the interactive playground. This was achieved by adding and improving watchers in all chart components to ensure proper reactivity and re-rendering when props change.
Fixes #1059
PR created automatically by Jules for task 2291101992291832992 started by @IhGori