Create an interactive model of the universe in fractal form.Zoom out takes you to the big bang, zooming in takes you through time up to present day. Include pop ups at significant events throughout time the user can view as they zoom in and out.
Assistant
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.
Here’s a proof-of-concept for a zoomable, “fractal” universe‐timeline using D3.js. Each nested ring represents a cosmic epoch; clicking a ring zooms you in, clicking the center zooms you back out. Hover (or click) any slice to see a popup with event details.
// 1) Hierarchical timeline data (in millions or billions of years before present, or in seconds for earliest epochs)
const data = {
name: "Big Bang",
start: 0, // t=0
end: 0.0000000001, // 10^−10s
description: "All space, time and matter sprang into being.",
children: [
{
name: "Inflation",
start: 0.0000000001, end: 0.000000001,
description: "Exponential expansion of spacetime."
},
{
name: "Quark Epoch",
start: 0.000000001, end: 0.0000001,
description: "Universe cooled enough for quarks to form."
},
{
name: "Recombination",
start: 380000, end: 380000,
description: "Electrons combined with nuclei; CMB released."
},
{
name: "Dark Ages",
start: 380000, end: 150_000_000,
description: "No stars yet; universe is neutral hydrogen."
},
{
name: "First Stars & Galaxies",
start: 150_000_000, end: 1_000_000_000,
description: "Star formation lights up the cosmos."
},
{
name: "Milky Way Formation",
start: 1_000_000_000, end: 3_000_000_000,
description: "Our galaxy takes shape."
},
{
name: "Solar System",
start: 4_567_000_000, end: 4_567_000_000,
description: "Sun and planets form."
},
{
name: "Origin of Life",
start: 4_100_000_000, end: 4_100_000_000,
description: "First microbial life emerges on Earth."
},
{
name: "Cambrian Explosion",
start: 541_000_000, end: 541_000_000,
description: "Rapid diversification of complex life."
},
{
name: "Dinosaur Extinction",
start: 66_000_000, end: 66_000_000,
description: "Asteroid impact wipes out non‐avian dinosaurs."
},
{
name: "Human Evolution",
start: 2_500_000, end: 300_000,
description: "Genus Homo and modern humans appear."
},
{
name: "Present Day",
start: 0, end: 0,
description: "Here we are!"
}
]
};
// 2) Set up SVG & partition layout
const width = 700;
const radius = width / 2;
const color = d3.scaleOrdinal(d3.schemeCategory10);
const svg = d3.select("#chart")
.append("svg")
.attr("width", width)
.attr("height", width)
.append("g")
.attr("transform", `translate(${radius},${radius})`);
const partition = d3.partition()
.size([2 * Math.PI, radius]);
const root = d3.hierarchy(data)
// the "value" can be the duration length to size arcs proportionally
.sum(d => Math.max(1, (d.end - d.start) || 1));
partition(root);
// 3) Arc generator
const arc = d3.arc()
.startAngle(d => d.x0)
.endAngle(d => d.x1)
.innerRadius(d => d.y0)
.outerRadius(d => d.y1);
// 4) Draw slices
const slices = svg.selectAll("path")
.data(root.descendants())
.enter()
.append("path")
.attr("class", "slice")
.attr("d", arc)
.style("fill", d => color((d.ancestors().map(d=>d.data.name).reverse().join("/"))))
.on("click", clicked)
.on("mouseover", showTooltip)
.on("mousemove", moveTooltip)
.on("mouseout", hideTooltip);
// 5) Tooltip div
const tooltip = d3.select(".tooltip");
function showTooltip(event, d) {
tooltip
.html(`<strong>${d.data.name}</strong><br/>
${d.data.description}<br/>
<em>Time:</em> ${d.data.start.toLocaleString()} – ${d.data.end.toLocaleString()} yrs`)
.style("opacity", 1);
}
function moveTooltip(event) {
tooltip
.style("left", (event.pageX + 15) + "px")
.style("top", (event.pageY + 10) + "px");
}
function hideTooltip() {
tooltip.style("opacity", 0);
}
// 6) Zooming behavior
function clicked(event, p) {
svg.transition()
.duration(750)
.tween("scale", () => {
const xd = d3.interpolate(svg.xDomain, [p.x0, p.x1]);
const yd = d3.interpolate(svg.yDomain, [p.y0, radius]);
return t => {
svg.xDomain = xd(t);
svg.yDomain = yd(t);
slices.attr("d", arc);
};
});
}
// initialize domains
svg.xDomain = [0, 2 * Math.PI];
svg.yDomain = [0, radius];
3) How It Works
Data Hierarchy
We model the universe as a tree: each “child” event descends from a broader epoch.
Fractal‐like Nesting
D3’s partition layout arranges these into concentric rings. The more zoomed‐out, the more epochs you see; zooming in reveals sub‐events.
Zoom
Clicking on a slice interpolates (tween) the angular and radial scales, smoothly zooming you into that epoch. Clicking the center (Big Bang) zooms you all the way out again.
Pop-Ups
Simple tooltip div appears on hover (or click) showing name, description, and time span.