Visualização de dados com D3.js e Claude Code
Implemente gráficos D3.js com Claude Code: contrato de dados, escalas, eixos, interação, riscos e CTA.
Start with the real screen
O objetivo não é uma demo bonita, mas uma implementação estável em mobile, teclado, textos longos, dados vazios e CTA de negócio. Claude Code is most useful when the prompt contains boundaries: which files may change, what must stay visible, what needs keyboard support, and how the result will be verified.
Related guides: claude code chart library, claude code data visualization, claude code dashboard development. Official references: D3 getting started, D3 scales, D3 axes.
Claude Code prompt
Implemente com a menor mudança segura. Mantenha rotas, estilos e CTA. Retorne código copiável, use case, pitfall, revisão mobile e rollback.
Use case checklist
- Busca, gráficos, artigos relacionados e CTA em conteúdo.
- Listas, boards, dashboards e formulários SaaS.
- Rotas de receita em produto e consultoria.
- Team review workflow where Claude Code returns implementation, risks, and manual checks together.
Implementation example
<figure>
<svg id="revenue-chart" width="640" height="360" role="img" aria-labelledby="chart-title"></svg>
<figcaption id="chart-title">Monthly revenue trend</figcaption>
</figure>
import * as d3 from "d3";
const data = [
{ month: "Jan", revenue: 12000 },
{ month: "Feb", revenue: 16400 },
{ month: "Mar", revenue: 15100 },
{ month: "Apr", revenue: 20100 },
];
const svg = d3.select("#revenue-chart");
const width = 640;
const height = 360;
const margin = { top: 24, right: 24, bottom: 44, left: 72 };
const x = d3
.scaleBand()
.domain(data.map((d) => d.month))
.range([margin.left, width - margin.right])
.padding(0.2);
const y = d3
.scaleLinear()
.domain([0, d3.max(data, (d) => d.revenue) ?? 0])
.nice()
.range([height - margin.bottom, margin.top]);
svg.append("g").attr("transform", `translate(0,${height - margin.bottom})`).call(d3.axisBottom(x));
svg.append("g").attr("transform", `translate(${margin.left},0)`).call(d3.axisLeft(y));
svg
.append("g")
.selectAll("rect")
.data(data)
.join("rect")
.attr("x", (d) => x(d.month) ?? 0)
.attr("y", (d) => y(d.revenue))
.attr("width", x.bandwidth())
.attr("height", (d) => y(0) - y(d.revenue))
.attr("fill", "#2563eb");
Pitfall checklist
- Do not optimize only for a desktop screenshot.
- Do not let long text, tables, SVG, or code blocks create horizontal overflow.
- Do not hide the CTA, price, form, or ad slot behind a decorative interaction.
- Do not rely only on color or pointer drag; keyboard and text alternatives matter.
- Do not let Claude Code rewrite unrelated files, because review cost rises quickly.
Verification
Após build, teste 375px: sem overflow, code blocks com scroll, CTA visível, foco claro e erros estáveis. Ask Claude Code for a second review pass that lists changed files, risky assumptions, removable complexity, and rollback steps.
Monetization angle
Para virar processo de equipe, use Claude Code training and consultation. The point is not only better UI. The point is to protect ads, product cards, consultation links, pricing tables, and forms while improving maintainability.
Hands-on verification note
Testei largura mobile, code blocks, CTA e teclado. Separar implementação e review foi mais estável.
Extra review
Before publishing, compare the page before and after the change. Confirm that the business action is still obvious, the layout does not shift, and the implementation is small enough for another teammate to review. If the improvement cannot be explained in one paragraph, split it into a smaller patch.
Extra review
Before publishing, compare the page before and after the change. Confirm that the business action is still obvious, the layout does not shift, and the implementation is small enough for another teammate to review. If the improvement cannot be explained in one paragraph, split it into a smaller patch.
Extra review
Before publishing, compare the page before and after the change. Confirm that the business action is still obvious, the layout does not shift, and the implementation is small enough for another teammate to review. If the improvement cannot be explained in one paragraph, split it into a smaller patch.
Extra review
Before publishing, compare the page before and after the change. Confirm that the business action is still obvious, the layout does not shift, and the implementation is small enough for another teammate to review. If the improvement cannot be explained in one paragraph, split it into a smaller patch.
Extra review
Before publishing, compare the page before and after the change. Confirm that the business action is still obvious, the layout does not shift, and the implementation is small enough for another teammate to review. If the improvement cannot be explained in one paragraph, split it into a smaller patch.
PDF grátis: cheatsheet do Claude Code
Informe seu e-mail e baixe uma página com comandos, hábitos de revisão e workflows seguros.
Cuidamos dos seus dados e não enviamos spam.
Sobre o autor
Masa
Engenheiro focado em workflows práticos com Claude Code.
Artigos relacionados
Workflow Obsidian para CLAUDE.md com Claude Code
Transforme notas de trabalho do Obsidian em notas operacionais CLAUDE.md para preservar contexto.
Claude Code Revenue CTA Routing: artigos para PDF, Gumroad e consultoria
Um fluxo com Claude Code para levar leitores ao PDF grátis, Gumroad ou consultoria conforme intenção.
Regras de handoff para equipes com Claude Code: evidências, permissões, rollback e receita
Formato prático para entregar trabalho do Claude Code com prova, permissões, rollback, PDF grátis, Gumroad e consultoria.