Drawing and Data Visualization

Garden Growth Timeline Chart

Complete a timeline chart for the garden growth scenario: includes real content, interactive controls, clear status feedback, and responsive layouts across sizes.

Drawing and Data VisualizationTimeline ChartHTMLCanvasJavaScript
With JavaScript enabled, you can edit, run, and save this example. The fixed source is as follows:
<!doctype html>
<html lang="en" dir="ltr">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>Garden Growth Timeline Chart</title>
  <style>
    :root { --ink:#18314f; --paper:#f7f8f2; --accent:#ff6b5e; --secondary:#71c9b5; --line:color-mix(in srgb, var(--ink) 18%, transparent); --shadow:0 24px 60px color-mix(in srgb, var(--ink) 16%, transparent); color-scheme:light; }
    * { box-sizing:border-box; }
    html { min-width:320px; background:var(--paper); }
    body { min-height:100vh; margin:0; overflow-x:hidden; color:var(--ink); font-family:"Songti SC","Noto Serif SC",Georgia,serif; background:linear-gradient(90deg,transparent 49.7%,color-mix(in srgb,var(--ink) 7%,transparent) 50%,transparent 50.3%),var(--paper); }
    button,input,select,textarea { color:inherit; font:inherit; }
    button,[role="button"],input,select,textarea { accent-color:var(--accent); }
    button { cursor:pointer; }
    button:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible,[tabindex]:focus-visible { outline:3px solid var(--accent); outline-offset:3px; }
    [hidden] { display:none !important; }
    @media (max-width:700px) { .mast h1 { line-height:1.08 !important; letter-spacing:-.035em !important; overflow-wrap:anywhere; } }
    @media (prefers-reduced-motion:reduce) { *,*::before,*::after { scroll-behavior:auto !important; animation-duration:.01ms !important; animation-iteration-count:1 !important; transition-duration:.01ms !important; } }
    .page{width:min(1180px,calc(100% - 40px));margin:auto;padding:7vw 0}.mast{display:grid;grid-template-columns:minmax(0,1.6fr) minmax(180px,.4fr);gap:5vw;align-items:end;margin-bottom:38px}.mast h1{font-family:"Songti SC",Georgia,serif;font-weight:800;font-size:clamp(42px,9vw,92px);max-width:920px;margin:0;line-height:.94}.eyebrow{display:block;margin-bottom:14px;color:var(--accent);font:800 11px/1 ui-monospace,monospace;letter-spacing:.24em}.intro{max-width:58ch;line-height:1.9}.scenario{align-self:start;padding-top:10px;border-top:1px solid var(--ink);font-style:italic}.demo{border-radius:0;border-width:2px;box-shadow:14px 14px 0 color-mix(in srgb,var(--ink) 18%,transparent);position:relative;overflow:hidden;min-height:420px;padding:clamp(22px,4vw,48px);background:var(--paper)}@media(max-width:700px){.page{width:calc(100% - 22px);padding:26px 0}.mast{grid-template-columns:1fr}.demo{min-height:340px;padding:18px}}
    .panel{padding:20px;border:1px solid color-mix(in srgb,var(--accent) 50%,transparent);border-radius:18px;background:color-mix(in srgb,var(--paper) 88%,transparent);box-shadow:inset 0 0 24px color-mix(in srgb,var(--accent) 7%,transparent)}.stack{display:grid;gap:16px}.row{display:flex;flex-wrap:wrap;gap:9px}.action{padding:11px 16px;border:1px solid var(--accent);border-radius:6px;color:var(--accent);background:transparent;box-shadow:0 0 14px color-mix(in srgb,var(--accent) 10%,transparent)}.action.primary,.action.is-active{color:var(--paper);background:var(--accent)}.status{min-height:24px;color:var(--secondary);text-shadow:0 0 10px currentColor}.metric{font-size:clamp(30px,7vw,64px);font-weight:900;text-shadow:0 0 18px color-mix(in srgb,var(--accent) 40%,transparent)}.muted{opacity:.7}.chip{padding:6px 9px;border:1px solid var(--secondary);border-radius:4px}.meter{height:7px;background:color-mix(in srgb,var(--accent) 15%,transparent)}.meter>i{display:block;height:100%;box-shadow:0 0 12px var(--accent);background:var(--accent)}
    .composition-studio{display:grid;gap:14px}.studio-ruler{display:flex;justify-content:space-between;padding:0 4px;color:color-mix(in srgb,var(--ink) 55%,transparent);font:700 11px/1 ui-monospace,monospace;letter-spacing:.14em}.studio-ruler::before{content:"01 / WORKING PROTOTYPE"}.studio-ruler::after{content:"360 · 768 · 1440"}.composition-studio .demo::after{content:"";position:absolute;right:18px;bottom:18px;width:24px;height:24px;border-right:2px solid var(--accent);border-bottom:2px solid var(--accent);pointer-events:none}
    .canvas-shell{display:grid;grid-template-columns:minmax(0,1.4fr) minmax(230px,.6fr);gap:16px}.canvas-shell canvas{width:100%;height:440px;border:1px solid var(--line);border-radius:18px;background:var(--ink)}.canvas-tools{display:grid;align-content:center;gap:16px}.canvas-tools label{display:grid;gap:8px;font-weight:800}@media(max-width:900px){.canvas-shell{grid-template-columns:1fr}.canvas-shell canvas{height:300px}}.drawing-pattern{display:grid;gap:14px}.timeline-controller{display:grid;grid-template-columns:minmax(0,1fr) 160px 220px auto;gap:14px;align-items:end;padding:20px;border-block:3px double var(--ink);background:var(--paper)}.timeline-controller>*{min-width:0}.timeline-controller h3{margin:.2em 0}.timeline-controller label{display:grid;gap:6px}.timeline-controller input{box-sizing:border-box;width:100%;min-width:0;padding:8px;border:1px solid var(--line);background:transparent}.timeline-controller ol{grid-column:1/-1;display:flex;flex-wrap:wrap;gap:20px;padding:18px 0 0;margin:0;border-top:1px solid var(--line);list-style-position:inside}.timeline-controller li{padding-right:18px;border-right:1px solid var(--accent)}@media(max-width:900px){.timeline-controller{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}.timeline-controller header,.timeline-controller ol{grid-column:1/-1}}.workflow-compare{display:grid;grid-template-columns:minmax(230px,.55fr) minmax(0,1.45fr);gap:18px}.compare-stage{display:grid;gap:12px;min-width:0}.compare-stage>header{display:flex;justify-content:space-between;gap:16px;align-items:end}.compare-stage h2{margin:.2em 0}.compare-core{--compare-split:50%;min-width:0;padding:14px;clip-path:inset(0 calc(100% - var(--compare-split)) 0 0);outline:1px dashed var(--accent);outline-offset:-8px;transition:clip-path .25s,filter .25s}.compare-core[data-compare-channel="B"]{filter:hue-rotate(32deg) saturate(1.15)}.compare-controls{display:grid;align-content:start;gap:16px;padding:20px;border:1px solid var(--line);border-radius:24px 4px 24px 4px;background:var(--paper)}.compare-controls fieldset,.compare-controls>label{display:grid;gap:8px}.compare-controls input[type="range"]{width:100%}#workflowCompareShelf{display:grid;gap:6px;padding:0;margin:0;list-style:none}#workflowCompareShelf li{display:grid;grid-template-columns:auto 1fr auto;gap:8px;padding:9px;border-top:1px solid var(--line);font-size:12px}@media(max-width:900px){.workflow-compare{grid-template-columns:1fr}.compare-stage{order:-1}.compare-core{clip-path:none;border-left:8px solid var(--accent)}}
  </style>
</head>
<body data-aesthetic="editorial" data-composition="studio">
  <main class="page">
    <header class="mast"><div><span class="eyebrow">editorial / timeline chart / INTERMEDIATE</span><h1>Garden Growth Timeline Chart</h1><p class="intro">Complete a timeline chart for the garden growth scenario: includes real content, interactive controls, clear status feedback, and responsive layouts across sizes.</p></div><span class="scenario">Garden Growth</span></header>
    <div class="composition-studio"><div class="studio-ruler" aria-hidden="true"></div><section class="demo" aria-label="Garden Growth Timeline Chart Interaction Area"><div class="workflow-compare"><form id="workflowCompareControls" class="compare-controls"><fieldset><legend>Reference Channel</legend><label><input type="radio" name="workflowChannel" value="A" checked>A · Sunflower Garden</label><label><input type="radio" name="workflowChannel" value="B">B · Partial Shade Flower Bed</label></fieldset><label>Stem Height Target Weight<input id="workflowCompareWeight" type="range" min="10" max="90" value="50"><output id="workflowCompareWeightValue">50 cm</output></label><label><input id="workflowCompareFreeze" type="checkbox">Freeze current version</label><button id="workflowCompareCapture" class="action primary" type="button">Sample and save observations</button><ol id="workflowCompareShelf" aria-label="Version Sampling Record"></ol></form><section class="compare-stage"><header><span class="eyebrow">Garden Growth COMPARE</span><h2>Growth comparison dual-version comparison</h2><output id="workflowCompareLive">Version A waiting for sampling</output></header><section id="workflowCore" class="workflow-core compare-core" data-compare-channel="A" style="--compare-split:50%"><!-- 11DZ_CORE_START:drawing-data-viz-timeline-chart --><div class="drawing-pattern drawing-pattern-7"><div class="canvas-shell"><canvas id="artboard" width="900" height="440" aria-label="Timeline chart canvas" aria-describedby="canvasDescription"></canvas><div class="canvas-tools panel"><span class="eyebrow">CANVAS MODE 8</span><h2>Timeline Chart</h2><label>Complexity <input id="canvasAmount" type="range" min="4" max="28" value="31"></label><button id="redrawCanvas" class="action primary" type="button">Redraw</button><p id="canvasDescription" class="muted">A timeline chart is drawn on a dark canvas using two high-contrast colors, with the complexity slider determining the number of shapes; the entire scene is generated locally in the browser.</p></div></div><form id="timelineMilestoneForm" class="drawing-controller timeline-controller"><header><span class="eyebrow">MILESTONE EDITOR</span><h3>Garden growth timeline</h3></header><label>Date<input id="timelineDate" type="date" value="2026-07-13"></label><label>Milestone<input id="timelineLabel" required value="Phase review"></label><button class="action" type="submit" data-core-bridge="drawing-data-viz-timeline-chart">Add to timeline</button><ol id="timelineMilestones"><li data-day="1">Launch</li><li data-day="12">Review</li></ol></form></div><!-- 11DZ_CORE_END --></section></section></div><p id="status" class="status" role="status" aria-live="polite"></p></section></div>
  </main>
  <script>
    'use strict';
    const statusOutput = document.querySelector('#status');
    const announce = message => { statusOutput.textContent = message; };
    /* 11DZ_CORE_SCRIPT_START:drawing-data-viz-timeline-chart */
const canvas = document.querySelector('#artboard'); const context = canvas.getContext('2d'); const amount = document.querySelector('#canvasAmount'); let drawSeed = 2426330855;
    function random(){ drawSeed = (drawSeed * 1664525 + 1013904223) >>> 0; return drawSeed / 4294967296; }
    function drawCanvas(){ const rect = canvas.getBoundingClientRect(); const ratio = Math.min(2,window.devicePixelRatio || 1); canvas.width = Math.max(320,Math.round(rect.width * ratio)); canvas.height = Math.max(240,Math.round(rect.height * ratio)); context.setTransform(ratio,0,0,ratio,0,0); const width = rect.width; const height = rect.height; context.clearRect(0,0,width,height); context.fillStyle = '#18314f'; context.fillRect(0,0,width,height); const drawingFactor=Number(canvas.dataset.drawingFactor||1); const count=Math.max(1,Math.round(Number(amount.value)*drawingFactor)); drawSeed += 1+Number(canvas.dataset.drawingShift||0); context.globalCompositeOperation=canvas.dataset.drawingBlend||'source-over';
      for(let index=0; index<count; index+=1){ const x=random()*width; const y=random()*height; const size=(10+random()*70)*Math.max(.45,drawingFactor); context.beginPath(); context.strokeStyle=index%2?'#ff6b5e':'#71c9b5'; context.fillStyle=context.strokeStyle+'88'; context.lineWidth=(2+random()*4)*Math.max(.6,drawingFactor);
        context.moveTo(width*.08+index*(width*.84/count),height*.78); context.lineTo(width*.08+index*(width*.84/count),height*.25+random()*height*.4); context.stroke(); context.arc(width*.08+index*(width*.84/count),height*.25+random()*height*.4,5,0,Math.PI*2); context.fill();
      } context.globalCompositeOperation='source-over'; announce('Canvas generated ' + count + ' graphic elements'); }
    document.querySelector('#redrawCanvas').addEventListener('click',drawCanvas); amount.addEventListener('input',drawCanvas); addEventListener('resize',drawCanvas,{passive:true}); drawCanvas();
const timelineForm=document.querySelector('#timelineMilestoneForm');const timelineEvents=[{day:1,label:'Launch'},{day:12,label:'Review'}];function drawTimelineModel(){document.querySelector('#timelineMilestones').replaceChildren(...timelineEvents.sort((left,right)=>left.day-right.day).map(entry=>{const item=document.createElement('li');item.dataset.day=String(entry.day);item.textContent=entry.day+' Day · '+entry.label;item.addEventListener('dblclick',()=>{timelineEvents.splice(timelineEvents.indexOf(entry),1);drawTimelineModel();});return item;}));canvas.dataset.drawingFactor=String(.6+timelineEvents.length*.18);canvas.dataset.drawingShift=String(timelineEvents.reduce((sum,event)=>sum+event.day,0));drawCanvas();}timelineForm.addEventListener('submit',event=>{event.preventDefault();const date=new Date(document.querySelector('#timelineDate').value+'T00:00:00');timelineEvents.push({day:date.getDate(),label:document.querySelector('#timelineLabel').value.trim()});drawTimelineModel();announce('The milestone has been added to the timeline; double-click to remove it');});drawTimelineModel();
/* 11DZ_CORE_SCRIPT_END */
const workflowBridgeSpec={"name":"drawing-data-viz-timeline-chart","selector":"[data-core-bridge=\"drawing-data-viz-timeline-chart\"]","mode":"click","key":"Enter"};const workflowBridgeCore=document.querySelector('#workflowCore');const workflowBridgeControl=workflowBridgeCore.querySelector(workflowBridgeSpec.selector);if(!workflowBridgeControl)throw new Error('Missing core bridge: '+workflowBridgeSpec.name);const workflowBridgeControlledId=workflowBridgeControl.getAttribute('aria-controls');const workflowBridgeControlled=workflowBridgeControlledId?document.getElementById(workflowBridgeControlledId):null;workflowBridgeCore.dataset.workflowBridge=workflowBridgeSpec.name;workflowBridgeCore.dataset.workflowVersion='0';function workflowBridgeSerialize(){const visualNode=workflowBridgeCore.firstElementChild||workflowBridgeCore;const visual=getComputedStyle(visualNode);const outputs=[...workflowBridgeCore.querySelectorAll('output,[role="status"],[aria-live],meter,progress')].map(node=>node.textContent.trim()+'|'+node.getAttribute('aria-valuenow')+'|'+node.getAttribute('value'));const canvas=[...workflowBridgeCore.querySelectorAll('canvas')].map(node=>{try{return node.toDataURL().slice(-160);}catch{return 'canvas-unavailable';}});return JSON.stringify({html:workflowBridgeCore.innerHTML,status:statusOutput.textContent,outputs,canvas,visual:[visual.display,visual.visibility,visual.opacity,visual.transform,visual.filter,visual.backgroundColor,visual.width,visual.height],scroll:workflowBridgeSpec.mode==='scroll'?workflowBridgeControl.scrollTop:null});}let workflowBridgeLastEffect=workflowBridgeSerialize();function workflowBridgeSummary(){const label=(workflowBridgeControl.getAttribute('aria-label')||workflowBridgeControl.textContent||workflowBridgeControl.value||workflowBridgeSpec.name).trim().replace(/\s+/g,' ').slice(0,72);return label+' · Core Version '+workflowBridgeCore.dataset.workflowVersion;}function workflowBridgeCommit(){const effect=workflowBridgeSerialize();if(effect===workflowBridgeLastEffect)return {changed:false,summary:workflowBridgeSummary()};workflowBridgeLastEffect=effect;workflowBridgeCore.dataset.workflowVersion=String(Number(workflowBridgeCore.dataset.workflowVersion||0)+1);return {changed:true,summary:workflowBridgeSummary()};}function workflowBridgeScheduleCommit(){queueMicrotask(workflowBridgeCommit);setTimeout(workflowBridgeCommit,0);}workflowBridgeControl.addEventListener("click",workflowBridgeScheduleCommit);const workflowBridgeStateTargets=new Set(workflowBridgeCore.querySelectorAll('dialog'));if(workflowBridgeControlled&&workflowBridgeCore.contains(workflowBridgeControlled))workflowBridgeStateTargets.add(workflowBridgeControlled);workflowBridgeStateTargets.forEach(target=>['close','cancel','toggle'].forEach(eventName=>target.addEventListener(eventName,workflowBridgeScheduleCommit)));function workflowBridgeActivate(){workflowBridgeControl.focus();workflowBridgeControl.click();const result=workflowBridgeCommit();setTimeout(workflowBridgeCommit,0);return result;}function workflowBridgeReset(){workflowBridgeCore.dataset.workflowVersion='0';workflowBridgeLastEffect=workflowBridgeSerialize();}
const workflowCompareCore=document.querySelector('#workflowCore');const workflowCompareWeight=document.querySelector('#workflowCompareWeight');const workflowCompareState={channel:'A',weight:50,frozen:false,snapshots:[]};function workflowCompareFingerprint(){const controls=[...workflowCompareCore.querySelectorAll('input,select,textarea')];const outputs=[...workflowCompareCore.querySelectorAll('output,[role="status"],strong')].map(node=>node.textContent.trim()).filter(Boolean);return {controlValues:controls.map(control=>control.type==='checkbox'||control.type==='radio'?control.checked:control.value),summary:outputs.slice(0,4).join(' / '),nodes:workflowCompareCore.querySelectorAll('*').length};}function workflowCompareDrive(){workflowCompareCore.dataset.compareChannel=workflowCompareState.channel;workflowCompareCore.style.setProperty('--compare-split',workflowCompareState.weight+'%');document.querySelector('#workflowCompareWeightValue').textContent=workflowCompareState.weight+' centimeters';document.querySelector('#workflowCompareLive').textContent=workflowCompareState.channel+' Version · '+workflowCompareState.weight+' centimeters'+(workflowCompareState.frozen?' · Frozen':'');announce('Growth comparison view in progress '+workflowCompareState.channel+' Version');}function workflowCompareCapture(source){const bridge=workflowBridgeActivate();const snapshot={...workflowCompareFingerprint(),channel:workflowCompareState.channel,weight:workflowCompareState.weight,source,bridge:bridge.summary};workflowCompareState.snapshots.push(snapshot);const item=document.createElement('li');item.innerHTML='<b>'+snapshot.channel+'</b><span>'+(snapshot.summary||snapshot.bridge)+'</span><small>'+snapshot.weight+' cm · '+snapshot.bridge+'</small>';document.querySelector('#workflowCompareShelf').prepend(item);announce('sampled '+snapshot.channel+' Version and save observation · '+bridge.summary);}document.querySelectorAll('[name="workflowChannel"]').forEach(input=>input.addEventListener('change',()=>{workflowCompareState.channel=input.value;workflowCompareDrive();}));workflowCompareWeight.addEventListener('input',()=>{workflowCompareState.weight=Number(workflowCompareWeight.value);workflowCompareDrive();});document.querySelector('#workflowCompareFreeze').addEventListener('change',event=>{workflowCompareState.frozen=event.currentTarget.checked;workflowCompareDrive();});document.querySelector('#workflowCompareCapture').addEventListener('click',()=>workflowCompareCapture('Button Sampling'));workflowCompareCore.addEventListener('dblclick',()=>workflowCompareCapture('Main view double-click'));workflowCompareDrive();
workflowBridgeReset();
  </script>
</body>
</html>
Page feedbackFound an issue or have suggestions for improvement?
Feedback features need to be used in the online version

Please enable JavaScript in the online version before submitting; local features of the current tool or example are not affected.

Go to the online version for feedback