Outpatient scheduling trend analysis dashboard
Complete the trend analysis panel for an outpatient scheduling scenario: includes real content, actionable controls, clear status feedback, and responsive layouts across sizes.
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>Outpatient scheduling trend analysis dashboard</title>
<style>
:root { --ink:#102c44; --paper:#eef6f8; --accent:#e05263; --secondary:#79b7c7; --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:"Hiragino Maru Gothic ProN","PingFang SC",sans-serif; background:radial-gradient(circle at 15% 10%,color-mix(in srgb,var(--secondary) 35%,transparent) 0 9%,transparent 10%),radial-gradient(circle at 90% 75%,color-mix(in srgb,var(--accent) 18%,transparent) 0 12%,transparent 13%),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(1140px,calc(100% - 28px));margin:auto;padding:54px 0}.mast{display:flex;justify-content:space-between;align-items:center;gap:24px;margin:0 12px 28px}.mast h1{font-family:"Hiragino Maru Gothic ProN","PingFang SC",sans-serif;font-weight:900;font-size:clamp(38px,8vw,82px);letter-spacing:-.035em;margin:0;line-height:.98}.eyebrow{display:inline-flex;padding:7px 12px;border-radius:999px;color:var(--paper);background:var(--accent);font-weight:900}.intro{max-width:620px;line-height:1.65}.scenario{padding:12px 18px;border-radius:999px;background:var(--secondary);box-shadow:0 7px 0 color-mix(in srgb,var(--ink) 18%,transparent);font-weight:900}.demo{border-radius:46px 18px 46px 18px;box-shadow:0 18px 0 color-mix(in srgb,var(--secondary) 45%,transparent);position:relative;min-height:390px;overflow:hidden;padding:clamp(22px,5vw,54px);background:color-mix(in srgb,var(--paper) 90%,#fff)}@media(max-width:700px){.mast{display:grid}.page{width:calc(100% - 16px);padding:18px 0}.demo{padding:17px}}
.stack{display:flex;flex-direction:column;gap:18px}.panel{padding:28px;border-left:7px solid var(--accent);background:color-mix(in srgb,var(--secondary) 12%,var(--paper))}.action{min-height:46px;padding:11px 18px;border:0;border-bottom:3px solid var(--ink);background:transparent;font-weight:900}.action.primary,.action.is-active{color:var(--paper);background:var(--ink)}.row{display:grid;grid-template-columns:repeat(auto-fit,minmax(120px,1fr));gap:8px}.metric{font:900 clamp(32px,7vw,64px)/1 ui-monospace,monospace}.status{min-height:22px;padding-top:12px;border-top:1px dashed var(--line)}.muted{color:color-mix(in srgb,var(--ink) 62%,transparent)}.chip{display:inline-block;padding:5px 8px;background:var(--secondary)}.meter{height:12px;border:1px solid var(--ink)}.meter>i{display:block;height:100%;background:var(--ink)}
.composition-gallery{margin:0;padding:clamp(8px,2vw,18px);border:1px solid var(--ink);background:color-mix(in srgb,var(--paper) 78%,transparent)}.gallery-caption{display:grid;grid-template-columns:auto 1fr auto;gap:16px;align-items:center;padding:15px 4px 2px;font-size:12px}.gallery-caption::before,.gallery-caption::after{content:"";height:1px;background:var(--line)}.gallery-caption strong{font:800 11px/1.2 ui-monospace,monospace;letter-spacing:.16em;text-transform:uppercase}.composition-gallery .demo{box-shadow:none}.composition-gallery .demo::before{content:"";position:absolute;inset:10px;border:1px dashed color-mix(in srgb,var(--accent) 36%,transparent);pointer-events:none}
.ops-trend{display:grid;gap:16px}.ops-trend>header{display:grid;grid-template-columns:1fr minmax(150px,.25fr) minmax(180px,.35fr);gap:18px;align-items:end;padding-bottom:16px;border-bottom:1px solid var(--line)}.ops-trend h2{margin:.2em 0}.ops-trend header label{display:grid;grid-template-columns:1fr auto;gap:7px}.ops-trend header select,.ops-trend header input{grid-column:1/-1;width:100%}.ops-trend-board{display:grid;grid-template-columns:minmax(0,1.5fr) minmax(210px,.5fr);gap:14px}.ops-chart-card{display:grid;gap:8px;padding:14px;border:1px solid var(--line);background:#081b25;color:#dff7f5}.ops-chart-card svg{width:100%;min-height:320px}.ops-chart-card #opsTrendPath{fill:none;stroke:#5eead4;stroke-width:5;stroke-linecap:round;stroke-linejoin:round}.ops-chart-card #opsTrendArea{fill:url(#none);fill:#2dd4bf22;stroke:none}.ops-chart-card circle{fill:#fb923c;stroke:#081b25;stroke-width:4;cursor:crosshair}.ops-chart-card output{min-height:22px;color:#99f6e4}.ops-trend-board>aside{display:grid;align-content:start;gap:9px}.ops-trend-board article{display:grid;gap:5px;padding:16px;border:1px solid var(--line);background:var(--paper)}.ops-trend-board strong{font-size:clamp(28px,5vw,48px)}#opsTrendAlerts{display:grid;gap:6px;padding:0;margin:0;list-style:none}#opsTrendAlerts li{padding:9px;border-left:4px solid var(--accent);background:color-mix(in srgb,var(--accent) 9%,var(--paper));font-size:12px}@media(max-width:760px){.ops-trend>header,.ops-trend-board{grid-template-columns:1fr}.ops-chart-card svg{min-height:240px}}.workflow-session{display:grid;gap:14px}.session-command{display:grid;grid-template-columns:1fr auto minmax(170px,.45fr) auto;gap:16px;align-items:end;padding:18px;border-block:4px double var(--ink)}.session-command h2{margin:.2em 0}.session-command output{font:900 clamp(28px,5vw,54px)/1 ui-monospace,monospace}.session-command label{display:grid;grid-template-columns:1fr auto;gap:7px;font-size:12px}.session-command input{grid-column:1/-1;width:100%}#workflowSessionProgress{height:12px;overflow:hidden;border-radius:2px;background:var(--line)}#workflowSessionProgress i{display:block;width:0;height:100%;background:var(--accent)}.session-stage{min-width:0;transition:filter .25s,transform .25s}.session-stage[data-session-phase="running"]{transform:translateY(-3px)}.session-stage[data-session-phase="paused"]{filter:grayscale(.65)}.session-stage[data-session-phase="complete"]{filter:contrast(.78);opacity:.72}.session-log{display:grid;grid-template-columns:auto 1fr;gap:18px;align-items:start}.session-log ol{display:flex;flex-wrap:wrap;gap:7px;padding:0;margin:0;list-style:none}.session-log li{padding:5px 8px;border:1px solid var(--line);font-size:12px}@media(max-width:900px){.session-stage{order:-1}.session-command{grid-template-columns:1fr auto}.session-command label{grid-column:1/-1}.session-log{grid-template-columns:1fr}}
</style>
</head>
<body data-aesthetic="playful" data-composition="gallery-frame">
<main class="page">
<header class="mast"><div><span class="eyebrow">playful / Trend Analysis Dashboard / BEGINNER</span><h1>Outpatient scheduling trend analysis dashboard</h1><p class="intro">Complete the trend analysis panel for an outpatient scheduling scenario: includes real content, actionable controls, clear status feedback, and responsive layouts across sizes.</p></div><span class="scenario">Clinic schedule</span></header>
<figure class="composition-gallery"><section class="demo" aria-label="Outpatient Scheduling Trend Analysis Panel Interaction Area"><div class="workflow-session"><header class="session-command"><div><span class="eyebrow">Outpatient Scheduling SESSION</span><h2>Outpatient Window Timer</h2></div><output id="workflowSessionClock">00:45</output><label>Round Duration<input id="workflowSessionLength" type="range" min="15" max="90" step="15" value="45"><span>sec</span></label><button id="workflowSessionToggle" class="action primary" type="button">Start shift duty</button></header><div id="workflowSessionProgress" role="progressbar" aria-label="Outpatient Window Progress" aria-valuemin="0" aria-valuemax="100" aria-valuenow="0"><i></i></div><section id="workflowCore" class="workflow-core session-stage" data-session-phase="ready" tabindex="-1"><!-- 11DZ_CORE_START:dashboards-admin-trend-chart --><div class="ops-trend"><header><div><span class="eyebrow">OPERATIONS TREND</span><h2>Outpatient Scheduling Waiting Count</h2><p>View real business units by operating shift, and generate pending intervals directly with thresholds.</p></div><label>Observation Window<select id="opsTrendWindow" data-core-bridge="dashboards-admin-trend-chart"><option value="6">Recent 6 Shift</option><option value="9">Recent 9 shift</option><option value="12" selected>All 12 classes</option></select></label><label>Alert threshold<input id="opsTrendThreshold" type="range" min="10" max="120" value="60"><output id="opsTrendThresholdValue">60 people</output></label></header><section class="ops-trend-board"><div class="ops-chart-card"><svg id="opsTrendSvg" viewBox="0 0 760 360" role="img" aria-labelledby="opsTrendTitle opsTrendDesc"><title id="opsTrendTitle">Outpatient Scheduling Operations Trend</title><desc id="opsTrendDesc">The line chart shows the number of patients waiting across twelve operating shifts, and the dashed line indicates the alert threshold.</desc><g id="opsTrendGrid" aria-hidden="true"></g><line id="opsTrendLimit" x1="48" x2="732" stroke="currentColor" stroke-dasharray="8 7"></line><path id="opsTrendArea"></path><path id="opsTrendPath"></path><g id="opsTrendPoints"></g></svg><output id="opsTrendHover">Move over a data point to view the shift</output></div><aside><article><span>Current value</span><strong id="opsTrendCurrent">—</strong></article><article><span>Window mean</span><strong id="opsTrendAverage">—</strong></article><article><span>Exceeds threshold</span><strong id="opsTrendBreaches">—</strong></article><ol id="opsTrendAlerts" aria-label="Threshold Event"></ol></aside></section></div><!-- 11DZ_CORE_END --></section><footer class="session-log"><strong id="workflowSessionScore">0 interaction checkpoints</strong><ol id="workflowSessionLaps" aria-label="Round Log"></ol></footer></div><p id="status" class="status" role="status" aria-live="polite"></p></section><figcaption class="gallery-caption"><strong>Outpatient Schedule / GALLERY 03</strong></figcaption></figure>
</main>
<script>
'use strict';
const statusOutput = document.querySelector('#status');
const announce = message => { statusOutput.textContent = message; };
/* 11DZ_CORE_SCRIPT_START:dashboards-admin-trend-chart */
const opsTrendAll=[18,32,47,55,43,36,29,41,52,38,24,17];const opsTrendUnit='person';const opsTrendWindow=document.querySelector('#opsTrendWindow');const opsTrendThreshold=document.querySelector('#opsTrendThreshold');const opsTrendSvg=document.querySelector('#opsTrendSvg');const opsTrendState={windowSize:12,threshold:60,visible:opsTrendAll};function opsTrendScale(value,max){return 320-value/max*260;}function renderOpsTrend(){opsTrendState.windowSize=Number(opsTrendWindow.value);opsTrendState.threshold=Number(opsTrendThreshold.value);opsTrendState.visible=opsTrendAll.slice(-opsTrendState.windowSize);const max=Math.max(opsTrendState.threshold,...opsTrendState.visible)*1.12;const step=684/Math.max(1,opsTrendState.visible.length-1);const points=opsTrendState.visible.map((value,index)=>({value,x:48+index*step,y:opsTrendScale(value,max),shift:opsTrendAll.length-opsTrendState.visible.length+index+1}));const commands=points.map((point,index)=>(index?'L':'M')+point.x.toFixed(1)+' '+point.y.toFixed(1)).join(' ');document.querySelector('#opsTrendPath').setAttribute('d',commands);document.querySelector('#opsTrendArea').setAttribute('d',commands+' L '+points.at(-1).x+' 320 L 48 320 Z');const limitY=opsTrendScale(opsTrendState.threshold,max);const limit=document.querySelector('#opsTrendLimit');limit.setAttribute('y1',String(limitY));limit.setAttribute('y2',String(limitY));const pointGroup=document.querySelector('#opsTrendPoints');pointGroup.replaceChildren(...points.map(point=>{const circle=document.createElementNS('http://www.w3.org/2000/svg','circle');circle.setAttribute('cx',String(point.x));circle.setAttribute('cy',String(point.y));circle.setAttribute('r','7');circle.dataset.value=String(point.value);circle.dataset.shift=String(point.shift);circle.setAttribute('tabindex','0');circle.setAttribute('aria-label','No. '+point.shift+' class,'+point.value+' '+opsTrendUnit);return circle;}));const average=Math.round(opsTrendState.visible.reduce((sum,value)=>sum+value,0)/opsTrendState.visible.length);const breaches=points.filter(point=>point.value>opsTrendState.threshold);document.querySelector('#opsTrendCurrent').textContent=opsTrendState.visible.at(-1)+' '+opsTrendUnit;document.querySelector('#opsTrendAverage').textContent=average+' '+opsTrendUnit;document.querySelector('#opsTrendBreaches').textContent=breaches.length+' Shift';document.querySelector('#opsTrendThresholdValue').textContent=opsTrendState.threshold+' '+opsTrendUnit;document.querySelector('#opsTrendAlerts').replaceChildren(...breaches.map(point=>{const item=document.createElement('li');item.textContent='No. '+point.shift+' Class exceeds threshold '+(point.value-opsTrendState.threshold)+' '+opsTrendUnit;return item;}));announce('Outpatient scheduling trends have been updated,'+breaches.length+' shifts need attention');}opsTrendWindow.addEventListener('change',renderOpsTrend);opsTrendThreshold.addEventListener('input',renderOpsTrend);opsTrendSvg.addEventListener('pointermove',event=>{const target=event.target.closest('circle');if(!target)return;document.querySelector('#opsTrendHover').textContent='No. '+target.dataset.shift+' class · '+target.dataset.value+' '+opsTrendUnit;});opsTrendSvg.addEventListener('focusin',event=>{if(event.target.matches('circle'))document.querySelector('#opsTrendHover').textContent=event.target.getAttribute('aria-label');});renderOpsTrend();
/* 11DZ_CORE_SCRIPT_END */
const workflowBridgeSpec={"name":"dashboards-admin-trend-chart","selector":"[data-core-bridge=\"dashboards-admin-trend-chart\"]","mode":"select","key":"ArrowRight"};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.setAttribute('aria-keyshortcuts',workflowBridgeSpec.key);workflowBridgeControl.addEventListener('keydown',event=>{if(event.key!==workflowBridgeSpec.key)return;event.preventDefault();workflowBridgeControl.selectedIndex=(workflowBridgeControl.selectedIndex+1)%workflowBridgeControl.options.length;workflowBridgeControl.dispatchEvent(new Event('input',{bubbles:true}));workflowBridgeControl.dispatchEvent(new Event('change',{bubbles:true}));});workflowBridgeControl.addEventListener("keydown",workflowBridgeScheduleCommit);workflowBridgeControl.addEventListener('input',workflowBridgeScheduleCommit);workflowBridgeControl.addEventListener('change',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.selectedIndex=(workflowBridgeControl.selectedIndex+1)%workflowBridgeControl.options.length;workflowBridgeControl.dispatchEvent(new Event('change',{bubbles:true}));const result=workflowBridgeCommit();setTimeout(workflowBridgeCommit,0);return result;}function workflowBridgeReset(){workflowBridgeCore.dataset.workflowVersion='0';workflowBridgeLastEffect=workflowBridgeSerialize();}
const workflowSessionCore=document.querySelector('#workflowCore');const workflowSessionToggle=document.querySelector('#workflowSessionToggle');const workflowSessionLength=document.querySelector('#workflowSessionLength');const workflowSessionState={phase:'ready',elapsed:0,limit:Number(workflowSessionLength.value),checkpoints:[],timer:null};function workflowSessionFormat(seconds){return String(Math.floor(seconds/60)).padStart(2,'0')+':'+String(seconds%60).padStart(2,'0');}function workflowSessionDrive(){const percent=Math.min(100,Math.round(workflowSessionState.elapsed/workflowSessionState.limit*100));document.querySelector('#workflowSessionClock').textContent=workflowSessionFormat(Math.max(0,workflowSessionState.limit-workflowSessionState.elapsed));const progress=document.querySelector('#workflowSessionProgress');progress.setAttribute('aria-valuenow',String(percent));progress.querySelector('i').style.width=percent+'%';workflowSessionCore.dataset.sessionPhase=workflowSessionState.phase;document.querySelector('#workflowSessionScore').textContent=workflowSessionState.checkpoints.length+' interactive checkpoints';}function workflowSessionLap(label){workflowSessionState.checkpoints.push({label,at:workflowSessionState.elapsed});const item=document.createElement('li');item.textContent=label+' · '+workflowSessionFormat(workflowSessionState.elapsed);document.querySelector('#workflowSessionLaps').append(item);workflowSessionDrive();}function workflowSessionStop(complete=false){clearInterval(workflowSessionState.timer);workflowSessionState.timer=null;workflowSessionState.phase=complete?'complete':'paused';workflowSessionToggle.textContent=complete?'Restart':'Continue round';workflowSessionToggle.setAttribute('aria-pressed','false');workflowSessionDrive();announce(complete?'Outpatient Window Round Complete':'Round paused');}function workflowSessionStart(){if(workflowSessionState.phase==='complete'){workflowSessionState.elapsed=0;workflowSessionState.checkpoints=[];document.querySelector('#workflowSessionLaps').replaceChildren();}workflowSessionState.phase='running';workflowSessionToggle.textContent='Pause round';workflowSessionToggle.setAttribute('aria-pressed','true');const bridge=workflowBridgeActivate();workflowSessionLap(bridge.summary);clearInterval(workflowSessionState.timer);workflowSessionState.timer=setInterval(()=>{workflowSessionState.elapsed+=1;if(workflowSessionState.elapsed>=workflowSessionState.limit){workflowSessionStop(true);return;}workflowSessionDrive();},1000);workflowSessionDrive();announce('The outpatient window session has begun · '+bridge.summary);}workflowSessionToggle.addEventListener('click',()=>workflowSessionState.phase==='running'?workflowSessionStop():workflowSessionStart());workflowSessionLength.addEventListener('input',()=>{workflowSessionState.limit=Number(workflowSessionLength.value);workflowSessionState.elapsed=Math.min(workflowSessionState.elapsed,workflowSessionState.limit);workflowSessionDrive();});workflowSessionCore.addEventListener('keydown',event=>{if(event.key==='Enter'||event.key===' '){workflowSessionLap('Keyboard Interaction');}});workflowSessionCore.addEventListener('click',event=>{if(event.target.closest('[data-core-bridge]'))workflowSessionLap('Core action · '+workflowBridgeSummary());});document.addEventListener('visibilitychange',()=>{if(document.hidden&&workflowSessionState.phase==='running')workflowSessionStop();});workflowSessionDrive();
workflowBridgeReset();
</script>
</body>
</html>