Data designer portfolio with a morphing chart
A crisp, code-drawn site for an information designer: the same 24 marks travel between a bar chart, a scatter plot, a radial daylight chart and a tide line as you switch projects, with hover values, drawn sparklines and a copy-email button.
"use client";
import { useEffect, useRef, useState, type CSSProperties } from "react";
import "./dataviz-portfolio.css";
/**
* DatavizPortfolio: a crisp site for an information designer.
* Its signature is one chart that becomes four: the same 24 marks travel
* between a bar chart, a scatter plot, a radial daylight chart and a line,
* so switching projects feels like the data rearranging itself.
* It is a demo: the email button copies the address to the clipboard.
*/
const N = 24;
const MONTHS = ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"];
type Mark = { x: number; y: number; w: number; h: number; r: number; label: string; value: string };
type View = {
id: string;
name: string;
outlet: string;
year: string;
question: string;
xLabel: string;
yLabel: string;
line?: boolean;
marks: Mark[];
};
/* Deterministic data, so the server and browser draw the same chart. */
const wave = (i: number, a: number, b: number) => Math.sin(i * a + b) * 0.5 + 0.5;
const rain = Array.from({ length: N }, (_, i) => 40 + wave(i, 0.52, 1.2) * 60 + wave(i, 1.7, 0.3) * 18);
const cities = Array.from({ length: N }, (_, i) => ({
coffee: 1.6 + wave(i, 2.31, 0.7) * 3.4,
rent: 600 + wave(i, 1.13, 2.1) * 1700 + wave(i, 2.31, 0.7) * 600,
}));
const CITY = ["Lisbon", "Oslo", "Leeds", "Porto", "Zurich", "Kraków", "Lyon", "Dublin", "Riga", "Turin", "Ghent", "Bergen", "Seville", "Malmö", "Bristol", "Graz", "Bilbao", "Aarhus", "Brno", "Cork", "Nantes", "Tampere", "Bologna", "Utrecht"];
const daylight = Array.from({ length: N }, (_, i) => 12 + Math.cos(((i + 0.5) / N) * Math.PI * 2 - Math.PI) * 4.6);
const river = Array.from({ length: N }, (_, i) => 2.1 + Math.sin((i / N) * Math.PI * 4 - 0.6) * 1.9 + wave(i, 1.9, 0.4) * 0.3);
const VIEWS: View[] = [
{
id: "rain",
name: "Two wet years",
outlet: "The Northern Ledger",
year: "2026",
question: "Is it really always raining in Manchester?",
xLabel: "Month, 2024 to 2025",
yLabel: "Rain (mm)",
marks: rain.map((v, i) => ({
x: (i + 0.15) / N,
y: 1 - v / 130,
w: 0.7 / N,
h: v / 130,
r: 3,
label: `${MONTHS[i % 12]} ${i < 12 ? 2024 : 2025}`,
value: `${Math.round(v)} mm`,
})),
},
{
id: "coffee",
name: "The flat white index",
outlet: "City Desk Weekly",
year: "2025",
question: "Does a coffee cost more where rent is high?",
xLabel: "Flat white (€)",
yLabel: "Rent for one bed (€ a month)",
marks: cities.map((c, i) => ({
x: (c.coffee - 1.4) / 4,
y: 1 - (c.rent - 400) / 2700,
w: 0.026,
h: 0.035,
r: 99,
label: CITY[i],
value: `€${c.coffee.toFixed(2)}, €${Math.round(c.rent / 10) * 10}`,
})),
},
{
id: "daylight",
name: "A year of daylight",
outlet: "Almanac Studio",
year: "2025",
question: "How much light does a northern year give you?",
xLabel: "Fortnights, round the year",
yLabel: "Hours of daylight",
marks: daylight.map((v, i) => {
const a = ((i + 0.5) / N) * Math.PI * 2 - Math.PI / 2;
const rad = 0.1 + (v / 17) * 0.36;
return {
x: 0.5 + Math.cos(a) * rad * 0.72 - 0.014,
y: 0.5 + Math.sin(a) * rad - 0.02,
w: 0.028,
h: 0.04,
r: 99,
label: `${MONTHS[Math.floor(i / 2)]}, ${i % 2 ? "late" : "early"}`,
value: `${v.toFixed(1)} hours`,
};
}),
},
{
id: "river",
name: "The river breathes",
outlet: "Thames Field Notes",
year: "2024",
question: "How far does the tide lift the river in a day?",
xLabel: "Hour of the day",
yLabel: "Height above datum (m)",
line: true,
marks: river.map((v, i) => ({
x: i / (N - 1) - 0.008,
y: 1 - v / 4.4 - 0.012,
w: 0.016,
h: 0.024,
r: 99,
label: `${String(i).padStart(2, "0")}:00`,
value: `${v.toFixed(2)} m`,
})),
},
];
const WORK = [
{ title: "Two wet years", outlet: "The Northern Ledger", kind: "Interactive story", spark: rain },
{ title: "The flat white index", outlet: "City Desk Weekly", kind: "Print double page", spark: cities.map((c) => c.coffee) },
{ title: "A year of daylight", outlet: "Almanac Studio", kind: "Poster and wall calendar", spark: daylight },
{ title: "The river breathes", outlet: "Thames Field Notes", kind: "Live chart", spark: river },
];
function spark(values: number[]) {
const min = Math.min(...values);
const max = Math.max(...values);
return values
.map((v, i) => `${(i / (values.length - 1)) * 100},${28 - ((v - min) / (max - min || 1)) * 24}`)
.join(" ");
}
export function DatavizPortfolio({ email = "hello@example.com" }: { email?: string }) {
const [view, setView] = useState(0);
const [tip, setTip] = useState<number | null>(null);
const [copied, setCopied] = useState(false);
const timer = useRef<number | undefined>(undefined);
useEffect(() => () => window.clearTimeout(timer.current), []);
const v = VIEWS[view];
const linePoints = v.marks.map((m) => `${(m.x + m.w / 2) * 1000},${(m.y + m.h / 2) * 600}`).join(" ");
const copy = async () => {
try {
await navigator.clipboard.writeText(email);
setCopied(true);
window.clearTimeout(timer.current);
timer.current = window.setTimeout(() => setCopied(false), 2200);
} catch {
setCopied(false);
}
};
return (
<div className="gu-viz">
<header className="gu-viz__bar">
<a href="#" className="gu-viz__mark">
<svg viewBox="0 0 24 24" aria-hidden="true">
<rect x="3" y="12" width="4" height="9" />
<rect x="10" y="6" width="4" height="15" />
<circle cx="19" cy="6" r="3" />
</svg>
Rui Tanaka
</a>
<nav aria-label="Rui Tanaka">
<a href="#viz-work">Work</a>
<a href="#viz-contact" className="gu-viz__navcta">
Say hello
</a>
</nav>
</header>
<section className="gu-viz__hero">
<h1>
I turn spreadsheets into <span>things people read to the end.</span>
</h1>
<p>Information designer for newsrooms, charities and the occasional almanac.</p>
</section>
<section className="gu-viz__stage" aria-labelledby="viz-q">
<div className="gu-viz__tabs" role="tablist" aria-label="Projects">
{VIEWS.map((x, i) => (
<button
key={x.id}
type="button"
role="tab"
id={`viz-tab-${x.id}`}
aria-selected={view === i}
aria-controls="viz-panel"
tabIndex={view === i ? 0 : -1}
onClick={() => {
setView(i);
setTip(null);
}}
onKeyDown={(e) => {
const d = e.key === "ArrowRight" ? 1 : e.key === "ArrowLeft" ? -1 : 0;
if (!d) return;
e.preventDefault();
const n = (view + d + VIEWS.length) % VIEWS.length;
setView(n);
document.getElementById(`viz-tab-${VIEWS[n].id}`)?.focus();
}}
>
<span className="gu-viz__tab-no">{String(i + 1).padStart(2, "0")}</span>
{x.name}
</button>
))}
</div>
<div id="viz-panel" role="tabpanel" aria-labelledby={`viz-tab-${v.id}`} className="gu-viz__panel">
<div className="gu-viz__caption">
<p id="viz-q" key={v.id}>
{v.question}
</p>
<span>
{v.outlet}, {v.year}
</span>
</div>
<div className="gu-viz__chart" data-view={v.id} onPointerLeave={() => setTip(null)}>
<span className="gu-viz__ylabel" key={`y${v.id}`}>
{v.yLabel}
</span>
<div className="gu-viz__plot">
<span className="gu-viz__grid" aria-hidden="true" />
<span className="gu-viz__rings" aria-hidden="true" />
<svg className="gu-viz__line" viewBox="0 0 1000 600" preserveAspectRatio="none" aria-hidden="true">
{v.line && <polyline key={v.id} points={linePoints} />}
</svg>
{v.marks.map((m, i) => (
<button
key={i}
type="button"
className="gu-viz__m"
data-on={tip === i || undefined}
style={
{
left: `${m.x * 100}%`,
top: `${m.y * 100}%`,
width: `${m.w * 100}%`,
height: `${m.h * 100}%`,
borderRadius: m.r,
"--i": i,
} as CSSProperties
}
aria-label={`${m.label}: ${m.value}`}
onPointerEnter={() => setTip(i)}
onFocus={() => setTip(i)}
onBlur={() => setTip(null)}
/>
))}
{tip !== null && (
<span
className="gu-viz__tip"
style={{
left: `${(v.marks[tip].x + v.marks[tip].w / 2) * 100}%`,
top: `${v.marks[tip].y * 100}%`,
}}
aria-hidden="true"
>
<b>{v.marks[tip].label}</b>
{v.marks[tip].value}
</span>
)}
</div>
<span className="gu-viz__xlabel" key={`x${v.id}`}>
{v.xLabel}
</span>
</div>
</div>
</section>
<section id="viz-work" className="gu-viz__work" aria-labelledby="viz-work-title">
<h2 id="viz-work-title">Selected work</h2>
<ul>
{WORK.map((w, i) => (
<li key={w.title}>
<button type="button" onClick={() => setView(i)} aria-label={`Show ${w.title} in the chart above`}>
<svg viewBox="0 0 100 30" preserveAspectRatio="none" aria-hidden="true">
<polyline points={spark(w.spark)} />
</svg>
<span className="gu-viz__wt">{w.title}</span>
<span className="gu-viz__wo">
{w.outlet}, {w.kind.toLowerCase()}
</span>
</button>
</li>
))}
</ul>
</section>
<section className="gu-viz__rules" aria-labelledby="viz-rules-title">
<h2 id="viz-rules-title">How I work</h2>
<dl>
<div>
<dt>Start with the question</dt>
<dd>Every chart answers one thing a reader actually wonders about.</dd>
</div>
<div>
<dt>Label the data, not the legend</dt>
<dd>Names sit next to their lines, so nobody has to look back and forth.</dd>
</div>
<div>
<dt>Show the doubt</dt>
<dd>Ranges and gaps stay visible. A clean chart that lies is worse than none.</dd>
</div>
</dl>
</section>
<section id="viz-contact" className="gu-viz__contact" aria-labelledby="viz-contact-title">
<h2 id="viz-contact-title">Got a dataset and a deadline?</h2>
<button type="button" className="gu-viz__email" onClick={copy} data-copied={copied || undefined}>
<span className="gu-viz__email-text">{email}</span>
<span className="gu-viz__email-tag" aria-hidden="true">
{copied ? "Copied" : "Copy"}
</span>
</button>
<span role="status" className="gu-viz__sr">
{copied ? "Email address copied" : ""}
</span>
</section>
<footer className="gu-viz__foot">
<span>© 2026 Rui Tanaka</span>
<a href="#">Bluesky</a>
<a href="#">GitHub</a>
</footer>
</div>
);
}
Paste this into ChatGPT, Claude, Cursor, v0, Lovable or Bolt. It describes the layout, motion, colors and accessibility and includes the code, so the AI can rebuild it in any framework.
# Build this UI piece: Data designer portfolio with a morphing chart
You are a senior front-end engineer. Recreate the piece below in my project. If I don't say which framework I use, ask once, then build it in that framework (React, Vue, Svelte, Angular, Astro, plain HTML/CSS/JS or anything else). Keep the behavior, motion, colors, spacing and accessibility exactly as described. Keep the code clean and commented for beginners.
## What it is
A crisp one-page portfolio for an information designer ("Rui Tanaka"), drawn entirely in code. Its signature is one chart that becomes four. Four project tabs switch the same 24 marks (absolutely positioned buttons) between:
- a 24-month rain bar chart in blue,
- a scatter plot of 24 cities (coffee price against rent) as orange dots,
- a radial chart of daylight through the year, with dots on concentric rings shading from blue to amber,
- a tide line over 24 hours, as hollow dots with a blue line drawing through them.
Each mark animates its left, top, width, height and corner radius over 0.9s with an 18ms stagger, so the data seems to rearrange itself. Hovering or focusing a mark grows it, turns it orange and shows a dark tooltip with its label and value. The question for each project types in above the chart, with axis labels. Other sections: selected work as cards with sparklines that redraw in orange on hover (clicking one switches the chart), three working principles, and a big email address that copies itself.
## Palette
Paper #f5f3ee, card #fbfaf7, ink #121212, muted #6e6b66, lines rgb(18 18 18 / 0.12), blue #2b35ff for data, orange #ff5a1f for highlights and focus. Type: Inter or system-ui at 800 weight with tight tracking for headings; a monospace for numbers and tab numbers.
## Layout
- Bar: a logo of two blue bars and an orange dot (the dot drops on hover), Work, and an ink "Say hello" pill.
- Hero: a big two-tone headline (max 20ch) and one line.
- Stage: a white card with the tabs (numbered pills), the question and its source, then the plot (5:3, 4:3 on narrow screens) with a vertical y label and an x label. A grid shows for cartesian charts; rings replace it for the radial one.
- Selected work: a two-column grid of cards (sparkline, title, outlet and format).
- How I work: three short principles, each with an orange bar.
- Contact (ink band): the heading and the email, which underlines in orange on hover; a Copy tag turns orange with "Copied".
## Motion
- The chart morph as described; tooltips spring in.
- The question reveals left to right; the line draws over 1.4s.
## Accessibility
- The tabs follow the tabs pattern (role="tab", aria-selected, roving tabindex, arrow keys).
- Every mark is a button labelled with its label and value, so the data reads without the chart.
- The copy result is announced in a role="status" region.
- prefers-reduced-motion turns off every animation and transition and shows lines drawn.
## Reference implementation
The original is written in React with one plain CSS file. Dependencies: none (plain React and CSS). Translate it faithfully; do not add new libraries unless my framework needs them.
### DatavizPortfolio.tsx
```tsx
"use client";
import { useEffect, useRef, useState, type CSSProperties } from "react";
import "./dataviz-portfolio.css";
/**
* DatavizPortfolio: a crisp site for an information designer.
* Its signature is one chart that becomes four: the same 24 marks travel
* between a bar chart, a scatter plot, a radial daylight chart and a line,
* so switching projects feels like the data rearranging itself.
* It is a demo: the email button copies the address to the clipboard.
*/
const N = 24;
const MONTHS = ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"];
type Mark = { x: number; y: number; w: number; h: number; r: number; label: string; value: string };
type View = {
id: string;
name: string;
outlet: string;
year: string;
question: string;
xLabel: string;
yLabel: string;
line?: boolean;
marks: Mark[];
};
/* Deterministic data, so the server and browser draw the same chart. */
const wave = (i: number, a: number, b: number) => Math.sin(i * a + b) * 0.5 + 0.5;
const rain = Array.from({ length: N }, (_, i) => 40 + wave(i, 0.52, 1.2) * 60 + wave(i, 1.7, 0.3) * 18);
const cities = Array.from({ length: N }, (_, i) => ({
coffee: 1.6 + wave(i, 2.31, 0.7) * 3.4,
rent: 600 + wave(i, 1.13, 2.1) * 1700 + wave(i, 2.31, 0.7) * 600,
}));
const CITY = ["Lisbon", "Oslo", "Leeds", "Porto", "Zurich", "Kraków", "Lyon", "Dublin", "Riga", "Turin", "Ghent", "Bergen", "Seville", "Malmö", "Bristol", "Graz", "Bilbao", "Aarhus", "Brno", "Cork", "Nantes", "Tampere", "Bologna", "Utrecht"];
const daylight = Array.from({ length: N }, (_, i) => 12 + Math.cos(((i + 0.5) / N) * Math.PI * 2 - Math.PI) * 4.6);
const river = Array.from({ length: N }, (_, i) => 2.1 + Math.sin((i / N) * Math.PI * 4 - 0.6) * 1.9 + wave(i, 1.9, 0.4) * 0.3);
const VIEWS: View[] = [
{
id: "rain",
name: "Two wet years",
outlet: "The Northern Ledger",
year: "2026",
question: "Is it really always raining in Manchester?",
xLabel: "Month, 2024 to 2025",
yLabel: "Rain (mm)",
marks: rain.map((v, i) => ({
x: (i + 0.15) / N,
y: 1 - v / 130,
w: 0.7 / N,
h: v / 130,
r: 3,
label: `${MONTHS[i % 12]} ${i < 12 ? 2024 : 2025}`,
value: `${Math.round(v)} mm`,
})),
},
{
id: "coffee",
name: "The flat white index",
outlet: "City Desk Weekly",
year: "2025",
question: "Does a coffee cost more where rent is high?",
xLabel: "Flat white (€)",
yLabel: "Rent for one bed (€ a month)",
marks: cities.map((c, i) => ({
x: (c.coffee - 1.4) / 4,
y: 1 - (c.rent - 400) / 2700,
w: 0.026,
h: 0.035,
r: 99,
label: CITY[i],
value: `€${c.coffee.toFixed(2)}, €${Math.round(c.rent / 10) * 10}`,
})),
},
{
id: "daylight",
name: "A year of daylight",
outlet: "Almanac Studio",
year: "2025",
question: "How much light does a northern year give you?",
xLabel: "Fortnights, round the year",
yLabel: "Hours of daylight",
marks: daylight.map((v, i) => {
const a = ((i + 0.5) / N) * Math.PI * 2 - Math.PI / 2;
const rad = 0.1 + (v / 17) * 0.36;
return {
x: 0.5 + Math.cos(a) * rad * 0.72 - 0.014,
y: 0.5 + Math.sin(a) * rad - 0.02,
w: 0.028,
h: 0.04,
r: 99,
label: `${MONTHS[Math.floor(i / 2)]}, ${i % 2 ? "late" : "early"}`,
value: `${v.toFixed(1)} hours`,
};
}),
},
{
id: "river",
name: "The river breathes",
outlet: "Thames Field Notes",
year: "2024",
question: "How far does the tide lift the river in a day?",
xLabel: "Hour of the day",
yLabel: "Height above datum (m)",
line: true,
marks: river.map((v, i) => ({
x: i / (N - 1) - 0.008,
y: 1 - v / 4.4 - 0.012,
w: 0.016,
h: 0.024,
r: 99,
label: `${String(i).padStart(2, "0")}:00`,
value: `${v.toFixed(2)} m`,
})),
},
];
const WORK = [
{ title: "Two wet years", outlet: "The Northern Ledger", kind: "Interactive story", spark: rain },
{ title: "The flat white index", outlet: "City Desk Weekly", kind: "Print double page", spark: cities.map((c) => c.coffee) },
{ title: "A year of daylight", outlet: "Almanac Studio", kind: "Poster and wall calendar", spark: daylight },
{ title: "The river breathes", outlet: "Thames Field Notes", kind: "Live chart", spark: river },
];
function spark(values: number[]) {
const min = Math.min(...values);
const max = Math.max(...values);
return values
.map((v, i) => `${(i / (values.length - 1)) * 100},${28 - ((v - min) / (max - min || 1)) * 24}`)
.join(" ");
}
export function DatavizPortfolio({ email = "hello@example.com" }: { email?: string }) {
const [view, setView] = useState(0);
const [tip, setTip] = useState<number | null>(null);
const [copied, setCopied] = useState(false);
const timer = useRef<number | undefined>(undefined);
useEffect(() => () => window.clearTimeout(timer.current), []);
const v = VIEWS[view];
const linePoints = v.marks.map((m) => `${(m.x + m.w / 2) * 1000},${(m.y + m.h / 2) * 600}`).join(" ");
const copy = async () => {
try {
await navigator.clipboard.writeText(email);
setCopied(true);
window.clearTimeout(timer.current);
timer.current = window.setTimeout(() => setCopied(false), 2200);
} catch {
setCopied(false);
}
};
return (
<div className="gu-viz">
<header className="gu-viz__bar">
<a href="#" className="gu-viz__mark">
<svg viewBox="0 0 24 24" aria-hidden="true">
<rect x="3" y="12" width="4" height="9" />
<rect x="10" y="6" width="4" height="15" />
<circle cx="19" cy="6" r="3" />
</svg>
Rui Tanaka
</a>
<nav aria-label="Rui Tanaka">
<a href="#viz-work">Work</a>
<a href="#viz-contact" className="gu-viz__navcta">
Say hello
</a>
</nav>
</header>
<section className="gu-viz__hero">
<h1>
I turn spreadsheets into <span>things people read to the end.</span>
</h1>
<p>Information designer for newsrooms, charities and the occasional almanac.</p>
</section>
<section className="gu-viz__stage" aria-labelledby="viz-q">
<div className="gu-viz__tabs" role="tablist" aria-label="Projects">
{VIEWS.map((x, i) => (
<button
key={x.id}
type="button"
role="tab"
id={`viz-tab-${x.id}`}
aria-selected={view === i}
aria-controls="viz-panel"
tabIndex={view === i ? 0 : -1}
onClick={() => {
setView(i);
setTip(null);
}}
onKeyDown={(e) => {
const d = e.key === "ArrowRight" ? 1 : e.key === "ArrowLeft" ? -1 : 0;
if (!d) return;
e.preventDefault();
const n = (view + d + VIEWS.length) % VIEWS.length;
setView(n);
document.getElementById(`viz-tab-${VIEWS[n].id}`)?.focus();
}}
>
<span className="gu-viz__tab-no">{String(i + 1).padStart(2, "0")}</span>
{x.name}
</button>
))}
</div>
<div id="viz-panel" role="tabpanel" aria-labelledby={`viz-tab-${v.id}`} className="gu-viz__panel">
<div className="gu-viz__caption">
<p id="viz-q" key={v.id}>
{v.question}
</p>
<span>
{v.outlet}, {v.year}
</span>
</div>
<div className="gu-viz__chart" data-view={v.id} onPointerLeave={() => setTip(null)}>
<span className="gu-viz__ylabel" key={`y${v.id}`}>
{v.yLabel}
</span>
<div className="gu-viz__plot">
<span className="gu-viz__grid" aria-hidden="true" />
<span className="gu-viz__rings" aria-hidden="true" />
<svg className="gu-viz__line" viewBox="0 0 1000 600" preserveAspectRatio="none" aria-hidden="true">
{v.line && <polyline key={v.id} points={linePoints} />}
</svg>
{v.marks.map((m, i) => (
<button
key={i}
type="button"
className="gu-viz__m"
data-on={tip === i || undefined}
style={
{
left: `${m.x * 100}%`,
top: `${m.y * 100}%`,
width: `${m.w * 100}%`,
height: `${m.h * 100}%`,
borderRadius: m.r,
"--i": i,
} as CSSProperties
}
aria-label={`${m.label}: ${m.value}`}
onPointerEnter={() => setTip(i)}
onFocus={() => setTip(i)}
onBlur={() => setTip(null)}
/>
))}
{tip !== null && (
<span
className="gu-viz__tip"
style={{
left: `${(v.marks[tip].x + v.marks[tip].w / 2) * 100}%`,
top: `${v.marks[tip].y * 100}%`,
}}
aria-hidden="true"
>
<b>{v.marks[tip].label}</b>
{v.marks[tip].value}
</span>
)}
</div>
<span className="gu-viz__xlabel" key={`x${v.id}`}>
{v.xLabel}
</span>
</div>
</div>
</section>
<section id="viz-work" className="gu-viz__work" aria-labelledby="viz-work-title">
<h2 id="viz-work-title">Selected work</h2>
<ul>
{WORK.map((w, i) => (
<li key={w.title}>
<button type="button" onClick={() => setView(i)} aria-label={`Show ${w.title} in the chart above`}>
<svg viewBox="0 0 100 30" preserveAspectRatio="none" aria-hidden="true">
<polyline points={spark(w.spark)} />
</svg>
<span className="gu-viz__wt">{w.title}</span>
<span className="gu-viz__wo">
{w.outlet}, {w.kind.toLowerCase()}
</span>
</button>
</li>
))}
</ul>
</section>
<section className="gu-viz__rules" aria-labelledby="viz-rules-title">
<h2 id="viz-rules-title">How I work</h2>
<dl>
<div>
<dt>Start with the question</dt>
<dd>Every chart answers one thing a reader actually wonders about.</dd>
</div>
<div>
<dt>Label the data, not the legend</dt>
<dd>Names sit next to their lines, so nobody has to look back and forth.</dd>
</div>
<div>
<dt>Show the doubt</dt>
<dd>Ranges and gaps stay visible. A clean chart that lies is worse than none.</dd>
</div>
</dl>
</section>
<section id="viz-contact" className="gu-viz__contact" aria-labelledby="viz-contact-title">
<h2 id="viz-contact-title">Got a dataset and a deadline?</h2>
<button type="button" className="gu-viz__email" onClick={copy} data-copied={copied || undefined}>
<span className="gu-viz__email-text">{email}</span>
<span className="gu-viz__email-tag" aria-hidden="true">
{copied ? "Copied" : "Copy"}
</span>
</button>
<span role="status" className="gu-viz__sr">
{copied ? "Email address copied" : ""}
</span>
</section>
<footer className="gu-viz__foot">
<span>© 2026 Rui Tanaka</span>
<a href="#">Bluesky</a>
<a href="#">GitHub</a>
</footer>
</div>
);
}
```
### dataviz-portfolio.css
```css
/* Rui Tanaka: clean paper, ink, one blue for data and one orange for the thing to notice. */
.gu-viz {
--bg: #f5f3ee;
--card: #fbfaf7;
--ink: #121212;
--muted: #6e6b66;
--line: rgb(18 18 18 / 0.12);
--blue: #2b35ff;
--orange: #ff5a1f;
--focus: #ff5a1f;
--ease: cubic-bezier(0.22, 1, 0.36, 1);
--spring: cubic-bezier(0.34, 1.56, 0.64, 1);
--mono: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, monospace;
position: relative;
container-type: inline-size;
overflow: hidden;
background: var(--bg);
color: var(--ink);
font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
line-height: 1.5;
}
.gu-viz *,
.gu-viz *::before,
.gu-viz *::after {
box-sizing: border-box;
}
.gu-viz a {
color: inherit;
}
.gu-viz :focus-visible {
outline: 3px solid var(--focus);
outline-offset: 3px;
}
.gu-viz__sr {
position: absolute;
width: 1px;
height: 1px;
overflow: hidden;
clip-path: inset(50%);
white-space: nowrap;
}
/* ---------- Bar ---------- */
.gu-viz__bar {
display: flex;
align-items: center;
justify-content: space-between;
gap: 16px;
padding: 22px 6%;
}
.gu-viz__mark {
display: inline-flex;
align-items: center;
gap: 10px;
font-weight: 800;
letter-spacing: -0.02em;
text-decoration: none;
}
.gu-viz__mark svg {
width: 24px;
fill: var(--blue);
}
.gu-viz__mark svg circle {
fill: var(--orange);
transition: transform 0.5s var(--spring);
transform-origin: 19px 6px;
}
.gu-viz__mark:hover svg circle {
transform: translateY(6px) scale(1.2);
}
.gu-viz__bar nav {
display: flex;
align-items: center;
gap: 24px;
font-weight: 600;
}
.gu-viz__bar nav a:not(.gu-viz__navcta) {
text-decoration: none;
color: var(--muted);
transition: color 0.3s;
}
.gu-viz__bar nav a:not(.gu-viz__navcta):hover {
color: var(--ink);
}
.gu-viz__navcta {
padding: 9px 18px;
border-radius: 999px;
background: var(--ink);
color: var(--bg) !important;
text-decoration: none;
transition: background-color 0.3s;
}
.gu-viz__navcta:hover {
background: var(--blue);
}
/* ---------- Hero ---------- */
.gu-viz__hero {
padding: 50px 6% 40px;
}
.gu-viz__hero h1 {
max-width: 20ch;
margin: 0;
font-size: clamp(2.4rem, 6.2cqi, 5rem);
font-weight: 800;
line-height: 0.98;
letter-spacing: -0.045em;
animation: gu-viz-rise 1s var(--ease) both;
}
.gu-viz__hero h1 span {
color: var(--blue);
}
.gu-viz__hero p {
margin: 20px 0 0;
color: var(--muted);
font-size: 1.05rem;
animation: gu-viz-rise 1s var(--ease) 0.15s both;
}
/* ---------- The chart ---------- */
.gu-viz__stage {
margin: 0 6%;
padding: 22px;
border: 1px solid var(--line);
border-radius: 22px;
background: var(--card);
box-shadow: 0 30px 60px -40px rgb(18 18 18 / 0.35);
animation: gu-viz-rise 1.1s var(--ease) 0.25s both;
}
.gu-viz__tabs {
display: flex;
gap: 6px;
overflow-x: auto;
padding-bottom: 4px;
scrollbar-width: none;
}
.gu-viz__tabs button {
display: inline-flex;
align-items: baseline;
gap: 8px;
flex: none;
min-height: 42px;
padding: 0 16px;
border: 1px solid var(--line);
border-radius: 999px;
background: transparent;
color: var(--muted);
font: inherit;
font-size: 0.9rem;
font-weight: 600;
cursor: pointer;
transition:
background-color 0.35s var(--ease),
color 0.35s var(--ease),
border-color 0.35s;
}
.gu-viz__tab-no {
font-family: var(--mono);
font-size: 0.75rem;
opacity: 0.7;
}
.gu-viz__tabs button:hover {
color: var(--ink);
border-color: var(--ink);
}
.gu-viz__tabs button[aria-selected="true"] {
background: var(--ink);
border-color: var(--ink);
color: var(--bg);
}
.gu-viz__caption {
display: flex;
flex-wrap: wrap;
align-items: baseline;
justify-content: space-between;
gap: 6px 20px;
margin: 22px 0 14px;
}
.gu-viz__caption p {
margin: 0;
font-size: clamp(1.2rem, 2.6cqi, 1.7rem);
font-weight: 700;
letter-spacing: -0.02em;
animation: gu-viz-type 0.7s var(--ease) both;
}
.gu-viz__caption span {
color: var(--muted);
font-size: 0.88rem;
}
.gu-viz__chart {
display: grid;
grid-template-columns: auto 1fr;
grid-template-rows: 1fr auto;
gap: 8px 10px;
}
.gu-viz__ylabel {
grid-row: 1;
writing-mode: vertical-rl;
rotate: 180deg;
justify-self: center;
color: var(--muted);
font-size: 0.78rem;
animation: gu-viz-fade 0.6s var(--ease) both;
}
.gu-viz__xlabel {
grid-column: 2;
justify-self: end;
color: var(--muted);
font-size: 0.78rem;
animation: gu-viz-fade 0.6s var(--ease) both;
}
.gu-viz__plot {
position: relative;
aspect-ratio: 5 / 3;
border-left: 1px solid var(--ink);
border-bottom: 1px solid var(--ink);
}
.gu-viz__grid {
position: absolute;
inset: 0;
background: repeating-linear-gradient(to top, var(--line) 0 1px, transparent 1px 20%);
transition: opacity 0.6s;
}
.gu-viz__rings {
position: absolute;
left: 50%;
top: 50%;
width: 66%;
aspect-ratio: 1;
border-radius: 50%;
background: repeating-radial-gradient(circle, transparent 0 calc(16.6% - 1px), var(--line) calc(16.6% - 1px) 16.6%);
translate: -50% -50%;
opacity: 0;
scale: 0.6;
transition:
opacity 0.6s var(--ease),
scale 0.9s var(--ease);
}
.gu-viz__chart[data-view="daylight"] .gu-viz__rings {
opacity: 1;
scale: 1;
}
.gu-viz__chart[data-view="daylight"] .gu-viz__grid {
opacity: 0;
}
.gu-viz__chart[data-view="daylight"] .gu-viz__plot {
border-color: transparent;
}
.gu-viz__plot {
transition: border-color 0.6s;
}
.gu-viz__line {
position: absolute;
inset: 0;
width: 100%;
height: 100%;
overflow: visible;
pointer-events: none;
}
.gu-viz__line polyline {
fill: none;
stroke: var(--blue);
stroke-width: 2.5;
stroke-linejoin: round;
vector-effect: non-scaling-stroke;
animation: gu-viz-reveal 1.4s var(--ease) 0.5s both;
}
/* The 24 marks: the same elements travel between every chart. */
.gu-viz__m {
position: absolute;
padding: 0;
border: 0;
background: var(--blue);
cursor: pointer;
transition:
left 0.9s var(--ease),
top 0.9s var(--ease),
width 0.9s var(--ease),
height 0.9s var(--ease),
border-radius 0.9s var(--ease),
background-color 0.5s,
scale 0.35s var(--spring);
transition-delay: calc(var(--i) * 18ms);
}
.gu-viz__chart[data-view="coffee"] .gu-viz__m {
background: var(--orange);
box-shadow: 0 0 0 3px var(--card);
}
.gu-viz__chart[data-view="daylight"] .gu-viz__m {
background: color-mix(in oklch, var(--blue), #ffb43a calc(var(--i) * 4%));
}
.gu-viz__chart[data-view="river"] .gu-viz__m {
background: var(--card);
box-shadow: inset 0 0 0 2px var(--blue);
}
.gu-viz__m:hover,
.gu-viz__m[data-on] {
scale: 1.3;
background: var(--orange) !important;
transition-delay: 0s;
z-index: 2;
}
.gu-viz__tip {
position: absolute;
z-index: 3;
display: grid;
padding: 8px 12px;
border-radius: 10px;
background: var(--ink);
color: var(--bg);
font-family: var(--mono);
font-size: 0.78rem;
white-space: nowrap;
pointer-events: none;
translate: -50% calc(-100% - 12px);
animation: gu-viz-tip 0.3s var(--spring) both;
}
.gu-viz__tip b {
font-family: "Inter", system-ui, sans-serif;
font-size: 0.85rem;
}
/* ---------- Selected work ---------- */
.gu-viz__work {
padding: 80px 6% 60px;
}
.gu-viz__work h2,
.gu-viz__rules h2,
.gu-viz__contact h2 {
margin: 0 0 24px;
font-size: clamp(1.8rem, 4cqi, 2.8rem);
font-weight: 800;
letter-spacing: -0.035em;
}
.gu-viz__work ul {
display: grid;
grid-template-columns: repeat(2, 1fr);
gap: 12px;
margin: 0;
padding: 0;
list-style: none;
}
.gu-viz__work button {
display: grid;
gap: 4px;
width: 100%;
padding: 18px;
border: 1px solid var(--line);
border-radius: 16px;
background: var(--card);
color: var(--ink);
font: inherit;
text-align: left;
cursor: pointer;
transition:
border-color 0.3s,
transform 0.4s var(--ease),
box-shadow 0.4s var(--ease);
}
.gu-viz__work button:hover {
border-color: var(--ink);
transform: translateY(-3px);
box-shadow: 0 20px 30px -24px rgb(18 18 18 / 0.5);
}
.gu-viz__work svg {
width: 100%;
height: 40px;
margin-bottom: 8px;
overflow: visible;
}
.gu-viz__work polyline {
fill: none;
stroke: var(--blue);
stroke-width: 2;
vector-effect: non-scaling-stroke;
transition: stroke 0.3s;
}
.gu-viz__work button:hover polyline {
animation: gu-viz-reveal 1s var(--ease);
stroke: var(--orange);
}
.gu-viz__wt {
font-weight: 700;
}
.gu-viz__wo {
color: var(--muted);
font-size: 0.88rem;
}
/* ---------- Principles ---------- */
.gu-viz__rules {
padding: 60px 6%;
border-top: 1px solid var(--line);
}
.gu-viz__rules dl {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 28px;
margin: 0;
}
.gu-viz__rules dt {
margin-bottom: 6px;
font-weight: 700;
}
.gu-viz__rules dt::before {
content: "";
display: block;
width: 28px;
height: 4px;
margin-bottom: 14px;
border-radius: 2px;
background: var(--orange);
}
.gu-viz__rules dd {
margin: 0;
color: var(--muted);
}
/* ---------- Contact ---------- */
.gu-viz__contact {
padding: 80px 6%;
background: var(--ink);
color: var(--bg);
}
.gu-viz__email {
display: inline-flex;
align-items: center;
flex-wrap: wrap;
gap: 14px;
padding: 0;
border: 0;
background: transparent;
color: var(--bg);
font: inherit;
cursor: pointer;
}
.gu-viz__email-text {
font-size: clamp(1.6rem, 5.4cqi, 3.6rem);
font-weight: 800;
letter-spacing: -0.04em;
background: linear-gradient(var(--orange), var(--orange)) 0 100% / 0 4px no-repeat;
transition: background-size 0.6s var(--ease);
}
.gu-viz__email:hover .gu-viz__email-text {
background-size: 100% 4px;
}
.gu-viz__email-tag {
padding: 6px 12px;
border: 1px solid rgb(245 243 238 / 0.3);
border-radius: 999px;
font-size: 0.85rem;
font-weight: 600;
transition:
background-color 0.3s,
color 0.3s;
}
.gu-viz__email[data-copied] .gu-viz__email-tag {
border-color: var(--orange);
background: var(--orange);
color: var(--ink);
animation: gu-viz-tip 0.4s var(--spring);
}
.gu-viz__foot {
display: flex;
flex-wrap: wrap;
gap: 12px 26px;
padding: 24px 6% 32px;
background: var(--ink);
color: rgb(245 243 238 / 0.6);
font-size: 0.9rem;
border-top: 1px solid rgb(245 243 238 / 0.12);
}
.gu-viz__foot span {
flex: 1;
}
/* ---------- Motion ---------- */
@keyframes gu-viz-rise {
from {
opacity: 0;
transform: translateY(22px);
}
}
@keyframes gu-viz-fade {
from {
opacity: 0;
}
}
@keyframes gu-viz-type {
from {
opacity: 0;
clip-path: inset(0 100% 0 0);
}
to {
clip-path: inset(0 0 0 0);
}
}
@keyframes gu-viz-reveal {
from {
clip-path: inset(-10% 100% -10% 0);
}
to {
clip-path: inset(-10% 0 -10% 0);
}
}
@keyframes gu-viz-tip {
from {
opacity: 0;
scale: 0.85;
}
}
/* ---------- Narrow ---------- */
@container (max-width: 700px) {
.gu-viz__rules dl {
grid-template-columns: 1fr;
}
.gu-viz__plot {
aspect-ratio: 4 / 3;
}
}
@container (max-width: 560px) {
.gu-viz__bar nav > a:not(.gu-viz__navcta) {
display: none;
}
.gu-viz__stage {
margin: 0 4%;
padding: 14px;
}
.gu-viz__work ul {
grid-template-columns: 1fr;
}
}
@media (prefers-reduced-motion: reduce) {
.gu-viz *,
.gu-viz *::before,
.gu-viz *::after {
animation: none !important;
transition: none !important;
}
}
```
You might also want
Next piece: Dental clinic landing page with a treatment finderCeramicist portfolio with a pottery wheel
Portfolios, advanced
Developer portfolio
Portfolios, intermediate
Fashion designer portfolio with a lookbook loupe
Portfolios, advanced