Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FbMbJPadPzVwvt9rU9GBNo
This commit is contained in:
@@ -53,7 +53,8 @@ function BarChart({ d }: { d: Extract<Block, { type: 'chart' }>['data'] }) {
|
||||
const H = top + d.labels.length * (rowH + 8) + 4;
|
||||
const max = Math.max(...d.series.flatMap((s) => s.values), 0) || 1;
|
||||
const X = (v: number) => (v / max) * (W - L - R);
|
||||
const fmt = (v: number) => (Number.isInteger(v) ? String(v) : v.toFixed(1)) + (d.unit ?? '');
|
||||
const allInt = d.series.every((s) => s.values.every(Number.isInteger));
|
||||
const fmt = (v: number) => (allInt ? String(v) : v.toFixed(1)) + (d.unit ?? '');
|
||||
return (
|
||||
<figure className="chart-fig">
|
||||
<figcaption className="chart-title">{d.title}</figcaption>
|
||||
|
||||
Reference in New Issue
Block a user