Compare commits
21
Commits
feat/ui-ux
..
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
04327dacda | ||
|
|
b563681c36 | ||
|
|
03d9f1e9aa | ||
|
|
b780e21659 | ||
|
|
8d687ad05b | ||
|
|
78d1f0e308 | ||
|
|
d3e22746fe | ||
|
|
359c226d00 | ||
|
|
c7eece9641 | ||
|
|
415d8b7ead | ||
|
|
4b63b31561 | ||
|
|
bcee6b2c68 | ||
|
|
3b9d515f22 | ||
|
|
9ba70965ba | ||
|
|
691b335a35 | ||
|
|
0ebd5d0d1c | ||
|
|
baa8fe7ae7 | ||
|
|
99885a8172 | ||
|
|
35521b237e | ||
|
|
d72a235d02 | ||
|
|
836e71c5f4 |
No files matched your search
+12
-1
@@ -14,6 +14,13 @@ const usingMock = computed(() => {
|
|||||||
return value === true || value === '1' || value === 'true'
|
return value === true || value === '1' || value === 'true'
|
||||||
})
|
})
|
||||||
|
|
||||||
|
const isNewShell = computed(
|
||||||
|
() =>
|
||||||
|
route.path === '/' ||
|
||||||
|
route.path.startsWith('/sensors') ||
|
||||||
|
route.path.startsWith('/playground') ||
|
||||||
|
route.path.startsWith('/use-cases'),
|
||||||
|
)
|
||||||
const isCool = computed(() => route.path.startsWith('/cool'))
|
const isCool = computed(() => route.path.startsWith('/cool'))
|
||||||
const isDarkPresentation = computed(
|
const isDarkPresentation = computed(
|
||||||
() => route.path === '/stage' || route.path === '/live' || route.path === '/cool/stage',
|
() => route.path === '/stage' || route.path === '/live' || route.path === '/cool/stage',
|
||||||
@@ -58,7 +65,11 @@ onBeforeUnmount(() => navRoleObserver?.disconnect())
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<NuxtPage v-if="isStandalone" />
|
<NuxtLayout v-if="isNewShell">
|
||||||
|
<NuxtPage />
|
||||||
|
</NuxtLayout>
|
||||||
|
|
||||||
|
<NuxtPage v-else-if="isStandalone" />
|
||||||
|
|
||||||
<OnyxAppLayout v-else>
|
<OnyxAppLayout v-else>
|
||||||
<template #navBar>
|
<template #navBar>
|
||||||
|
|||||||
@@ -0,0 +1,30 @@
|
|||||||
|
@tailwind base;
|
||||||
|
@tailwind components;
|
||||||
|
@tailwind utilities;
|
||||||
|
|
||||||
|
@layer base {
|
||||||
|
html,
|
||||||
|
body {
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
body {
|
||||||
|
overscroll-behavior: none;
|
||||||
|
background-color: #081723;
|
||||||
|
color: #FFFFFF;
|
||||||
|
font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
|
||||||
|
}
|
||||||
|
|
||||||
|
main > :first-child {
|
||||||
|
margin-top: 0 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
main > :last-child {
|
||||||
|
margin-bottom: 0 !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
::-webkit-scrollbar {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
@@ -0,0 +1,513 @@
|
|||||||
|
<script setup lang="ts">
|
||||||
|
import type { Point } from '#shared/types'
|
||||||
|
import { formatNumber, formatShortDate, formatTime } from '~/utils/format'
|
||||||
|
|
||||||
|
const props = defineProps<{
|
||||||
|
observed: Point[]
|
||||||
|
forecast: Point[]
|
||||||
|
}>()
|
||||||
|
|
||||||
|
interface ChartTick {
|
||||||
|
x: number
|
||||||
|
line1: string
|
||||||
|
line2?: string
|
||||||
|
anchor: 'start' | 'middle' | 'end'
|
||||||
|
}
|
||||||
|
|
||||||
|
interface ChartGeometry {
|
||||||
|
width: number
|
||||||
|
height: number
|
||||||
|
pad: { top: number; right: number; bottom: number; left: number }
|
||||||
|
hasData: boolean
|
||||||
|
observedPath: string
|
||||||
|
forecastPath: string
|
||||||
|
bandPath: string
|
||||||
|
singleBand: { x: number; top: number; bottom: number } | null
|
||||||
|
observedSingle: { x: number; y: number } | null
|
||||||
|
forecastSingle: { x: number; y: number } | null
|
||||||
|
nowX: number
|
||||||
|
nowAnchor: 'start' | 'middle' | 'end'
|
||||||
|
peak: Point | null
|
||||||
|
peakX: number
|
||||||
|
peakY: number
|
||||||
|
peakLabel: string
|
||||||
|
peakLabelX: number
|
||||||
|
peakLabelY: number
|
||||||
|
peakLabelWidth: number
|
||||||
|
yTicks: Array<{ y: number; label: string }>
|
||||||
|
xTicks: ChartTick[]
|
||||||
|
}
|
||||||
|
|
||||||
|
function niceMax(value: number): number {
|
||||||
|
if (!Number.isFinite(value) || value <= 0) return 1
|
||||||
|
const magnitude = 10 ** Math.floor(Math.log10(value))
|
||||||
|
const residual = value / magnitude
|
||||||
|
const steps = [1, 1.5, 2, 2.5, 3, 4, 5, 6, 8, 10]
|
||||||
|
const step = steps.find((candidate) => residual <= candidate) ?? 10
|
||||||
|
return step * magnitude
|
||||||
|
}
|
||||||
|
|
||||||
|
function sorted(points: Point[]): Point[] {
|
||||||
|
return [...points].sort((a, b) => Date.parse(a.t) - Date.parse(b.t))
|
||||||
|
}
|
||||||
|
|
||||||
|
function buildGeometry(width: number, height: number, compact: boolean): ChartGeometry {
|
||||||
|
const observed = sorted(props.observed)
|
||||||
|
const forecast = sorted(props.forecast)
|
||||||
|
const pad = compact
|
||||||
|
? { top: 26, right: 14, bottom: 42, left: 38 }
|
||||||
|
: { top: 28, right: 18, bottom: 44, left: 48 }
|
||||||
|
const plotWidth = width - pad.left - pad.right
|
||||||
|
const plotHeight = height - pad.top - pad.bottom
|
||||||
|
|
||||||
|
const times = [...observed, ...forecast]
|
||||||
|
.map((point) => Date.parse(point.t))
|
||||||
|
.filter((time) => Number.isFinite(time))
|
||||||
|
let start = times.length ? Math.min(...times) : Date.now()
|
||||||
|
let end = times.length ? Math.max(...times) : start + 3_600_000
|
||||||
|
if (end <= start) {
|
||||||
|
start -= 1_800_000
|
||||||
|
end += 1_800_000
|
||||||
|
}
|
||||||
|
|
||||||
|
const peakSource = [...observed.map((point) => point.v), ...forecast.map((point) => Math.max(point.v, point.hi ?? point.v))]
|
||||||
|
const yMax = niceMax(Math.max(...peakSource, 1) * 1.05)
|
||||||
|
|
||||||
|
const x = (iso: string) =>
|
||||||
|
pad.left + ((Date.parse(iso) - start) / (end - start)) * plotWidth
|
||||||
|
const y = (value: number) =>
|
||||||
|
pad.top + plotHeight - (Math.max(0, value) / yMax) * plotHeight
|
||||||
|
|
||||||
|
const linePath = (points: Point[]) =>
|
||||||
|
points
|
||||||
|
.map((point, index) => {
|
||||||
|
const command = index === 0 ? 'M' : 'L'
|
||||||
|
return `${command} ${x(point.t).toFixed(2)} ${y(point.v).toFixed(2)}`
|
||||||
|
})
|
||||||
|
.join(' ')
|
||||||
|
|
||||||
|
const bandPoints = forecast.map((point) => ({
|
||||||
|
x: x(point.t),
|
||||||
|
top: y(point.hi ?? point.v),
|
||||||
|
bottom: y(point.lo ?? point.v),
|
||||||
|
}))
|
||||||
|
let bandPath = ''
|
||||||
|
if (bandPoints.length >= 2) {
|
||||||
|
const top = bandPoints.map((point) => `${point.x.toFixed(2)} ${point.top.toFixed(2)}`)
|
||||||
|
const bottom = [...bandPoints]
|
||||||
|
.reverse()
|
||||||
|
.map((point) => `${point.x.toFixed(2)} ${point.bottom.toFixed(2)}`)
|
||||||
|
bandPath = `M ${top[0]} L ${top.slice(1).join(' L ')} L ${bottom.join(' L ')} Z`
|
||||||
|
}
|
||||||
|
|
||||||
|
let peak: Point | null = null
|
||||||
|
for (const point of forecast) {
|
||||||
|
if (!peak || point.v > peak.v) peak = point
|
||||||
|
}
|
||||||
|
|
||||||
|
const peakX = peak ? x(peak.t) : pad.left
|
||||||
|
const peakY = peak ? y(peak.v) : pad.top
|
||||||
|
const peakLabel = peak ? `Peak ${formatTime(peak.t)}` : ''
|
||||||
|
const peakLabelWidth = peak ? peakLabel.length * 5.6 + 14 : 0
|
||||||
|
const peakLabelX = peak
|
||||||
|
? Math.min(
|
||||||
|
Math.max(peakX - peakLabelWidth / 2, pad.left),
|
||||||
|
width - pad.right - peakLabelWidth,
|
||||||
|
)
|
||||||
|
: 0
|
||||||
|
const peakLabelY = peak ? Math.max(pad.top + 2, peakY - 25) : 0
|
||||||
|
|
||||||
|
const nowX = forecast.length
|
||||||
|
? x(forecast[0]!.t)
|
||||||
|
: observed.length
|
||||||
|
? x(observed.at(-1)!.t)
|
||||||
|
: pad.left + plotWidth
|
||||||
|
const nowAnchor: 'start' | 'middle' | 'end' =
|
||||||
|
nowX > width - pad.right - 24 ? 'end' : nowX < pad.left + 24 ? 'start' : 'middle'
|
||||||
|
|
||||||
|
const yTickCount = compact ? 3 : 4
|
||||||
|
const yTicks = Array.from({ length: yTickCount }, (_, index) => {
|
||||||
|
const value = (yMax / (yTickCount - 1)) * index
|
||||||
|
const labelValue = yMax <= 5 ? Math.round(value * 10) / 10 : Math.round(value)
|
||||||
|
return { y: y(value), label: formatNumber(labelValue) }
|
||||||
|
})
|
||||||
|
|
||||||
|
const spanHours = (end - start) / 3_600_000
|
||||||
|
const xTickCount = compact ? 4 : 6
|
||||||
|
const xTicks = Array.from({ length: xTickCount }, (_, index) => {
|
||||||
|
const fraction = index / (xTickCount - 1)
|
||||||
|
const time = start + (end - start) * fraction
|
||||||
|
const iso = new Date(time).toISOString()
|
||||||
|
const anchor: ChartTick['anchor'] =
|
||||||
|
index === 0 ? 'start' : index === xTickCount - 1 ? 'end' : 'middle'
|
||||||
|
return {
|
||||||
|
x: pad.left + plotWidth * fraction,
|
||||||
|
line1: spanHours <= 26 ? formatTime(iso) : formatShortDate(iso),
|
||||||
|
line2: spanHours <= 26 ? undefined : formatTime(iso),
|
||||||
|
anchor,
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
return {
|
||||||
|
width,
|
||||||
|
height,
|
||||||
|
pad,
|
||||||
|
hasData: observed.length > 0 || forecast.length > 0,
|
||||||
|
observedPath: linePath(observed),
|
||||||
|
forecastPath: linePath(forecast),
|
||||||
|
bandPath,
|
||||||
|
singleBand:
|
||||||
|
bandPoints.length === 1
|
||||||
|
? {
|
||||||
|
x: bandPoints[0]!.x,
|
||||||
|
top: bandPoints[0]!.top,
|
||||||
|
bottom: bandPoints[0]!.bottom,
|
||||||
|
}
|
||||||
|
: null,
|
||||||
|
observedSingle:
|
||||||
|
observed.length === 1
|
||||||
|
? { x: x(observed[0]!.t), y: y(observed[0]!.v) }
|
||||||
|
: null,
|
||||||
|
forecastSingle:
|
||||||
|
forecast.length === 1
|
||||||
|
? { x: x(forecast[0]!.t), y: y(forecast[0]!.v) }
|
||||||
|
: null,
|
||||||
|
nowX,
|
||||||
|
nowAnchor,
|
||||||
|
peak,
|
||||||
|
peakX,
|
||||||
|
peakY,
|
||||||
|
peakLabel,
|
||||||
|
peakLabelX,
|
||||||
|
peakLabelY,
|
||||||
|
peakLabelWidth,
|
||||||
|
yTicks,
|
||||||
|
xTicks,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const mobile = computed(() => buildGeometry(360, 236, true))
|
||||||
|
const desktop = computed(() => buildGeometry(760, 286, false))
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<div class="w-full min-w-0">
|
||||||
|
<svg
|
||||||
|
class="w-full h-auto sm:hidden"
|
||||||
|
:viewBox="`0 0 ${mobile.width} ${mobile.height}`"
|
||||||
|
role="img"
|
||||||
|
aria-label="Observed history and forecast estimated devices per hour with an 80 percent band"
|
||||||
|
>
|
||||||
|
<g v-if="mobile.hasData">
|
||||||
|
<text x="8" y="13" fill="#94A3B8" font-size="9" font-family="Inter, sans-serif">
|
||||||
|
devices/hour
|
||||||
|
</text>
|
||||||
|
|
||||||
|
<g>
|
||||||
|
<line
|
||||||
|
v-for="tick in mobile.yTicks"
|
||||||
|
:key="`my-${tick.y}`"
|
||||||
|
:x1="mobile.pad.left"
|
||||||
|
:x2="mobile.width - mobile.pad.right"
|
||||||
|
:y1="tick.y"
|
||||||
|
:y2="tick.y"
|
||||||
|
stroke="#1e3a52"
|
||||||
|
stroke-dasharray="3 3"
|
||||||
|
/>
|
||||||
|
<text
|
||||||
|
v-for="tick in mobile.yTicks"
|
||||||
|
:key="`myl-${tick.y}`"
|
||||||
|
:x="mobile.pad.left - 7"
|
||||||
|
:y="tick.y + 3"
|
||||||
|
fill="#94A3B8"
|
||||||
|
font-size="9"
|
||||||
|
font-family="Inter, sans-serif"
|
||||||
|
text-anchor="end"
|
||||||
|
>
|
||||||
|
{{ tick.label }}
|
||||||
|
</text>
|
||||||
|
</g>
|
||||||
|
|
||||||
|
<path v-if="mobile.bandPath" :d="mobile.bandPath" fill="#00C3CD" fill-opacity="0.16" />
|
||||||
|
<rect
|
||||||
|
v-if="mobile.singleBand"
|
||||||
|
:x="mobile.singleBand.x - 3"
|
||||||
|
:y="mobile.singleBand.top"
|
||||||
|
width="6"
|
||||||
|
:height="Math.max(2, mobile.singleBand.bottom - mobile.singleBand.top)"
|
||||||
|
rx="2"
|
||||||
|
fill="#00C3CD"
|
||||||
|
fill-opacity="0.25"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<path
|
||||||
|
v-if="mobile.observedPath"
|
||||||
|
:d="mobile.observedPath"
|
||||||
|
fill="none"
|
||||||
|
stroke="#FFFFFF"
|
||||||
|
stroke-width="2"
|
||||||
|
stroke-linejoin="round"
|
||||||
|
stroke-linecap="round"
|
||||||
|
/>
|
||||||
|
<circle
|
||||||
|
v-if="mobile.observedSingle"
|
||||||
|
:cx="mobile.observedSingle.x"
|
||||||
|
:cy="mobile.observedSingle.y"
|
||||||
|
r="3"
|
||||||
|
fill="#FFFFFF"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<path
|
||||||
|
v-if="mobile.forecastPath"
|
||||||
|
:d="mobile.forecastPath"
|
||||||
|
fill="none"
|
||||||
|
stroke="#00C3CD"
|
||||||
|
stroke-width="2.4"
|
||||||
|
stroke-dasharray="6 4"
|
||||||
|
stroke-linejoin="round"
|
||||||
|
stroke-linecap="round"
|
||||||
|
/>
|
||||||
|
<circle
|
||||||
|
v-if="mobile.forecastSingle"
|
||||||
|
:cx="mobile.forecastSingle.x"
|
||||||
|
:cy="mobile.forecastSingle.y"
|
||||||
|
r="4"
|
||||||
|
fill="#00C3CD"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<line
|
||||||
|
:x1="mobile.nowX"
|
||||||
|
:x2="mobile.nowX"
|
||||||
|
:y1="mobile.pad.top"
|
||||||
|
:y2="mobile.height - mobile.pad.bottom"
|
||||||
|
stroke="#94A3B8"
|
||||||
|
stroke-dasharray="3 4"
|
||||||
|
stroke-opacity="0.8"
|
||||||
|
/>
|
||||||
|
<text
|
||||||
|
:x="mobile.nowX"
|
||||||
|
:y="mobile.height - 4"
|
||||||
|
fill="#00C3CD"
|
||||||
|
font-size="9"
|
||||||
|
font-family="Inter, sans-serif"
|
||||||
|
:text-anchor="mobile.nowAnchor"
|
||||||
|
>
|
||||||
|
Now
|
||||||
|
</text>
|
||||||
|
|
||||||
|
<g v-if="mobile.peak">
|
||||||
|
<rect
|
||||||
|
:x="mobile.peakLabelX"
|
||||||
|
:y="mobile.peakLabelY - 11"
|
||||||
|
:width="mobile.peakLabelWidth"
|
||||||
|
height="16"
|
||||||
|
rx="4"
|
||||||
|
fill="#132b40"
|
||||||
|
stroke="#1e3a52"
|
||||||
|
/>
|
||||||
|
<text
|
||||||
|
:x="mobile.peakLabelX + mobile.peakLabelWidth / 2"
|
||||||
|
:y="mobile.peakLabelY"
|
||||||
|
fill="#00C3CD"
|
||||||
|
font-size="9"
|
||||||
|
font-family="Inter, sans-serif"
|
||||||
|
font-weight="600"
|
||||||
|
text-anchor="middle"
|
||||||
|
>
|
||||||
|
{{ mobile.peakLabel }}
|
||||||
|
</text>
|
||||||
|
<circle
|
||||||
|
:cx="mobile.peakX"
|
||||||
|
:cy="mobile.peakY"
|
||||||
|
r="4"
|
||||||
|
fill="#FFFFFF"
|
||||||
|
stroke="#00C3CD"
|
||||||
|
stroke-width="2"
|
||||||
|
/>
|
||||||
|
</g>
|
||||||
|
|
||||||
|
<g>
|
||||||
|
<text
|
||||||
|
v-for="tick in mobile.xTicks"
|
||||||
|
:key="`mx-${tick.x}`"
|
||||||
|
:x="tick.x"
|
||||||
|
:y="mobile.height - mobile.pad.bottom + (tick.line2 ? 15 : 20)"
|
||||||
|
fill="#94A3B8"
|
||||||
|
font-size="9"
|
||||||
|
font-family="Inter, sans-serif"
|
||||||
|
:text-anchor="tick.anchor"
|
||||||
|
>
|
||||||
|
{{ tick.line1 }}
|
||||||
|
<tspan
|
||||||
|
v-if="tick.line2"
|
||||||
|
:x="tick.x"
|
||||||
|
:dy="11"
|
||||||
|
fill="#64748B"
|
||||||
|
>
|
||||||
|
{{ tick.line2 }}
|
||||||
|
</tspan>
|
||||||
|
</text>
|
||||||
|
</g>
|
||||||
|
</g>
|
||||||
|
</svg>
|
||||||
|
|
||||||
|
<svg
|
||||||
|
class="hidden sm:block w-full h-auto"
|
||||||
|
:viewBox="`0 0 ${desktop.width} ${desktop.height}`"
|
||||||
|
role="img"
|
||||||
|
aria-label="Observed history and forecast estimated devices per hour with an 80 percent band"
|
||||||
|
>
|
||||||
|
<g v-if="desktop.hasData">
|
||||||
|
<text x="10" y="13" fill="#94A3B8" font-size="9" font-family="Inter, sans-serif">
|
||||||
|
devices/hour
|
||||||
|
</text>
|
||||||
|
|
||||||
|
<g>
|
||||||
|
<line
|
||||||
|
v-for="tick in desktop.yTicks"
|
||||||
|
:key="`dy-${tick.y}`"
|
||||||
|
:x1="desktop.pad.left"
|
||||||
|
:x2="desktop.width - desktop.pad.right"
|
||||||
|
:y1="tick.y"
|
||||||
|
:y2="tick.y"
|
||||||
|
stroke="#1e3a52"
|
||||||
|
stroke-dasharray="3 3"
|
||||||
|
/>
|
||||||
|
<text
|
||||||
|
v-for="tick in desktop.yTicks"
|
||||||
|
:key="`dyl-${tick.y}`"
|
||||||
|
:x="desktop.pad.left - 8"
|
||||||
|
:y="tick.y + 3"
|
||||||
|
fill="#94A3B8"
|
||||||
|
font-size="10"
|
||||||
|
font-family="Inter, sans-serif"
|
||||||
|
text-anchor="end"
|
||||||
|
>
|
||||||
|
{{ tick.label }}
|
||||||
|
</text>
|
||||||
|
</g>
|
||||||
|
|
||||||
|
<path v-if="desktop.bandPath" :d="desktop.bandPath" fill="#00C3CD" fill-opacity="0.16" />
|
||||||
|
<rect
|
||||||
|
v-if="desktop.singleBand"
|
||||||
|
:x="desktop.singleBand.x - 4"
|
||||||
|
:y="desktop.singleBand.top"
|
||||||
|
width="8"
|
||||||
|
:height="Math.max(2, desktop.singleBand.bottom - desktop.singleBand.top)"
|
||||||
|
rx="2"
|
||||||
|
fill="#00C3CD"
|
||||||
|
fill-opacity="0.25"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<path
|
||||||
|
v-if="desktop.observedPath"
|
||||||
|
:d="desktop.observedPath"
|
||||||
|
fill="none"
|
||||||
|
stroke="#FFFFFF"
|
||||||
|
stroke-width="2.2"
|
||||||
|
stroke-linejoin="round"
|
||||||
|
stroke-linecap="round"
|
||||||
|
/>
|
||||||
|
<circle
|
||||||
|
v-if="desktop.observedSingle"
|
||||||
|
:cx="desktop.observedSingle.x"
|
||||||
|
:cy="desktop.observedSingle.y"
|
||||||
|
r="3"
|
||||||
|
fill="#FFFFFF"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<path
|
||||||
|
v-if="desktop.forecastPath"
|
||||||
|
:d="desktop.forecastPath"
|
||||||
|
fill="none"
|
||||||
|
stroke="#00C3CD"
|
||||||
|
stroke-width="2.4"
|
||||||
|
stroke-dasharray="6 4"
|
||||||
|
stroke-linejoin="round"
|
||||||
|
stroke-linecap="round"
|
||||||
|
/>
|
||||||
|
<circle
|
||||||
|
v-if="desktop.forecastSingle"
|
||||||
|
:cx="desktop.forecastSingle.x"
|
||||||
|
:cy="desktop.forecastSingle.y"
|
||||||
|
r="4"
|
||||||
|
fill="#00C3CD"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<line
|
||||||
|
:x1="desktop.nowX"
|
||||||
|
:x2="desktop.nowX"
|
||||||
|
:y1="desktop.pad.top"
|
||||||
|
:y2="desktop.height - desktop.pad.bottom"
|
||||||
|
stroke="#94A3B8"
|
||||||
|
stroke-dasharray="3 4"
|
||||||
|
stroke-opacity="0.8"
|
||||||
|
/>
|
||||||
|
<text
|
||||||
|
:x="desktop.nowX"
|
||||||
|
:y="desktop.height - 4"
|
||||||
|
fill="#00C3CD"
|
||||||
|
font-size="9"
|
||||||
|
font-family="Inter, sans-serif"
|
||||||
|
:text-anchor="desktop.nowAnchor"
|
||||||
|
>
|
||||||
|
Now
|
||||||
|
</text>
|
||||||
|
|
||||||
|
<g v-if="desktop.peak">
|
||||||
|
<rect
|
||||||
|
:x="desktop.peakLabelX"
|
||||||
|
:y="desktop.peakLabelY - 11"
|
||||||
|
:width="desktop.peakLabelWidth"
|
||||||
|
height="16"
|
||||||
|
rx="4"
|
||||||
|
fill="#132b40"
|
||||||
|
stroke="#1e3a52"
|
||||||
|
/>
|
||||||
|
<text
|
||||||
|
:x="desktop.peakLabelX + desktop.peakLabelWidth / 2"
|
||||||
|
:y="desktop.peakLabelY"
|
||||||
|
fill="#00C3CD"
|
||||||
|
font-size="9"
|
||||||
|
font-family="Inter, sans-serif"
|
||||||
|
font-weight="600"
|
||||||
|
text-anchor="middle"
|
||||||
|
>
|
||||||
|
{{ desktop.peakLabel }}
|
||||||
|
</text>
|
||||||
|
<circle
|
||||||
|
:cx="desktop.peakX"
|
||||||
|
:cy="desktop.peakY"
|
||||||
|
r="4.5"
|
||||||
|
fill="#FFFFFF"
|
||||||
|
stroke="#00C3CD"
|
||||||
|
stroke-width="2"
|
||||||
|
/>
|
||||||
|
</g>
|
||||||
|
|
||||||
|
<g>
|
||||||
|
<text
|
||||||
|
v-for="tick in desktop.xTicks"
|
||||||
|
:key="`dx-${tick.x}`"
|
||||||
|
:x="tick.x"
|
||||||
|
:y="desktop.height - desktop.pad.bottom + (tick.line2 ? 15 : 20)"
|
||||||
|
fill="#94A3B8"
|
||||||
|
font-size="10"
|
||||||
|
font-family="Inter, sans-serif"
|
||||||
|
:text-anchor="tick.anchor"
|
||||||
|
>
|
||||||
|
{{ tick.line1 }}
|
||||||
|
<tspan
|
||||||
|
v-if="tick.line2"
|
||||||
|
:x="tick.x"
|
||||||
|
:dy="12"
|
||||||
|
fill="#64748B"
|
||||||
|
>
|
||||||
|
{{ tick.line2 }}
|
||||||
|
</tspan>
|
||||||
|
</text>
|
||||||
|
</g>
|
||||||
|
</g>
|
||||||
|
</svg>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
<script setup lang="ts">
|
||||||
|
withDefaults(
|
||||||
|
defineProps<{
|
||||||
|
label: string
|
||||||
|
value: string
|
||||||
|
hint?: string
|
||||||
|
tone?: 'default' | 'accent'
|
||||||
|
mono?: boolean
|
||||||
|
}>(),
|
||||||
|
{
|
||||||
|
hint: '',
|
||||||
|
tone: 'default',
|
||||||
|
mono: true,
|
||||||
|
},
|
||||||
|
)
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<div class="flex flex-col rounded-lg border border-[#1e3a52] bg-[#0e2233] p-2.5">
|
||||||
|
<span class="text-[11px] text-[#94A3B8]">{{ label }}</span>
|
||||||
|
<span
|
||||||
|
class="mt-0.5 text-lg font-bold leading-tight"
|
||||||
|
:class="[tone === 'accent' ? 'text-[#00C3CD]' : 'text-[#FFFFFF]', mono ? 'font-mono' : '']"
|
||||||
|
>
|
||||||
|
{{ value }}
|
||||||
|
</span>
|
||||||
|
<span v-if="hint" class="text-[10px] text-[#64748B]">{{ hint }}</span>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
@@ -0,0 +1,92 @@
|
|||||||
|
<script setup lang="ts">
|
||||||
|
import { LIVE_LABELS, liveAge, scenarioLabel } from '#shared/live'
|
||||||
|
import type { LiveConnection } from '#shared/live'
|
||||||
|
import MiniBar from '~/components/use-cases/MiniBar.vue'
|
||||||
|
|
||||||
|
const props = withDefaults(
|
||||||
|
defineProps<{
|
||||||
|
status: LiveConnection
|
||||||
|
scenarioId: string
|
||||||
|
sensorCount: number
|
||||||
|
cadenceMin: number | null
|
||||||
|
lastEventAt: string
|
||||||
|
}>(),
|
||||||
|
{ cadenceMin: null, lastEventAt: '' },
|
||||||
|
)
|
||||||
|
|
||||||
|
const now = ref(Date.now())
|
||||||
|
let timer: ReturnType<typeof setInterval> | undefined
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
now.value = Date.now()
|
||||||
|
timer = setInterval(() => {
|
||||||
|
now.value = Date.now()
|
||||||
|
}, 1000)
|
||||||
|
})
|
||||||
|
onBeforeUnmount(() => {
|
||||||
|
if (timer) clearInterval(timer)
|
||||||
|
})
|
||||||
|
|
||||||
|
const age = computed(() => (props.lastEventAt ? liveAge(props.lastEventAt, now.value) : 'SSR payload'))
|
||||||
|
const isLive = computed(() => props.status === 'live')
|
||||||
|
const statusLabel = computed(() =>
|
||||||
|
isLive.value ? 'SCENARIO STREAM: LIVE' : `SCENARIO STREAM: ${LIVE_LABELS[props.status].toUpperCase()}`,
|
||||||
|
)
|
||||||
|
const coveragePct = computed(() => (props.sensorCount > 0 ? Math.min(100, (props.sensorCount / 8) * 100) : 0))
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<section
|
||||||
|
aria-label="Live telemetry"
|
||||||
|
class="relative flex w-full flex-col items-start justify-between gap-4 overflow-hidden rounded-xl border border-[#1e3a52] bg-[#0e2233] p-3.5 shadow-sm md:flex-row md:items-center"
|
||||||
|
>
|
||||||
|
<div class="absolute inset-y-0 left-0 w-1" :class="isLive ? 'bg-[#00C3CD]' : 'bg-[#475569]'" aria-hidden="true" />
|
||||||
|
<div class="flex flex-wrap items-center gap-4 pl-2">
|
||||||
|
<div
|
||||||
|
class="flex items-center gap-2 rounded border px-2.5 py-1"
|
||||||
|
:class="
|
||||||
|
isLive
|
||||||
|
? 'border-[#00C3CD]/30 bg-[#00C3CD]/15'
|
||||||
|
: 'border-white/10 bg-white/[0.06]'
|
||||||
|
"
|
||||||
|
>
|
||||||
|
<span
|
||||||
|
class="h-2 w-2 rounded-full"
|
||||||
|
:class="isLive ? 'animate-pulse bg-[#00C3CD]' : 'bg-[#94A3B8]'"
|
||||||
|
aria-hidden="true"
|
||||||
|
/>
|
||||||
|
<span
|
||||||
|
class="text-[11px] font-bold tracking-wider"
|
||||||
|
:class="isLive ? 'text-[#00C3CD]' : 'text-[#94A3B8]'"
|
||||||
|
>
|
||||||
|
{{ statusLabel }}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<span class="flex items-center gap-1.5 text-xs text-white md:text-sm">
|
||||||
|
<span class="text-[#94A3B8]">Sensor nodes:</span>
|
||||||
|
{{ sensorCount }} counted
|
||||||
|
</span>
|
||||||
|
<span class="hidden text-[#64748B] sm:inline" aria-hidden="true">•</span>
|
||||||
|
<span class="hidden items-center gap-1.5 text-xs text-[#94A3B8] sm:flex md:text-sm">
|
||||||
|
Cadence:
|
||||||
|
<span class="font-mono text-white">{{ cadenceMin ? `${cadenceMin} min` : '—' }}</span>
|
||||||
|
</span>
|
||||||
|
<span class="hidden text-[#64748B] lg:inline" aria-hidden="true">•</span>
|
||||||
|
<span class="hidden text-xs text-[#94A3B8] lg:inline md:text-sm">
|
||||||
|
Scenario:
|
||||||
|
<span class="font-mono text-[#00C3CD]">{{ scenarioLabel(scenarioId) }}</span>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="flex w-full items-center justify-between gap-4 pl-2 md:w-auto md:justify-end md:pl-0">
|
||||||
|
<div class="flex w-36 flex-col gap-1">
|
||||||
|
<div class="flex items-center justify-between text-[11px] text-[#94A3B8]">
|
||||||
|
<span>Sensor coverage</span>
|
||||||
|
<span class="font-mono font-semibold text-white">{{ sensorCount }}/8</span>
|
||||||
|
</div>
|
||||||
|
<MiniBar :value="coveragePct" label="Sensor coverage" />
|
||||||
|
</div>
|
||||||
|
<span class="shrink-0 text-[11px] font-medium text-[#94A3B8]">Updated {{ age }}</span>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
</template>
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
<script setup lang="ts">
|
||||||
|
withDefaults(
|
||||||
|
defineProps<{
|
||||||
|
value: number
|
||||||
|
tone?: 'accent' | 'muted' | 'subtle'
|
||||||
|
label?: string
|
||||||
|
height?: 'sm' | 'md'
|
||||||
|
}>(),
|
||||||
|
{
|
||||||
|
tone: 'accent',
|
||||||
|
label: '',
|
||||||
|
height: 'sm',
|
||||||
|
},
|
||||||
|
)
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<div
|
||||||
|
class="w-full overflow-hidden rounded-full border border-white/10 bg-[#081723]"
|
||||||
|
:class="height === 'md' ? 'h-2' : 'h-1.5'"
|
||||||
|
role="img"
|
||||||
|
:aria-label="label || `${Math.round(value)} percent`"
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
class="h-full rounded-full transition-all duration-500"
|
||||||
|
:class="{
|
||||||
|
'bg-[#00C3CD] shadow-[0_0_8px_rgba(0,195,205,0.55)]': tone === 'accent',
|
||||||
|
'bg-[#94A3B8]': tone === 'muted',
|
||||||
|
'bg-[#475569]': tone === 'subtle',
|
||||||
|
}"
|
||||||
|
:style="{ width: `${Math.max(0, Math.min(100, value))}%` }"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
@@ -0,0 +1,397 @@
|
|||||||
|
<script setup lang="ts">
|
||||||
|
import type { PrezeroBundle, PrezeroContainer } from '#shared/use-cases'
|
||||||
|
import {
|
||||||
|
PRIORITY_ORDER,
|
||||||
|
prezeroReason,
|
||||||
|
prezeroTotal,
|
||||||
|
priorityShare,
|
||||||
|
shortContainerId,
|
||||||
|
} from '#shared/use-cases'
|
||||||
|
import DecisionMetric from '~/components/use-cases/DecisionMetric.vue'
|
||||||
|
import MiniBar from '~/components/use-cases/MiniBar.vue'
|
||||||
|
|
||||||
|
const props = defineProps<{
|
||||||
|
bundle: PrezeroBundle | null
|
||||||
|
error: string
|
||||||
|
}>()
|
||||||
|
|
||||||
|
const ruleOpen = ref(false)
|
||||||
|
const exportNote = ref('')
|
||||||
|
|
||||||
|
const PRIORITY_LABELS: Record<PrezeroContainer['priority'], string> = {
|
||||||
|
high: 'High',
|
||||||
|
medium: 'Medium',
|
||||||
|
low: 'Low',
|
||||||
|
}
|
||||||
|
|
||||||
|
const PRIORITY_TONE: Record<PrezeroContainer['priority'], 'accent' | 'muted' | 'subtle'> = {
|
||||||
|
high: 'accent',
|
||||||
|
medium: 'muted',
|
||||||
|
low: 'subtle',
|
||||||
|
}
|
||||||
|
|
||||||
|
const PRIORITY_DOT: Record<PrezeroContainer['priority'], string> = { high: 'bg-[#00C3CD]', medium: 'bg-[#94A3B8]', low: 'bg-[#64748B]' }
|
||||||
|
|
||||||
|
const PRIORITY_BADGE: Record<PrezeroContainer['priority'], string> = {
|
||||||
|
high: 'border-[#00C3CD]/40 bg-[#00C3CD]/15 text-[#00C3CD]',
|
||||||
|
medium: 'border-[#1e3a52] bg-white/10 text-[#94A3B8]',
|
||||||
|
low: 'border-[#1e3a52] bg-[#081723] text-[#64748B]',
|
||||||
|
}
|
||||||
|
|
||||||
|
const MATERIAL_ORDER = ['white', 'green', 'brown'] as const
|
||||||
|
const MATERIAL_META = {
|
||||||
|
white: { label: 'White glass', icon: 'material-symbols:local-drink', iconClass: 'text-[#94A3B8]' },
|
||||||
|
green: { label: 'Green glass', icon: 'material-symbols:eco', iconClass: 'text-[#00C3CD]' },
|
||||||
|
brown: { label: 'Brown glass', icon: 'material-symbols:inventory-2', iconClass: 'text-[#64748B]' },
|
||||||
|
} as const
|
||||||
|
|
||||||
|
const total = computed(() => prezeroTotal(props.bundle))
|
||||||
|
const highCount = computed(() => props.bundle?.summary.priority_counts.high ?? 0)
|
||||||
|
const highShare = computed(() => priorityShare(props.bundle, 'high'))
|
||||||
|
const top = computed(() => props.bundle?.top ?? [])
|
||||||
|
const limitations = computed(() => props.bundle?.meta.limitations ?? [])
|
||||||
|
|
||||||
|
const distribution = computed(() =>
|
||||||
|
PRIORITY_ORDER.map((priority) => ({
|
||||||
|
priority,
|
||||||
|
label: PRIORITY_LABELS[priority],
|
||||||
|
count: props.bundle?.summary.priority_counts[priority] ?? 0,
|
||||||
|
share: priorityShare(props.bundle, priority),
|
||||||
|
})),
|
||||||
|
)
|
||||||
|
|
||||||
|
const materialRows = computed(() => {
|
||||||
|
const materials = props.bundle?.summary.by_material
|
||||||
|
if (!materials) return []
|
||||||
|
return MATERIAL_ORDER.flatMap((key) => {
|
||||||
|
const stats = materials[key]
|
||||||
|
if (!stats) return []
|
||||||
|
return [
|
||||||
|
{
|
||||||
|
key,
|
||||||
|
...MATERIAL_META[key],
|
||||||
|
readings: stats.readings,
|
||||||
|
overfull: stats.overfull,
|
||||||
|
share: stats.readings > 0 ? (stats.overfull / stats.readings) * 100 : 0,
|
||||||
|
},
|
||||||
|
]
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
function fmt(value: number): string {
|
||||||
|
return String(Math.round(value)).replace(/\B(?=(\d{3})+(?!\d))/g, ',')
|
||||||
|
}
|
||||||
|
|
||||||
|
function csvCell(value: unknown): string {
|
||||||
|
const text = value == null ? '' : String(value)
|
||||||
|
return /[",\n]/.test(text) ? `"${text.replaceAll('"', '""')}"` : text
|
||||||
|
}
|
||||||
|
|
||||||
|
function exportCsv() {
|
||||||
|
if (!props.bundle || props.bundle.top.length === 0) return
|
||||||
|
try {
|
||||||
|
const header = ['rank', 'location_id', 'priority', 'priority_score', 'readings', 'overfull_count', 'overfull_rate', 'p95_fill', 'max_fill', 'mean_fill', 'last_fill', 'last_is_overfull', 'last_date', 'days_since_last', 'trend']
|
||||||
|
const rows = props.bundle.top.map((row, index) => [index + 1, row.location_id, row.priority, row.priority_score, row.readings, row.overfull_count, row.overfull_rate, row.p95_fill, row.max_fill, row.mean_fill, row.last_fill, row.last_is_overfull, row.last_date, row.days_since_last, row.trend])
|
||||||
|
const csv = [header, ...rows].map((line) => line.map(csvCell).join(',')).join('\r\n')
|
||||||
|
const blob = new Blob([`\uFEFF${csv}`], { type: 'text/csv;charset=utf-8' })
|
||||||
|
const url = URL.createObjectURL(blob)
|
||||||
|
const anchor = document.createElement('a')
|
||||||
|
anchor.href = url
|
||||||
|
anchor.download = `sensing-engine-prezero-priority-${props.bundle.meta.reference_date}.csv`
|
||||||
|
anchor.click()
|
||||||
|
anchor.remove()
|
||||||
|
URL.revokeObjectURL(url)
|
||||||
|
exportNote.value = `Exported ${props.bundle.top.length} ranked locations; ${total.value} locations in the snapshot.`
|
||||||
|
} catch {
|
||||||
|
exportNote.value = 'The browser blocked the download; no file was created.'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<div class="grid grid-cols-1 items-start gap-6 lg:grid-cols-12">
|
||||||
|
<div
|
||||||
|
v-if="error"
|
||||||
|
class="rounded-xl border border-[#1e3a52] bg-[#132b40] p-4 text-sm text-[#94A3B8] lg:col-span-12"
|
||||||
|
role="alert"
|
||||||
|
>
|
||||||
|
<div class="flex items-start gap-3">
|
||||||
|
<Icon name="material-symbols:info" class="mt-0.5 text-[20px] text-[#00C3CD]" />
|
||||||
|
<div class="flex flex-col gap-0.5">
|
||||||
|
<span class="font-semibold text-white">Priority snapshot unavailable</span>
|
||||||
|
<span>{{ error }} No ranking is estimated or filled in.</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<template v-if="bundle">
|
||||||
|
<!-- LEFT: decision story -->
|
||||||
|
<div class="flex min-w-0 flex-col gap-6 lg:col-span-5">
|
||||||
|
<section class="relative flex flex-col gap-5 overflow-hidden rounded-xl border border-[#1e3a52] bg-[#0e2233] p-6 shadow-sm">
|
||||||
|
<div class="flex flex-col gap-1">
|
||||||
|
<span class="text-[11px] font-semibold uppercase tracking-widest text-[#00C3CD]">Optimization query</span>
|
||||||
|
<h2 class="text-lg font-bold leading-snug tracking-tight text-white md:text-xl">
|
||||||
|
Which containers need collection first?
|
||||||
|
</h2>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="relative flex flex-col gap-3 rounded-xl border border-[#00C3CD]/30 bg-[#132b40] p-5 shadow-inner">
|
||||||
|
<div class="flex flex-wrap items-center justify-between gap-2">
|
||||||
|
<span class="text-[11px] font-bold uppercase tracking-wider text-[#00C3CD]">Priority answer</span>
|
||||||
|
<span class="rounded border border-[#00C3CD]/40 bg-[#00C3CD]/15 px-2 py-0.5 font-mono text-[10px] font-bold text-[#00C3CD]">
|
||||||
|
RULE OUTPUT · {{ bundle.meta.reference_date }}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<div class="flex flex-col">
|
||||||
|
<span class="text-2xl font-extrabold tracking-tight text-white md:text-3xl">
|
||||||
|
{{ fmt(highCount) }} high-priority {{ highCount === 1 ? 'location' : 'locations' }}
|
||||||
|
</span>
|
||||||
|
<span class="mt-1 text-[12px] font-semibold leading-snug text-[#00C3CD]">
|
||||||
|
High if 5+ overfull readings, or 2+ with at least 25% of visits overfull.
|
||||||
|
</span>
|
||||||
|
<span class="mt-1 text-[11px] leading-snug text-[#94A3B8]">
|
||||||
|
Priority proof, not a route. {{ highShare.toFixed(1) }}% of all {{ fmt(total) }} locations clear the
|
||||||
|
high threshold.
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="grid grid-cols-2 gap-2.5">
|
||||||
|
<DecisionMetric
|
||||||
|
label="Container locations"
|
||||||
|
:value="fmt(total)"
|
||||||
|
hint="rule-scored IDs"
|
||||||
|
tone="accent"
|
||||||
|
/>
|
||||||
|
<DecisionMetric
|
||||||
|
label="Overfull readings"
|
||||||
|
:value="fmt(bundle.meta.overfull_readings)"
|
||||||
|
hint="reported states"
|
||||||
|
/>
|
||||||
|
<DecisionMetric
|
||||||
|
label="High-priority share"
|
||||||
|
:value="`${highShare.toFixed(1)}%`"
|
||||||
|
:hint="`${fmt(highCount)} of ${fmt(total)}`"
|
||||||
|
tone="accent"
|
||||||
|
/>
|
||||||
|
<DecisionMetric
|
||||||
|
label="Review window"
|
||||||
|
:value="bundle.meta.date_from"
|
||||||
|
:hint="`to ${bundle.meta.date_to}`"
|
||||||
|
:mono="false"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="flex flex-col gap-1.5">
|
||||||
|
<span class="text-[11px] font-bold uppercase tracking-wider text-[#94A3B8]">Fused rationale</span>
|
||||||
|
<div class="rounded-lg border border-[#1e3a52] bg-[#081723] p-3">
|
||||||
|
<span class="mb-1 block text-[10px] font-semibold uppercase tracking-wider text-[#64748B]">Priority rule</span>
|
||||||
|
<p class="break-words font-mono text-[10px] leading-relaxed text-[#94A3B8]">
|
||||||
|
{{ bundle.meta.priority_rule }}
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
<p class="text-sm leading-relaxed text-[#94A3B8]">
|
||||||
|
The snapshot applies that rule once to every container's full reading history. The classification uses
|
||||||
|
observed overfull counts and the overfull rate only. Overfull is a reported state in the fill-level
|
||||||
|
series, not a measured volume, and the artifact has no coordinates. It therefore proves priority; it does
|
||||||
|
not produce a route.
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="flex flex-col gap-2.5 pt-1">
|
||||||
|
<span class="text-[11px] font-bold uppercase tracking-wider text-[#94A3B8]">Material summary</span>
|
||||||
|
<div
|
||||||
|
v-for="material in materialRows"
|
||||||
|
:key="material.key"
|
||||||
|
class="flex items-center justify-between gap-3 rounded-lg border border-white/10 bg-[#132b40] p-3"
|
||||||
|
>
|
||||||
|
<div class="flex min-w-0 items-center gap-3">
|
||||||
|
<Icon :name="material.icon" class="shrink-0 text-[20px]" :class="material.iconClass" />
|
||||||
|
<div class="flex min-w-0 flex-col">
|
||||||
|
<span class="text-[13px] font-semibold text-white">{{ material.label }}</span>
|
||||||
|
<span class="text-[11px] text-[#94A3B8]">
|
||||||
|
{{ fmt(material.readings) }} readings · {{ fmt(material.overfull) }} overfull
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<span
|
||||||
|
class="shrink-0 rounded border border-[#00C3CD]/30 bg-[#00C3CD]/15 px-2 py-0.5 font-mono text-[11px] font-semibold text-[#00C3CD]"
|
||||||
|
:aria-label="`${material.share.toFixed(1)} percent of ${material.label} readings overfull`"
|
||||||
|
>
|
||||||
|
{{ material.share.toFixed(1) }}% overfull
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="flex items-start gap-2 rounded-lg border border-[#1e3a52] bg-[#081723] p-3">
|
||||||
|
<Icon name="material-symbols:info" class="mt-0.5 shrink-0 text-[16px] text-[#64748B]" />
|
||||||
|
<p class="text-[10px] leading-relaxed text-[#64748B]">
|
||||||
|
No coordinates in the dataset; no container capacity or depot data. This is a priority proof, not a
|
||||||
|
route.
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="flex flex-col gap-2 pt-1">
|
||||||
|
<div class="flex flex-col gap-2.5 sm:flex-row sm:items-center">
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
class="flex h-10 w-full items-center justify-center gap-2 rounded-lg bg-[#00C3CD] px-4 text-[13px] font-semibold text-[#081723] shadow-[0_0_16px_rgba(0,195,205,0.3)] transition-all hover:bg-[#00d8e4] disabled:cursor-not-allowed disabled:opacity-60 sm:w-auto sm:flex-1"
|
||||||
|
:disabled="top.length === 0"
|
||||||
|
@click="exportCsv"
|
||||||
|
>
|
||||||
|
<Icon name="material-symbols:download" class="text-[18px]" />
|
||||||
|
Export priority CSV
|
||||||
|
</button>
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
class="flex h-10 w-full items-center justify-center gap-1.5 rounded-lg border border-[#1e3a52] bg-[#132b40] px-4 text-[13px] font-semibold text-[#94A3B8] transition-all hover:bg-[#1e3a52] hover:text-white sm:w-auto"
|
||||||
|
:aria-expanded="ruleOpen"
|
||||||
|
@click="ruleOpen = !ruleOpen"
|
||||||
|
>
|
||||||
|
<Icon name="material-symbols:query-stats" class="text-[18px]" />
|
||||||
|
Inspect rule
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
<p v-if="exportNote" class="text-[10px] text-[#94A3B8]" role="status">{{ exportNote }}</p>
|
||||||
|
<div
|
||||||
|
v-if="ruleOpen"
|
||||||
|
class="flex flex-col gap-2 rounded-lg border border-[#1e3a52] bg-[#081723] p-3 text-[11px] leading-relaxed text-[#94A3B8]"
|
||||||
|
>
|
||||||
|
<p>
|
||||||
|
<strong class="text-white">Rule.</strong>
|
||||||
|
<span class="break-words font-mono text-[10px]">{{ bundle.meta.priority_rule }}</span>
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
<strong class="text-white">Counts.</strong>
|
||||||
|
{{ fmt(bundle.meta.rows) }} readings across {{ fmt(bundle.meta.containers) }} containers;
|
||||||
|
{{ fmt(bundle.meta.overfull_readings) }} overfull readings. Classes:
|
||||||
|
{{ fmt(bundle.summary.priority_counts.high) }} high /
|
||||||
|
{{ fmt(bundle.summary.priority_counts.medium) }} medium /
|
||||||
|
{{ fmt(bundle.summary.priority_counts.low) }} low.
|
||||||
|
</p>
|
||||||
|
<ul class="list-disc space-y-1 pl-4">
|
||||||
|
<li v-for="limitation in limitations" :key="limitation">{{ limitation }}</li>
|
||||||
|
</ul>
|
||||||
|
<p class="break-words text-[#64748B]">
|
||||||
|
Source: {{ bundle.meta.source }} · generated {{ bundle.meta.generated_at }} · reviewed
|
||||||
|
{{ bundle.meta.date_from }} → {{ bundle.meta.date_to }}.
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- RIGHT: visual data story -->
|
||||||
|
<div class="flex min-w-0 flex-col gap-6 lg:col-span-7">
|
||||||
|
<section class="flex flex-col gap-4 rounded-xl border border-[#1e3a52] bg-[#0e2233] p-5 shadow-sm md:p-6">
|
||||||
|
<div class="flex flex-wrap items-center justify-between gap-2">
|
||||||
|
<div class="flex flex-col">
|
||||||
|
<span class="text-[11px] font-semibold uppercase tracking-widest text-[#00C3CD]">Frozen priority rule</span>
|
||||||
|
<h3 class="mt-0.5 text-base font-bold text-white">Priority distribution</h3>
|
||||||
|
</div>
|
||||||
|
<span class="rounded border border-[#1e3a52] bg-[#132b40] px-2.5 py-1 font-mono text-[11px] text-[#94A3B8]">
|
||||||
|
{{ fmt(total) }} locations
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="flex flex-col gap-4 pt-1">
|
||||||
|
<div v-for="row in distribution" :key="row.priority" class="flex flex-col gap-1.5">
|
||||||
|
<div class="flex flex-wrap items-baseline justify-between gap-x-3 gap-y-0.5">
|
||||||
|
<span class="flex items-center gap-2 text-[12px] font-semibold text-white">
|
||||||
|
<span class="h-1.5 w-1.5 rounded-full" :class="PRIORITY_DOT[row.priority]" aria-hidden="true" />
|
||||||
|
{{ row.label }}
|
||||||
|
</span>
|
||||||
|
<span class="font-mono text-[12px] font-semibold text-white">
|
||||||
|
{{ fmt(row.count) }}
|
||||||
|
<span class="font-normal text-[#94A3B8]">· {{ row.share.toFixed(1) }}%</span>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<MiniBar
|
||||||
|
:value="row.share"
|
||||||
|
:tone="PRIORITY_TONE[row.priority]"
|
||||||
|
height="md"
|
||||||
|
:label="`${row.label} priority: ${fmt(row.count)} of ${fmt(total)} locations, ${row.share.toFixed(1)} percent`"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<p class="text-[10px] leading-relaxed text-[#64748B]">
|
||||||
|
Counts are container locations, not readings. Priority is a deterministic rule output, not a modeled
|
||||||
|
confidence score.
|
||||||
|
</p>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<section class="flex flex-col gap-4 rounded-xl border border-[#1e3a52] bg-[#0e2233] p-5 shadow-sm md:p-6">
|
||||||
|
<div class="flex flex-wrap items-center justify-between gap-2">
|
||||||
|
<div class="flex flex-col">
|
||||||
|
<span class="text-[11px] font-semibold uppercase tracking-widest text-[#00C3CD]">Top of the frozen ranking</span>
|
||||||
|
<h3 class="mt-0.5 text-base font-bold text-white">Container priority matrix</h3>
|
||||||
|
</div>
|
||||||
|
<span class="rounded border border-[#1e3a52] bg-[#132b40] px-2.5 py-1 font-mono text-[11px] text-[#94A3B8]">
|
||||||
|
{{ top.length }} rows
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="flex flex-col gap-2">
|
||||||
|
<article
|
||||||
|
v-for="(row, index) in top"
|
||||||
|
:key="row.location_id"
|
||||||
|
class="flex flex-col gap-1.5 rounded-lg border border-[#1e3a52] bg-[#132b40] px-3 py-2.5 transition-colors hover:border-[#64748B]/60"
|
||||||
|
>
|
||||||
|
<div class="flex flex-wrap items-center gap-x-2 gap-y-1">
|
||||||
|
<span class="w-6 shrink-0 font-mono text-[10px] text-[#64748B]">
|
||||||
|
{{ String(index + 1).padStart(2, '0') }}
|
||||||
|
</span>
|
||||||
|
<span class="font-mono text-[12px] font-semibold text-white">{{ shortContainerId(row.location_id) }}</span>
|
||||||
|
<span class="rounded border px-1.5 py-0.5 text-[9px] font-bold uppercase tracking-wide" :class="PRIORITY_BADGE[row.priority]">
|
||||||
|
{{ row.priority }}
|
||||||
|
</span>
|
||||||
|
<span class="ml-auto flex items-center gap-2 font-mono text-[10px] text-[#94A3B8]">
|
||||||
|
<span><span class="font-semibold text-white">{{ fmt(row.overfull_count) }}</span> overfull</span>
|
||||||
|
<span class="text-[#64748B]" aria-hidden="true">·</span>
|
||||||
|
<span>p95 <span class="font-semibold text-white">{{ Math.round(row.p95_fill) }}%</span></span>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<div class="flex items-center gap-2">
|
||||||
|
<MiniBar
|
||||||
|
:value="row.overfull_rate * 100"
|
||||||
|
:tone="PRIORITY_TONE[row.priority]"
|
||||||
|
:label="`Container ${shortContainerId(row.location_id)} overfull rate ${(row.overfull_rate * 100).toFixed(1)} percent`"
|
||||||
|
/>
|
||||||
|
<span class="shrink-0 font-mono text-[10px] text-[#64748B]">
|
||||||
|
{{ (row.overfull_rate * 100).toFixed(1) }}%
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<p class="text-[11px] leading-snug text-[#64748B]">{{ prezeroReason(row) }}</p>
|
||||||
|
</article>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="flex items-start gap-2 rounded-lg border border-[#1e3a52] bg-[#081723] p-3">
|
||||||
|
<Icon name="material-symbols:info" class="mt-0.5 shrink-0 text-[16px] text-[#64748B]" />
|
||||||
|
<p class="text-[10px] leading-relaxed text-[#64748B]">
|
||||||
|
No map: the dataset has no coordinates. This is a priority proof, not a route.
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<section
|
||||||
|
v-else
|
||||||
|
class="flex flex-col items-center justify-center gap-3 rounded-xl border border-[#1e3a52] bg-[#0e2233] p-8 text-center shadow-sm lg:col-span-12"
|
||||||
|
role="status"
|
||||||
|
>
|
||||||
|
<div class="flex h-11 w-11 items-center justify-center rounded-lg border border-[#1e3a52] bg-[#132b40] text-[#00C3CD]">
|
||||||
|
<Icon name="material-symbols:recycling" class="text-[24px]" />
|
||||||
|
</div>
|
||||||
|
<div class="flex max-w-md flex-col gap-1">
|
||||||
|
<span class="text-base font-bold text-white">Priority snapshot not loaded</span>
|
||||||
|
<p class="text-sm leading-relaxed text-[#94A3B8]">
|
||||||
|
The frozen PreZero artifact is unavailable. The location ranking and summary stay hidden rather than being
|
||||||
|
filled with estimates.
|
||||||
|
</p>
|
||||||
|
<p class="text-[11px] text-[#64748B]">Expected artifact: /prezero/priority.json</p>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
@@ -0,0 +1,362 @@
|
|||||||
|
<script setup lang="ts">
|
||||||
|
import type { CoolRouteBundle, CoolRouteId } from '#shared/cool'
|
||||||
|
import { ROUTE_ORDER, routeValuesFor } from '#shared/use-cases'
|
||||||
|
|
||||||
|
interface BuildingPolygon {
|
||||||
|
name: string | null
|
||||||
|
kind: string
|
||||||
|
points: Array<[number, number]>
|
||||||
|
}
|
||||||
|
|
||||||
|
interface PlacePoint {
|
||||||
|
name: string | null
|
||||||
|
lat: number
|
||||||
|
lon: number
|
||||||
|
near_routes_m?: Record<string, number>
|
||||||
|
}
|
||||||
|
|
||||||
|
interface PlacesBundle {
|
||||||
|
cool_places: PlacePoint[]
|
||||||
|
water: PlacePoint[]
|
||||||
|
benches: PlacePoint[]
|
||||||
|
}
|
||||||
|
|
||||||
|
const props = defineProps<{
|
||||||
|
bundle: CoolRouteBundle
|
||||||
|
buildings: BuildingPolygon[] | null
|
||||||
|
places: PlacesBundle | null
|
||||||
|
selectedRouteId: CoolRouteId
|
||||||
|
time: string
|
||||||
|
}>()
|
||||||
|
|
||||||
|
const WIDTH = 760
|
||||||
|
const HEIGHT = 380
|
||||||
|
const PAD = 34
|
||||||
|
|
||||||
|
const zoom = ref(1)
|
||||||
|
const map = ref<SVGSVGElement | null>(null)
|
||||||
|
const viewBox = computed(() => {
|
||||||
|
if (zoom.value === 1) return `0 0 ${WIDTH} ${HEIGHT}`
|
||||||
|
const w = WIDTH / zoom.value
|
||||||
|
const h = HEIGHT / zoom.value
|
||||||
|
return `${(WIDTH - w) / 2} ${(HEIGHT - h) / 2} ${w} ${h}`
|
||||||
|
})
|
||||||
|
|
||||||
|
const bounds = computed(() => {
|
||||||
|
const points = props.bundle.routes.flatMap((route) => route.geometry)
|
||||||
|
if (!points.length) return { minLon: 9.2175, maxLon: 9.2204, minLat: 49.1402, maxLat: 49.1426 }
|
||||||
|
const lons = points.map(([lon]) => lon)
|
||||||
|
const lats = points.map(([, lat]) => lat)
|
||||||
|
return {
|
||||||
|
minLon: Math.min(...lons),
|
||||||
|
maxLon: Math.max(...lons),
|
||||||
|
minLat: Math.min(...lats),
|
||||||
|
maxLat: Math.max(...lats),
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
function project([lon, lat]: [number, number]): [number, number] {
|
||||||
|
const b = bounds.value
|
||||||
|
const nx = (lon - b.minLon) / Math.max(b.maxLon - b.minLon, 0.000001)
|
||||||
|
const ny = (b.maxLat - lat) / Math.max(b.maxLat - b.minLat, 0.000001)
|
||||||
|
return [PAD + nx * (WIDTH - PAD * 2), PAD + ny * (HEIGHT - PAD * 2)]
|
||||||
|
}
|
||||||
|
|
||||||
|
function pathFor(routeId: CoolRouteId): string {
|
||||||
|
const route = props.bundle.routes.find((entry) => entry.id === routeId)
|
||||||
|
if (!route || route.geometry.length < 2) return ''
|
||||||
|
const points = route.geometry.map(project)
|
||||||
|
return points.map(([x, y], index) => `${index === 0 ? 'M' : 'L'} ${x.toFixed(2)} ${y.toFixed(2)}`).join(' ')
|
||||||
|
}
|
||||||
|
|
||||||
|
const polygons = computed(() =>
|
||||||
|
(props.buildings ?? []).map((building) => ({
|
||||||
|
...building,
|
||||||
|
d: `${building.points
|
||||||
|
.map(([lon, lat], index) => {
|
||||||
|
const [x, y] = project([lon, lat])
|
||||||
|
return `${index === 0 ? 'M' : 'L'} ${x.toFixed(2)} ${y.toFixed(2)}`
|
||||||
|
})
|
||||||
|
.join(' ')} Z`,
|
||||||
|
})),
|
||||||
|
)
|
||||||
|
|
||||||
|
const routePaths = computed(() =>
|
||||||
|
ROUTE_ORDER.map((id) => ({
|
||||||
|
id,
|
||||||
|
d: pathFor(id),
|
||||||
|
active: id === props.selectedRouteId,
|
||||||
|
recommended: props.bundle.recommendationByTime[props.time] === id,
|
||||||
|
})),
|
||||||
|
)
|
||||||
|
|
||||||
|
const selectedRoute = computed(() =>
|
||||||
|
props.bundle.routes.find((route) => route.id === props.selectedRouteId),
|
||||||
|
)
|
||||||
|
const values = computed(() => routeValuesFor(props.bundle, props.selectedRouteId, props.time))
|
||||||
|
|
||||||
|
const origin = computed(() => {
|
||||||
|
const [x, y] = project([
|
||||||
|
props.bundle.origin.lon ?? 9.218444,
|
||||||
|
props.bundle.origin.lat ?? 49.140269,
|
||||||
|
])
|
||||||
|
return { x, y }
|
||||||
|
})
|
||||||
|
const destination = computed(() => {
|
||||||
|
const [x, y] = project([
|
||||||
|
props.bundle.destination.lon ?? 9.218659,
|
||||||
|
props.bundle.destination.lat ?? 49.142318,
|
||||||
|
])
|
||||||
|
return { x, y }
|
||||||
|
})
|
||||||
|
|
||||||
|
// The shaded route's middle is the real Deutschhof / Kiliansplatz corridor.
|
||||||
|
const corridor = computed(() => {
|
||||||
|
const route = props.bundle.routes.find((entry) => entry.id === 'shaded')
|
||||||
|
if (!route || route.geometry.length < 4) return ''
|
||||||
|
const slice = route.geometry.slice(
|
||||||
|
Math.floor(route.geometry.length * 0.28),
|
||||||
|
Math.ceil(route.geometry.length * 0.78),
|
||||||
|
)
|
||||||
|
return slice
|
||||||
|
.map(([lon, lat], index) => {
|
||||||
|
const [x, y] = project([lon, lat])
|
||||||
|
return `${index === 0 ? 'M' : 'L'} ${x.toFixed(2)} ${y.toFixed(2)}`
|
||||||
|
})
|
||||||
|
.join(' ')
|
||||||
|
})
|
||||||
|
|
||||||
|
const waterPoints = computed(() =>
|
||||||
|
(props.places?.water ?? []).map((place) => {
|
||||||
|
const [x, y] = project([place.lon, place.lat])
|
||||||
|
return { ...place, x, y }
|
||||||
|
}),
|
||||||
|
)
|
||||||
|
|
||||||
|
const benchPoints = computed(() =>
|
||||||
|
(props.places?.benches ?? [])
|
||||||
|
.filter((place) => {
|
||||||
|
const near = place.near_routes_m?.[props.selectedRouteId]
|
||||||
|
return typeof near === 'number' && near <= 30
|
||||||
|
})
|
||||||
|
.slice(0, 7)
|
||||||
|
.map((place) => {
|
||||||
|
const [x, y] = project([place.lon, place.lat])
|
||||||
|
return { ...place, x, y }
|
||||||
|
}),
|
||||||
|
)
|
||||||
|
|
||||||
|
const keyPlaces = computed(() => {
|
||||||
|
const names = ['Kiliansplatz', 'Marktplatz', 'Deutschhof']
|
||||||
|
return (props.places?.cool_places ?? [])
|
||||||
|
.filter((place) => place.name && names.some((name) => place.name!.includes(name)))
|
||||||
|
.slice(0, 3)
|
||||||
|
.map((place) => {
|
||||||
|
const [x, y] = project([place.lon, place.lat])
|
||||||
|
return { ...place, x, y }
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
function zoomBy(delta: number) {
|
||||||
|
zoom.value = Math.max(1, Math.min(2.2, Math.round((zoom.value + delta) * 10) / 10))
|
||||||
|
}
|
||||||
|
function resetZoom() {
|
||||||
|
zoom.value = 1
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<figure class="m-0 flex w-full flex-col gap-2">
|
||||||
|
<div
|
||||||
|
class="relative h-[370px] w-full overflow-hidden rounded-xl border border-[#1e3a52] bg-[#050f17] shadow-inner"
|
||||||
|
>
|
||||||
|
<svg
|
||||||
|
ref="map"
|
||||||
|
class="absolute inset-0 h-full w-full"
|
||||||
|
:viewBox="viewBox"
|
||||||
|
role="img"
|
||||||
|
:aria-label="`Schematic of the ${selectedRoute?.longName ?? selectedRouteId} between ${bundle.origin.name} and ${bundle.destination.name}. Buildings are real OSM footprints; the projection is a schematic and not for navigation.`"
|
||||||
|
preserveAspectRatio="xMidYMid meet"
|
||||||
|
>
|
||||||
|
<defs>
|
||||||
|
<pattern id="uc-grid" width="38" height="38" patternUnits="userSpaceOnUse">
|
||||||
|
<path d="M 38 0 L 0 0 0 38" fill="none" stroke="#102536" stroke-width="0.8" stroke-dasharray="2 3" />
|
||||||
|
</pattern>
|
||||||
|
<marker id="uc-arrow" markerWidth="7" markerHeight="7" refX="5" refY="5" viewBox="0 0 10 10" orient="auto-start-reverse">
|
||||||
|
<path d="M 0 1.5 L 8 5 L 0 8.5 z" fill="#00C3CD" />
|
||||||
|
</marker>
|
||||||
|
<filter id="uc-glow" x="-30%" y="-30%" width="160%" height="160%">
|
||||||
|
<feGaussianBlur stdDeviation="4" result="blur" />
|
||||||
|
<feMerge>
|
||||||
|
<feMergeNode in="blur" />
|
||||||
|
<feMergeNode in="SourceGraphic" />
|
||||||
|
</feMerge>
|
||||||
|
</filter>
|
||||||
|
</defs>
|
||||||
|
|
||||||
|
<rect width="100%" height="100%" fill="url(#uc-grid)" />
|
||||||
|
|
||||||
|
<!-- Real OSM building footprints around the route. -->
|
||||||
|
<path
|
||||||
|
v-for="(building, index) in polygons"
|
||||||
|
:key="`${building.name ?? 'building'}-${index}`"
|
||||||
|
:d="building.d"
|
||||||
|
fill="#0e2233"
|
||||||
|
:stroke="building.name ? '#23445f' : '#1a354c'"
|
||||||
|
stroke-width="0.8"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<!-- Translucent corridor behind the real shaded route. -->
|
||||||
|
<path
|
||||||
|
v-if="corridor"
|
||||||
|
:d="corridor"
|
||||||
|
fill="none"
|
||||||
|
stroke="#00C3CD"
|
||||||
|
stroke-width="26"
|
||||||
|
stroke-linecap="round"
|
||||||
|
stroke-linejoin="round"
|
||||||
|
opacity="0.07"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<!-- Alternatives first. -->
|
||||||
|
<path
|
||||||
|
v-for="path in routePaths.filter((entry) => !entry.active)"
|
||||||
|
:key="path.id"
|
||||||
|
:d="path.d"
|
||||||
|
fill="none"
|
||||||
|
stroke="#64748B"
|
||||||
|
stroke-width="2.4"
|
||||||
|
stroke-dasharray="5 4"
|
||||||
|
stroke-linecap="round"
|
||||||
|
stroke-linejoin="round"
|
||||||
|
opacity="0.55"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<!-- Selected route: glow + line + direction arrow. -->
|
||||||
|
<template v-for="path in routePaths.filter((entry) => entry.active)" :key="`active-${path.id}`">
|
||||||
|
<path
|
||||||
|
:d="path.d"
|
||||||
|
fill="none"
|
||||||
|
stroke="#00C3CD"
|
||||||
|
stroke-width="10"
|
||||||
|
stroke-linecap="round"
|
||||||
|
stroke-linejoin="round"
|
||||||
|
opacity="0.18"
|
||||||
|
filter="url(#uc-glow)"
|
||||||
|
/>
|
||||||
|
<path
|
||||||
|
:d="path.d"
|
||||||
|
fill="none"
|
||||||
|
stroke="#00C3CD"
|
||||||
|
stroke-width="4"
|
||||||
|
stroke-linecap="round"
|
||||||
|
stroke-linejoin="round"
|
||||||
|
marker-end="url(#uc-arrow)"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<!-- Real drinking water points. -->
|
||||||
|
<g v-for="(place, index) in waterPoints" :key="`water-${index}`" :transform="`translate(${place.x} ${place.y})`">
|
||||||
|
<circle r="7" fill="#081723" stroke="#00C3CD" stroke-width="1" opacity="0.9" />
|
||||||
|
<path d="M0 -4 C3 0 4 1.2 4 2.8 A4 4 0 1 1 -4 2.8 C-4 1.2 -3 0 0 -4 Z" fill="#00C3CD" />
|
||||||
|
<title>{{ place.name ?? 'Drinking water' }}</title>
|
||||||
|
</g>
|
||||||
|
|
||||||
|
<!-- Benches within 30 m of the selected route. -->
|
||||||
|
<g v-for="(place, index) in benchPoints" :key="`bench-${index}`" :transform="`translate(${place.x} ${place.y})`">
|
||||||
|
<rect x="-3" y="-2" width="6" height="4" rx="1" fill="#94A3B8" opacity="0.8" />
|
||||||
|
<title>{{ place.name ?? 'Mapped bench' }}</title>
|
||||||
|
</g>
|
||||||
|
|
||||||
|
<!-- Key place labels from the real bundle. -->
|
||||||
|
<g v-for="place in keyPlaces" :key="place.name ?? 'place'" :transform="`translate(${place.x} ${place.y})`">
|
||||||
|
<circle r="2.2" fill="#00C3CD" />
|
||||||
|
<text x="6" y="3" fill="#94A3B8" font-size="8.5" font-family="Inter, sans-serif">{{ place.name }}</text>
|
||||||
|
</g>
|
||||||
|
|
||||||
|
<!-- Origin / destination cards, like a wayfinding board. -->
|
||||||
|
<g :transform="`translate(${origin.x} ${origin.y})`">
|
||||||
|
<circle r="10" fill="#00C3CD" stroke="#081723" stroke-width="2" />
|
||||||
|
<text x="0" y="3.5" text-anchor="middle" fill="#081723" font-size="10" font-weight="700" font-family="Inter, sans-serif">A</text>
|
||||||
|
<g transform="translate(16 -26)">
|
||||||
|
<rect width="132" height="32" rx="6" fill="#132b40" stroke="#00C3CD" stroke-opacity="0.5" />
|
||||||
|
<text x="8" y="12" fill="#94A3B8" font-size="6.5" font-family="Inter, sans-serif" letter-spacing="0.8">START POINT</text>
|
||||||
|
<text x="8" y="24" fill="#FFFFFF" font-size="9" font-weight="600" font-family="Inter, sans-serif">{{ bundle.origin.name }}</text>
|
||||||
|
</g>
|
||||||
|
</g>
|
||||||
|
|
||||||
|
<g :transform="`translate(${destination.x} ${destination.y})`">
|
||||||
|
<circle r="10" fill="#FFFFFF" stroke="#081723" stroke-width="2" />
|
||||||
|
<text x="0" y="3.5" text-anchor="middle" fill="#081723" font-size="10" font-weight="700" font-family="Inter, sans-serif">B</text>
|
||||||
|
<g transform="translate(-148 12)">
|
||||||
|
<rect width="132" height="32" rx="6" fill="#132b40" stroke="#00C3CD" stroke-opacity="0.5" />
|
||||||
|
<text x="8" y="12" fill="#94A3B8" font-size="6.5" font-family="Inter, sans-serif" letter-spacing="0.8">DESTINATION</text>
|
||||||
|
<text x="8" y="24" fill="#FFFFFF" font-size="9" font-weight="600" font-family="Inter, sans-serif">{{ bundle.destination.name }}</text>
|
||||||
|
</g>
|
||||||
|
</g>
|
||||||
|
|
||||||
|
<!-- Compass + solar cue. -->
|
||||||
|
<g transform="translate(38 40)">
|
||||||
|
<circle r="17" fill="#081723" fill-opacity="0.7" stroke="#1e3a52" />
|
||||||
|
<text x="0" y="-21" text-anchor="middle" fill="#94A3B8" font-size="7" font-family="Inter, sans-serif">N</text>
|
||||||
|
<path d="M0 -12 L4 4 L0 1 L-4 4 Z" fill="#00C3CD" />
|
||||||
|
</g>
|
||||||
|
</svg>
|
||||||
|
|
||||||
|
<!-- Canvas controls. -->
|
||||||
|
<div class="absolute right-3 top-3 z-10 flex flex-col gap-1 rounded-lg border border-[#1e3a52] bg-[#0e2233]/90 p-1 backdrop-blur">
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
class="flex h-7 w-7 items-center justify-center rounded text-[#94A3B8] transition-colors hover:bg-[#132b40] hover:text-white"
|
||||||
|
aria-label="Zoom in"
|
||||||
|
@click="zoomBy(0.3)"
|
||||||
|
>
|
||||||
|
<Icon name="material-symbols:add" class="text-[17px]" />
|
||||||
|
</button>
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
class="flex h-7 w-7 items-center justify-center rounded text-[#94A3B8] transition-colors hover:bg-[#132b40] hover:text-white"
|
||||||
|
aria-label="Zoom out"
|
||||||
|
@click="zoomBy(-0.3)"
|
||||||
|
>
|
||||||
|
<Icon name="material-symbols:remove" class="text-[17px]" />
|
||||||
|
</button>
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
class="flex h-7 w-7 items-center justify-center rounded text-[#00C3CD] transition-colors hover:bg-[#132b40]"
|
||||||
|
aria-label="Reset map view"
|
||||||
|
title="Recenter view"
|
||||||
|
@click="resetZoom"
|
||||||
|
>
|
||||||
|
<Icon name="material-symbols:my-location" class="text-[17px]" />
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="pointer-events-none absolute bottom-3 left-3 z-10 rounded-md border border-[#1e3a52] bg-[#0e2233]/90 px-2 py-1 text-[9px] font-medium text-[#94A3B8] backdrop-blur">
|
||||||
|
Schematic projection · real OSM footprints · not for navigation
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<figcaption class="flex flex-wrap items-center justify-between gap-3 pt-1 text-[11px] text-[#94A3B8]">
|
||||||
|
<div class="flex flex-wrap items-center gap-4">
|
||||||
|
<span class="flex items-center gap-1.5">
|
||||||
|
<span class="h-1.5 w-3.5 rounded-full bg-[#00C3CD]" />
|
||||||
|
<span class="font-medium text-white">Active recommendation</span>
|
||||||
|
</span>
|
||||||
|
<span class="flex items-center gap-1.5">
|
||||||
|
<span class="h-2.5 w-2.5 rounded-sm border border-[#64748B] bg-[#475569]/40" />
|
||||||
|
<span>Alternative route</span>
|
||||||
|
</span>
|
||||||
|
<span class="flex items-center gap-1.5">
|
||||||
|
<span class="h-2.5 w-2.5 rounded-full border border-[#00C3CD] bg-[#00C3CD]/20" />
|
||||||
|
<span>Drinking water</span>
|
||||||
|
</span>
|
||||||
|
<span class="flex items-center gap-1.5">
|
||||||
|
<span class="h-2.5 w-2.5 rounded-sm bg-[#94A3B8]" />
|
||||||
|
<span>Mapped bench</span>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<span class="font-mono text-[#64748B]">EPSG:4326 · modeled, not measured</span>
|
||||||
|
</figcaption>
|
||||||
|
</figure>
|
||||||
|
</template>
|
||||||
@@ -0,0 +1,387 @@
|
|||||||
|
<script setup lang="ts">
|
||||||
|
import { COOL_TIMES } from '#shared/cool'
|
||||||
|
import type { CoolRouteBundle, CoolRouteId, CoolTime } from '#shared/cool'
|
||||||
|
import type { Sensor } from '#shared/types'
|
||||||
|
import DecisionMetric from '~/components/use-cases/DecisionMetric.vue'
|
||||||
|
import MiniBar from '~/components/use-cases/MiniBar.vue'
|
||||||
|
import RouteMatrixMap from '~/components/use-cases/RouteMatrixMap.vue'
|
||||||
|
import {
|
||||||
|
buildGpx,
|
||||||
|
compassDirection,
|
||||||
|
formatMinutes,
|
||||||
|
formatPercent,
|
||||||
|
recommendedRoute,
|
||||||
|
recommendedValues,
|
||||||
|
routeComparison,
|
||||||
|
routeRationale,
|
||||||
|
solarPosition,
|
||||||
|
} from '#shared/use-cases'
|
||||||
|
|
||||||
|
interface BuildingPolygon {
|
||||||
|
name: string | null
|
||||||
|
kind: string
|
||||||
|
points: Array<[number, number]>
|
||||||
|
}
|
||||||
|
|
||||||
|
interface PlacePoint {
|
||||||
|
name: string | null
|
||||||
|
lat: number
|
||||||
|
lon: number
|
||||||
|
near_routes_m?: Record<string, number>
|
||||||
|
}
|
||||||
|
interface PlacesBundle {
|
||||||
|
cool_places: PlacePoint[]
|
||||||
|
water: PlacePoint[]
|
||||||
|
benches: PlacePoint[]
|
||||||
|
}
|
||||||
|
|
||||||
|
const props = defineProps<{
|
||||||
|
bundle: CoolRouteBundle
|
||||||
|
buildings: BuildingPolygon[] | null
|
||||||
|
places: PlacesBundle | null
|
||||||
|
sensors: Sensor[] | null
|
||||||
|
time: CoolTime
|
||||||
|
}>()
|
||||||
|
|
||||||
|
const emit = defineEmits<{ 'update:time': [value: CoolTime] }>()
|
||||||
|
|
||||||
|
const methodOpen = ref(false)
|
||||||
|
const exportNote = ref('')
|
||||||
|
const routeId = computed<CoolRouteId>(() => recommendedRoute(props.bundle, props.time)?.id ?? 'shortest')
|
||||||
|
const route = computed(() => recommendedRoute(props.bundle, props.time))
|
||||||
|
const values = computed(() => recommendedValues(props.bundle, props.time))
|
||||||
|
const comparison = computed(() => routeComparison(props.bundle, props.time))
|
||||||
|
const fastest = computed(() =>
|
||||||
|
comparison.value.slice().sort((a, b) => a.values.durationMin - b.values.durationMin)[0],
|
||||||
|
)
|
||||||
|
const deltaVsFastest = computed(() => {
|
||||||
|
if (!values.value || !fastest.value) return 0
|
||||||
|
return Math.round((values.value.durationMin - fastest.value.values.durationMin) * 10) / 10
|
||||||
|
})
|
||||||
|
const solar = computed(() => solarPosition(props.bundle, props.time))
|
||||||
|
const sensor = computed(
|
||||||
|
() => props.sensors?.find((entry) => entry.name === 'Marktplatz') ?? props.sensors?.[0] ?? null,
|
||||||
|
)
|
||||||
|
const rationale = computed(() => routeRationale(props.bundle, props.time))
|
||||||
|
const hotDay = computed(() => props.bundle.hotDay)
|
||||||
|
const shadeLabel = computed(() => props.bundle.shadeLabel || 'modeled shade, not measured')
|
||||||
|
const activeRouteName = computed(() => route.value?.longName ?? route.value?.label ?? 'Route')
|
||||||
|
const routeDescription = computed(() => route.value?.description ?? '')
|
||||||
|
|
||||||
|
function selectTime(value: CoolTime) {
|
||||||
|
emit('update:time', value)
|
||||||
|
}
|
||||||
|
|
||||||
|
function exportGpx() {
|
||||||
|
try {
|
||||||
|
const xml = buildGpx(props.bundle, routeId.value, props.time)
|
||||||
|
const blob = new Blob([xml], { type: 'application/gpx+xml' })
|
||||||
|
const url = URL.createObjectURL(blob)
|
||||||
|
const anchor = document.createElement('a')
|
||||||
|
anchor.href = url
|
||||||
|
anchor.download = `sensing-engine-${routeId.value}-${props.time.replace(':', '')}.gpx`
|
||||||
|
anchor.click()
|
||||||
|
URL.revokeObjectURL(url)
|
||||||
|
exportNote.value = 'GPX exported with the real OSM geometry.'
|
||||||
|
} catch {
|
||||||
|
exportNote.value = 'The route geometry is unavailable; no file was created.'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<div class="grid grid-cols-1 items-start gap-6 lg:grid-cols-12">
|
||||||
|
<!-- LEFT: decision story -->
|
||||||
|
<div class="flex flex-col gap-6 lg:col-span-5">
|
||||||
|
<section class="relative flex flex-col gap-5 overflow-hidden rounded-xl border border-[#1e3a52] bg-[#0e2233] p-6 shadow-sm">
|
||||||
|
<div class="flex flex-col gap-1">
|
||||||
|
<span class="text-[11px] font-semibold uppercase tracking-widest text-[#00C3CD]">Optimization query</span>
|
||||||
|
<h2 class="text-lg font-bold leading-snug tracking-tight text-white md:text-xl">
|
||||||
|
Fastest way from A to B on a hot day, with modeled shade and step-free access.
|
||||||
|
</h2>
|
||||||
|
<div class="mt-2 flex flex-wrap items-center gap-1.5" role="group" aria-label="Modeled hour">
|
||||||
|
<span class="mr-1 text-[11px] text-[#94A3B8]">Modeled at</span>
|
||||||
|
<button
|
||||||
|
v-for="slot in COOL_TIMES"
|
||||||
|
:key="slot"
|
||||||
|
type="button"
|
||||||
|
class="rounded-md border px-2.5 py-1 text-[11px] font-semibold transition-colors"
|
||||||
|
:class="
|
||||||
|
time === slot
|
||||||
|
? 'border-[#00C3CD]/50 bg-[#00C3CD]/15 text-[#00C3CD]'
|
||||||
|
: 'border-[#1e3a52] bg-[#081723] text-[#94A3B8] hover:text-white'
|
||||||
|
"
|
||||||
|
:aria-pressed="time === slot"
|
||||||
|
@click="selectTime(slot)"
|
||||||
|
>
|
||||||
|
{{ slot }}
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="relative flex flex-col gap-3 rounded-xl border border-[#00C3CD]/30 bg-[#132b40] p-5 shadow-inner">
|
||||||
|
<div class="flex items-center justify-between gap-2">
|
||||||
|
<span class="text-[11px] font-bold uppercase tracking-wider text-[#00C3CD]">Optimal vector</span>
|
||||||
|
<span class="rounded border border-[#00C3CD]/40 bg-[#00C3CD]/15 px-2 py-0.5 font-mono text-[11px] font-bold text-[#00C3CD]">
|
||||||
|
MODEL ROUTE · {{ time }}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<div class="flex flex-col">
|
||||||
|
<span class="text-2xl font-extrabold tracking-tight text-white md:text-3xl">{{ activeRouteName }}</span>
|
||||||
|
<span class="mt-0.5 text-base font-semibold text-[#00C3CD]">
|
||||||
|
{{ values ? `${formatMinutes(values.durationMin)} total duration` : 'Waiting for route values' }}
|
||||||
|
</span>
|
||||||
|
<span v-if="routeDescription" class="mt-1 text-[11px] leading-snug text-[#94A3B8]">{{ routeDescription }}</span>
|
||||||
|
</div>
|
||||||
|
<div class="grid grid-cols-3 gap-2.5 pt-2">
|
||||||
|
<DecisionMetric
|
||||||
|
label="Delta"
|
||||||
|
:value="deltaVsFastest > 0 ? `+${deltaVsFastest} min` : 'Fastest'"
|
||||||
|
:hint="deltaVsFastest > 0 ? 'vs fastest' : 'no penalty'"
|
||||||
|
:tone="deltaVsFastest > 0 ? 'default' : 'accent'"
|
||||||
|
/>
|
||||||
|
<DecisionMetric
|
||||||
|
label="Shade"
|
||||||
|
:value="values ? formatPercent(values.shadePct) : '—'"
|
||||||
|
hint="modeled cover"
|
||||||
|
tone="accent"
|
||||||
|
/>
|
||||||
|
<DecisionMetric
|
||||||
|
label="Direct sun"
|
||||||
|
:value="values ? formatMinutes(values.directSunMin) : '—'"
|
||||||
|
hint="modeled"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<div class="grid grid-cols-3 gap-2.5">
|
||||||
|
<div class="flex flex-col">
|
||||||
|
<span class="text-[10px] text-[#64748B]">Step-free</span>
|
||||||
|
<span class="text-[12px] font-semibold text-white">{{ values?.stepFree ? 'Yes' : 'No' }}</span>
|
||||||
|
</div>
|
||||||
|
<div class="flex flex-col">
|
||||||
|
<span class="text-[10px] text-[#64748B]">Water</span>
|
||||||
|
<span class="text-[12px] font-semibold text-white">{{ values?.waterStops ?? '—' }} stops</span>
|
||||||
|
</div>
|
||||||
|
<div class="flex flex-col">
|
||||||
|
<span class="text-[10px] text-[#64748B]">Benches</span>
|
||||||
|
<span class="text-[12px] font-semibold text-white">{{ values?.benchStops ?? '—' }} stops</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="flex flex-col gap-1.5">
|
||||||
|
<span class="text-[11px] font-bold uppercase tracking-wider text-[#94A3B8]">Fused rationale</span>
|
||||||
|
<p class="text-sm leading-relaxed text-[#94A3B8]">
|
||||||
|
{{ rationale }}
|
||||||
|
</p>
|
||||||
|
<p class="text-[10px] leading-relaxed text-[#64748B]">
|
||||||
|
{{ shadeLabel }}. Estimated devices, not people. The recommendation is deterministic, not a confidence score.
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="flex flex-col gap-2.5 pt-1">
|
||||||
|
<span class="text-[11px] font-bold uppercase tracking-wider text-[#94A3B8]">Sensor context · historical baseline</span>
|
||||||
|
<div class="flex items-center justify-between gap-3 rounded-lg border border-white/10 bg-[#132b40] p-3">
|
||||||
|
<div class="flex items-center gap-3">
|
||||||
|
<Icon name="material-symbols:wb-sunny" class="text-[20px] text-[#94A3B8]" />
|
||||||
|
<div class="flex flex-col">
|
||||||
|
<span class="text-[13px] font-semibold text-white">Solar exposure index</span>
|
||||||
|
<span class="text-[11px] text-[#94A3B8]">
|
||||||
|
{{ solar ? `Azimuth ${Math.round(solar.azimuth_deg)}° ${compassDirection(solar.azimuth_deg)}` : 'solar position unavailable' }}
|
||||||
|
<template v-if="hotDay"> · ambient {{ hotDay.temperature_max_c }}°C</template>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<span class="rounded border border-white/20 bg-white/10 px-2 py-0.5 text-[11px] font-semibold text-white">
|
||||||
|
{{ hotDay && hotDay.temperature_max_c >= 30 ? 'High load' : 'Modeled' }}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<div class="flex items-center justify-between gap-3 rounded-lg border border-white/10 bg-[#132b40] p-3">
|
||||||
|
<div class="flex items-center gap-3">
|
||||||
|
<Icon name="material-symbols:groups" class="text-[20px] text-[#00C3CD]" />
|
||||||
|
<div class="flex flex-col">
|
||||||
|
<span class="text-[13px] font-semibold text-white">Pedestrian flux density</span>
|
||||||
|
<span class="text-[11px] text-[#94A3B8]">
|
||||||
|
<template v-if="sensor">{{ sensor.name }} · p95 {{ sensor.p95 }} est. devices/h</template>
|
||||||
|
<template v-else>Waiting for sensor data</template>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<span class="rounded border border-[#00C3CD]/30 bg-[#00C3CD]/15 px-2 py-0.5 text-[11px] font-semibold text-[#00C3CD]">
|
||||||
|
{{ sensor ? `mean ${sensor.mean}` : '—' }}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<div class="flex items-center justify-between gap-3 rounded-lg border border-white/10 bg-[#132b40] p-3">
|
||||||
|
<div class="flex items-center gap-3">
|
||||||
|
<Icon name="material-symbols:sensors" class="text-[20px] text-[#00C3CD]" />
|
||||||
|
<div class="flex flex-col">
|
||||||
|
<span class="text-[13px] font-semibold text-white">Microclimate sensor node</span>
|
||||||
|
<span class="text-[11px] text-[#94A3B8]">
|
||||||
|
<template v-if="sensor">{{ sensor.id }}</template>
|
||||||
|
<template v-else>Sensor cluster offline</template>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<span class="font-mono text-[11px] font-semibold text-[#00C3CD]">
|
||||||
|
{{ sensor?.battery != null ? `${sensor.battery}% battery` : 'no battery data' }}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="flex flex-col gap-2 pt-1">
|
||||||
|
<div class="flex items-center gap-3">
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
class="flex h-10 flex-1 items-center justify-center gap-2 rounded-lg bg-[#00C3CD] px-4 text-[13px] font-semibold text-[#081723] shadow-[0_0_16px_rgba(0,195,205,0.3)] transition-all hover:bg-[#00d8e4]"
|
||||||
|
@click="exportGpx"
|
||||||
|
>
|
||||||
|
<Icon name="material-symbols:download" class="text-[18px]" />
|
||||||
|
Export route GPX
|
||||||
|
</button>
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
class="flex h-10 items-center justify-center gap-1.5 rounded-lg border border-[#1e3a52] bg-[#132b40] px-4 text-[13px] font-semibold text-[#94A3B8] transition-all hover:bg-[#18364e] hover:text-white"
|
||||||
|
:aria-expanded="methodOpen"
|
||||||
|
@click="methodOpen = !methodOpen"
|
||||||
|
>
|
||||||
|
<Icon name="material-symbols:query-stats" class="text-[18px]" />
|
||||||
|
Inspect method
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
<p v-if="exportNote" class="text-[10px] text-[#94A3B8]" role="status">{{ exportNote }}</p>
|
||||||
|
<div v-if="methodOpen" class="flex flex-col gap-2 rounded-lg border border-[#1e3a52] bg-[#081723] p-3 text-[11px] leading-relaxed text-[#94A3B8]">
|
||||||
|
<p><strong class="text-white">Method.</strong> {{ bundle.meta?.method ?? 'Route/shade method unavailable.' }}</p>
|
||||||
|
<p><strong class="text-white">Walking speed.</strong> {{ bundle.meta?.walkingSpeedMps ?? '—' }} m/s. {{ shadeLabel }}.</p>
|
||||||
|
<ul class="list-disc space-y-1 pl-4">
|
||||||
|
<li v-for="gap in bundle.meta?.dataGaps ?? []" :key="gap">{{ gap }}</li>
|
||||||
|
</ul>
|
||||||
|
<p class="text-[#64748B]">
|
||||||
|
Source bundle: {{ bundle.generatedAt || 'generated date unavailable' }} · 3 routes × 4 modeled hours · 35 OSM segments.
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- RIGHT: visual data story -->
|
||||||
|
<div class="flex flex-col gap-6 lg:col-span-7">
|
||||||
|
<section class="flex flex-col gap-4 rounded-xl border border-[#1e3a52] bg-[#0e2233] p-5 shadow-sm md:p-6">
|
||||||
|
<div class="flex flex-wrap items-center justify-between gap-2">
|
||||||
|
<div class="flex items-center gap-2">
|
||||||
|
<Icon name="material-symbols:layers" class="text-[20px] text-[#00C3CD]" />
|
||||||
|
<span class="text-base font-bold text-white">Micro-spatial routing matrix</span>
|
||||||
|
</div>
|
||||||
|
<div class="flex flex-wrap items-center gap-2">
|
||||||
|
<span v-if="solar" class="text-[12px] text-[#94A3B8]">
|
||||||
|
Solar vector: {{ Math.round(solar.azimuth_deg) }}° {{ compassDirection(solar.azimuth_deg) }}
|
||||||
|
</span>
|
||||||
|
<span class="h-1.5 w-1.5 rounded-full bg-[#00C3CD]" aria-hidden="true" />
|
||||||
|
<span class="text-[12px] font-semibold text-[#00C3CD]">Modeled canvas · {{ time }}</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<RouteMatrixMap
|
||||||
|
:bundle="bundle"
|
||||||
|
:buildings="buildings"
|
||||||
|
:places="places"
|
||||||
|
:selected-route-id="routeId"
|
||||||
|
:time="time"
|
||||||
|
/>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<section class="flex flex-col gap-4 rounded-xl border border-[#1e3a52] bg-[#0e2233] p-5 shadow-sm md:p-6">
|
||||||
|
<div class="flex flex-wrap items-center justify-between gap-2">
|
||||||
|
<div class="flex flex-col">
|
||||||
|
<span class="text-[11px] font-semibold uppercase tracking-widest text-[#00C3CD]">Algorithmic trade-off analysis</span>
|
||||||
|
<h3 class="mt-0.5 text-base font-bold text-white">Candidate paths comparison</h3>
|
||||||
|
</div>
|
||||||
|
<span class="rounded border border-[#1e3a52] bg-[#132b40] px-2.5 py-1 font-mono text-[11px] text-[#94A3B8]">
|
||||||
|
{{ comparison.length }} alternatives evaluated
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="flex flex-col gap-3">
|
||||||
|
<article
|
||||||
|
v-for="row in comparison"
|
||||||
|
:key="row.id"
|
||||||
|
class="relative flex flex-col gap-2 overflow-hidden rounded-xl border p-4 transition-all"
|
||||||
|
:class="
|
||||||
|
row.recommended
|
||||||
|
? 'border-[#00C3CD]/60 bg-[#132b40] shadow-[0_0_20px_rgba(0,195,205,0.08)]'
|
||||||
|
: 'border-[#1e3a52] bg-[#132b40] hover:border-[#64748B]/60'
|
||||||
|
"
|
||||||
|
>
|
||||||
|
<div v-if="row.recommended" class="absolute inset-y-0 left-0 w-1.5 bg-[#00C3CD]" aria-hidden="true" />
|
||||||
|
<div class="flex flex-col justify-between gap-1 sm:flex-row sm:items-center" :class="row.recommended ? 'pl-1.5' : ''">
|
||||||
|
<div class="flex flex-wrap items-center gap-2">
|
||||||
|
<Icon
|
||||||
|
v-if="row.recommended"
|
||||||
|
name="material-symbols:verified"
|
||||||
|
class="text-[18px] text-[#00C3CD]"
|
||||||
|
/>
|
||||||
|
<span class="text-[13px]" :class="row.recommended ? 'font-bold text-white' : 'font-semibold text-white'">
|
||||||
|
{{ row.title }}
|
||||||
|
</span>
|
||||||
|
<span
|
||||||
|
v-if="row.recommended"
|
||||||
|
class="rounded bg-[#00C3CD] px-2 py-0.5 text-[10px] font-bold tracking-wide text-[#081723]"
|
||||||
|
>
|
||||||
|
RECOMMENDED
|
||||||
|
</span>
|
||||||
|
<span
|
||||||
|
class="rounded border px-2 py-0.5 text-[10px] font-semibold"
|
||||||
|
:class="
|
||||||
|
row.recommended
|
||||||
|
? 'border-[#00C3CD]/30 bg-[#00C3CD]/15 text-[#00C3CD]'
|
||||||
|
: 'border-[#1e3a52] bg-white/10 text-[#94A3B8]'
|
||||||
|
"
|
||||||
|
>
|
||||||
|
{{ row.tag }}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<div class="flex items-center gap-2" :class="row.recommended ? 'pl-6 sm:pl-0' : ''">
|
||||||
|
<span class="font-mono font-extrabold text-[#00C3CD]" :class="row.recommended ? 'text-xl' : 'text-base text-white'">
|
||||||
|
{{ formatMinutes(row.values.durationMin) }}
|
||||||
|
</span>
|
||||||
|
<span class="text-[11px] font-mono text-[#94A3B8]">
|
||||||
|
{{ row.penaltyMin > 0 ? `(+${row.penaltyMin} min penalty)` : '(fastest)' }}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="grid grid-cols-1 gap-3 pt-1 md:grid-cols-2" :class="row.recommended ? 'pl-1.5' : ''">
|
||||||
|
<div class="flex flex-col gap-1">
|
||||||
|
<div class="flex justify-between text-[11px]">
|
||||||
|
<span class="flex items-center gap-1 text-[#94A3B8]">
|
||||||
|
<Icon
|
||||||
|
:name="row.recommended ? 'material-symbols:park' : 'material-symbols:wb-sunny'"
|
||||||
|
class="text-[13px]"
|
||||||
|
:class="row.recommended ? 'text-[#00C3CD]' : 'text-[#64748B]'"
|
||||||
|
/>
|
||||||
|
Shade coverage
|
||||||
|
</span>
|
||||||
|
<span class="font-mono font-bold" :class="row.recommended ? 'text-[#00C3CD]' : 'text-white'">
|
||||||
|
{{ formatPercent(row.values.shadePct) }}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<MiniBar :value="row.values.shadePct" :tone="row.recommended ? 'accent' : 'muted'" :label="`${row.title} shade coverage`" />
|
||||||
|
</div>
|
||||||
|
<div class="flex flex-col gap-1">
|
||||||
|
<div class="flex justify-between text-[11px]">
|
||||||
|
<span class="flex items-center gap-1 text-[#94A3B8]">
|
||||||
|
<Icon name="material-symbols:sunny" class="text-[13px] text-[#64748B]" />
|
||||||
|
Direct sun
|
||||||
|
</span>
|
||||||
|
<span class="font-mono font-semibold text-white">{{ formatMinutes(row.values.directSunMin) }}</span>
|
||||||
|
</div>
|
||||||
|
<MiniBar :value="Math.min(100, (row.values.directSunMin / 6) * 100)" :tone="row.recommended ? 'subtle' : 'subtle'" :label="`${row.title} direct sun`" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<p class="text-[11px] leading-snug text-[#64748B]" :class="row.recommended ? 'pl-1.5' : ''">
|
||||||
|
{{ row.values.distanceM }} m · {{ row.description }}
|
||||||
|
</p>
|
||||||
|
</article>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
@@ -0,0 +1,428 @@
|
|||||||
|
<script setup lang="ts">
|
||||||
|
import { berlinParts, parseHour } from '#shared/staffing'
|
||||||
|
import type { ContextResponse, Sensor, StaffingHour, StaffingResponse } from '#shared/types'
|
||||||
|
import { sensorForPlan, staffingSnapshot } from '#shared/use-cases'
|
||||||
|
import DecisionMetric from '~/components/use-cases/DecisionMetric.vue'
|
||||||
|
import MiniBar from '~/components/use-cases/MiniBar.vue'
|
||||||
|
import { formatEuro, formatNumber, formatPercent, formatShortDate, formatWeekday } from '~/utils/format'
|
||||||
|
import { planDays } from '~/utils/plan'
|
||||||
|
|
||||||
|
const props = defineProps<{
|
||||||
|
plan: StaffingResponse | null
|
||||||
|
sensors: Sensor[] | null
|
||||||
|
context: ContextResponse | null
|
||||||
|
sensorId: string
|
||||||
|
pending: boolean
|
||||||
|
error: string
|
||||||
|
}>()
|
||||||
|
|
||||||
|
const emit = defineEmits<{
|
||||||
|
'update:sensor-id': [value: string]
|
||||||
|
refresh: []
|
||||||
|
}>()
|
||||||
|
|
||||||
|
const assumptionsOpen = ref(false)
|
||||||
|
const exportNote = ref('')
|
||||||
|
const snapshot = computed(() => staffingSnapshot(props.plan))
|
||||||
|
const days = computed(() => planDays(props.plan))
|
||||||
|
const peakDate = computed(() => snapshot.value.peakShift?.date ?? '')
|
||||||
|
const peakDay = computed(() => days.value.find((day) => day.date === peakDate.value) ?? null)
|
||||||
|
const peakShift = computed(() => snapshot.value.peakShift)
|
||||||
|
const peakShiftLabel = computed(() =>
|
||||||
|
peakShift.value ? `${formatWeekday(peakShift.value.date)} · ${formatShortDate(peakShift.value.date)}` : '',
|
||||||
|
)
|
||||||
|
const selectedSensor = computed(() => props.sensors?.find((sensor) => sensor.id === props.sensorId) ?? null)
|
||||||
|
const planSensor = computed(() => sensorForPlan(props.sensors, props.plan))
|
||||||
|
const weather = computed(() => props.context?.weather.now ?? null)
|
||||||
|
const telemetryRows = computed(() => {
|
||||||
|
const sensor = selectedSensor.value
|
||||||
|
const now = weather.value
|
||||||
|
const plan = props.plan
|
||||||
|
return [
|
||||||
|
{
|
||||||
|
title: 'Pedestrian flux density',
|
||||||
|
detail: sensor
|
||||||
|
? `${sensor.name} · mean ${sensor.mean} · p95 ${sensor.p95} est. devices/h`
|
||||||
|
: 'Selected sensor data unavailable.',
|
||||||
|
badge: sensor?.battery != null ? `${sensor.battery}% battery` : 'no battery data',
|
||||||
|
icon: 'material-symbols:sensors',
|
||||||
|
iconClass: 'text-[#00C3CD]',
|
||||||
|
badgeClass: 'border-[#00C3CD]/30 bg-[#00C3CD]/15 text-[#00C3CD]',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: 'Context weather now',
|
||||||
|
detail: now ? `${now.temp_c} °C · ${now.precip_mm} mm · ${now.cloud_pct}% cloud` : 'Weather now unavailable.',
|
||||||
|
badge: now ? 'Now' : '—',
|
||||||
|
icon: 'material-symbols:cloud',
|
||||||
|
iconClass: 'text-[#94A3B8]',
|
||||||
|
badgeClass: 'border-[#1e3a52] bg-white/10 text-[#94A3B8]',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: 'Plan provenance',
|
||||||
|
detail: plan
|
||||||
|
? `data ${plan.data_version || '—'} · model ${plan.model_version || '—'} · context ${plan.context_version || '—'}`
|
||||||
|
: 'Waiting for a plan response.',
|
||||||
|
badge: plan ? (plan.cached ? 'Cached' : 'Not cached') : '—',
|
||||||
|
icon: 'material-symbols:database',
|
||||||
|
iconClass: 'text-[#94A3B8]',
|
||||||
|
badgeClass: 'border-[#1e3a52] bg-white/10 text-[#94A3B8]',
|
||||||
|
},
|
||||||
|
]
|
||||||
|
})
|
||||||
|
|
||||||
|
const hourColumns = computed(() => {
|
||||||
|
const open = parseHour(props.plan?.assumptions.store_hours.open ?? '10:00')
|
||||||
|
const close = parseHour(props.plan?.assumptions.store_hours.close ?? '20:00')
|
||||||
|
return Array.from({ length: Math.max(0, close - open) }, (_, index) => open + index)
|
||||||
|
})
|
||||||
|
const hourRange = computed(() => {
|
||||||
|
const first = hourColumns.value[0]
|
||||||
|
const last = hourColumns.value.at(-1)
|
||||||
|
return first === undefined || last === undefined ? '—' : `${first}:00–${last + 1}:00`
|
||||||
|
})
|
||||||
|
|
||||||
|
const matrixRows = computed(() =>
|
||||||
|
days.value.map((day) => {
|
||||||
|
const byHour = new Map(day.hours.map((hour) => [berlinParts(hour.t).hour, hour] as const))
|
||||||
|
const peak = Math.max(0, ...day.hours.map((hour) => hour.required_staff))
|
||||||
|
return {
|
||||||
|
...day,
|
||||||
|
isPeak: day.date === peakDate.value,
|
||||||
|
cells: hourColumns.value.map((hour) => {
|
||||||
|
const entry = byHour.get(hour)
|
||||||
|
return {
|
||||||
|
hour,
|
||||||
|
required: entry?.required_staff ?? 0,
|
||||||
|
scheduled: entry?.scheduled_staff ?? 0,
|
||||||
|
intensity: entry && peak > 0 ? entry.required_staff / peak : 0,
|
||||||
|
}
|
||||||
|
}),
|
||||||
|
}
|
||||||
|
}),
|
||||||
|
)
|
||||||
|
|
||||||
|
const maxStaffHours = computed(() => Math.max(0, ...days.value.map((day) => day.staffHours)))
|
||||||
|
const assumptionRows = computed<Array<{ label: string; value: string; sub?: string }>>(() => {
|
||||||
|
const a = props.plan?.assumptions
|
||||||
|
if (!a) return []
|
||||||
|
return [
|
||||||
|
{ label: 'Visitors / staff-hour', value: String(a.visitors_per_staff_hour) },
|
||||||
|
{ label: 'Safety factor', value: `×${a.safety_factor}` },
|
||||||
|
{ label: 'Minimum staff', value: String(a.min_staff) },
|
||||||
|
{ label: 'Shift block', value: `${a.shift_length_h} h` },
|
||||||
|
{ label: 'Labour cost', value: `${formatEuro(a.labor_cost_eur_h)}/h` },
|
||||||
|
{ label: 'Store hours', value: `${a.store_hours.open}–${a.store_hours.close}`, sub: a.store_hours.tz },
|
||||||
|
]
|
||||||
|
})
|
||||||
|
|
||||||
|
function cellStyle(intensity: number) {
|
||||||
|
return { backgroundColor: `rgba(0, 195, 205, ${(0.07 + Math.max(0, Math.min(1, intensity)) * 0.33).toFixed(3)})` }
|
||||||
|
}
|
||||||
|
|
||||||
|
function cellLabel(
|
||||||
|
day: { weekdayLong: string; dayNumber: string; month: string },
|
||||||
|
cell: { hour: number; required: number; scheduled: number },
|
||||||
|
) {
|
||||||
|
const prefix = `${day.weekdayLong} ${day.dayNumber} ${day.month} at ${cell.hour}:00`
|
||||||
|
return cell.required ? `${prefix}: ${cell.scheduled} scheduled, ${cell.required} required.` : `${prefix}: no plan hour.`
|
||||||
|
}
|
||||||
|
|
||||||
|
function selectSensor(event: Event) {
|
||||||
|
const value = (event.target as HTMLSelectElement).value
|
||||||
|
if (value) emit('update:sensor-id', value)
|
||||||
|
}
|
||||||
|
|
||||||
|
function csvCell(value: unknown) {
|
||||||
|
const text = value == null ? '' : String(value)
|
||||||
|
return /[",\n]/.test(text) ? `"${text.replaceAll('"', '""')}"` : text
|
||||||
|
}
|
||||||
|
|
||||||
|
function exportCsv() {
|
||||||
|
if (!import.meta.client || !props.plan) return
|
||||||
|
try {
|
||||||
|
const plan = props.plan
|
||||||
|
const rows: Array<Array<string | number>> = [
|
||||||
|
['Sensing Engine staffing plan'],
|
||||||
|
['sensor', plan.sensor, 'scenario', plan.scenario, 'standard', plan.standard],
|
||||||
|
['cached', plan.cached ? 'true' : 'false', 'data_version', plan.data_version, 'model_version', plan.model_version],
|
||||||
|
[],
|
||||||
|
['shift blocks'],
|
||||||
|
['date', 'start', 'end', 'staff'],
|
||||||
|
...plan.shifts.map((shift) => [shift.date, shift.start, shift.end, shift.staff]),
|
||||||
|
[],
|
||||||
|
['hourly plan'],
|
||||||
|
['date', 'hour', 'footfall_est_devices', 'required_staff', 'scheduled_staff', 'coverage'],
|
||||||
|
...plan.hours.map((hour) => {
|
||||||
|
const parts = berlinParts(hour.t)
|
||||||
|
return [parts.date, `${String(parts.hour).padStart(2, '0')}:00`, hour.footfall, hour.required_staff, hour.scheduled_staff, hour.coverage]
|
||||||
|
}),
|
||||||
|
]
|
||||||
|
const csv = rows.map((row) => row.map(csvCell).join(',')).join('\n')
|
||||||
|
const blob = new Blob([`\uFEFF${csv}`], { type: 'text/csv;charset=utf-8' })
|
||||||
|
const url = URL.createObjectURL(blob)
|
||||||
|
const anchor = document.createElement('a')
|
||||||
|
anchor.href = url
|
||||||
|
anchor.download = `sensing-engine-staffing-${plan.sensor || 'plan'}-${plan.scenario}.csv`
|
||||||
|
anchor.click()
|
||||||
|
anchor.remove()
|
||||||
|
URL.revokeObjectURL(url)
|
||||||
|
exportNote.value = `Exported ${plan.shifts.length} shift blocks and ${plan.hours.length} hourly rows.`
|
||||||
|
} catch {
|
||||||
|
exportNote.value = 'The browser blocked the download; no file was created.'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<div class="grid grid-cols-1 items-start gap-6 lg:grid-cols-12">
|
||||||
|
<div v-if="error" class="flex flex-col gap-3 rounded-xl border border-[#00C3CD]/40 bg-[#132b40] p-4 sm:flex-row sm:items-center sm:justify-between lg:col-span-12" role="alert">
|
||||||
|
<div class="flex min-w-0 items-start gap-3">
|
||||||
|
<Icon name="material-symbols:info" class="mt-0.5 shrink-0 text-[20px] text-[#00C3CD]" />
|
||||||
|
<div class="flex min-w-0 flex-col gap-0.5">
|
||||||
|
<span class="font-semibold text-white">{{ plan ? 'Plan refresh failed' : 'Live plan unavailable' }}</span>
|
||||||
|
<span class="text-[12px] leading-relaxed text-[#94A3B8]">{{ error }} {{ plan ? 'The last known response stays visible.' : 'Nothing is estimated or filled in.' }}</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<button type="button" class="flex h-10 shrink-0 items-center justify-center gap-2 rounded-lg border border-[#00C3CD]/40 bg-[#00C3CD]/10 px-4 text-[12px] font-semibold text-[#00C3CD] transition-colors hover:bg-[#00C3CD]/20" @click="emit('refresh')">
|
||||||
|
<Icon name="material-symbols:refresh" class="text-[18px]" /> Retry
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="flex min-w-0 flex-col gap-6 lg:col-span-5">
|
||||||
|
<section class="relative flex flex-col gap-5 overflow-hidden rounded-xl border border-[#1e3a52] bg-[#0e2233] p-6 shadow-sm">
|
||||||
|
<div class="flex flex-col gap-1">
|
||||||
|
<span class="text-[11px] font-semibold uppercase tracking-widest text-[#00C3CD]">Optimization query</span>
|
||||||
|
<h2 class="text-lg font-bold leading-snug tracking-tight text-white md:text-xl">How many staff for the next peak?</h2>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="flex flex-col gap-1.5">
|
||||||
|
<label for="staffing-sensor" class="text-[10px] font-semibold uppercase tracking-wider text-[#64748B]">Store sensor</label>
|
||||||
|
<div class="relative">
|
||||||
|
<select id="staffing-sensor" :value="sensorId" :disabled="!sensors?.length" class="h-10 w-full appearance-none rounded-lg border border-[#1e3a52] bg-[#081723] px-3 pr-9 text-[12px] font-medium text-white outline-none transition-colors focus:border-[#00C3CD]/60 disabled:cursor-not-allowed disabled:opacity-60 [&>option]:bg-[#0e2233] [&>option]:text-white" @change="selectSensor">
|
||||||
|
<option v-for="sensor in sensors ?? []" :key="sensor.id" :value="sensor.id">{{ sensor.name }}</option>
|
||||||
|
<option v-if="!sensors?.length" value="" disabled>Sensor list unavailable</option>
|
||||||
|
</select>
|
||||||
|
<Icon name="material-symbols:expand-more" class="pointer-events-none absolute right-3 top-1/2 -translate-y-1/2 text-[18px] text-[#94A3B8]" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div v-if="pending" class="flex items-center gap-2 rounded-lg border border-[#1e3a52] bg-[#132b40] px-3 py-2 text-[11px] text-[#94A3B8]" role="status">
|
||||||
|
<span class="h-1.5 w-1.5 animate-pulse rounded-full bg-[#00C3CD]" aria-hidden="true" />
|
||||||
|
Refreshing the plan for the selected sensor…
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="relative flex flex-col gap-3 rounded-xl border border-[#00C3CD]/30 bg-[#132b40] p-5 shadow-inner">
|
||||||
|
<div class="flex flex-wrap items-center justify-between gap-2">
|
||||||
|
<span class="text-[11px] font-bold uppercase tracking-wider text-[#00C3CD]">Peak shift</span>
|
||||||
|
<span class="rounded border border-[#00C3CD]/40 bg-[#00C3CD]/15 px-2 py-0.5 font-mono text-[10px] font-bold text-[#00C3CD]">BLOCK OUTPUT · {{ plan?.assumptions.shift_length_h ?? '—' }} H</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<template v-if="plan && peakShift">
|
||||||
|
<div class="flex flex-wrap items-end gap-x-2 gap-y-1">
|
||||||
|
<span class="text-3xl font-extrabold tracking-tight text-white">{{ peakShift.staff }}</span>
|
||||||
|
<span class="pb-1 text-sm font-semibold text-[#00C3CD]">staff on the peak shift</span>
|
||||||
|
</div>
|
||||||
|
<div class="flex flex-col">
|
||||||
|
<span class="text-base font-semibold text-white">{{ peakShiftLabel }}</span>
|
||||||
|
<span class="text-[12px] text-[#94A3B8]">{{ peakShift.start }}–{{ peakShift.end }} local</span>
|
||||||
|
</div>
|
||||||
|
<p class="text-[10px] leading-relaxed text-[#64748B]">Plan input: {{ planSensor?.name ?? plan.sensor }} · {{ plan.standard }} standard. Footfall is estimated devices, not people.</p>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<div v-else-if="!plan && pending" class="flex flex-col gap-2.5" aria-busy="true">
|
||||||
|
<div class="h-8 w-32 animate-pulse rounded bg-white/10" />
|
||||||
|
<div class="h-3 w-48 animate-pulse rounded bg-white/10" />
|
||||||
|
<div class="h-3 w-40 animate-pulse rounded bg-white/10" />
|
||||||
|
<p class="text-[10px] text-[#94A3B8]">Loading the live plan. No values are estimated.</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<p v-else class="text-sm leading-relaxed text-[#94A3B8]">{{ error ? 'No plan response is available, so no staff count or shift window is shown.' : 'The API returned no shift blocks for this plan. No staff count is estimated.' }}</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div v-if="plan" class="grid grid-cols-2 gap-2.5">
|
||||||
|
<DecisionMetric label="Peak footfall" :value="formatNumber(snapshot.peakFootfall)" hint="est. devices/h" tone="accent" />
|
||||||
|
<DecisionMetric label="Staff hours" :value="formatNumber(snapshot.staffHours)" hint="scheduled" />
|
||||||
|
<DecisionMetric label="Saved vs flat" :value="formatEuro(snapshot.savedEur)" :hint="`${formatPercent(snapshot.savedPct, 1)} vs flat`" tone="accent" />
|
||||||
|
<DecisionMetric label="Coverage" :value="formatPercent(snapshot.coveragePct, 1)" hint="scheduled ≥ required" />
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<p v-if="plan" class="text-[10px] leading-relaxed text-[#64748B]">
|
||||||
|
Coverage = scheduled ≥ required; the block heuristic keeps this at 100% for complete plans. It is not a
|
||||||
|
service-quality or forecast-accuracy score. Footfall is estimated devices, not people.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<div v-if="plan" class="flex flex-col gap-1.5">
|
||||||
|
<span class="text-[11px] font-bold uppercase tracking-wider text-[#94A3B8]">Fused rationale</span>
|
||||||
|
<ul v-if="plan.why.length" class="flex flex-col gap-1.5">
|
||||||
|
<li v-for="reason in plan.why.slice(0, 3)" :key="reason" class="flex gap-2 text-[12px] leading-relaxed text-[#94A3B8]">
|
||||||
|
<span class="mt-1.5 h-1 w-1 shrink-0 rounded-full bg-[#00C3CD]" aria-hidden="true" />
|
||||||
|
<span>{{ reason }}</span>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
<p v-else class="text-[12px] leading-relaxed text-[#94A3B8]">No API rationale lines were returned with this plan. The declared rule below still applies.</p>
|
||||||
|
<p class="text-[11px] leading-relaxed text-[#94A3B8]">
|
||||||
|
<strong class="text-white">Rule.</strong> {{ plan.assumptions.visitors_per_staff_hour }} visitors per staff-hour × {{ plan.assumptions.safety_factor }} safety factor, minimum {{ plan.assumptions.min_staff }} staff, {{ plan.assumptions.shift_length_h }} h shift blocks.
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="flex flex-col gap-2.5 pt-1">
|
||||||
|
<span class="text-[11px] font-bold uppercase tracking-wider text-[#94A3B8]">Sensor context · historical baseline</span>
|
||||||
|
<div v-for="row in telemetryRows" :key="row.title" class="flex items-center justify-between gap-3 rounded-lg border border-white/10 bg-[#132b40] p-3">
|
||||||
|
<div class="flex min-w-0 items-center gap-3">
|
||||||
|
<Icon :name="row.icon" class="shrink-0 text-[20px]" :class="row.iconClass" />
|
||||||
|
<div class="flex min-w-0 flex-col">
|
||||||
|
<span class="text-[13px] font-semibold text-white">{{ row.title }}</span>
|
||||||
|
<span class="break-words text-[11px] text-[#94A3B8]">{{ row.detail }}</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<span class="shrink-0 rounded border px-2 py-0.5 text-[11px] font-semibold" :class="row.badgeClass">
|
||||||
|
{{ row.badge }}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="flex flex-col gap-2 pt-1">
|
||||||
|
<button type="button" class="flex h-10 items-center justify-center gap-2 rounded-lg bg-[#00C3CD] px-4 text-[13px] font-semibold text-[#081723] shadow-[0_0_16px_rgba(0,195,205,0.3)] transition-all hover:bg-[#00d8e4] disabled:cursor-not-allowed disabled:opacity-60" :disabled="!plan" @click="exportCsv">
|
||||||
|
<Icon name="material-symbols:download" class="text-[18px]" /> Export shift CSV
|
||||||
|
</button>
|
||||||
|
<div class="grid grid-cols-1 gap-2 sm:grid-cols-2">
|
||||||
|
<NuxtLink to="/plan" class="flex h-10 items-center justify-center gap-1.5 rounded-lg border border-[#1e3a52] bg-[#132b40] px-3 text-[13px] font-semibold text-[#94A3B8] transition-all hover:bg-[#18364e] hover:text-white">
|
||||||
|
<Icon name="material-symbols:open-in-new" class="text-[18px]" /> Open full plan
|
||||||
|
</NuxtLink>
|
||||||
|
<button type="button" class="flex h-10 items-center justify-center gap-1.5 rounded-lg border border-[#1e3a52] bg-[#132b40] px-3 text-[13px] font-semibold text-[#94A3B8] transition-all hover:bg-[#18364e] hover:text-white" :aria-expanded="assumptionsOpen" @click="assumptionsOpen = !assumptionsOpen">
|
||||||
|
<Icon name="material-symbols:query-stats" class="text-[18px]" /> Inspect assumptions
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
<p v-if="exportNote" class="text-[10px] text-[#94A3B8]" role="status">{{ exportNote }}</p>
|
||||||
|
|
||||||
|
<div v-if="assumptionsOpen && plan" class="flex flex-col gap-2 rounded-lg border border-[#1e3a52] bg-[#081723] p-3">
|
||||||
|
<div class="grid grid-cols-2 gap-x-3 gap-y-2 text-[11px]">
|
||||||
|
<div v-for="row in assumptionRows" :key="row.label" class="flex flex-col">
|
||||||
|
<span class="text-[#64748B]">{{ row.label }}</span>
|
||||||
|
<span class="break-words font-mono font-semibold text-white">{{ row.value }}</span>
|
||||||
|
<span v-if="row.sub" class="break-words text-[9px] text-[#64748B]">{{ row.sub }}</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<p class="text-[10px] leading-relaxed text-[#64748B]">Coverage = scheduled ≥ required; the block heuristic keeps this at 100% for complete plans. It is a property of the heuristic, not a service-quality claim. No POS, queue or payroll feed is used.</p>
|
||||||
|
</div>
|
||||||
|
<p v-else-if="assumptionsOpen" class="rounded-lg border border-[#1e3a52] bg-[#081723] p-3 text-[10px] text-[#94A3B8]">Assumptions are unavailable until a plan response arrives.</p>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="flex min-w-0 flex-col gap-6 lg:col-span-7">
|
||||||
|
<section class="flex flex-col gap-4 rounded-xl border border-[#1e3a52] bg-[#0e2233] p-5 shadow-sm md:p-6">
|
||||||
|
<div class="flex flex-wrap items-center justify-between gap-2">
|
||||||
|
<div class="flex min-w-0 items-center gap-2">
|
||||||
|
<Icon name="material-symbols:table-chart" class="shrink-0 text-[20px] text-[#00C3CD]" />
|
||||||
|
<span class="text-base font-bold text-white">Workforce adequacy matrix</span>
|
||||||
|
</div>
|
||||||
|
<div class="flex flex-wrap items-center gap-2">
|
||||||
|
<span v-if="peakDay" class="text-[12px] text-[#94A3B8]">
|
||||||
|
Peak day {{ peakDay.weekdayLong }} {{ peakDay.dayNumber }} {{ peakDay.month }}
|
||||||
|
</span>
|
||||||
|
<span v-if="peakDay" class="h-1.5 w-1.5 rounded-full bg-[#00C3CD]" aria-hidden="true" />
|
||||||
|
<span class="font-mono text-[11px] text-[#00C3CD]">
|
||||||
|
{{ plan ? `${days.length} days · ${hourColumns.length} open hours` : 'No plan loaded' }}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<template v-if="matrixRows.length">
|
||||||
|
<div class="overflow-hidden rounded-lg border border-[#1e3a52] bg-[#081723] p-2">
|
||||||
|
<table class="w-full table-fixed border-separate border-spacing-0.5" :aria-label="`Workforce adequacy matrix: ${days.length} local days by ${hourColumns.length} store hours`">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th scope="col" class="w-[2.35rem] pb-1 text-left text-[9px] font-semibold uppercase tracking-wider text-[#64748B]"><span class="sr-only">Day</span></th>
|
||||||
|
<th v-for="hour in hourColumns" :key="hour" scope="col" class="pb-1 text-center text-[9px] font-semibold text-[#64748B]">{{ String(hour).padStart(2, '0') }}</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<tr v-for="day in matrixRows" :key="day.date">
|
||||||
|
<th scope="row" class="pr-1 align-middle">
|
||||||
|
<span class="block truncate text-[10px] font-bold" :class="day.isPeak ? 'text-[#00C3CD]' : 'text-white'">{{ day.weekday }}</span>
|
||||||
|
<span class="block text-[9px] font-normal text-[#64748B]">{{ day.dayNumber }}</span>
|
||||||
|
</th>
|
||||||
|
<td v-for="cell in day.cells" :key="cell.hour" class="p-0 align-middle" :aria-label="cellLabel(day, cell)">
|
||||||
|
<div class="flex h-7 w-full items-center justify-center rounded-[3px] border border-white/10 sm:h-8" :class="cell.required ? 'text-white' : 'bg-[#0e2233] text-[#64748B]'" :style="cell.required ? cellStyle(cell.intensity) : undefined" aria-hidden="true">
|
||||||
|
<span class="font-mono text-[9px] font-semibold leading-none">{{ cell.required ? cell.scheduled : '–' }}</span>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="flex flex-wrap items-center justify-between gap-2 text-[10px] text-[#64748B]">
|
||||||
|
<div class="flex flex-wrap items-center gap-3">
|
||||||
|
<span class="flex items-center gap-1.5"><span class="h-2.5 w-2.5 rounded-[2px] border border-white/10" :style="cellStyle(0.2)" aria-hidden="true" />Lower requirement</span>
|
||||||
|
<span class="flex items-center gap-1.5"><span class="h-2.5 w-2.5 rounded-[2px] border border-white/10" :style="cellStyle(1)" aria-hidden="true" />Day peak</span>
|
||||||
|
<span class="flex items-center gap-1.5"><span class="h-2.5 w-2.5 rounded-[2px] border border-white/10 bg-[#0e2233]" aria-hidden="true" />No hour</span>
|
||||||
|
</div>
|
||||||
|
<span>Number = scheduled staff · local hours {{ hourRange }}</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<p class="text-[10px] leading-relaxed text-[#64748B]">
|
||||||
|
Intensity = required staff ÷ that day's peak requirement. Coverage = scheduled ≥ required; the block
|
||||||
|
heuristic keeps this at 100% for complete plans. It is a scheduling property, not a quality score.
|
||||||
|
</p>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<div v-else class="rounded-lg border border-dashed border-[#1e3a52] bg-[#132b40] p-4 text-[11px] leading-relaxed text-[#94A3B8]" role="status">
|
||||||
|
{{ pending ? 'Loading the plan days for this sensor…' : 'No plan days are available. The matrix stays empty rather than being estimated.' }}
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<section class="flex flex-col gap-4 rounded-xl border border-[#1e3a52] bg-[#0e2233] p-5 shadow-sm md:p-6">
|
||||||
|
<div class="flex flex-wrap items-center justify-between gap-2">
|
||||||
|
<div class="flex items-center gap-2">
|
||||||
|
<Icon name="material-symbols:calendar-month" class="text-[20px] text-[#00C3CD]" />
|
||||||
|
<span class="text-base font-bold text-white">Shift comparison</span>
|
||||||
|
</div>
|
||||||
|
<span class="rounded border border-[#1e3a52] bg-[#132b40] px-2.5 py-1 font-mono text-[11px] text-[#94A3B8]">
|
||||||
|
{{ plan ? `${days.length} days · ${formatNumber(snapshot.staffHours)} staff-hours` : 'No plan loaded' }}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div v-if="days.length" class="flex flex-col gap-2">
|
||||||
|
<article v-for="day in days" :key="day.date" class="rounded-lg border p-3 transition-colors" :class="day.date === peakDate ? 'border-[#00C3CD]/40 bg-[#132b40]' : 'border-[#1e3a52] bg-[#132b40] hover:border-[#64748B]/60'">
|
||||||
|
<div class="flex flex-wrap items-center justify-between gap-x-3 gap-y-1">
|
||||||
|
<div class="flex flex-wrap items-center gap-2">
|
||||||
|
<span class="text-[13px] font-bold text-white">{{ day.weekdayLong }}</span>
|
||||||
|
<span class="text-[11px] text-[#64748B]">{{ day.dayNumber }} {{ day.month }}</span>
|
||||||
|
<span v-if="day.date === peakDate" class="rounded bg-[#00C3CD] px-2 py-0.5 text-[10px] font-bold tracking-wide text-[#081723]">PEAK DAY</span>
|
||||||
|
</div>
|
||||||
|
<div class="flex items-baseline gap-1.5">
|
||||||
|
<span class="font-mono text-base font-bold" :class="day.date === peakDate ? 'text-[#00C3CD]' : 'text-white'">{{ day.peakStaff }}</span>
|
||||||
|
<span class="text-[10px] text-[#64748B]">peak staff</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="mt-2.5 grid grid-cols-1 gap-2.5 sm:grid-cols-[minmax(0,1fr)_auto] sm:items-center">
|
||||||
|
<div class="flex flex-col gap-1">
|
||||||
|
<div class="flex items-center justify-between text-[10px]">
|
||||||
|
<span class="text-[#94A3B8]">Staff-hours</span>
|
||||||
|
<span class="font-mono font-semibold text-white">{{ day.staffHours }}</span>
|
||||||
|
</div>
|
||||||
|
<MiniBar :value="maxStaffHours ? (day.staffHours / maxStaffHours) * 100 : 0" :tone="day.date === peakDate ? 'accent' : 'muted'" :label="`${day.weekdayLong}: ${day.staffHours} scheduled staff-hours`" />
|
||||||
|
</div>
|
||||||
|
<div class="flex items-center justify-between gap-4 text-[10px] sm:justify-end">
|
||||||
|
<span class="text-[#94A3B8]">Overstaffed</span>
|
||||||
|
<span class="font-mono font-semibold text-white">{{ day.overHours }} h</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="mt-2 flex flex-wrap items-center gap-1.5">
|
||||||
|
<span v-for="shift in day.shifts" :key="`${shift.start}-${shift.end}`" class="rounded border border-[#1e3a52] bg-[#0e2233] px-2 py-0.5 font-mono text-[10px] text-[#94A3B8]" :aria-label="`${shift.staff} staff, ${shift.start} to ${shift.end}`">{{ shift.start }}–{{ shift.end }}</span>
|
||||||
|
<span v-if="!day.shifts.length" class="text-[10px] text-[#64748B]">No shift blocks</span>
|
||||||
|
</div>
|
||||||
|
</article>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div v-else class="rounded-lg border border-dashed border-[#1e3a52] bg-[#132b40] p-4 text-[11px] leading-relaxed text-[#94A3B8]" role="status">
|
||||||
|
{{ pending ? 'Loading the shift plan…' : 'No shift rows are available. Nothing is estimated.' }}
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
@@ -0,0 +1,58 @@
|
|||||||
|
<script setup lang="ts">
|
||||||
|
import { USE_CASE_TABS } from '#shared/use-cases'
|
||||||
|
import type { UseCaseId } from '#shared/use-cases'
|
||||||
|
|
||||||
|
const props = defineProps<{ active: UseCaseId }>()
|
||||||
|
const route = useRoute()
|
||||||
|
|
||||||
|
function to(id: UseCaseId) {
|
||||||
|
return { path: '/use-cases', query: { ...route.query, uc: id } }
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<nav
|
||||||
|
aria-label="Use case"
|
||||||
|
class="flex w-full flex-col items-stretch gap-1.5 rounded-xl border border-[#1e3a52] bg-[#0e2233] p-1.5 shadow-sm sm:flex-row"
|
||||||
|
>
|
||||||
|
<NuxtLink
|
||||||
|
v-for="tab in USE_CASE_TABS"
|
||||||
|
:key="tab.id"
|
||||||
|
:to="to(tab.id)"
|
||||||
|
class="flex flex-1 items-center justify-between rounded-lg px-4 py-2.5 text-left transition-all"
|
||||||
|
:class="
|
||||||
|
active === tab.id
|
||||||
|
? 'border border-[#00C3CD]/40 bg-[#132b40] text-white shadow-sm'
|
||||||
|
: 'text-[#94A3B8] hover:bg-[#132b40]/60 hover:text-white'
|
||||||
|
"
|
||||||
|
:aria-current="active === tab.id ? 'page' : undefined"
|
||||||
|
>
|
||||||
|
<span class="flex min-w-0 flex-col">
|
||||||
|
<span class="flex items-center gap-2">
|
||||||
|
<span
|
||||||
|
class="text-[11px] font-bold uppercase tracking-wider"
|
||||||
|
:class="active === tab.id ? 'text-[#00C3CD]' : 'text-[#94A3B8]'"
|
||||||
|
>
|
||||||
|
{{ tab.eyebrow }}
|
||||||
|
</span>
|
||||||
|
<span
|
||||||
|
v-if="active === tab.id"
|
||||||
|
class="h-1.5 w-1.5 rounded-full bg-[#00C3CD] animate-pulse"
|
||||||
|
aria-hidden="true"
|
||||||
|
/>
|
||||||
|
</span>
|
||||||
|
<span
|
||||||
|
class="mt-0.5 truncate text-[13px]"
|
||||||
|
:class="active === tab.id ? 'text-[#94A3B8]' : 'text-[#64748B]'"
|
||||||
|
>
|
||||||
|
{{ tab.title }}
|
||||||
|
</span>
|
||||||
|
</span>
|
||||||
|
<Icon
|
||||||
|
:name="tab.icon"
|
||||||
|
class="ml-2 shrink-0 text-[19px]"
|
||||||
|
:class="active === tab.id ? 'text-[#00C3CD]' : 'text-[#64748B]'"
|
||||||
|
/>
|
||||||
|
</NuxtLink>
|
||||||
|
</nav>
|
||||||
|
</template>
|
||||||
@@ -0,0 +1,157 @@
|
|||||||
|
<script setup lang="ts">
|
||||||
|
const route = useRoute()
|
||||||
|
const mobileOpen = ref(false)
|
||||||
|
const menuButton = ref<HTMLButtonElement | null>(null)
|
||||||
|
|
||||||
|
const engineActive = computed(() => route.path === '/')
|
||||||
|
const sensorsActive = computed(() => route.path.startsWith('/sensors'))
|
||||||
|
const useCasesActive = computed(() => route.path.startsWith('/use-cases'))
|
||||||
|
const playgroundActive = computed(() => route.path.startsWith('/playground'))
|
||||||
|
|
||||||
|
const navLinkClass =
|
||||||
|
'inline-flex h-16 items-center border-b-2 font-label-md transition-colors'
|
||||||
|
const mobileLinkClass = 'inline-flex h-12 items-center justify-center font-label-md transition-colors'
|
||||||
|
|
||||||
|
function desktopLinkClass(active: boolean) {
|
||||||
|
return [
|
||||||
|
navLinkClass,
|
||||||
|
active
|
||||||
|
? 'border-[#00C3CD] text-[#00C3CD] font-semibold'
|
||||||
|
: 'border-transparent text-[#94A3B8] hover:text-[#FFFFFF]',
|
||||||
|
].join(' ')
|
||||||
|
}
|
||||||
|
|
||||||
|
function mobileLinkClassFor(active: boolean) {
|
||||||
|
return [
|
||||||
|
mobileLinkClass,
|
||||||
|
active ? 'text-[#00C3CD] font-semibold' : 'text-[#94A3B8] hover:text-[#FFFFFF]',
|
||||||
|
].join(' ')
|
||||||
|
}
|
||||||
|
|
||||||
|
function closeMenu() {
|
||||||
|
mobileOpen.value = false
|
||||||
|
}
|
||||||
|
|
||||||
|
function onKeydown(event: KeyboardEvent) {
|
||||||
|
if (event.key === 'Escape' && mobileOpen.value) {
|
||||||
|
closeMenu()
|
||||||
|
menuButton.value?.focus()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function toggleMenu() {
|
||||||
|
mobileOpen.value = !mobileOpen.value
|
||||||
|
}
|
||||||
|
|
||||||
|
onMounted(() => window.addEventListener('keydown', onKeydown))
|
||||||
|
onBeforeUnmount(() => window.removeEventListener('keydown', onKeydown))
|
||||||
|
watch(() => route.fullPath, closeMenu)
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<header class="fixed top-0 left-0 right-0 z-50 h-16 bg-[#081723]/95 backdrop-blur-md border-b border-[#1e3a52]">
|
||||||
|
<div class="relative h-16 max-w-[1200px] mx-auto px-margin-desktop flex items-center justify-between">
|
||||||
|
<NuxtLink
|
||||||
|
to="/"
|
||||||
|
aria-label="Schwarz Digits — Pulse Engine home"
|
||||||
|
class="inline-flex items-center shrink-0"
|
||||||
|
>
|
||||||
|
<img
|
||||||
|
src="/schwarz-digits-logo.svg"
|
||||||
|
alt="Schwarz Digits"
|
||||||
|
class="h-8 w-auto md:h-9"
|
||||||
|
/>
|
||||||
|
</NuxtLink>
|
||||||
|
|
||||||
|
<nav
|
||||||
|
aria-label="Primary"
|
||||||
|
class="hidden md:flex absolute top-0 left-1/2 -translate-x-1/2 h-16 items-center gap-space-xl"
|
||||||
|
>
|
||||||
|
<NuxtLink
|
||||||
|
to="/"
|
||||||
|
:class="desktopLinkClass(engineActive)"
|
||||||
|
:aria-current="engineActive ? 'page' : undefined"
|
||||||
|
>
|
||||||
|
Engine
|
||||||
|
</NuxtLink>
|
||||||
|
<NuxtLink
|
||||||
|
to="/sensors"
|
||||||
|
:class="desktopLinkClass(sensorsActive)"
|
||||||
|
:aria-current="sensorsActive ? 'page' : undefined"
|
||||||
|
>
|
||||||
|
Sensors
|
||||||
|
</NuxtLink>
|
||||||
|
<NuxtLink
|
||||||
|
to="/use-cases"
|
||||||
|
:class="desktopLinkClass(useCasesActive)"
|
||||||
|
:aria-current="useCasesActive ? 'page' : undefined"
|
||||||
|
>
|
||||||
|
Use cases
|
||||||
|
</NuxtLink>
|
||||||
|
<NuxtLink
|
||||||
|
to="/playground"
|
||||||
|
:class="desktopLinkClass(playgroundActive)"
|
||||||
|
:aria-current="playgroundActive ? 'page' : undefined"
|
||||||
|
>
|
||||||
|
Playground
|
||||||
|
</NuxtLink>
|
||||||
|
</nav>
|
||||||
|
|
||||||
|
<button
|
||||||
|
ref="menuButton"
|
||||||
|
type="button"
|
||||||
|
class="md:hidden inline-flex h-11 w-11 items-center justify-center rounded-lg text-[#94A3B8] hover:text-[#FFFFFF] transition-colors"
|
||||||
|
aria-controls="mobile-nav"
|
||||||
|
:aria-expanded="mobileOpen"
|
||||||
|
:aria-label="mobileOpen ? 'Close menu' : 'Open menu'"
|
||||||
|
@click="toggleMenu"
|
||||||
|
>
|
||||||
|
<Icon v-if="mobileOpen" name="material-symbols:close" class="text-[24px]" />
|
||||||
|
<Icon v-else name="material-symbols:menu" class="text-[24px]" />
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div
|
||||||
|
v-show="mobileOpen"
|
||||||
|
id="mobile-nav"
|
||||||
|
class="md:hidden absolute top-full left-0 right-0 bg-[#081723] border-b border-[#1e3a52] shadow-[0_8px_24px_rgba(0,0,0,0.4)]"
|
||||||
|
>
|
||||||
|
<nav aria-label="Mobile primary" class="max-w-[1200px] mx-auto px-margin-desktop py-space-sm flex flex-col">
|
||||||
|
<NuxtLink
|
||||||
|
to="/"
|
||||||
|
:class="mobileLinkClassFor(engineActive)"
|
||||||
|
:aria-current="engineActive ? 'page' : undefined"
|
||||||
|
@click="closeMenu"
|
||||||
|
>
|
||||||
|
Engine
|
||||||
|
</NuxtLink>
|
||||||
|
<NuxtLink
|
||||||
|
to="/sensors"
|
||||||
|
:class="mobileLinkClassFor(sensorsActive)"
|
||||||
|
:aria-current="sensorsActive ? 'page' : undefined"
|
||||||
|
@click="closeMenu"
|
||||||
|
>
|
||||||
|
Sensors
|
||||||
|
</NuxtLink>
|
||||||
|
<NuxtLink
|
||||||
|
to="/use-cases"
|
||||||
|
:class="mobileLinkClassFor(useCasesActive)"
|
||||||
|
:aria-current="useCasesActive ? 'page' : undefined"
|
||||||
|
@click="closeMenu"
|
||||||
|
>
|
||||||
|
Use cases
|
||||||
|
</NuxtLink>
|
||||||
|
<NuxtLink
|
||||||
|
to="/playground"
|
||||||
|
:class="mobileLinkClassFor(playgroundActive)"
|
||||||
|
:aria-current="playgroundActive ? 'page' : undefined"
|
||||||
|
@click="closeMenu"
|
||||||
|
>
|
||||||
|
Playground
|
||||||
|
</NuxtLink>
|
||||||
|
</nav>
|
||||||
|
</div>
|
||||||
|
</header>
|
||||||
|
|
||||||
|
<slot />
|
||||||
|
</template>
|
||||||
+232
-564
@@ -1,582 +1,250 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { iconArrowRight, iconTriangleWarning } from '@sit-onyx/icons'
|
const comparisonRows = [
|
||||||
import { addDays, berlinParts, planWeekStart } from '#shared/staffing'
|
{ label: 'Privacy-preserving sensor counts', hyperscaler: 'Varies', ai: false },
|
||||||
import type { MetaResponse, ScenarioState, Sensor, SeriesResponse, StaffingResponse } from '#shared/types'
|
{ label: 'Real-world context fused', hyperscaler: 'Varies', ai: false },
|
||||||
import {
|
{ label: 'Self-coded + self-hosted AI', hyperscaler: 'Varies', ai: true },
|
||||||
formatDateTime,
|
{ label: 'EU-sovereign cloud (STACKIT)', hyperscaler: 'Varies', ai: false },
|
||||||
formatEuro,
|
{ label: 'One engine, three decisions', hyperscaler: '—', ai: false },
|
||||||
formatNumber,
|
]
|
||||||
formatPercent,
|
|
||||||
formatTime,
|
|
||||||
formatWeekday,
|
|
||||||
weekLabel,
|
|
||||||
} from '~/utils/format'
|
|
||||||
import {
|
|
||||||
numberWord,
|
|
||||||
peakHourOf,
|
|
||||||
peakShiftOf,
|
|
||||||
planDays,
|
|
||||||
savingOf,
|
|
||||||
savingPctOf,
|
|
||||||
totalStaffHoursOf,
|
|
||||||
} from '~/utils/plan'
|
|
||||||
|
|
||||||
const config = useRuntimeConfig()
|
|
||||||
const demoNow = String(config.public.demoNow)
|
|
||||||
|
|
||||||
const { data: sensors } = await useFetch<Sensor[]>('/api/sensors')
|
|
||||||
const { data: meta } = await useFetch<MetaResponse>('/api/meta')
|
|
||||||
const { data: liveScenarioState } = await useFetch<ScenarioState>('/api/scenario')
|
|
||||||
const live = useLiveScenario(liveScenarioState.value)
|
|
||||||
|
|
||||||
const sensorId = ref(
|
|
||||||
sensors.value?.find((sensor) => sensor.id === 'hn-stadtgalerie-01')?.id ??
|
|
||||||
sensors.value?.[0]?.id ??
|
|
||||||
'hn-stadtgalerie-01',
|
|
||||||
)
|
|
||||||
const { data: series } = await useFetch<SeriesResponse>('/api/series', {
|
|
||||||
query: computed(() => ({ sensor: sensorId.value, step: '1h' })),
|
|
||||||
})
|
|
||||||
|
|
||||||
const { data: planData, status, refresh } = await useFetch<StaffingResponse>('/api/staffing', {
|
|
||||||
query: computed(() => ({ sensor: sensorId.value, scenario: live.scenarioId, standard: 'standard' })),
|
|
||||||
})
|
|
||||||
|
|
||||||
let lastScenarioId = live.scenarioId
|
|
||||||
watch(
|
|
||||||
() => live.revision,
|
|
||||||
() => {
|
|
||||||
if (live.scenarioId === lastScenarioId) void refresh()
|
|
||||||
lastScenarioId = live.scenarioId
|
|
||||||
},
|
|
||||||
)
|
|
||||||
|
|
||||||
const plan = computed(() => planData.value ?? null)
|
|
||||||
const activeSensor = computed(() => sensors.value?.find((sensor) => sensor.id === sensorId.value))
|
|
||||||
const peakShift = computed(() => peakShiftOf(plan.value))
|
|
||||||
const peakHour = computed(() => peakHourOf(plan.value))
|
|
||||||
const totalStaffHours = computed(() => totalStaffHoursOf(plan.value))
|
|
||||||
const savingEur = computed(() => savingOf(plan.value))
|
|
||||||
const savingPct = computed(() => savingPctOf(plan.value))
|
|
||||||
const daySummaries = computed(() => planDays(plan.value))
|
|
||||||
|
|
||||||
const weekStart = computed(() => {
|
|
||||||
const first = plan.value?.hours[0]
|
|
||||||
return first ? berlinParts(first.t).date : planWeekStart(demoNow)
|
|
||||||
})
|
|
||||||
const weekEnd = computed(() => addDays(weekStart.value, 6))
|
|
||||||
const today = computed(() => berlinParts(demoNow).date)
|
|
||||||
const windowTag = computed(() => {
|
|
||||||
if (!plan.value) return 'No plan'
|
|
||||||
return weekStart.value <= today.value && today.value <= weekEnd.value ? 'Today–Friday' : 'Seven days'
|
|
||||||
})
|
|
||||||
const windowLabel = computed(() => (plan.value ? weekLabel(weekStart.value, weekEnd.value) : 'Window unavailable'))
|
|
||||||
|
|
||||||
const lastPoint = computed(() => series.value?.points.at(-1))
|
|
||||||
const lastMeasured = computed(() => (lastPoint.value ? formatDateTime(lastPoint.value.t) : '—'))
|
|
||||||
const latestReading = computed(() => (lastPoint.value ? formatNumber(lastPoint.value.v) : '—'))
|
|
||||||
|
|
||||||
useHead(() => ({
|
|
||||||
title: peakShift.value
|
|
||||||
? `${numberWord(peakShift.value.staff)} on ${formatWeekday(peakShift.value.date)} — PulseCast`
|
|
||||||
: 'PulseCast — footfall to shifts',
|
|
||||||
}))
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div class="pc-page landing">
|
<div class="min-h-dvh flex flex-col">
|
||||||
<section class="landing__hero" aria-labelledby="landing-title">
|
<main class="w-full flex-1 pt-16 bg-[#081723]">
|
||||||
<div class="landing__copy">
|
<div class="flex flex-col w-full">
|
||||||
<div class="landing__meta">
|
<!-- Above-The-Fold Master Container (1200px max width aligned) -->
|
||||||
<span class="pc-tag">{{ windowTag }}</span>
|
<section class="w-full bg-[#081723] pt-space-2xl pb-space-xl">
|
||||||
<LiveStatusBadge :status="live.status" :last-event-at="live.lastEventAt" compact />
|
<div class="max-w-[1200px] mx-auto px-margin-desktop flex flex-col gap-space-2xl">
|
||||||
</div>
|
<!-- HERO TWO-COLUMN GRID (50% / 50%) -->
|
||||||
|
<div class="grid grid-cols-1 lg:grid-cols-12 gap-space-xl items-center">
|
||||||
<h1 id="landing-title" class="landing__title">
|
<!-- LEFT COLUMN: Value Proposition & CTAs -->
|
||||||
<template v-if="peakShift">{{ numberWord(peakShift.staff) }} on {{ formatWeekday(peakShift.date) }}.</template>
|
<div class="lg:col-span-6 flex flex-col justify-center gap-space-lg">
|
||||||
<template v-else>The week, shifted.</template>
|
<!-- Eyebrow Pill -->
|
||||||
</h1>
|
<div class="inline-flex items-center gap-2 self-start px-3 py-1 rounded-full bg-[#0e2233] border border-[#1e3a52] shadow-sm">
|
||||||
|
<span class="w-1.5 h-1.5 rounded-full bg-[#00C3CD]"></span>
|
||||||
<p class="landing__lede">
|
<span class="font-label-sm text-[10px] leading-none tracking-[0.12em] text-[#94A3B8] uppercase font-semibold whitespace-nowrap">
|
||||||
<template v-if="plan">
|
Schwarz Digits · Pulse Engine
|
||||||
PulseCast turns inner-city footfall into a shift plan you can defend.
|
</span>
|
||||||
This window: <strong>{{ totalStaffHours }} staff-hours</strong>,
|
</div>
|
||||||
<strong>{{ formatEuro(plan.summary.cost_eur) }}</strong>,
|
<!-- Headline -->
|
||||||
<strong>{{ formatPercent(plan.summary.coverage_pct, 1) }} coverage</strong>.
|
<h1 class="text-[36px] leading-[40px] sm:text-[52px] sm:leading-[58px] tracking-[-0.03em] font-semibold text-[#FFFFFF]">
|
||||||
</template>
|
You bring the data.<br />
|
||||||
<template v-else>
|
<span class="text-[#00C3CD]">We bring the engine.</span>
|
||||||
PulseCast turns inner-city footfall into a transparent shift plan for the week.
|
</h1>
|
||||||
</template>
|
<!-- Subline -->
|
||||||
</p>
|
<p class="font-body-lg text-body-lg text-[#94A3B8] max-w-[500px] leading-relaxed">
|
||||||
|
Privacy-preserving sensor counts in, decisions out. Turn raw edge signals into verified operational foresight without compromising individual identity.
|
||||||
<div class="landing__actions">
|
</p>
|
||||||
<OnyxButton label="Open the plan" link="/plan" color="primary" :icon="iconArrowRight" icon-position="right" />
|
<!-- CTAs Row -->
|
||||||
<OnyxButton label="See the forecast" link="/forecast" mode="outline" />
|
<div class="flex flex-wrap items-center justify-center md:justify-start gap-space-md pt-space-xs">
|
||||||
</div>
|
<a class="inline-flex items-center justify-center gap-2 px-6 h-12 rounded-xl bg-[#00C3CD] text-[#081723] font-label-md text-label-md font-semibold hover:bg-[#00d8e4] transition-all shadow-[0_2px_12px_rgba(0,195,205,0.25)] active:scale-[0.99] group" href="#playground">
|
||||||
|
<span>Try the engine</span>
|
||||||
<ol class="landing__chain" aria-label="How the plan is made">
|
<Icon name="material-symbols:arrow-forward" class="text-[18px] group-hover:translate-x-0.5 transition-transform text-[#081723]" />
|
||||||
<li><span>Measured</span> footfall</li>
|
</a>
|
||||||
<li><span>Modelled</span> forecast</li>
|
<a class="inline-flex items-center justify-center gap-2 px-6 h-12 rounded-xl bg-[#0e2233] text-[#FFFFFF] border border-[#1e3a52] font-label-md text-label-md hover:bg-[#132b40] transition-all shadow-sm" href="/use-cases">
|
||||||
<li><span>Declared</span> assumptions</li>
|
<Icon name="material-symbols:visibility-outline" class="text-[18px] text-[#00C3CD]" />
|
||||||
<li><span>Shift</span> plan</li>
|
<span>See live use cases</span>
|
||||||
</ol>
|
</a>
|
||||||
|
</div>
|
||||||
<dl class="landing__proof" aria-label="What the plan is built on">
|
<!-- Trust Micro-Copy -->
|
||||||
<div>
|
<div class="flex items-center gap-2 pt-space-xs font-body-sm text-body-sm text-[#94A3B8]">
|
||||||
<dt>Latest reading</dt>
|
<Icon name="material-symbols:verified-user" class="text-[17px] text-[#00C3CD]" />
|
||||||
<dd>
|
<span>Zero personally identifiable information (PII) processed. GDPR Art. 25 Privacy by Design.</span>
|
||||||
{{ latestReading }} <span>est. devices/hour</span>
|
</div>
|
||||||
<small>{{ activeSensor?.name ?? 'Stadtgalerie' }} · last point {{ lastMeasured }}</small>
|
</div>
|
||||||
</dd>
|
<!-- RIGHT COLUMN: Pipeline Architecture Diagram Card -->
|
||||||
|
<div class="lg:col-span-6 w-full">
|
||||||
|
<div class="w-full bg-[#0e2233] border border-[#1e3a52] rounded-xl shadow-xl p-space-lg flex flex-col gap-space-md relative overflow-hidden">
|
||||||
|
<!-- Card Header Badge -->
|
||||||
|
<div class="flex flex-wrap items-center justify-between gap-2 pb-space-xs border-b border-[#1e3a52]/60">
|
||||||
|
<div class="flex items-center gap-2">
|
||||||
|
<span class="w-2 h-2 rounded-full bg-[#00C3CD] animate-pulse"></span>
|
||||||
|
<span class="font-label-sm text-label-sm uppercase tracking-wider text-[#FFFFFF] font-semibold">Real-Time Core Pipeline</span>
|
||||||
|
</div>
|
||||||
|
<span class="font-label-sm text-label-sm bg-[#132b40] border border-[#1e3a52] px-2 py-0.5 rounded text-[#94A3B8] font-mono font-medium">Operational</span>
|
||||||
|
</div>
|
||||||
|
<!-- Pipeline Diagram Stage -->
|
||||||
|
<div class="bg-[#081723]/60 border border-[#1e3a52] rounded-xl p-space-md flex flex-col gap-space-md relative">
|
||||||
|
<!-- 3-Node Pipeline Layout -->
|
||||||
|
<div class="flex flex-col md:flex-row items-center justify-between gap-2 md:gap-1 w-full">
|
||||||
|
<!-- NODE 1: Ingest -->
|
||||||
|
<div class="w-full md:w-[30%] bg-[#0e2233] border border-[#1e3a52] rounded-xl p-space-sm flex flex-col items-center text-center shadow-sm">
|
||||||
|
<div class="w-10 h-10 rounded-lg bg-[#132b40] border border-[#1e3a52] flex items-center justify-center text-[#00C3CD] mb-1">
|
||||||
|
<Icon name="material-symbols:sensors" class="text-[20px]" />
|
||||||
|
</div>
|
||||||
|
<span class="font-headline-sm text-[13px] leading-tight text-[#FFFFFF] font-semibold">Anonymously counted individuals</span>
|
||||||
|
</div>
|
||||||
|
<!-- CONNECTOR 1 -->
|
||||||
|
<div class="w-full md:w-auto flex flex-col items-center justify-center py-1 md:py-0 md:flex-1 md:px-1 relative">
|
||||||
|
<div class="md:hidden w-[2px] h-8 bg-[#1e3a52] relative overflow-hidden">
|
||||||
|
<div class="w-[2px] h-1/2 bg-[#00C3CD] animate-flow-y"></div>
|
||||||
|
</div>
|
||||||
|
<div class="hidden md:flex w-full h-[2px] bg-[#1e3a52] relative overflow-hidden items-center">
|
||||||
|
<div class="w-1/2 h-[2px] bg-[#00C3CD] animate-flow"></div>
|
||||||
|
</div>
|
||||||
|
<span class="text-[9px] text-[#00C3CD] font-mono tracking-tighter mt-1 uppercase whitespace-nowrap">No personal data</span>
|
||||||
|
</div>
|
||||||
|
<!-- NODE 2: PULSE ENGINE (Centerpiece) -->
|
||||||
|
<div class="w-full md:w-[38%] bg-[#132b40] border-2 border-[#00C3CD] text-[#FFFFFF] rounded-xl p-space-md flex flex-col items-center text-center shadow-lg relative overflow-hidden group">
|
||||||
|
<div class="absolute -right-6 -bottom-6 w-20 h-20 rounded-full bg-[#00C3CD]/15 blur-xl pointer-events-none"></div>
|
||||||
|
<div class="w-9 h-9 rounded-full bg-[#00C3CD]/20 border border-[#00C3CD]/40 flex items-center justify-center text-[#00C3CD] mb-1">
|
||||||
|
<Icon name="material-symbols:hub-outline" class="text-[19px]" />
|
||||||
|
</div>
|
||||||
|
<span class="font-headline-sm text-[14px] leading-tight text-[#FFFFFF] font-semibold tracking-tight">Pulse Engine</span>
|
||||||
|
</div>
|
||||||
|
<!-- CONNECTOR 2 -->
|
||||||
|
<div class="w-full md:w-auto flex flex-col items-center justify-center py-1 md:py-0 md:flex-1 md:px-1 relative">
|
||||||
|
<div class="md:hidden w-[2px] h-8 bg-[#1e3a52] relative overflow-hidden">
|
||||||
|
<div class="w-[2px] h-1/2 bg-[#00C3CD] animate-flow-y"></div>
|
||||||
|
</div>
|
||||||
|
<div class="hidden md:flex w-full h-[2px] bg-[#1e3a52] relative overflow-hidden items-center">
|
||||||
|
<div class="w-1/2 h-[2px] bg-[#00C3CD] animate-flow"></div>
|
||||||
|
</div>
|
||||||
|
<span class="text-[9px] text-[#00C3CD] font-mono tracking-tighter mt-1 uppercase">Forecast</span>
|
||||||
|
</div>
|
||||||
|
<!-- NODE 3: Decision -->
|
||||||
|
<div class="w-full md:w-[30%] bg-[#0e2233] border border-[#1e3a52] rounded-xl p-space-sm flex flex-col items-center text-center shadow-sm">
|
||||||
|
<div class="w-10 h-10 rounded-lg bg-[#132b40] border border-[#1e3a52] flex items-center justify-center text-[#00C3CD] mb-1">
|
||||||
|
<Icon name="material-symbols:bolt-outline" class="text-[20px]" />
|
||||||
|
</div>
|
||||||
|
<span class="font-headline-sm text-[13px] leading-tight text-[#FFFFFF] font-semibold">Decision</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- Real-world Context Fusion Ribbon -->
|
||||||
|
<div class="flex flex-col gap-1.5 pt-1">
|
||||||
|
<div class="flex flex-wrap items-center justify-between gap-x-3 gap-y-1 px-1 text-[#94A3B8]">
|
||||||
|
<span class="font-label-sm text-[11px] tracking-wider uppercase font-semibold text-[#94A3B8]">Contextual Signals Fused in Real-Time</span>
|
||||||
|
<span class="text-[10px] font-mono text-[#00C3CD] shrink-0 whitespace-nowrap">4 live feeds</span>
|
||||||
|
</div>
|
||||||
|
<div class="grid grid-cols-2 md:grid-cols-4 gap-1.5">
|
||||||
|
<div class="flex items-center gap-2 px-2 py-1.5 rounded-lg bg-[#0e2233] border border-[#1e3a52] shadow-sm">
|
||||||
|
<Icon name="material-symbols:sunny" class="text-[16px] text-[#00C3CD]" />
|
||||||
|
<span class="font-label-sm text-[12px] text-[#FFFFFF] font-semibold">Sun position</span>
|
||||||
|
</div>
|
||||||
|
<div class="flex items-center gap-2 px-2 py-1.5 rounded-lg bg-[#0e2233] border border-[#1e3a52] shadow-sm">
|
||||||
|
<Icon name="material-symbols:partly-cloudy-day" class="text-[16px] text-[#00C3CD]" />
|
||||||
|
<span class="font-label-sm text-[12px] text-[#FFFFFF] font-semibold">Weather</span>
|
||||||
|
</div>
|
||||||
|
<div class="flex items-center gap-2 px-2 py-1.5 rounded-lg bg-[#0e2233] border border-[#1e3a52] shadow-sm">
|
||||||
|
<Icon name="material-symbols:calendar-month" class="text-[16px] text-[#00C3CD]" />
|
||||||
|
<span class="font-label-sm text-[12px] text-[#FFFFFF] font-semibold">Calendar</span>
|
||||||
|
</div>
|
||||||
|
<div class="flex items-center gap-2 px-2 py-1.5 rounded-lg bg-[#0e2233] border border-[#1e3a52] shadow-sm">
|
||||||
|
<Icon name="material-symbols:map-outline" class="text-[16px] text-[#00C3CD]" />
|
||||||
|
<span class="font-label-sm text-[12px] text-[#FFFFFF] font-semibold">City map</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- Mini Telemetry Footer Bar -->
|
||||||
|
<div class="flex flex-wrap items-center justify-between gap-2 px-space-xs font-mono text-[11px] text-[#94A3B8]">
|
||||||
|
<div class="flex items-center gap-1.5 whitespace-nowrap">
|
||||||
|
<Icon name="material-symbols:speed" class="text-[14px] text-[#00C3CD]" />
|
||||||
|
<span>Pipeline Latency: <strong class="text-[#FFFFFF]"><42ms</strong></span>
|
||||||
|
</div>
|
||||||
|
<div class="flex items-center gap-1.5 whitespace-nowrap">
|
||||||
|
<Icon name="material-symbols:sync" class="text-[14px] text-[#00C3CD]" />
|
||||||
|
<span>Edge aggregation: <strong class="text-[#FFFFFF]">60s epoch</strong></span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- ENGINE COMPARISON -->
|
||||||
|
<div class="w-full bg-[#0e2233] border border-[#1e3a52] rounded-xl shadow-sm p-space-lg flex flex-col gap-space-lg">
|
||||||
|
<!-- Header -->
|
||||||
|
<div class="flex flex-col gap-3 lg:flex-row lg:items-end lg:justify-between">
|
||||||
|
<div class="flex flex-col gap-1">
|
||||||
|
<span class="font-label-sm text-[10px] uppercase tracking-wider text-[#00C3CD] font-semibold">Built sovereign</span>
|
||||||
|
<h2 class="font-headline-sm text-[20px] leading-tight text-[#FFFFFF] font-semibold tracking-tight">Why this engine</h2>
|
||||||
|
<p class="text-[12px] leading-relaxed text-[#94A3B8]">Self-coded AI. Self-hosted. One engine.</p>
|
||||||
|
</div>
|
||||||
|
<span class="font-label-sm text-[10px] uppercase tracking-wider text-[#94A3B8] font-semibold">vs Hyperscalers</span>
|
||||||
|
</div>
|
||||||
|
<!-- AI key points -->
|
||||||
|
<div class="grid grid-cols-1 sm:grid-cols-3 gap-2">
|
||||||
|
<div class="flex items-start gap-2 rounded-lg border border-[#00C3CD]/30 bg-[#00C3CD]/[0.06] px-3 py-2.5">
|
||||||
|
<Icon name="material-symbols:psychology" class="text-[18px] text-[#00C3CD] shrink-0 mt-0.5" />
|
||||||
|
<div class="flex flex-col">
|
||||||
|
<span class="text-[11px] font-semibold text-[#FFFFFF]">AI in the engine</span>
|
||||||
|
<span class="text-[10px] leading-snug text-[#94A3B8]">Purpose-built models, not an API wrapper.</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="flex items-start gap-2 rounded-lg border border-[#1e3a52] bg-[#132b40]/60 px-3 py-2.5">
|
||||||
|
<Icon name="material-symbols:dns" class="text-[18px] text-[#00C3CD] shrink-0 mt-0.5" />
|
||||||
|
<div class="flex flex-col">
|
||||||
|
<span class="text-[11px] font-semibold text-[#FFFFFF]">Self-hosted</span>
|
||||||
|
<span class="text-[10px] leading-snug text-[#94A3B8]">Runs on STACKIT, inside your perimeter.</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="flex items-start gap-2 rounded-lg border border-[#1e3a52] bg-[#132b40]/60 px-3 py-2.5">
|
||||||
|
<Icon name="material-symbols:shield-lock" class="text-[18px] text-[#00C3CD] shrink-0 mt-0.5" />
|
||||||
|
<div class="flex flex-col">
|
||||||
|
<span class="text-[11px] font-semibold text-[#FFFFFF]">Privacy-first</span>
|
||||||
|
<span class="text-[10px] leading-snug text-[#94A3B8]">Counts, not identities.</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- Matrix -->
|
||||||
|
<div class="w-full border border-[#1e3a52] rounded-lg overflow-hidden">
|
||||||
|
<table class="w-full table-fixed border-collapse">
|
||||||
|
<thead class="bg-[#132b40]/60">
|
||||||
|
<tr class="border-b border-[#1e3a52]">
|
||||||
|
<th scope="col" class="px-3 py-2 text-left font-label-sm text-[9px] uppercase tracking-wider text-[#94A3B8] font-semibold">Capability</th>
|
||||||
|
<th scope="col" class="w-[4.75rem] sm:w-[7rem] px-2 py-2 text-center font-label-sm text-[9px] uppercase tracking-wider text-[#00C3CD] font-semibold">Schwarz Digits</th>
|
||||||
|
<th scope="col" class="w-[5.5rem] sm:w-[8rem] px-2 py-2 text-center font-label-sm text-[9px] uppercase tracking-wider text-[#94A3B8] font-semibold">Hyperscalers</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<tr v-for="row in comparisonRows" :key="row.label" class="border-b border-[#1e3a52]/60 last:border-b-0" :class="row.ai ? 'bg-[#00C3CD]/[0.06]' : ''">
|
||||||
|
<th scope="row" class="px-3 py-2 text-left font-label-sm text-[12px] leading-snug text-[#FFFFFF] font-normal">
|
||||||
|
<span class="flex items-center gap-1.5">
|
||||||
|
{{ row.label }}
|
||||||
|
<span v-if="row.ai" class="rounded bg-[#00C3CD] px-1 py-0.5 text-[8px] font-bold uppercase tracking-wide text-[#081723]">AI</span>
|
||||||
|
</span>
|
||||||
|
</th>
|
||||||
|
<td class="px-2 py-2 text-center">
|
||||||
|
<Icon name="material-symbols:check-circle" class="text-[16px] text-[#00C3CD]" />
|
||||||
|
</td>
|
||||||
|
<td class="px-2 py-2 text-center font-mono text-[10px] uppercase tracking-wide text-[#94A3B8]">{{ row.hyperscaler }}</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
<p class="text-[10px] leading-relaxed text-[#94A3B8]">General comparison; hyperscaler capabilities vary by service and region.</p>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
</section>
|
||||||
<dt>Modelled peak</dt>
|
|
||||||
<dd>
|
|
||||||
{{ peakHour ? formatNumber(peakHour.footfall) : '—' }} <span>est. devices/hour</span>
|
|
||||||
<small>{{ peakHour ? `${formatWeekday(berlinParts(peakHour.t).date)} ${formatTime(peakHour.t)}` : 'waiting for the forecast' }}</small>
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<dt>Assumed</dt>
|
|
||||||
<dd>
|
|
||||||
{{ plan?.assumptions.labor_cost_eur_h ?? 16 }} <span>€/staff-hour</span>
|
|
||||||
<small>{{ plan?.assumptions.visitors_per_staff_hour ?? 25 }} visitors/staff-h · ×{{ plan?.assumptions.safety_factor ?? 1.15 }} safety</small>
|
|
||||||
</dd>
|
|
||||||
</div>
|
|
||||||
</dl>
|
|
||||||
</div>
|
</div>
|
||||||
|
</main>
|
||||||
|
|
||||||
<aside class="landing__board" aria-label="Live weekly shift board">
|
<footer class="mt-auto w-full bg-[#081723] border-t border-[#1e3a52]/50 py-3">
|
||||||
<div class="landing__board-head">
|
<div class="max-w-[1200px] mx-auto px-margin-desktop flex flex-col sm:flex-row items-center justify-between gap-1 sm:gap-space-lg text-[11px] font-body-sm text-[#94A3B8] opacity-50 hover:opacity-100 transition-opacity duration-200">
|
||||||
<div>
|
<span>© 2026 Schwarz Digits · Privacy by design · Deployed on STACKIT</span>
|
||||||
<p class="pc-label">The week, block by block</p>
|
<span>All systems operational</span>
|
||||||
<p class="landing__board-window">{{ windowLabel }} · {{ windowTag }}</p>
|
</div>
|
||||||
</div>
|
</footer>
|
||||||
<span class="pc-tag pc-tag--signal">Live plan</span>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<template v-if="plan && daySummaries.length">
|
|
||||||
<WeekBoard
|
|
||||||
:days="daySummaries"
|
|
||||||
:peak-date="peakShift?.date"
|
|
||||||
show-pulse
|
|
||||||
label="Live weekly shift board"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<div class="landing__board-receipt">
|
|
||||||
<div>
|
|
||||||
<span class="pc-label">Peak shift</span>
|
|
||||||
<strong>
|
|
||||||
<template v-if="peakShift">
|
|
||||||
{{ peakShift.staff }} staff · {{ peakShift.start }}–{{ peakShift.end }}
|
|
||||||
</template>
|
|
||||||
<template v-else>—</template>
|
|
||||||
</strong>
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<span class="pc-label">Cost vs flat</span>
|
|
||||||
<strong>{{ formatEuro(plan.summary.cost_eur) }} <span>vs {{ formatEuro(plan.summary.flat_schedule_cost_eur) }}</span></strong>
|
|
||||||
<small>{{ formatEuro(savingEur) }} saved · {{ Math.round(savingPct) }}% lower</small>
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<span class="pc-label">Coverage</span>
|
|
||||||
<strong>{{ formatPercent(plan.summary.coverage_pct, 1) }}</strong>
|
|
||||||
<small>{{ plan.summary.understaffed_hours }} h short · {{ plan.summary.overstaffed_hours }} h over</small>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="landing__board-foot">
|
|
||||||
<span>{{ totalStaffHours }} staff-hours · {{ plan.assumptions.shift_length_h }} h blocks</span>
|
|
||||||
<NuxtLink to="/plan">Open the plan <span aria-hidden="true">→</span></NuxtLink>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<div v-else-if="status === 'error'" class="landing__board-empty" role="alert">
|
|
||||||
<OnyxIcon :icon="iconTriangleWarning" size="18px" color="warning" />
|
|
||||||
<p>The live plan is unavailable. Retry when the connection is back.</p>
|
|
||||||
<OnyxButton label="Retry" mode="outline" density="compact" @click="refresh()" />
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div v-else class="landing__board-empty" aria-busy="true">
|
|
||||||
<div class="pc-skeleton" style="width: 100%; height: 9rem" />
|
|
||||||
<div class="pc-skeleton" style="width: 76%; height: 1.1rem; margin-top: 0.8rem" />
|
|
||||||
<p class="pc-small pc-muted">Loading the current plan…</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="landing__board-note">
|
|
||||||
<span>Live demo plan · not a city-wide claim.</span>
|
|
||||||
<span>{{ meta?.coverage.sensors ?? 8 }} sensors · 580 m · no POS data</span>
|
|
||||||
</div>
|
|
||||||
</aside>
|
|
||||||
</section>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style scoped>
|
<style>
|
||||||
.landing {
|
@keyframes pulseDataFlow {
|
||||||
min-height: calc(100dvh - 8rem);
|
0% { transform: translateX(0); opacity: 0.15; }
|
||||||
justify-content: space-between;
|
50% { opacity: 0.95; }
|
||||||
gap: 1.25rem;
|
100% { transform: translateX(64px); opacity: 0.15; }
|
||||||
}
|
}
|
||||||
|
|
||||||
.landing__hero {
|
.animate-flow {
|
||||||
display: grid;
|
animation: pulseDataFlow 2.4s cubic-bezier(0.4, 0, 0.2, 1) infinite;
|
||||||
grid-template-columns: minmax(0, 1.02fr) minmax(26rem, 0.98fr);
|
|
||||||
gap: clamp(1.5rem, 4vw, 4rem);
|
|
||||||
align-items: stretch;
|
|
||||||
padding-block: clamp(0.5rem, 2vw, 1.5rem);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.landing__copy {
|
@keyframes pulseDataFlowY {
|
||||||
display: flex;
|
0% { transform: translateY(0); opacity: 0.15; }
|
||||||
min-width: 0;
|
50% { opacity: 0.95; }
|
||||||
flex-direction: column;
|
100% { transform: translateY(32px); opacity: 0.15; }
|
||||||
justify-content: center;
|
|
||||||
gap: 1.1rem;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.landing__meta {
|
.animate-flow-y {
|
||||||
display: flex;
|
animation: pulseDataFlowY 2.4s cubic-bezier(0.4, 0, 0.2, 1) infinite;
|
||||||
flex-wrap: wrap;
|
|
||||||
align-items: center;
|
|
||||||
gap: 0.55rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
.landing__title {
|
|
||||||
max-width: 10ch;
|
|
||||||
margin: 0;
|
|
||||||
font-size: clamp(3.6rem, 7.1vw, 6.7rem);
|
|
||||||
font-stretch: 76%;
|
|
||||||
font-weight: 850;
|
|
||||||
line-height: 0.84;
|
|
||||||
letter-spacing: -0.04em;
|
|
||||||
text-wrap: balance;
|
|
||||||
}
|
|
||||||
|
|
||||||
.landing__lede {
|
|
||||||
max-width: 48ch;
|
|
||||||
margin: 0;
|
|
||||||
color: var(--pc-ink-2);
|
|
||||||
font-size: clamp(1.05rem, 1.35vw, 1.22rem);
|
|
||||||
line-height: 1.45;
|
|
||||||
}
|
|
||||||
|
|
||||||
.landing__lede strong {
|
|
||||||
font-weight: 780;
|
|
||||||
}
|
|
||||||
|
|
||||||
.landing__actions {
|
|
||||||
display: flex;
|
|
||||||
flex-wrap: wrap;
|
|
||||||
gap: 0.6rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
.landing__chain {
|
|
||||||
display: flex;
|
|
||||||
flex-wrap: wrap;
|
|
||||||
gap: 0.35rem;
|
|
||||||
margin: 0;
|
|
||||||
padding: 0.65rem 0;
|
|
||||||
border-block: 1px solid var(--pc-line);
|
|
||||||
list-style: none;
|
|
||||||
counter-reset: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.landing__chain li {
|
|
||||||
display: inline-flex;
|
|
||||||
align-items: baseline;
|
|
||||||
gap: 0.3rem;
|
|
||||||
color: var(--pc-muted);
|
|
||||||
font-size: 0.72rem;
|
|
||||||
font-weight: 600;
|
|
||||||
letter-spacing: 0.02em;
|
|
||||||
}
|
|
||||||
|
|
||||||
.landing__chain li + li::before {
|
|
||||||
content: "→";
|
|
||||||
margin-inline-end: 0.2rem;
|
|
||||||
color: var(--pc-signal-text);
|
|
||||||
}
|
|
||||||
|
|
||||||
.landing__chain li span {
|
|
||||||
color: var(--pc-ink);
|
|
||||||
font-weight: 750;
|
|
||||||
text-transform: uppercase;
|
|
||||||
}
|
|
||||||
|
|
||||||
.landing__chain li span::after {
|
|
||||||
content: "";
|
|
||||||
}
|
|
||||||
|
|
||||||
.landing__proof {
|
|
||||||
display: grid;
|
|
||||||
grid-template-columns: repeat(3, minmax(0, 1fr));
|
|
||||||
gap: 0;
|
|
||||||
margin: 0;
|
|
||||||
border-top: 2px solid var(--pc-ink);
|
|
||||||
}
|
|
||||||
|
|
||||||
.landing__proof > div {
|
|
||||||
min-width: 0;
|
|
||||||
padding: 0.7rem 0.75rem 0;
|
|
||||||
border-inline-end: 1px solid var(--pc-line);
|
|
||||||
}
|
|
||||||
|
|
||||||
.landing__proof > div:first-child {
|
|
||||||
padding-inline-start: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.landing__proof > div:last-child {
|
|
||||||
border-inline-end: 0;
|
|
||||||
padding-inline-end: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.landing__proof dt {
|
|
||||||
margin: 0;
|
|
||||||
color: var(--pc-muted);
|
|
||||||
font-size: 0.62rem;
|
|
||||||
font-weight: 700;
|
|
||||||
letter-spacing: 0.1em;
|
|
||||||
text-transform: uppercase;
|
|
||||||
}
|
|
||||||
|
|
||||||
.landing__proof dd {
|
|
||||||
margin: 0.25rem 0 0;
|
|
||||||
font-size: 1.35rem;
|
|
||||||
font-weight: 800;
|
|
||||||
letter-spacing: -0.02em;
|
|
||||||
line-height: 1;
|
|
||||||
font-variant-numeric: tabular-nums;
|
|
||||||
}
|
|
||||||
|
|
||||||
.landing__proof dd span {
|
|
||||||
display: block;
|
|
||||||
margin-top: 0.15rem;
|
|
||||||
color: var(--pc-muted);
|
|
||||||
font-size: 0.62rem;
|
|
||||||
font-weight: 500;
|
|
||||||
letter-spacing: 0.02em;
|
|
||||||
}
|
|
||||||
|
|
||||||
.landing__proof dd small {
|
|
||||||
display: block;
|
|
||||||
margin-top: 0.35rem;
|
|
||||||
color: var(--pc-muted);
|
|
||||||
font-size: 0.65rem;
|
|
||||||
font-weight: 450;
|
|
||||||
line-height: 1.35;
|
|
||||||
}
|
|
||||||
|
|
||||||
.landing__board {
|
|
||||||
display: flex;
|
|
||||||
min-width: 0;
|
|
||||||
flex-direction: column;
|
|
||||||
border: 2px solid var(--pc-ink);
|
|
||||||
background: var(--pc-paper);
|
|
||||||
}
|
|
||||||
|
|
||||||
.landing__board-head {
|
|
||||||
display: flex;
|
|
||||||
flex-wrap: wrap;
|
|
||||||
align-items: flex-start;
|
|
||||||
justify-content: space-between;
|
|
||||||
gap: 0.5rem;
|
|
||||||
padding: 0.85rem 0.85rem 0.55rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
.landing__board-head p {
|
|
||||||
margin: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.landing__board-window {
|
|
||||||
margin-top: 0.2rem !important;
|
|
||||||
color: var(--pc-muted);
|
|
||||||
font-size: 0.78rem;
|
|
||||||
font-variant-numeric: tabular-nums;
|
|
||||||
}
|
|
||||||
|
|
||||||
.landing__board .pc-board {
|
|
||||||
border-inline: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.landing__board-receipt {
|
|
||||||
display: grid;
|
|
||||||
grid-template-columns: 1.1fr 1.6fr 0.8fr;
|
|
||||||
gap: 0;
|
|
||||||
border-top: 2px solid var(--pc-ink);
|
|
||||||
border-bottom: 1px solid var(--pc-line);
|
|
||||||
}
|
|
||||||
|
|
||||||
.landing__board-receipt > div {
|
|
||||||
min-width: 0;
|
|
||||||
padding: 0.7rem 0.75rem;
|
|
||||||
border-inline-end: 1px solid var(--pc-line);
|
|
||||||
}
|
|
||||||
|
|
||||||
.landing__board-receipt > div:last-child {
|
|
||||||
border-inline-end: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.landing__board-receipt .pc-label {
|
|
||||||
display: block;
|
|
||||||
margin-bottom: 0.25rem;
|
|
||||||
font-size: 0.58rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
.landing__board-receipt strong {
|
|
||||||
display: block;
|
|
||||||
font-size: 0.95rem;
|
|
||||||
font-weight: 800;
|
|
||||||
line-height: 1.2;
|
|
||||||
font-variant-numeric: tabular-nums;
|
|
||||||
}
|
|
||||||
|
|
||||||
.landing__board-receipt strong span {
|
|
||||||
color: var(--pc-muted);
|
|
||||||
font-size: 0.72rem;
|
|
||||||
font-weight: 500;
|
|
||||||
}
|
|
||||||
|
|
||||||
.landing__board-receipt small {
|
|
||||||
display: block;
|
|
||||||
margin-top: 0.2rem;
|
|
||||||
color: var(--pc-muted);
|
|
||||||
font-size: 0.62rem;
|
|
||||||
line-height: 1.35;
|
|
||||||
}
|
|
||||||
|
|
||||||
.landing__board-foot {
|
|
||||||
display: flex;
|
|
||||||
flex-wrap: wrap;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: space-between;
|
|
||||||
gap: 0.5rem;
|
|
||||||
padding: 0.55rem 0.85rem;
|
|
||||||
color: var(--pc-muted);
|
|
||||||
font-size: 0.68rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
.landing__board-foot a {
|
|
||||||
color: var(--pc-ink);
|
|
||||||
font-weight: 750;
|
|
||||||
text-decoration-color: var(--pc-signal-text);
|
|
||||||
}
|
|
||||||
|
|
||||||
.landing__board-note {
|
|
||||||
display: flex;
|
|
||||||
flex-wrap: wrap;
|
|
||||||
justify-content: space-between;
|
|
||||||
gap: 0.35rem;
|
|
||||||
margin-top: auto;
|
|
||||||
padding: 0.45rem 0.85rem;
|
|
||||||
border-top: 1px solid var(--pc-line);
|
|
||||||
color: var(--pc-muted);
|
|
||||||
font-size: 0.6rem;
|
|
||||||
line-height: 1.35;
|
|
||||||
}
|
|
||||||
|
|
||||||
.landing__board-empty {
|
|
||||||
display: flex;
|
|
||||||
flex: 1;
|
|
||||||
min-height: 16rem;
|
|
||||||
flex-direction: column;
|
|
||||||
justify-content: center;
|
|
||||||
gap: 0.6rem;
|
|
||||||
padding: 1rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
.landing__board-empty p {
|
|
||||||
margin: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
@media (max-width: 1100px) {
|
|
||||||
.landing__hero {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
gap: 1.2rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
.landing__copy {
|
|
||||||
display: contents;
|
|
||||||
}
|
|
||||||
|
|
||||||
.landing__meta {
|
|
||||||
order: 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
.landing__title {
|
|
||||||
order: 2;
|
|
||||||
max-width: 14ch;
|
|
||||||
}
|
|
||||||
|
|
||||||
.landing__lede {
|
|
||||||
order: 3;
|
|
||||||
}
|
|
||||||
|
|
||||||
.landing__actions {
|
|
||||||
order: 4;
|
|
||||||
}
|
|
||||||
|
|
||||||
.landing__board {
|
|
||||||
order: 5;
|
|
||||||
max-width: 46rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
.landing__chain {
|
|
||||||
order: 6;
|
|
||||||
}
|
|
||||||
|
|
||||||
.landing__proof {
|
|
||||||
order: 7;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@media (max-width: 640px) {
|
|
||||||
.landing {
|
|
||||||
min-height: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.landing__title {
|
|
||||||
max-width: 11ch;
|
|
||||||
font-size: clamp(3rem, 14vw, 4rem);
|
|
||||||
}
|
|
||||||
|
|
||||||
.landing__proof {
|
|
||||||
grid-template-columns: minmax(0, 1fr);
|
|
||||||
}
|
|
||||||
|
|
||||||
.landing__proof > div {
|
|
||||||
display: grid;
|
|
||||||
grid-template-columns: 7rem minmax(0, 1fr);
|
|
||||||
gap: 0.4rem;
|
|
||||||
padding: 0.55rem 0;
|
|
||||||
border-inline-end: 0;
|
|
||||||
border-bottom: 1px solid var(--pc-line);
|
|
||||||
}
|
|
||||||
|
|
||||||
.landing__proof > div:last-child {
|
|
||||||
border-bottom: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.landing__proof dd {
|
|
||||||
font-size: 1.1rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
.landing__proof dd small {
|
|
||||||
margin-top: 0.15rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
.landing__board-receipt {
|
|
||||||
grid-template-columns: minmax(0, 1fr);
|
|
||||||
}
|
|
||||||
|
|
||||||
.landing__board-receipt > div {
|
|
||||||
border-inline-end: 0;
|
|
||||||
border-bottom: 1px solid var(--pc-line);
|
|
||||||
}
|
|
||||||
|
|
||||||
.landing__board-receipt > div:last-child {
|
|
||||||
border-bottom: 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
@@ -0,0 +1,1000 @@
|
|||||||
|
<script setup lang="ts">
|
||||||
|
import { SCENARIO_PRESETS } from '#shared/scenarios'
|
||||||
|
import type {
|
||||||
|
Horizon,
|
||||||
|
MetaResponse,
|
||||||
|
PlaygroundForecastResponse,
|
||||||
|
Point,
|
||||||
|
Scenario,
|
||||||
|
ScenarioPreset,
|
||||||
|
Sensor,
|
||||||
|
SeriesResponse,
|
||||||
|
} from '#shared/types'
|
||||||
|
import { apiErrorMessage } from '~/utils/api-error'
|
||||||
|
import {
|
||||||
|
formatDate,
|
||||||
|
formatDateTime,
|
||||||
|
formatNumber,
|
||||||
|
formatPercent,
|
||||||
|
formatShortDate,
|
||||||
|
formatWeekdayShort,
|
||||||
|
} from '~/utils/format'
|
||||||
|
import {
|
||||||
|
buildHeatmap,
|
||||||
|
formatBand,
|
||||||
|
scenarioDelta,
|
||||||
|
summarizeForecast,
|
||||||
|
} from '~/utils/playground'
|
||||||
|
|
||||||
|
const DEFAULT_SENSOR = 'hn-stadtgalerie-01'
|
||||||
|
const DEFAULT_HORIZON: Horizon = '48h'
|
||||||
|
const DEFAULT_SCENARIO: Scenario = 'base'
|
||||||
|
const DEFAULT_TEMP_C = 22
|
||||||
|
const DEFAULT_PRECIP_MM = 0
|
||||||
|
|
||||||
|
const HORIZON_OPTIONS: Horizon[] = ['15m', '1h', '48h', '7d']
|
||||||
|
|
||||||
|
const sensorId = ref(DEFAULT_SENSOR)
|
||||||
|
const horizon = ref<Horizon>(DEFAULT_HORIZON)
|
||||||
|
const scenario = ref<Scenario>(DEFAULT_SCENARIO)
|
||||||
|
const tempOverride = ref(false)
|
||||||
|
const tempC = ref(DEFAULT_TEMP_C)
|
||||||
|
const precipOverride = ref(false)
|
||||||
|
const precipMm = ref(DEFAULT_PRECIP_MM)
|
||||||
|
const holiday = ref(false)
|
||||||
|
|
||||||
|
const {
|
||||||
|
data: sensors,
|
||||||
|
error: sensorsError,
|
||||||
|
} = await useFetch<Sensor[]>('/api/sensors', { key: 'playground-sensors' })
|
||||||
|
const { data: presets } = await useFetch<ScenarioPreset[]>('/api/scenarios', {
|
||||||
|
key: 'playground-scenarios',
|
||||||
|
})
|
||||||
|
const {
|
||||||
|
data: meta,
|
||||||
|
error: metaError,
|
||||||
|
refresh: refreshMeta,
|
||||||
|
pending: metaPending,
|
||||||
|
} = await useFetch<MetaResponse>('/api/meta', { key: 'playground-meta' })
|
||||||
|
|
||||||
|
if (sensors.value?.length && !sensors.value.some((sensor) => sensor.id === sensorId.value)) {
|
||||||
|
sensorId.value = sensors.value[0]!.id
|
||||||
|
}
|
||||||
|
|
||||||
|
function buildQuery(target: {
|
||||||
|
sensor: string
|
||||||
|
horizon: Horizon
|
||||||
|
scenario: Scenario
|
||||||
|
}): Record<string, string | number | boolean> {
|
||||||
|
const query: Record<string, string | number | boolean> = { ...target }
|
||||||
|
if (tempOverride.value) query.temp_c = tempC.value
|
||||||
|
if (precipOverride.value) query.precip_mm = precipMm.value
|
||||||
|
if (holiday.value) query.is_holiday = true
|
||||||
|
return query
|
||||||
|
}
|
||||||
|
|
||||||
|
interface InitialPlayground {
|
||||||
|
forecast: PlaygroundForecastResponse
|
||||||
|
observed: Point[]
|
||||||
|
observedError: string
|
||||||
|
}
|
||||||
|
|
||||||
|
const initialQuery = buildQuery({
|
||||||
|
sensor: sensorId.value,
|
||||||
|
horizon: DEFAULT_HORIZON,
|
||||||
|
scenario: DEFAULT_SCENARIO,
|
||||||
|
})
|
||||||
|
|
||||||
|
const {
|
||||||
|
data: initial,
|
||||||
|
error: initialError,
|
||||||
|
} = await useAsyncData<InitialPlayground>('playground-initial', async () => {
|
||||||
|
const [forecastResult, seriesResult] = await Promise.allSettled([
|
||||||
|
$fetch<PlaygroundForecastResponse>('/api/playground', { query: initialQuery }),
|
||||||
|
$fetch<SeriesResponse>('/api/series', {
|
||||||
|
query: { sensor: sensorId.value, step: '1h' },
|
||||||
|
}),
|
||||||
|
])
|
||||||
|
|
||||||
|
if (forecastResult.status === 'rejected') throw forecastResult.reason
|
||||||
|
|
||||||
|
return {
|
||||||
|
forecast: forecastResult.value,
|
||||||
|
observed: seriesResult.status === 'fulfilled' ? seriesResult.value.points : [],
|
||||||
|
observedError:
|
||||||
|
seriesResult.status === 'rejected'
|
||||||
|
? apiErrorMessage(seriesResult.reason, 'Observed series unavailable.')
|
||||||
|
: '',
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
const result = ref<PlaygroundForecastResponse | null>(initial.value?.forecast ?? null)
|
||||||
|
const observedPoints = ref<Point[]>(initial.value?.observed ?? [])
|
||||||
|
const observedError = ref(initial.value?.observedError ?? '')
|
||||||
|
const comparisonBase = ref<PlaygroundForecastResponse | null>(null)
|
||||||
|
const comparisonError = ref('')
|
||||||
|
const loading = ref(false)
|
||||||
|
const errorMessage = ref(
|
||||||
|
initialError.value
|
||||||
|
? apiErrorMessage(
|
||||||
|
initialError.value,
|
||||||
|
'The playground forecast is unavailable. Start the Go and Python services and retry.',
|
||||||
|
)
|
||||||
|
: '',
|
||||||
|
)
|
||||||
|
|
||||||
|
const presetList = computed(() =>
|
||||||
|
presets.value?.length ? presets.value : SCENARIO_PRESETS,
|
||||||
|
)
|
||||||
|
|
||||||
|
function scenarioLabel(id: Scenario | undefined): string {
|
||||||
|
if (!id) return '—'
|
||||||
|
return presetList.value.find((preset) => preset.id === id)?.label ?? id
|
||||||
|
}
|
||||||
|
|
||||||
|
const resultSensorName = computed(
|
||||||
|
() =>
|
||||||
|
sensors.value?.find((sensor) => sensor.id === result.value?.sensor)?.name ??
|
||||||
|
result.value?.sensor ??
|
||||||
|
'—',
|
||||||
|
)
|
||||||
|
|
||||||
|
const summary = computed(() => summarizeForecast(result.value?.points ?? []))
|
||||||
|
const baseSummary = computed(() =>
|
||||||
|
comparisonBase.value ? summarizeForecast(comparisonBase.value.points) : null,
|
||||||
|
)
|
||||||
|
const delta = computed(() =>
|
||||||
|
baseSummary.value ? scenarioDelta(summary.value, baseSummary.value) : null,
|
||||||
|
)
|
||||||
|
const heatmap = computed(() => buildHeatmap(result.value?.points ?? []))
|
||||||
|
const isBaseScenario = computed(() => result.value?.scenario === 'base')
|
||||||
|
const interpolated = computed(
|
||||||
|
() => result.value?.horizon === '15m' || result.value?.horizon === '1h',
|
||||||
|
)
|
||||||
|
const weatherSourceLabel = computed(() =>
|
||||||
|
result.value?.weather_source === 'override' ? 'Your weather override' : 'Forecast weather',
|
||||||
|
)
|
||||||
|
const holidayForced = computed(() => result.value?.request?.is_holiday === true)
|
||||||
|
|
||||||
|
const observedWindow = computed(() => {
|
||||||
|
const cutoff = Date.parse(result.value?.points[0]?.t ?? '')
|
||||||
|
const sorted = [...observedPoints.value].sort(
|
||||||
|
(a, b) => Date.parse(a.t) - Date.parse(b.t),
|
||||||
|
)
|
||||||
|
const before = Number.isFinite(cutoff)
|
||||||
|
? sorted.filter((point) => Date.parse(point.t) < cutoff)
|
||||||
|
: sorted
|
||||||
|
const last = before.at(-1)
|
||||||
|
if (!last || !Number.isFinite(cutoff)) return []
|
||||||
|
// Only draw observed history when it is contiguous with the forecast start.
|
||||||
|
// A multi-day gap would make the chart look like a continuous signal.
|
||||||
|
if (cutoff - Date.parse(last.t) > 24 * 60 * 60 * 1000) return []
|
||||||
|
return before.slice(-24)
|
||||||
|
})
|
||||||
|
|
||||||
|
const comparisonRows = computed(() => {
|
||||||
|
if (!comparisonBase.value || !baseSummary.value) return []
|
||||||
|
const selectedPeak = summary.value.peak?.v ?? 0
|
||||||
|
const basePeak = baseSummary.value.peak?.v ?? 0
|
||||||
|
const selectedMean = summary.value.mean
|
||||||
|
const baseMean = baseSummary.value.mean
|
||||||
|
return [
|
||||||
|
{
|
||||||
|
label: 'Peak devices/hour',
|
||||||
|
selected: selectedPeak,
|
||||||
|
base: basePeak,
|
||||||
|
max: Math.max(selectedPeak, basePeak, 1),
|
||||||
|
delta: delta.value?.peakDelta ?? 0,
|
||||||
|
pct: delta.value?.peakDeltaPct ?? null,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Mean devices/hour',
|
||||||
|
selected: selectedMean,
|
||||||
|
base: baseMean,
|
||||||
|
max: Math.max(selectedMean, baseMean, 1),
|
||||||
|
delta: delta.value?.meanDelta ?? 0,
|
||||||
|
pct: delta.value?.meanDeltaPct ?? null,
|
||||||
|
},
|
||||||
|
]
|
||||||
|
})
|
||||||
|
|
||||||
|
const metaErrorMessage = computed(() =>
|
||||||
|
metaError.value ? apiErrorMessage(metaError.value, 'Model metadata is unavailable.') : '',
|
||||||
|
)
|
||||||
|
|
||||||
|
const sensorsMessage = computed(() =>
|
||||||
|
sensorsError.value
|
||||||
|
? apiErrorMessage(sensorsError.value, 'The sensor list is unavailable.')
|
||||||
|
: '',
|
||||||
|
)
|
||||||
|
|
||||||
|
const statusMessage = computed(() => {
|
||||||
|
if (loading.value) return 'Running the live forecast model.'
|
||||||
|
if (errorMessage.value) return 'The latest run failed.'
|
||||||
|
if (!result.value) return 'No forecast loaded yet.'
|
||||||
|
return `${summary.value.count} forecast points loaded.`
|
||||||
|
})
|
||||||
|
|
||||||
|
function signed(value: number, suffix = ''): string {
|
||||||
|
const rounded = Math.round(value * 10) / 10
|
||||||
|
if (rounded === 0) return `0${suffix}`
|
||||||
|
return `${rounded > 0 ? '+' : ''}${formatNumber(rounded)}${suffix}`
|
||||||
|
}
|
||||||
|
|
||||||
|
async function run() {
|
||||||
|
if (loading.value) return
|
||||||
|
loading.value = true
|
||||||
|
errorMessage.value = ''
|
||||||
|
comparisonError.value = ''
|
||||||
|
|
||||||
|
const target = {
|
||||||
|
sensor: sensorId.value,
|
||||||
|
horizon: horizon.value,
|
||||||
|
scenario: scenario.value,
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
const [selectedResult, seriesResult, baseResult] = await Promise.allSettled([
|
||||||
|
$fetch<PlaygroundForecastResponse>('/api/playground', {
|
||||||
|
query: buildQuery(target),
|
||||||
|
}),
|
||||||
|
$fetch<SeriesResponse>('/api/series', {
|
||||||
|
query: { sensor: target.sensor, step: '1h' },
|
||||||
|
}),
|
||||||
|
target.scenario === 'base'
|
||||||
|
? Promise.resolve<PlaygroundForecastResponse | null>(null)
|
||||||
|
: $fetch<PlaygroundForecastResponse>('/api/playground', {
|
||||||
|
query: buildQuery({ ...target, scenario: 'base' }),
|
||||||
|
}),
|
||||||
|
])
|
||||||
|
|
||||||
|
if (selectedResult.status === 'rejected') {
|
||||||
|
errorMessage.value = apiErrorMessage(
|
||||||
|
selectedResult.reason,
|
||||||
|
'The forecast API could not complete this run.',
|
||||||
|
)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
result.value = selectedResult.value
|
||||||
|
|
||||||
|
if (seriesResult.status === 'fulfilled') {
|
||||||
|
observedPoints.value = seriesResult.value.points
|
||||||
|
observedError.value = ''
|
||||||
|
} else {
|
||||||
|
observedPoints.value = []
|
||||||
|
observedError.value = apiErrorMessage(
|
||||||
|
seriesResult.reason,
|
||||||
|
'Observed series unavailable.',
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
if (baseResult.status === 'fulfilled' && baseResult.value) {
|
||||||
|
comparisonBase.value = baseResult.value
|
||||||
|
} else {
|
||||||
|
comparisonBase.value = null
|
||||||
|
if (baseResult.status === 'rejected') {
|
||||||
|
comparisonError.value = apiErrorMessage(
|
||||||
|
baseResult.reason,
|
||||||
|
'The base comparison is unavailable.',
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} finally {
|
||||||
|
loading.value = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function resetDefaults() {
|
||||||
|
sensorId.value = sensors.value?.some((sensor) => sensor.id === DEFAULT_SENSOR)
|
||||||
|
? DEFAULT_SENSOR
|
||||||
|
: sensors.value?.[0]?.id ?? DEFAULT_SENSOR
|
||||||
|
horizon.value = DEFAULT_HORIZON
|
||||||
|
scenario.value = DEFAULT_SCENARIO
|
||||||
|
tempOverride.value = false
|
||||||
|
tempC.value = DEFAULT_TEMP_C
|
||||||
|
precipOverride.value = false
|
||||||
|
precipMm.value = DEFAULT_PRECIP_MM
|
||||||
|
holiday.value = false
|
||||||
|
comparisonBase.value = null
|
||||||
|
comparisonError.value = ''
|
||||||
|
void run()
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<div class="min-h-dvh flex flex-col">
|
||||||
|
<main class="w-full flex-1 pt-16 bg-[#081723]">
|
||||||
|
<div class="max-w-[1200px] w-full mx-auto px-margin-desktop py-space-2xl flex flex-col gap-space-2xl">
|
||||||
|
<header class="flex flex-col gap-space-sm max-w-3xl">
|
||||||
|
<div class="flex flex-wrap items-center gap-space-sm">
|
||||||
|
<span class="font-label-sm text-[11px] leading-none tracking-[0.12em] text-[#00C3CD] uppercase font-semibold">
|
||||||
|
Section 04 / Interactive simulation
|
||||||
|
</span>
|
||||||
|
<span class="w-1.5 h-1.5 rounded-full bg-[#334e68]"></span>
|
||||||
|
<span class="inline-flex items-center gap-1.5 rounded-full bg-[#00C3CD]/10 border border-[#00C3CD]/25 px-2.5 py-1 font-label-sm text-[10px] leading-none text-[#00C3CD]">
|
||||||
|
<span class="w-1.5 h-1.5 rounded-full bg-[#00C3CD] animate-pulse"></span>
|
||||||
|
Live model inference
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<h1 class="text-[32px] leading-[38px] sm:text-[44px] sm:leading-[50px] tracking-[-0.03em] font-semibold text-[#FFFFFF]">
|
||||||
|
Run the engine yourself.
|
||||||
|
</h1>
|
||||||
|
<p class="font-body-lg text-[16px] leading-relaxed text-[#94A3B8]">
|
||||||
|
Pick a sensor, horizon and scenario, then override the weather. Every point, band,
|
||||||
|
peak and version below is returned by the live forecast API or computed from its points.
|
||||||
|
</p>
|
||||||
|
</header>
|
||||||
|
|
||||||
|
<div class="grid grid-cols-1 lg:grid-cols-12 gap-gutter-desktop items-start">
|
||||||
|
<!-- Controls -->
|
||||||
|
<section
|
||||||
|
aria-labelledby="playground-controls-heading"
|
||||||
|
class="lg:col-span-4 min-w-0 flex flex-col gap-space-lg bg-[#0e2233] border border-[#1e3a52] rounded-xl p-space-lg shadow-sm"
|
||||||
|
>
|
||||||
|
<div class="flex items-center justify-between gap-2">
|
||||||
|
<div class="flex items-center gap-2 min-w-0">
|
||||||
|
<Icon name="material-symbols:tune" class="text-[20px] text-[#00C3CD] shrink-0" />
|
||||||
|
<h2 id="playground-controls-heading" class="font-headline-sm text-[16px] text-[#FFFFFF] font-semibold">
|
||||||
|
Simulation controls
|
||||||
|
</h2>
|
||||||
|
</div>
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
class="inline-flex items-center gap-1 font-label-sm text-[11px] text-[#94A3B8] hover:text-[#00C3CD] transition-colors disabled:opacity-50"
|
||||||
|
:disabled="loading"
|
||||||
|
@click="resetDefaults"
|
||||||
|
>
|
||||||
|
<Icon name="material-symbols:restart-alt" class="text-[15px]" />
|
||||||
|
Reset defaults
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<p v-if="sensorsMessage" class="text-[10px] leading-snug text-[#fbbf24]">
|
||||||
|
{{ sensorsMessage }} Using {{ sensorId }}.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<div class="flex flex-col gap-space-md">
|
||||||
|
<div class="flex flex-col gap-1.5">
|
||||||
|
<label for="playground-sensor" class="font-label-sm text-[11px] text-[#94A3B8] uppercase tracking-wider">
|
||||||
|
Sensor
|
||||||
|
</label>
|
||||||
|
<select
|
||||||
|
id="playground-sensor"
|
||||||
|
v-model="sensorId"
|
||||||
|
class="w-full h-10 rounded-lg bg-[#132b40] border border-[#1e3a52] px-3 font-body-md text-[13px] text-[#FFFFFF] focus:outline-none focus:border-[#00C3CD] focus:ring-1 focus:ring-[#00C3CD] [color-scheme:dark]"
|
||||||
|
>
|
||||||
|
<option
|
||||||
|
v-for="sensor in sensors ?? []"
|
||||||
|
:key="sensor.id"
|
||||||
|
:value="sensor.id"
|
||||||
|
>
|
||||||
|
{{ sensor.name }}
|
||||||
|
</option>
|
||||||
|
<option v-if="!sensors?.length" :value="DEFAULT_SENSOR">
|
||||||
|
{{ DEFAULT_SENSOR }}
|
||||||
|
</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<fieldset class="flex flex-col gap-1.5">
|
||||||
|
<legend class="font-label-sm text-[11px] text-[#94A3B8] uppercase tracking-wider mb-1.5">
|
||||||
|
Horizon
|
||||||
|
</legend>
|
||||||
|
<div class="grid grid-cols-4 gap-1 bg-[#081723] p-1 rounded-lg border border-[#1e3a52]">
|
||||||
|
<button
|
||||||
|
v-for="option in HORIZON_OPTIONS"
|
||||||
|
:key="option"
|
||||||
|
type="button"
|
||||||
|
class="py-1.5 rounded font-label-sm text-[11px] transition-all focus:outline-none focus-visible:ring-1 focus-visible:ring-[#00C3CD]"
|
||||||
|
:class="
|
||||||
|
horizon === option
|
||||||
|
? 'bg-[#132b40] text-[#00C3CD] font-semibold border border-[#00C3CD]/30'
|
||||||
|
: 'text-[#94A3B8] hover:text-[#FFFFFF] border border-transparent'
|
||||||
|
"
|
||||||
|
:aria-pressed="horizon === option"
|
||||||
|
@click="horizon = option"
|
||||||
|
>
|
||||||
|
{{ option }}
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</fieldset>
|
||||||
|
|
||||||
|
<div class="flex flex-col gap-1.5">
|
||||||
|
<label for="playground-scenario" class="font-label-sm text-[11px] text-[#94A3B8] uppercase tracking-wider">
|
||||||
|
Scenario
|
||||||
|
</label>
|
||||||
|
<select
|
||||||
|
id="playground-scenario"
|
||||||
|
v-model="scenario"
|
||||||
|
class="w-full h-10 rounded-lg bg-[#132b40] border border-[#1e3a52] px-3 font-body-md text-[13px] text-[#FFFFFF] focus:outline-none focus:border-[#00C3CD] focus:ring-1 focus:ring-[#00C3CD] [color-scheme:dark]"
|
||||||
|
>
|
||||||
|
<option v-for="preset in presetList" :key="preset.id" :value="preset.id">
|
||||||
|
{{ preset.label }}
|
||||||
|
</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="flex flex-col gap-2 bg-[#132b40] border border-[#1e3a52] p-space-md rounded-lg">
|
||||||
|
<div class="flex items-center justify-between gap-2">
|
||||||
|
<label for="playground-temp-toggle" class="inline-flex items-center gap-2 font-label-sm text-[11px] text-[#94A3B8] cursor-pointer">
|
||||||
|
<input
|
||||||
|
id="playground-temp-toggle"
|
||||||
|
v-model="tempOverride"
|
||||||
|
type="checkbox"
|
||||||
|
class="h-4 w-4 accent-[#00C3CD] rounded border-[#1e3a52]"
|
||||||
|
/>
|
||||||
|
Override temperature
|
||||||
|
</label>
|
||||||
|
<span class="font-tabular-stat-md text-[13px] font-semibold text-[#00C3CD]">
|
||||||
|
{{ tempOverride ? `${tempC}°C` : 'Forecast' }}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<input
|
||||||
|
v-model.number="tempC"
|
||||||
|
type="range"
|
||||||
|
min="10"
|
||||||
|
max="35"
|
||||||
|
step="1"
|
||||||
|
:disabled="!tempOverride"
|
||||||
|
class="w-full h-1.5 accent-[#00C3CD] cursor-pointer disabled:opacity-35 disabled:cursor-not-allowed"
|
||||||
|
aria-label="Temperature override in degrees Celsius"
|
||||||
|
/>
|
||||||
|
<p class="text-[10px] leading-snug text-[#64748B]">
|
||||||
|
When off, the API uses its baked hourly weather forecast.
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="flex flex-col gap-2 bg-[#132b40] border border-[#1e3a52] p-space-md rounded-lg">
|
||||||
|
<div class="flex items-center justify-between gap-2">
|
||||||
|
<label for="playground-rain-toggle" class="inline-flex items-center gap-2 font-label-sm text-[11px] text-[#94A3B8] cursor-pointer">
|
||||||
|
<input
|
||||||
|
id="playground-rain-toggle"
|
||||||
|
v-model="precipOverride"
|
||||||
|
type="checkbox"
|
||||||
|
class="h-4 w-4 accent-[#00C3CD] rounded border-[#1e3a52]"
|
||||||
|
/>
|
||||||
|
Override rain
|
||||||
|
</label>
|
||||||
|
<span class="font-tabular-stat-md text-[13px] font-semibold text-[#00C3CD]">
|
||||||
|
{{ precipOverride ? `${precipMm} mm` : 'Forecast' }}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<input
|
||||||
|
v-model.number="precipMm"
|
||||||
|
type="range"
|
||||||
|
min="0"
|
||||||
|
max="10"
|
||||||
|
step="0.5"
|
||||||
|
:disabled="!precipOverride"
|
||||||
|
class="w-full h-1.5 accent-[#00C3CD] cursor-pointer disabled:opacity-35 disabled:cursor-not-allowed"
|
||||||
|
aria-label="Rain override in millimetres"
|
||||||
|
/>
|
||||||
|
<p class="text-[10px] leading-snug text-[#64748B]">
|
||||||
|
When off, the API uses its baked hourly weather forecast.
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<label class="inline-flex items-start gap-2 font-label-sm text-[11px] leading-snug text-[#94A3B8] cursor-pointer">
|
||||||
|
<input
|
||||||
|
v-model="holiday"
|
||||||
|
type="checkbox"
|
||||||
|
class="mt-0.5 h-4 w-4 accent-[#00C3CD] rounded border-[#1e3a52]"
|
||||||
|
/>
|
||||||
|
Force public-holiday flag
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
class="w-full h-11 px-4 rounded-lg bg-[#00C3CD] hover:bg-[#3ddae4] text-[#081723] transition-all flex items-center justify-center gap-2 font-label-md text-[13px] font-bold shadow-md active:scale-[0.99] disabled:opacity-60 disabled:cursor-wait"
|
||||||
|
:disabled="loading"
|
||||||
|
@click="run"
|
||||||
|
>
|
||||||
|
<Icon
|
||||||
|
:name="loading ? 'material-symbols:progress-activity' : 'material-symbols:bolt'"
|
||||||
|
class="text-[18px]"
|
||||||
|
:class="loading ? 'animate-spin' : ''"
|
||||||
|
/>
|
||||||
|
{{ loading ? 'Running forecast…' : 'Run forecast' }}
|
||||||
|
</button>
|
||||||
|
|
||||||
|
<p class="flex items-center gap-1.5 text-[10px] leading-snug text-[#94A3B8] border-t border-[#1e3a52]/70 pt-space-sm">
|
||||||
|
<Icon name="material-symbols:verified" class="text-[14px] text-[#00C3CD] shrink-0" />
|
||||||
|
Live model · aggregate counts · no identifiers
|
||||||
|
</p>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<!-- Results -->
|
||||||
|
<section class="lg:col-span-8 min-w-0 flex flex-col gap-space-lg">
|
||||||
|
<p class="sr-only" role="status" aria-live="polite">{{ statusMessage }}</p>
|
||||||
|
|
||||||
|
<div
|
||||||
|
v-if="loading"
|
||||||
|
class="flex items-center gap-2 rounded-lg border border-[#00C3CD]/30 bg-[#00C3CD]/[0.06] px-space-md py-2.5 text-[12px] text-[#00C3CD]"
|
||||||
|
role="status"
|
||||||
|
>
|
||||||
|
<Icon name="material-symbols:progress-activity" class="text-[16px] animate-spin shrink-0" />
|
||||||
|
Running the live forecast model…
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div
|
||||||
|
v-if="errorMessage"
|
||||||
|
class="flex items-start gap-3 rounded-lg border border-[#fbbf24]/40 bg-[#fbbf24]/10 px-space-md py-3 text-[12px] text-[#fde68a]"
|
||||||
|
role="alert"
|
||||||
|
>
|
||||||
|
<Icon name="material-symbols:error" class="text-[18px] shrink-0 mt-0.5" />
|
||||||
|
<div class="min-w-0 flex-1">
|
||||||
|
<p class="font-semibold text-[#FFFFFF]">The forecast could not be completed.</p>
|
||||||
|
<p class="mt-0.5 leading-relaxed break-words">{{ errorMessage }}</p>
|
||||||
|
<p v-if="result" class="mt-1 text-[11px] text-[#fbbf24]">
|
||||||
|
Showing the last successful run below.
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
class="shrink-0 h-8 px-3 rounded-lg border border-[#fbbf24]/40 text-[11px] font-semibold text-[#FFFFFF] hover:bg-[#fbbf24]/20 transition-colors"
|
||||||
|
:disabled="loading"
|
||||||
|
@click="run"
|
||||||
|
>
|
||||||
|
Retry
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div
|
||||||
|
v-if="!result && !loading"
|
||||||
|
class="flex flex-col items-center gap-2 rounded-xl border border-dashed border-[#1e3a52] bg-[#0e2233] p-space-xl text-center"
|
||||||
|
>
|
||||||
|
<Icon name="material-symbols:cloud-off" class="text-[28px] text-[#94A3B8]" />
|
||||||
|
<p class="font-headline-sm text-[15px] text-[#FFFFFF]">No forecast available</p>
|
||||||
|
<p class="max-w-md text-[12px] leading-relaxed text-[#94A3B8]">
|
||||||
|
Start the Go and Python services, then retry. The page never substitutes demo
|
||||||
|
numbers for an unavailable model.
|
||||||
|
</p>
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
class="mt-1 h-9 px-4 rounded-lg bg-[#00C3CD] text-[#081723] font-label-md text-[12px] font-bold"
|
||||||
|
@click="run"
|
||||||
|
>
|
||||||
|
Try again
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<template v-if="result">
|
||||||
|
<!-- Result summary -->
|
||||||
|
<article class="relative overflow-hidden rounded-xl border border-[#1e3a52] bg-[#0e2233] p-space-lg shadow-sm flex flex-col gap-space-md">
|
||||||
|
<div class="absolute inset-y-0 left-0 w-1.5 bg-[#00C3CD]"></div>
|
||||||
|
<div class="flex flex-col gap-2 pl-2 sm:flex-row sm:items-start sm:justify-between">
|
||||||
|
<div class="min-w-0">
|
||||||
|
<p class="font-label-sm text-[10px] uppercase tracking-wider text-[#00C3CD] font-semibold">
|
||||||
|
Selected forecast
|
||||||
|
</p>
|
||||||
|
<h2 class="font-headline-lg text-[24px] leading-[30px] tracking-tight text-[#FFFFFF] font-semibold mt-0.5 break-words">
|
||||||
|
{{ resultSensorName }}
|
||||||
|
</h2>
|
||||||
|
<div class="mt-1.5 flex flex-wrap items-center gap-1.5">
|
||||||
|
<span class="rounded bg-[#132b40] border border-[#1e3a52] px-2 py-0.5 text-[10px] text-[#FFFFFF] font-semibold">
|
||||||
|
{{ scenarioLabel(result.scenario) }}
|
||||||
|
</span>
|
||||||
|
<span class="rounded bg-[#132b40] border border-[#1e3a52] px-2 py-0.5 text-[10px] text-[#94A3B8] font-semibold">
|
||||||
|
{{ result.horizon }}
|
||||||
|
</span>
|
||||||
|
<span
|
||||||
|
class="inline-flex items-center gap-1 rounded border px-2 py-0.5 text-[10px] font-semibold"
|
||||||
|
:class="
|
||||||
|
result.weather_source === 'override'
|
||||||
|
? 'border-[#00C3CD]/35 bg-[#00C3CD]/10 text-[#00C3CD]'
|
||||||
|
: 'border-[#1e3a52] bg-[#132b40] text-[#94A3B8]'
|
||||||
|
"
|
||||||
|
>
|
||||||
|
<Icon
|
||||||
|
:name="result.weather_source === 'override' ? 'material-symbols:water-drop' : 'material-symbols:partly-cloudy-day'"
|
||||||
|
class="text-[13px]"
|
||||||
|
/>
|
||||||
|
{{ weatherSourceLabel }}
|
||||||
|
</span>
|
||||||
|
<span
|
||||||
|
v-if="holidayForced"
|
||||||
|
class="rounded border border-[#1e3a52] bg-[#132b40] px-2 py-0.5 text-[10px] text-[#94A3B8] font-semibold"
|
||||||
|
>
|
||||||
|
Holiday flag forced
|
||||||
|
</span>
|
||||||
|
<span
|
||||||
|
v-if="interpolated"
|
||||||
|
class="rounded border border-[#1e3a52] bg-[#132b40] px-2 py-0.5 text-[10px] text-[#94A3B8] font-semibold"
|
||||||
|
>
|
||||||
|
Interpolated from hourly model
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="shrink-0 rounded-lg border border-[#1e3a52] bg-[#132b40] px-3 py-2">
|
||||||
|
<p class="font-label-sm text-[9px] uppercase tracking-wider text-[#94A3B8]">Peak band</p>
|
||||||
|
<p class="font-tabular-stat-md text-[16px] text-[#00C3CD] font-semibold mt-0.5">
|
||||||
|
{{ formatBand(summary.peak?.lo, summary.peak?.hi) }}
|
||||||
|
</p>
|
||||||
|
<p class="text-[9px] text-[#64748B]">devices/hour</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div v-if="result.points.length" class="grid grid-cols-2 lg:grid-cols-4 gap-space-sm pl-2">
|
||||||
|
<div class="flex flex-col rounded-lg border border-[#1e3a52] bg-[#132b40] px-3 py-2">
|
||||||
|
<span class="font-label-sm text-[10px] text-[#94A3B8]">Peak estimate</span>
|
||||||
|
<span class="font-tabular-stat-md text-[18px] text-[#FFFFFF] font-semibold mt-0.5">
|
||||||
|
{{ summary.peak ? formatNumber(summary.peak.v) : '—' }}
|
||||||
|
</span>
|
||||||
|
<span class="text-[10px] text-[#64748B]">devices/hour</span>
|
||||||
|
<span class="mt-1 text-[10px] text-[#00C3CD]">
|
||||||
|
{{ summary.peak ? formatDateTime(summary.peak.t) : 'No points' }}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<div class="flex flex-col rounded-lg border border-[#1e3a52] bg-[#132b40] px-3 py-2">
|
||||||
|
<span class="font-label-sm text-[10px] text-[#94A3B8]">Mean estimate</span>
|
||||||
|
<span class="font-tabular-stat-md text-[18px] text-[#FFFFFF] font-semibold mt-0.5">
|
||||||
|
{{ formatNumber(summary.mean) }}
|
||||||
|
</span>
|
||||||
|
<span class="text-[10px] text-[#64748B]">devices/hour</span>
|
||||||
|
<span class="mt-1 text-[10px] text-[#64748B]">{{ summary.count }} points</span>
|
||||||
|
</div>
|
||||||
|
<div class="flex flex-col rounded-lg border border-[#1e3a52] bg-[#132b40] px-3 py-2">
|
||||||
|
<span class="font-label-sm text-[10px] text-[#94A3B8]">Modeled device-hours</span>
|
||||||
|
<span class="font-tabular-stat-md text-[18px] text-[#FFFFFF] font-semibold mt-0.5">
|
||||||
|
{{ formatNumber(Math.round(summary.total)) }}
|
||||||
|
</span>
|
||||||
|
<span class="text-[10px] text-[#64748B]">aggregate estimate</span>
|
||||||
|
<span class="mt-1 text-[10px] text-[#64748B]">
|
||||||
|
Σ v × {{ summary.intervalHours }} h
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<div class="flex flex-col rounded-lg border border-[#1e3a52] bg-[#132b40] px-3 py-2">
|
||||||
|
<span class="font-label-sm text-[10px] text-[#94A3B8]">Peak 80% band</span>
|
||||||
|
<span class="font-tabular-stat-md text-[18px] text-[#00C3CD] font-semibold mt-0.5">
|
||||||
|
{{ formatBand(summary.peak?.lo, summary.peak?.hi) }}
|
||||||
|
</span>
|
||||||
|
<span class="text-[10px] text-[#64748B]">devices/hour</span>
|
||||||
|
<span class="mt-1 text-[10px] text-[#64748B]">empirical residual range</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<p v-else class="pl-2 text-[12px] text-[#fbbf24]">
|
||||||
|
The API returned no points for this run. Change an input and try again.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<div class="grid grid-cols-1 sm:grid-cols-3 gap-2 border-t border-[#1e3a52]/70 pt-space-sm pl-2">
|
||||||
|
<div class="min-w-0">
|
||||||
|
<p class="font-label-sm text-[9px] uppercase tracking-wider text-[#94A3B8]">Model version</p>
|
||||||
|
<p class="mt-0.5 font-mono text-[10px] leading-snug text-[#FFFFFF] break-all">
|
||||||
|
{{ result.model_version || '—' }}
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
<div class="min-w-0">
|
||||||
|
<p class="font-label-sm text-[9px] uppercase tracking-wider text-[#94A3B8]">Data version</p>
|
||||||
|
<p class="mt-0.5 font-mono text-[10px] leading-snug text-[#FFFFFF] break-all">
|
||||||
|
{{ result.data_version || '—' }}
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
<div class="min-w-0">
|
||||||
|
<p class="font-label-sm text-[9px] uppercase tracking-wider text-[#94A3B8]">Context version</p>
|
||||||
|
<p class="mt-0.5 font-mono text-[10px] leading-snug text-[#FFFFFF] break-all">
|
||||||
|
{{ result.context_version || '—' }}
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</article>
|
||||||
|
|
||||||
|
<!-- Chart -->
|
||||||
|
<article class="rounded-xl border border-[#1e3a52] bg-[#0e2233] p-space-lg shadow-sm flex flex-col gap-space-md min-w-0">
|
||||||
|
<div class="flex flex-col gap-2 sm:flex-row sm:items-start sm:justify-between">
|
||||||
|
<div>
|
||||||
|
<h2 class="font-headline-sm text-[16px] text-[#FFFFFF] font-semibold">
|
||||||
|
Forecast with 80% band
|
||||||
|
</h2>
|
||||||
|
<p class="text-[12px] leading-relaxed text-[#94A3B8]">
|
||||||
|
Estimated devices per hour. Observed history is the last 24 hourly points
|
||||||
|
before the forecast starts.
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
<div class="flex flex-wrap items-center gap-3 font-label-sm text-[10px] text-[#94A3B8] shrink-0">
|
||||||
|
<span v-if="observedWindow.length" class="inline-flex items-center gap-1">
|
||||||
|
<span class="w-3 h-0.5 bg-[#FFFFFF]"></span>
|
||||||
|
Observed
|
||||||
|
</span>
|
||||||
|
<span class="inline-flex items-center gap-1">
|
||||||
|
<span class="w-3 h-0.5 bg-[#00C3CD]"></span>
|
||||||
|
Forecast
|
||||||
|
</span>
|
||||||
|
<span class="inline-flex items-center gap-1">
|
||||||
|
<span class="w-2.5 h-2.5 rounded-sm bg-[#00C3CD]/20 border border-[#00C3CD]/40"></span>
|
||||||
|
80% band
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="rounded-lg border border-[#1e3a52] bg-[#081723] p-2 min-w-0">
|
||||||
|
<PlaygroundChart
|
||||||
|
:observed="observedWindow"
|
||||||
|
:forecast="result.points"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<p v-if="interpolated" class="text-[10px] leading-relaxed text-[#94A3B8]">
|
||||||
|
Interpolated from hourly model. The 15m and 1h horizons are resampled, not a
|
||||||
|
native quarter-hour model.
|
||||||
|
</p>
|
||||||
|
<p v-if="observedError" class="text-[10px] leading-relaxed text-[#fbbf24]">
|
||||||
|
Observed history unavailable: {{ observedError }}
|
||||||
|
</p>
|
||||||
|
<p
|
||||||
|
v-else-if="observedPoints.length && !observedWindow.length"
|
||||||
|
class="text-[10px] leading-relaxed text-[#94A3B8]"
|
||||||
|
>
|
||||||
|
No contiguous observed hours immediately before the forecast start; showing forecast only.
|
||||||
|
</p>
|
||||||
|
</article>
|
||||||
|
|
||||||
|
<!-- Heatmap + comparison -->
|
||||||
|
<div class="grid grid-cols-1 xl:grid-cols-2 gap-space-lg items-start min-w-0">
|
||||||
|
<article class="rounded-xl border border-[#1e3a52] bg-[#0e2233] p-space-lg shadow-sm flex flex-col gap-space-sm min-w-0">
|
||||||
|
<div>
|
||||||
|
<h2 class="font-headline-sm text-[16px] text-[#FFFFFF] font-semibold">
|
||||||
|
Weekday × hour heatmap
|
||||||
|
</h2>
|
||||||
|
<p class="text-[11px] leading-relaxed text-[#94A3B8]">
|
||||||
|
Mean forecast devices/hour by local Berlin weekday and hour.
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div v-if="heatmap.rows.length" class="overflow-x-auto pb-1">
|
||||||
|
<div class="min-w-[300px] grid grid-cols-[minmax(58px,1fr)_repeat(6,minmax(32px,1fr))] gap-1 items-center">
|
||||||
|
<span class="font-label-sm text-[9px] uppercase tracking-wider text-[#64748B]">Day</span>
|
||||||
|
<span
|
||||||
|
v-for="hour in heatmap.hours"
|
||||||
|
:key="`hh-${hour}`"
|
||||||
|
class="text-center font-label-sm text-[9px] text-[#94A3B8] uppercase"
|
||||||
|
>
|
||||||
|
{{ String(hour).padStart(2, '0') }}h
|
||||||
|
</span>
|
||||||
|
|
||||||
|
<template v-for="row in heatmap.rows" :key="row.date">
|
||||||
|
<span class="flex flex-col leading-tight">
|
||||||
|
<span class="font-label-sm text-[11px] text-[#FFFFFF] font-semibold">
|
||||||
|
{{ formatWeekdayShort(row.date) }}
|
||||||
|
</span>
|
||||||
|
<span class="text-[9px] text-[#64748B]">{{ formatShortDate(row.date) }}</span>
|
||||||
|
</span>
|
||||||
|
<div
|
||||||
|
v-for="cell in row.cells"
|
||||||
|
:key="`${row.date}-${cell.hour}`"
|
||||||
|
class="h-7 rounded border flex items-center justify-center text-[10px] font-semibold"
|
||||||
|
:class="
|
||||||
|
cell.value === null
|
||||||
|
? 'border-dashed border-[#1e3a52]/70'
|
||||||
|
: 'border-[#00C3CD]/30'
|
||||||
|
"
|
||||||
|
:style="
|
||||||
|
cell.value === null
|
||||||
|
? undefined
|
||||||
|
: {
|
||||||
|
backgroundColor: `rgba(0, 195, 205, ${0.06 + cell.intensity * 0.84})`,
|
||||||
|
color: cell.intensity > 0.55 ? '#081723' : '#FFFFFF',
|
||||||
|
}
|
||||||
|
"
|
||||||
|
:aria-label="
|
||||||
|
cell.value === null
|
||||||
|
? `No forecast at ${cell.hour}:00`
|
||||||
|
: `${formatNumber(Math.round(cell.value))} devices per hour at ${cell.hour}:00`
|
||||||
|
"
|
||||||
|
>
|
||||||
|
{{ cell.value === null ? '' : formatNumber(Math.round(cell.value)) }}
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</div>
|
||||||
|
<div class="mt-2 flex items-center justify-between text-[9px] text-[#64748B]">
|
||||||
|
<span>Forecast window, not historical week 30.</span>
|
||||||
|
<span class="inline-flex items-center gap-1">
|
||||||
|
<span class="w-8 h-1.5 rounded bg-[linear-gradient(90deg,rgba(0,195,205,0.12),rgba(0,195,205,0.9))]"></span>
|
||||||
|
Low → peak
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<p v-else class="text-[12px] text-[#94A3B8]">
|
||||||
|
No forecast points to bucket for this horizon.
|
||||||
|
</p>
|
||||||
|
</article>
|
||||||
|
|
||||||
|
<article class="rounded-xl border border-[#1e3a52] bg-[#0e2233] p-space-lg shadow-sm flex flex-col gap-space-sm min-w-0">
|
||||||
|
<div>
|
||||||
|
<h2 class="font-headline-sm text-[16px] text-[#FFFFFF] font-semibold">
|
||||||
|
Scenario comparison
|
||||||
|
</h2>
|
||||||
|
<p class="text-[11px] leading-relaxed text-[#94A3B8]">
|
||||||
|
Selected scenario against base on the same sensor, horizon and weather inputs.
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<p
|
||||||
|
v-if="isBaseScenario"
|
||||||
|
class="rounded-lg border border-[#1e3a52] bg-[#132b40] px-space-md py-3 text-[12px] leading-relaxed text-[#94A3B8]"
|
||||||
|
>
|
||||||
|
Base is the reference. Choose another scenario to see a delta.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<template v-else-if="comparisonRows.length">
|
||||||
|
<div class="flex flex-col gap-space-sm">
|
||||||
|
<div
|
||||||
|
v-for="row in comparisonRows"
|
||||||
|
:key="row.label"
|
||||||
|
class="flex flex-col gap-1.5"
|
||||||
|
>
|
||||||
|
<div class="flex items-center justify-between gap-2 text-[11px]">
|
||||||
|
<span class="text-[#94A3B8]">{{ row.label }}</span>
|
||||||
|
<span class="font-semibold text-[#FFFFFF]">
|
||||||
|
{{ formatNumber(row.selected) }} vs {{ formatNumber(row.base) }}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<div class="flex flex-col gap-1">
|
||||||
|
<div class="w-full h-2 rounded-full bg-[#081723] border border-[#1e3a52] overflow-hidden">
|
||||||
|
<div
|
||||||
|
class="h-full rounded-full bg-[#00C3CD]"
|
||||||
|
:style="{ width: `${Math.max(2, (row.selected / row.max) * 100)}%` }"
|
||||||
|
></div>
|
||||||
|
</div>
|
||||||
|
<div class="w-full h-2 rounded-full bg-[#081723] border border-[#1e3a52] overflow-hidden">
|
||||||
|
<div
|
||||||
|
class="h-full rounded-full bg-[#64748B]"
|
||||||
|
:style="{ width: `${Math.max(2, (row.base / row.max) * 100)}%` }"
|
||||||
|
></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="flex items-center justify-between gap-2 text-[10px]">
|
||||||
|
<span class="text-[#00C3CD]">Selected</span>
|
||||||
|
<span class="text-[#94A3B8]">Base</span>
|
||||||
|
<span
|
||||||
|
class="rounded border border-[#00C3CD]/30 bg-[#00C3CD]/10 px-1.5 py-0.5 font-semibold text-[#00C3CD]"
|
||||||
|
>
|
||||||
|
Δ {{ signed(row.delta) }} ({{ row.pct === null ? '—' : signed(row.pct, '%') }})
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<p class="text-[10px] leading-relaxed text-[#64748B]">
|
||||||
|
Both requests use the same weather override, so the delta isolates the
|
||||||
|
scenario event uplift. Scenario presets are assumptions, not causal estimates.
|
||||||
|
</p>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<p
|
||||||
|
v-else-if="comparisonError"
|
||||||
|
class="rounded-lg border border-[#fbbf24]/40 bg-[#fbbf24]/10 px-space-md py-2 text-[11px] leading-relaxed text-[#fde68a]"
|
||||||
|
>
|
||||||
|
Comparison unavailable: {{ comparisonError }}
|
||||||
|
</p>
|
||||||
|
<p v-else class="text-[12px] text-[#94A3B8]">
|
||||||
|
Run the forecast again to load the base comparison.
|
||||||
|
</p>
|
||||||
|
</article>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Model context -->
|
||||||
|
<article class="rounded-xl border border-[#1e3a52] bg-[#0e2233] p-space-lg shadow-sm flex flex-col gap-space-md min-w-0">
|
||||||
|
<div class="flex flex-col gap-2 sm:flex-row sm:items-start sm:justify-between">
|
||||||
|
<div>
|
||||||
|
<h2 class="font-headline-sm text-[16px] text-[#FFFFFF] font-semibold">Model context</h2>
|
||||||
|
<p class="text-[11px] leading-relaxed text-[#94A3B8]">
|
||||||
|
Metadata reported by <code class="text-[#FFFFFF]">/api/meta</code>, not a
|
||||||
|
marketing model card.
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
<NuxtLink
|
||||||
|
to="/sensors"
|
||||||
|
class="inline-flex items-center gap-1.5 font-label-sm text-[11px] text-[#00C3CD] hover:text-[#3ddae4] transition-colors"
|
||||||
|
>
|
||||||
|
<Icon name="material-symbols:shield-lock" class="text-[15px]" />
|
||||||
|
Privacy design
|
||||||
|
<Icon name="material-symbols:arrow-forward" class="text-[14px]" />
|
||||||
|
</NuxtLink>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<template v-if="meta">
|
||||||
|
<div class="grid grid-cols-1 sm:grid-cols-3 gap-2">
|
||||||
|
<div class="rounded-lg border border-[#1e3a52] bg-[#132b40] px-3 py-2 min-w-0">
|
||||||
|
<p class="font-label-sm text-[9px] uppercase tracking-wider text-[#94A3B8]">Model</p>
|
||||||
|
<p class="mt-0.5 font-mono text-[10px] text-[#FFFFFF] break-all">{{ meta.model_version }}</p>
|
||||||
|
</div>
|
||||||
|
<div class="rounded-lg border border-[#1e3a52] bg-[#132b40] px-3 py-2 min-w-0">
|
||||||
|
<p class="font-label-sm text-[9px] uppercase tracking-wider text-[#94A3B8]">Data</p>
|
||||||
|
<p class="mt-0.5 font-mono text-[10px] text-[#FFFFFF] break-all">{{ meta.data_version }}</p>
|
||||||
|
</div>
|
||||||
|
<div class="rounded-lg border border-[#1e3a52] bg-[#132b40] px-3 py-2 min-w-0">
|
||||||
|
<p class="font-label-sm text-[9px] uppercase tracking-wider text-[#94A3B8]">Context</p>
|
||||||
|
<p class="mt-0.5 font-mono text-[10px] text-[#FFFFFF] break-all">{{ meta.context_version }}</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="grid grid-cols-2 lg:grid-cols-4 gap-2">
|
||||||
|
<div class="rounded-lg border border-[#1e3a52] bg-[#132b40] px-3 py-2">
|
||||||
|
<p class="font-label-sm text-[9px] uppercase tracking-wider text-[#94A3B8]">Coverage</p>
|
||||||
|
<p class="mt-0.5 text-[12px] font-semibold text-[#FFFFFF]">{{ meta.coverage.sensors }} sensors</p>
|
||||||
|
<p class="text-[10px] text-[#64748B]">{{ meta.coverage.cadence_min }} min cadence</p>
|
||||||
|
<p class="mt-0.5 text-[9px] leading-snug text-[#64748B]">
|
||||||
|
{{ formatDate(meta.coverage.from) }} – {{ formatDate(meta.coverage.to) }}
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
<div class="rounded-lg border border-[#1e3a52] bg-[#132b40] px-3 py-2">
|
||||||
|
<p class="font-label-sm text-[9px] uppercase tracking-wider text-[#94A3B8]">MAE</p>
|
||||||
|
<p class="mt-0.5 text-[12px] font-semibold text-[#FFFFFF]">{{ formatNumber(meta.metrics.mae) }}</p>
|
||||||
|
<p class="text-[10px] text-[#64748B]">vs {{ formatNumber(meta.metrics.baseline_mae) }} baseline</p>
|
||||||
|
<p class="mt-0.5 text-[9px] text-[#64748B]">Holdout, devices/hour</p>
|
||||||
|
</div>
|
||||||
|
<div class="rounded-lg border border-[#1e3a52] bg-[#132b40] px-3 py-2">
|
||||||
|
<p class="font-label-sm text-[9px] uppercase tracking-wider text-[#94A3B8]">WAPE</p>
|
||||||
|
<p class="mt-0.5 text-[12px] font-semibold text-[#FFFFFF]">{{ formatPercent(meta.metrics.wape, 1) }}</p>
|
||||||
|
<p class="text-[10px] text-[#64748B]">vs {{ formatPercent(meta.metrics.baseline_wape, 1) }} baseline</p>
|
||||||
|
<p class="mt-0.5 text-[9px] text-[#64748B]">Holdout, lower is better</p>
|
||||||
|
</div>
|
||||||
|
<div class="rounded-lg border border-[#1e3a52] bg-[#132b40] px-3 py-2">
|
||||||
|
<p class="font-label-sm text-[9px] uppercase tracking-wider text-[#94A3B8]">R²</p>
|
||||||
|
<p class="mt-0.5 text-[12px] font-semibold text-[#FFFFFF]">{{ meta.metrics.r2.toFixed(3) }}</p>
|
||||||
|
<p class="text-[10px] text-[#64748B]">Holdout fit</p>
|
||||||
|
<p class="mt-0.5 text-[9px] text-[#64748B]">{{ meta.metrics.model }} model</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div v-if="meta.limits?.length" class="flex flex-col gap-1">
|
||||||
|
<p class="font-label-sm text-[9px] uppercase tracking-wider text-[#94A3B8]">Known limits</p>
|
||||||
|
<ul class="flex flex-col gap-1">
|
||||||
|
<li
|
||||||
|
v-for="limit in meta.limits"
|
||||||
|
:key="limit"
|
||||||
|
class="flex items-start gap-1.5 text-[10px] leading-snug text-[#94A3B8]"
|
||||||
|
>
|
||||||
|
<Icon name="material-symbols:info" class="text-[12px] text-[#00C3CD] shrink-0 mt-0.5" />
|
||||||
|
{{ limit }}
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<div v-else class="flex items-center justify-between gap-3 rounded-lg border border-[#1e3a52] bg-[#132b40] px-space-md py-3">
|
||||||
|
<p class="text-[11px] leading-relaxed text-[#94A3B8]">
|
||||||
|
{{ metaErrorMessage || 'Model metadata is unavailable.' }}
|
||||||
|
</p>
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
class="shrink-0 h-8 px-3 rounded-lg border border-[#1e3a52] text-[11px] font-semibold text-[#FFFFFF] hover:border-[#00C3CD] transition-colors disabled:opacity-50"
|
||||||
|
:disabled="metaPending"
|
||||||
|
@click="refreshMeta()"
|
||||||
|
>
|
||||||
|
{{ metaPending ? 'Loading…' : 'Retry' }}
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</article>
|
||||||
|
|
||||||
|
<!-- Transparency -->
|
||||||
|
<article class="rounded-xl border border-[#1e3a52] bg-[#0e2233] p-space-md flex items-start gap-space-sm">
|
||||||
|
<Icon name="material-symbols:verified" class="text-[20px] text-[#00C3CD] shrink-0 mt-0.5" />
|
||||||
|
<div class="flex flex-col gap-1">
|
||||||
|
<h2 class="font-headline-sm text-[13px] text-[#FFFFFF] font-semibold">
|
||||||
|
What this forecast is, and is not
|
||||||
|
</h2>
|
||||||
|
<p class="text-[11px] leading-relaxed text-[#94A3B8]">
|
||||||
|
Aggregate estimated-device counts, not people. Eight sensors in a ~580 m
|
||||||
|
inner-city cluster. Weather is observed in training and forecast in this demo.
|
||||||
|
Scenario uplifts are explicit assumptions, not causal estimates. The 80% bands
|
||||||
|
are empirical residuals, not calibrated guarantees.
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</article>
|
||||||
|
</template>
|
||||||
|
</section>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</main>
|
||||||
|
|
||||||
|
<footer class="mt-auto w-full bg-[#081723] border-t border-[#1e3a52]/50 py-3">
|
||||||
|
<div class="max-w-[1200px] mx-auto px-margin-desktop flex flex-col sm:flex-row items-center justify-between gap-1 sm:gap-space-lg text-[11px] font-body-sm text-[#94A3B8] opacity-50 hover:opacity-100 transition-opacity duration-200">
|
||||||
|
<span>© 2026 Schwarz Digits · Privacy by design</span>
|
||||||
|
<span>Aggregate counts · No identifiers</span>
|
||||||
|
</div>
|
||||||
|
</footer>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
@@ -0,0 +1,394 @@
|
|||||||
|
<script setup lang="ts">
|
||||||
|
const tiers = [
|
||||||
|
{
|
||||||
|
id: 'tier-1',
|
||||||
|
tier: 'Tier 01',
|
||||||
|
status: 'Weak',
|
||||||
|
statusTone: 'muted',
|
||||||
|
title: 'Bluetooth & Wi-Fi Sniffing',
|
||||||
|
subtitle: 'Hardware probe-frame capture',
|
||||||
|
analogy: '“Like a doorman writing down every single phone’s name tag.”',
|
||||||
|
mechanism: 'MAC address capture, beacon probes, RSSI vector trilateration.',
|
||||||
|
tradeoff:
|
||||||
|
'Accurate, but inherently identifies individual devices. Fragile; permanently breaks with contemporary iOS/Android randomized MAC protocols.',
|
||||||
|
footerStatus: 'PROHIBITED BY POLICY',
|
||||||
|
footerNote: 'Deprecated for internal retail and logistical operations.',
|
||||||
|
footerIcon: 'material-symbols:cancel',
|
||||||
|
footerTone: 'muted',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 'tier-2',
|
||||||
|
tier: 'Tier 02',
|
||||||
|
status: 'Marginal',
|
||||||
|
statusTone: 'muted',
|
||||||
|
title: 'Hashed Device IDs',
|
||||||
|
subtitle: 'Pseudonymized tracking tokens',
|
||||||
|
analogy: '“Like swapping the name tag for a scrambled secret number.”',
|
||||||
|
mechanism: 'SHA-256 salted MAC strings, rotating pseudonym tokens.',
|
||||||
|
tradeoff:
|
||||||
|
'Slightly better than raw plaintext, yet persistently linkable over time and prone to rainbow-table cross-correlation attacks.',
|
||||||
|
footerStatus: 'LEGACY COMPLIANCE ONLY',
|
||||||
|
footerNote: 'Pseudonymous data remains personal data under GDPR; a documented legal basis is required.',
|
||||||
|
footerIcon: 'material-symbols:warning',
|
||||||
|
footerTone: 'muted',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 'tier-3',
|
||||||
|
tier: 'Tier 03',
|
||||||
|
status: 'Good',
|
||||||
|
statusTone: 'muted',
|
||||||
|
title: 'Edge Optical Counting',
|
||||||
|
subtitle: 'Localized discrete increment gates',
|
||||||
|
analogy: '“Like a physical turnstile that strictly tallies +1 or −1.”',
|
||||||
|
mechanism:
|
||||||
|
'On-chip break-beam or overhead pixel delta calculates an integer, discarding video buffers immediately in volatile RAM.',
|
||||||
|
tradeoff:
|
||||||
|
'Only integer totals exit the perimeter. Lacks granular continuous path routing, zone dwell metrics, and queuing velocity.',
|
||||||
|
footerStatus: 'PERMITTED FOR GATES',
|
||||||
|
footerNote: 'Local counts only; no video buffers leave the device.',
|
||||||
|
footerIcon: 'material-symbols:check-circle',
|
||||||
|
footerTone: 'accent',
|
||||||
|
},
|
||||||
|
] as const
|
||||||
|
|
||||||
|
// On phones the privacy spectrum reads best-to-worst, so the recommended
|
||||||
|
// Tier 4 card comes first. Desktop keeps the original left-to-right order.
|
||||||
|
const tierMobileOrder = ['order-4', 'order-3', 'order-2'] as const
|
||||||
|
|
||||||
|
const comparisonRows = [
|
||||||
|
{
|
||||||
|
tier: 'Tier 1: Sniffing',
|
||||||
|
pii: 'Critical (device MAC)',
|
||||||
|
consent: 'Explicit opt-in required',
|
||||||
|
retargeting: 'Trivial / persistent',
|
||||||
|
audit: 'Not permitted',
|
||||||
|
recommended: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
tier: 'Tier 2: Pseudonyms',
|
||||||
|
pii: 'High (re-identification risk)',
|
||||||
|
consent: 'Legal basis required',
|
||||||
|
retargeting: 'Possible via correlation',
|
||||||
|
audit: 'Complex',
|
||||||
|
recommended: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
tier: 'Tier 3: Edge Optical',
|
||||||
|
pii: 'Low (ephemeral video)',
|
||||||
|
consent: 'Legal basis required',
|
||||||
|
retargeting: 'Not possible (no tokens)',
|
||||||
|
audit: 'Reviewable',
|
||||||
|
recommended: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
tier: 'Tier 4: Pulse Engine',
|
||||||
|
pii: 'None by design',
|
||||||
|
consent: 'Designed to avoid identifiers',
|
||||||
|
retargeting: 'Not possible by design',
|
||||||
|
audit: 'Documented',
|
||||||
|
recommended: true,
|
||||||
|
},
|
||||||
|
] as const
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<div class="min-h-dvh flex flex-col">
|
||||||
|
<main class="w-full flex-1 pt-16 bg-[#081723]">
|
||||||
|
<div class="max-w-[1200px] w-full mx-auto px-margin-desktop py-space-2xl flex flex-col gap-space-2xl">
|
||||||
|
<!-- Header Section -->
|
||||||
|
<div class="flex flex-col gap-space-sm max-w-3xl">
|
||||||
|
<div class="flex flex-wrap items-center gap-space-sm">
|
||||||
|
<span class="font-label-sm text-[11px] leading-none tracking-[0.12em] text-[#00C3CD] uppercase font-semibold">
|
||||||
|
Section 02 / Privacy Spectrum
|
||||||
|
</span>
|
||||||
|
<span class="w-1.5 h-1.5 rounded-full bg-[#334e68]"></span>
|
||||||
|
<span class="font-label-sm text-[11px] leading-none text-[#94A3B8]">Design target</span>
|
||||||
|
</div>
|
||||||
|
<h1 class="text-[32px] leading-[38px] sm:text-[44px] sm:leading-[50px] tracking-[-0.03em] font-semibold text-[#FFFFFF]">
|
||||||
|
Sensing options: from naive tracking to privacy-first.
|
||||||
|
</h1>
|
||||||
|
<p class="font-body-lg text-[16px] leading-relaxed text-[#94A3B8]">
|
||||||
|
Why Schwarz Digits rejects device identifiers and adopts mathematical privacy by design.
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Privacy Gradient Visual Meter -->
|
||||||
|
<section
|
||||||
|
aria-label="Privacy spectrum from invasive tracking to privacy by design"
|
||||||
|
class="flex flex-col gap-space-sm bg-[#0e2233] p-space-lg rounded-xl border border-[#1e3a52] shadow-lg"
|
||||||
|
>
|
||||||
|
<div class="flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between font-label-sm text-[11px]">
|
||||||
|
<div class="flex items-center gap-1.5 text-[#94A3B8] font-semibold">
|
||||||
|
<Icon name="material-symbols:warning" class="text-[16px] text-[#94A3B8] shrink-0" />
|
||||||
|
<span class="text-[#FFFFFF] uppercase tracking-wide">High privacy risk / Invasive</span>
|
||||||
|
</div>
|
||||||
|
<div class="flex items-center gap-2 text-[#94A3B8] font-medium">
|
||||||
|
<Icon name="material-symbols:tune" class="text-[16px] text-[#00C3CD] shrink-0" />
|
||||||
|
<span class="tracking-wide text-[#94A3B8] uppercase">Mathematical privacy horizon · Design target</span>
|
||||||
|
</div>
|
||||||
|
<div class="flex items-center gap-1.5 text-[#00C3CD] font-semibold">
|
||||||
|
<Icon name="material-symbols:verified-user" class="text-[16px] text-[#00C3CD] shrink-0" />
|
||||||
|
<span class="text-[#FFFFFF] uppercase tracking-wide">No identifiers / Privacy by design</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Continuous Spectrum Bar -->
|
||||||
|
<div class="relative w-full h-3 rounded-full overflow-hidden bg-[#081723] border border-[#1e3a52]">
|
||||||
|
<div class="absolute inset-0 rounded-full bg-[linear-gradient(90deg,#1e3a52_0%,#2d4d6a_35%,#105569_65%,#00C3CD_100%)]"></div>
|
||||||
|
<!-- Indicator ticks for each tier -->
|
||||||
|
<div class="absolute inset-0 grid grid-cols-4 pointer-events-none">
|
||||||
|
<div class="border-r border-[#081723] h-full flex items-center justify-end pr-2">
|
||||||
|
<span class="w-1.5 h-1.5 rounded-full bg-[#94A3B8] shadow-sm"></span>
|
||||||
|
</div>
|
||||||
|
<div class="border-r border-[#081723] h-full flex items-center justify-end pr-2">
|
||||||
|
<span class="w-1.5 h-1.5 rounded-full bg-[#94A3B8] shadow-sm"></span>
|
||||||
|
</div>
|
||||||
|
<div class="border-r border-[#081723] h-full flex items-center justify-end pr-2">
|
||||||
|
<span class="w-1.5 h-1.5 rounded-full bg-[#94A3B8] shadow-sm"></span>
|
||||||
|
</div>
|
||||||
|
<div class="h-full flex items-center justify-end pr-3">
|
||||||
|
<span class="relative flex h-2.5 w-2.5">
|
||||||
|
<span class="absolute inline-flex h-full w-full animate-ping rounded-full bg-[#00C3CD] opacity-75"></span>
|
||||||
|
<span class="relative inline-flex h-2.5 w-2.5 rounded-full bg-[#00C3CD] shadow-[0_0_10px_#00C3CD]"></span>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="grid grid-cols-2 sm:grid-cols-4 gap-2 pt-1 text-left sm:text-center font-label-sm text-[10px] sm:text-[11px] text-[#94A3B8]">
|
||||||
|
<span>Tier 1 · Proximity Sniffing</span>
|
||||||
|
<span>Tier 2 · Pseudonymized Hashes</span>
|
||||||
|
<span>Tier 3 · Edge Counting</span>
|
||||||
|
<span class="text-[#00C3CD] font-semibold">Tier 4 · Differential Spatial Radar</span>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<!-- 4 Tiers Comparison Grid -->
|
||||||
|
<section aria-label="Sensing architecture tiers" class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-gutter-desktop items-stretch">
|
||||||
|
<h2 class="sr-only">Sensing architecture tiers</h2>
|
||||||
|
<!-- TIER 1 -->
|
||||||
|
<article
|
||||||
|
v-for="(tier, index) in tiers"
|
||||||
|
:key="tier.id"
|
||||||
|
class="flex flex-col bg-[#0e2233] border border-[#1e3a52] rounded-xl p-space-lg shadow-sm hover:border-[#334e68] transition-all relative overflow-hidden"
|
||||||
|
:class="[tierMobileOrder[index], 'md:order-none']"
|
||||||
|
>
|
||||||
|
<div class="flex items-center justify-between mb-space-md">
|
||||||
|
<span class="font-label-sm text-[11px] text-[#94A3B8] uppercase tracking-wider">{{ tier.tier }}</span>
|
||||||
|
<span class="inline-flex items-center gap-1 px-2 py-0.5 rounded text-[#FFFFFF] bg-[#132b40] border border-[#1e3a52] font-label-sm text-[11px]">
|
||||||
|
<span class="w-1.5 h-1.5 rounded-full bg-[#94A3B8]"></span>
|
||||||
|
{{ tier.status }}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<h3 class="font-headline-sm text-[18px] leading-snug text-[#FFFFFF] mb-space-xs font-semibold">
|
||||||
|
{{ tier.title }}
|
||||||
|
</h3>
|
||||||
|
<p class="font-body-sm text-[13px] text-[#94A3B8] mb-space-md">{{ tier.subtitle }}</p>
|
||||||
|
|
||||||
|
<!-- Analogy Callout -->
|
||||||
|
<div class="bg-[#132b40] rounded-lg p-space-md mb-space-md border border-[#1e3a52]/60">
|
||||||
|
<span class="font-label-sm text-[10px] text-[#94A3B8] uppercase tracking-wider block mb-1">Analogy</span>
|
||||||
|
<p class="font-body-sm text-[13px] leading-relaxed text-[#FFFFFF] italic">{{ tier.analogy }}</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Mechanism -->
|
||||||
|
<div class="flex flex-col gap-1 mb-space-md">
|
||||||
|
<span class="font-label-sm text-[10px] text-[#94A3B8] uppercase tracking-wider">Mechanism</span>
|
||||||
|
<p class="font-body-sm text-[13px] leading-relaxed text-[#FFFFFF]">{{ tier.mechanism }}</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Trade-off -->
|
||||||
|
<div class="flex flex-col gap-1 mb-space-lg flex-grow">
|
||||||
|
<span class="font-label-sm text-[10px] text-[#94A3B8] uppercase tracking-wider">Trade-off</span>
|
||||||
|
<p class="font-body-sm text-[13px] leading-relaxed text-[#94A3B8]">{{ tier.tradeoff }}</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Status Footer -->
|
||||||
|
<div class="pt-space-md mt-auto bg-[#132b40]/70 -mx-space-lg -mb-space-lg px-space-lg pb-space-lg rounded-b-xl border-t border-[#1e3a52]">
|
||||||
|
<div class="flex items-center gap-1.5 text-[#FFFFFF] font-label-sm text-[11px] font-semibold">
|
||||||
|
<Icon
|
||||||
|
:name="tier.footerIcon"
|
||||||
|
class="text-[18px] shrink-0"
|
||||||
|
:class="tier.footerTone === 'accent' ? 'text-[#00C3CD]' : 'text-[#94A3B8]'"
|
||||||
|
/>
|
||||||
|
<span>{{ tier.footerStatus }}</span>
|
||||||
|
</div>
|
||||||
|
<p class="font-body-sm text-[11px] leading-snug text-[#94A3B8] mt-0.5">{{ tier.footerNote }}</p>
|
||||||
|
</div>
|
||||||
|
</article>
|
||||||
|
|
||||||
|
<!-- TIER 4 (RECOMMENDED) -->
|
||||||
|
<article class="order-1 md:order-none flex flex-col bg-[#0e2233] rounded-xl p-space-lg shadow-[0_0_30px_rgba(0,195,205,0.22)] relative overflow-hidden mt-0 md:-mt-2 lg:-mt-3 ring-2 ring-[#00C3CD] border border-[#00C3CD]">
|
||||||
|
<!-- Top Banner -->
|
||||||
|
<div class="bg-[#132b40] text-[#00C3CD] -mx-space-lg -mt-space-lg px-space-lg py-2 flex items-center justify-between gap-2 mb-space-md border-b border-[#00C3CD]/40">
|
||||||
|
<div class="flex items-center gap-1 text-[9px] font-label-sm uppercase tracking-wide font-bold whitespace-nowrap">
|
||||||
|
<Icon name="material-symbols:stars" class="text-[14px] text-[#00C3CD] shrink-0" />
|
||||||
|
<span class="text-[#00C3CD]">Pulse Engine standard</span>
|
||||||
|
</div>
|
||||||
|
<span class="bg-[#00C3CD] px-2 py-0.5 rounded text-[9px] font-label-sm uppercase tracking-wide text-[#081723] font-extrabold shadow-sm whitespace-nowrap">
|
||||||
|
Standard
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="flex items-center justify-between mb-space-sm">
|
||||||
|
<span class="font-label-sm text-[11px] text-[#00C3CD] font-bold uppercase tracking-wider">Tier 04</span>
|
||||||
|
<span class="inline-flex items-center gap-1 px-2.5 py-0.5 rounded text-[#00C3CD] bg-[#00C3CD]/15 border border-[#00C3CD]/40 font-label-sm text-[11px] font-semibold">
|
||||||
|
<span class="w-1.5 h-1.5 rounded-full bg-[#00C3CD] animate-pulse"></span>
|
||||||
|
Recommended
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<h3 class="font-headline-sm text-[18px] leading-snug text-[#FFFFFF] mb-space-xs font-bold">
|
||||||
|
Radar & Differential Spatial Mesh
|
||||||
|
</h3>
|
||||||
|
<p class="font-body-sm text-[13px] text-[#94A3B8] mb-space-md">mmWave point clouds + Laplace noise</p>
|
||||||
|
|
||||||
|
<!-- Analogy Callout -->
|
||||||
|
<div class="bg-[#132b40] rounded-lg p-space-md mb-space-md border border-[#00C3CD]/30">
|
||||||
|
<span class="font-label-sm text-[10px] text-[#00C3CD] font-semibold uppercase tracking-wider block mb-1">Analogy</span>
|
||||||
|
<p class="font-body-sm text-[13px] leading-relaxed text-[#FFFFFF] italic font-medium">
|
||||||
|
“Sees movement and cluster volume, never human beings.”
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Mechanism -->
|
||||||
|
<div class="flex flex-col gap-1 mb-space-md">
|
||||||
|
<span class="font-label-sm text-[10px] text-[#00C3CD] uppercase tracking-wider font-semibold">Mechanism</span>
|
||||||
|
<p class="font-body-sm text-[13px] leading-relaxed text-[#FFFFFF]">
|
||||||
|
Low-power 60 GHz mmWave radar and Time-of-Flight vectors aggregated with calibrated Laplace differential-privacy noise. The noise level is a design target, not a deployed parameter.
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Trade-off -->
|
||||||
|
<div class="flex flex-col gap-1 mb-space-md flex-grow">
|
||||||
|
<span class="font-label-sm text-[10px] text-[#94A3B8] uppercase tracking-wider">Trade-off</span>
|
||||||
|
<p class="font-body-sm text-[13px] leading-relaxed text-[#94A3B8]">
|
||||||
|
Strongest mathematical privacy in this comparison. The sensor is designed to avoid facial contours, device signatures, and gait biometric tokens; aggregates are not linkable by design.
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Key Technical Specs Tag Cloud -->
|
||||||
|
<div class="grid grid-cols-2 gap-1.5 mb-space-lg text-[10px] leading-tight font-label-sm">
|
||||||
|
<div class="flex items-center gap-1 bg-[#132b40] border border-[#1e3a52] p-1 rounded text-[#FFFFFF]">
|
||||||
|
<Icon name="material-symbols:videocam-off" class="text-[14px] text-[#00C3CD] shrink-0" />
|
||||||
|
<span class="truncate">Zero optics</span>
|
||||||
|
</div>
|
||||||
|
<div class="flex items-center gap-1 bg-[#132b40] border border-[#1e3a52] p-1 rounded text-[#FFFFFF]">
|
||||||
|
<Icon name="material-symbols:wifi-off" class="text-[14px] text-[#00C3CD] shrink-0" />
|
||||||
|
<span class="truncate">No sniffing</span>
|
||||||
|
</div>
|
||||||
|
<div class="flex items-center gap-1 bg-[#132b40] border border-[#1e3a52] p-1 rounded text-[#FFFFFF]">
|
||||||
|
<Icon name="material-symbols:functions" class="text-[14px] text-[#00C3CD] shrink-0" />
|
||||||
|
<span class="truncate">DP noise · target</span>
|
||||||
|
</div>
|
||||||
|
<div class="flex items-center gap-1 bg-[#132b40] border border-[#1e3a52] p-1 rounded text-[#FFFFFF]">
|
||||||
|
<Icon name="material-symbols:verified" class="text-[14px] text-[#00C3CD] shrink-0" />
|
||||||
|
<span class="truncate">No identifiers</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Status Footer -->
|
||||||
|
<div class="pt-space-md mt-auto bg-[#00C3CD]/15 -mx-space-lg -mb-space-lg px-space-lg pb-space-lg rounded-b-xl border-t border-[#00C3CD]/40">
|
||||||
|
<div class="flex items-center gap-1.5 text-[#00C3CD] font-label-sm text-[11px] font-bold">
|
||||||
|
<Icon name="material-symbols:verified-user" class="text-[18px] shrink-0" />
|
||||||
|
<span class="text-[#FFFFFF]">RECOMMENDED DEFAULT</span>
|
||||||
|
</div>
|
||||||
|
<p class="font-body-sm text-[11px] leading-snug text-[#94A3B8] mt-0.5">Aggregate counts only; no identifiers in the data path.</p>
|
||||||
|
</div>
|
||||||
|
</article>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<!-- Technical Parameter Benchmark Strip -->
|
||||||
|
<section
|
||||||
|
id="privacy-matrix"
|
||||||
|
class="bg-[#0e2233] border border-[#1e3a52] rounded-xl p-space-lg shadow-lg flex flex-col gap-space-md scroll-mt-20"
|
||||||
|
>
|
||||||
|
<div class="flex flex-col gap-1 sm:flex-row sm:items-center sm:justify-between pb-space-xs">
|
||||||
|
<h2 class="font-label-sm text-[11px] text-[#94A3B8] uppercase tracking-wider font-semibold">
|
||||||
|
Comparative Privacy & Performance Matrix
|
||||||
|
</h2>
|
||||||
|
<span class="font-label-sm text-[10px] sm:text-[11px] text-[#00C3CD] font-semibold">Design review · Not a certification</span>
|
||||||
|
</div>
|
||||||
|
<div class="overflow-x-auto">
|
||||||
|
<table class="w-full min-w-[760px] text-left font-body-sm text-[13px]">
|
||||||
|
<thead>
|
||||||
|
<tr class="bg-[#132b40] text-[#94A3B8] font-label-sm text-[10px] uppercase tracking-wider border-b border-[#1e3a52]">
|
||||||
|
<th scope="col" class="py-2.5 px-space-md text-[#FFFFFF] font-semibold">Architecture Tier</th>
|
||||||
|
<th scope="col" class="py-2.5 px-space-md font-semibold">PII Capture Risk</th>
|
||||||
|
<th scope="col" class="py-2.5 px-space-md font-semibold">Subject Consent Requirement</th>
|
||||||
|
<th scope="col" class="py-2.5 px-space-md font-semibold">Cross-Store Retargeting</th>
|
||||||
|
<th scope="col" class="py-2.5 px-space-md text-right font-semibold">Audit Feasibility</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody class="divide-y divide-[#1e3a52]">
|
||||||
|
<tr
|
||||||
|
v-for="row in comparisonRows"
|
||||||
|
:key="row.tier"
|
||||||
|
:class="row.recommended ? 'bg-[#132b40]/80 border-t-2 border-b border-[#00C3CD]/40' : ''"
|
||||||
|
>
|
||||||
|
<th
|
||||||
|
scope="row"
|
||||||
|
class="py-3 px-space-md font-semibold text-[#FFFFFF]"
|
||||||
|
:class="row.recommended ? 'font-bold' : ''"
|
||||||
|
>
|
||||||
|
<span v-if="row.recommended" class="inline-flex items-center gap-1.5">
|
||||||
|
<span class="w-2 h-2 rounded-full bg-[#00C3CD] shadow-[0_0_8px_#00C3CD]"></span>
|
||||||
|
<span class="text-[#00C3CD]">{{ row.tier }}</span>
|
||||||
|
</span>
|
||||||
|
<span v-else>{{ row.tier }}</span>
|
||||||
|
</th>
|
||||||
|
<td class="py-3 px-space-md" :class="row.recommended ? 'text-[#FFFFFF] font-semibold' : 'text-[#94A3B8]'">
|
||||||
|
{{ row.pii }}
|
||||||
|
</td>
|
||||||
|
<td class="py-3 px-space-md" :class="row.recommended ? 'text-[#FFFFFF] font-semibold' : 'text-[#94A3B8]'">
|
||||||
|
{{ row.consent }}
|
||||||
|
</td>
|
||||||
|
<td class="py-3 px-space-md" :class="row.recommended ? 'text-[#FFFFFF] font-semibold' : 'text-[#94A3B8]'">
|
||||||
|
{{ row.retargeting }}
|
||||||
|
</td>
|
||||||
|
<td
|
||||||
|
class="py-3 px-space-md text-right font-tabular-stat-md"
|
||||||
|
:class="row.recommended ? 'text-[#00C3CD] font-bold' : 'text-[#FFFFFF] font-semibold'"
|
||||||
|
>
|
||||||
|
{{ row.audit }}
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<!-- Official Schwarz Digits Governance Box -->
|
||||||
|
<section class="bg-[#0e2233] border border-[#1e3a52] rounded-xl p-space-xl shadow-lg flex flex-col md:flex-row items-center gap-space-lg relative overflow-hidden">
|
||||||
|
<div class="w-12 h-12 rounded-xl bg-[#132b40] border border-[#00C3CD]/50 flex items-center justify-center shrink-0 shadow-md">
|
||||||
|
<Icon name="material-symbols:shield-with-heart" class="text-[#00C3CD] text-[28px]" />
|
||||||
|
</div>
|
||||||
|
<div class="flex flex-col gap-1 flex-grow text-center md:text-left">
|
||||||
|
<div class="flex flex-wrap items-center justify-center md:justify-start gap-2">
|
||||||
|
<h2 class="font-headline-sm text-[18px] text-[#FFFFFF] font-semibold">Executive Privacy Commitment</h2>
|
||||||
|
<span class="px-2 py-0.5 rounded text-[11px] bg-[#132b40] text-[#00C3CD] border border-[#00C3CD]/30 font-label-sm font-semibold">Privacy by design</span>
|
||||||
|
</div>
|
||||||
|
<p class="font-body-md text-[14px] leading-relaxed text-[#94A3B8] italic max-w-4xl">
|
||||||
|
“Our engine is designed to work from aggregate spatial density — avoiding the legal and ethical liability of tracking human beings.”
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
<div class="flex items-center gap-space-md shrink-0">
|
||||||
|
<a
|
||||||
|
href="#privacy-matrix"
|
||||||
|
class="h-10 px-space-lg rounded-lg bg-[#00C3CD] text-[#081723] hover:bg-[#3ddae4] transition-all font-label-md text-[13px] flex items-center gap-2 shadow-[0_0_15px_rgba(0,195,205,0.3)] font-bold"
|
||||||
|
>
|
||||||
|
<Icon name="material-symbols:arrow-forward" class="text-[18px] text-[#081723]" />
|
||||||
|
<span>Review the comparison</span>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
</div>
|
||||||
|
</main>
|
||||||
|
|
||||||
|
<footer class="mt-auto w-full bg-[#081723] border-t border-[#1e3a52]/50 py-3">
|
||||||
|
<div class="max-w-[1200px] mx-auto px-margin-desktop flex flex-col sm:flex-row items-center justify-between gap-1 sm:gap-space-lg text-[11px] font-body-sm text-[#94A3B8] opacity-50 hover:opacity-100 transition-opacity duration-200">
|
||||||
|
<span>© 2026 Schwarz Digits · Privacy by design</span>
|
||||||
|
<span>Aggregate counts · No identifiers</span>
|
||||||
|
</div>
|
||||||
|
</footer>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
@@ -0,0 +1,305 @@
|
|||||||
|
<script setup lang="ts">
|
||||||
|
import type { CoolRouteBundle, CoolTime } from '#shared/cool'
|
||||||
|
import { pendingCoolRouteBundle } from '#shared/cool'
|
||||||
|
import type { ContextResponse, MetaResponse, ScenarioState, Sensor, StaffingResponse } from '#shared/types'
|
||||||
|
import type { UseCaseId, PrezeroBundle } from '#shared/use-cases'
|
||||||
|
import {
|
||||||
|
DEFAULT_USE_CASE,
|
||||||
|
USE_CASE_TABS,
|
||||||
|
isCoolTimeValue,
|
||||||
|
isUseCaseId,
|
||||||
|
} from '#shared/use-cases'
|
||||||
|
import LiveTelemetryBar from '~/components/use-cases/LiveTelemetryBar.vue'
|
||||||
|
import PrezeroPanel from '~/components/use-cases/PrezeroPanel.vue'
|
||||||
|
import RoutingPanel from '~/components/use-cases/RoutingPanel.vue'
|
||||||
|
import StaffingPanel from '~/components/use-cases/StaffingPanel.vue'
|
||||||
|
import UseCaseTabs from '~/components/use-cases/UseCaseTabs.vue'
|
||||||
|
|
||||||
|
interface BuildingPolygon {
|
||||||
|
name: string | null
|
||||||
|
kind: string
|
||||||
|
points: Array<[number, number]>
|
||||||
|
}
|
||||||
|
interface BuildingsBundle {
|
||||||
|
source: string
|
||||||
|
generated: string
|
||||||
|
buildings: BuildingPolygon[]
|
||||||
|
}
|
||||||
|
interface PlacePoint {
|
||||||
|
name: string | null
|
||||||
|
lat: number
|
||||||
|
lon: number
|
||||||
|
near_routes_m?: Record<string, number>
|
||||||
|
}
|
||||||
|
interface PlacesBundle {
|
||||||
|
cool_places: PlacePoint[]
|
||||||
|
water: PlacePoint[]
|
||||||
|
benches: PlacePoint[]
|
||||||
|
}
|
||||||
|
|
||||||
|
const route = useRoute()
|
||||||
|
const active = computed<UseCaseId>(() =>
|
||||||
|
isUseCaseId(route.query.uc) ? route.query.uc : DEFAULT_USE_CASE,
|
||||||
|
)
|
||||||
|
const time = computed<CoolTime>(() =>
|
||||||
|
isCoolTimeValue(route.query.t) ? route.query.t : '16:00',
|
||||||
|
)
|
||||||
|
const activeTab = computed(() => USE_CASE_TABS.find((tab) => tab.id === active.value) ?? USE_CASE_TABS[1]!)
|
||||||
|
|
||||||
|
function selectTime(value: CoolTime) {
|
||||||
|
void navigateTo({ query: { ...route.query, t: value } }, { replace: true })
|
||||||
|
}
|
||||||
|
|
||||||
|
const latency = useState<Record<string, number>>('use-cases-latency', () => ({
|
||||||
|
routing: 0,
|
||||||
|
staffing: 0,
|
||||||
|
prezero: 0,
|
||||||
|
}))
|
||||||
|
const activeLatency = computed(() => latency.value[active.value] ?? 0)
|
||||||
|
|
||||||
|
function startLatency(key: keyof typeof latency.value) {
|
||||||
|
const started = typeof performance === 'undefined' ? Date.now() : performance.now()
|
||||||
|
return () => {
|
||||||
|
const ended = typeof performance === 'undefined' ? Date.now() : performance.now()
|
||||||
|
latency.value = { ...latency.value, [key]: Math.max(1, Math.round(ended - started)) }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const { data: initialScenario } = await useFetch<ScenarioState>('/api/scenario')
|
||||||
|
const live = useLiveScenario(initialScenario.value)
|
||||||
|
|
||||||
|
let finishRouteLatency: (() => void) | undefined
|
||||||
|
const routeFetch = useFetch<CoolRouteBundle>('/cool-city/route.json', {
|
||||||
|
key: 'use-cases-route-bundle',
|
||||||
|
onRequest: () => {
|
||||||
|
finishRouteLatency = startLatency('routing')
|
||||||
|
},
|
||||||
|
onResponse: () => finishRouteLatency?.(),
|
||||||
|
})
|
||||||
|
const buildingsFetch = useFetch<BuildingsBundle>('/cool-city/buildings.json', {
|
||||||
|
key: 'use-cases-buildings',
|
||||||
|
})
|
||||||
|
const placesFetch = useFetch<PlacesBundle>('/cool-city/places.json', {
|
||||||
|
key: 'use-cases-places',
|
||||||
|
})
|
||||||
|
|
||||||
|
let finishPrezeroLatency: (() => void) | undefined
|
||||||
|
const prezeroFetch = useFetch<PrezeroBundle>('/prezero/priority.json', {
|
||||||
|
key: 'use-cases-prezero',
|
||||||
|
onRequest: () => {
|
||||||
|
finishPrezeroLatency = startLatency('prezero')
|
||||||
|
},
|
||||||
|
onResponse: () => finishPrezeroLatency?.(),
|
||||||
|
})
|
||||||
|
|
||||||
|
const sensorsFetch = useFetch<Sensor[]>('/api/sensors', { key: 'use-cases-sensors' })
|
||||||
|
const contextFetch = useFetch<ContextResponse>('/api/context', { key: 'use-cases-context' })
|
||||||
|
const metaFetch = useFetch<MetaResponse>('/api/meta', { key: 'use-cases-meta' })
|
||||||
|
|
||||||
|
const sensorId = ref('hn-stadtgalerie-01')
|
||||||
|
|
||||||
|
let finishPlanLatency: (() => void) | undefined
|
||||||
|
const planFetch = useFetch<StaffingResponse>('/api/staffing', {
|
||||||
|
key: 'use-cases-plan',
|
||||||
|
query: computed(() => ({
|
||||||
|
sensor: sensorId.value,
|
||||||
|
scenario: live.scenarioId,
|
||||||
|
standard: 'standard',
|
||||||
|
})),
|
||||||
|
onRequest: () => {
|
||||||
|
finishPlanLatency = startLatency('staffing')
|
||||||
|
},
|
||||||
|
onResponse: () => finishPlanLatency?.(),
|
||||||
|
})
|
||||||
|
|
||||||
|
await Promise.all([
|
||||||
|
routeFetch,
|
||||||
|
buildingsFetch,
|
||||||
|
placesFetch,
|
||||||
|
prezeroFetch,
|
||||||
|
sensorsFetch,
|
||||||
|
contextFetch,
|
||||||
|
metaFetch,
|
||||||
|
planFetch,
|
||||||
|
])
|
||||||
|
|
||||||
|
const { data: routeBundle, error: routeError } = routeFetch
|
||||||
|
const { data: buildings } = buildingsFetch
|
||||||
|
const { data: places } = placesFetch
|
||||||
|
const { data: prezero, error: prezeroError } = prezeroFetch
|
||||||
|
const { data: sensors } = sensorsFetch
|
||||||
|
const { data: context } = contextFetch
|
||||||
|
const { data: meta } = metaFetch
|
||||||
|
const { data: plan, error: planError, pending: planPending, refresh: refreshPlan } = planFetch
|
||||||
|
|
||||||
|
watch(
|
||||||
|
sensors,
|
||||||
|
(list) => {
|
||||||
|
if (list?.length && !list.some((sensor) => sensor.id === sensorId.value)) {
|
||||||
|
sensorId.value = list[0]!.id
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{ immediate: true },
|
||||||
|
)
|
||||||
|
|
||||||
|
watch(
|
||||||
|
() => live.revision,
|
||||||
|
() => {
|
||||||
|
void refreshPlan()
|
||||||
|
},
|
||||||
|
)
|
||||||
|
|
||||||
|
const bundle = computed(() => routeBundle.value ?? pendingCoolRouteBundle())
|
||||||
|
const routePending = computed(() => !routeBundle.value || bundle.value.status !== 'ready')
|
||||||
|
const sensorCount = computed(() => meta.value?.coverage.sensors ?? sensors.value?.length ?? 0)
|
||||||
|
const cadenceMin = computed(() => meta.value?.coverage.cadence_min ?? null)
|
||||||
|
const scenarioName = computed(() => live.scenarioId)
|
||||||
|
const routeErrorText = computed(() =>
|
||||||
|
routeError.value ? 'The route bundle could not be loaded.' : '',
|
||||||
|
)
|
||||||
|
const planErrorText = computed(() =>
|
||||||
|
planError.value ? 'The live staffing plan is unavailable. The last known response is not invented.' : '',
|
||||||
|
)
|
||||||
|
const prezeroErrorText = computed(() =>
|
||||||
|
prezeroError.value ? 'The PreZero snapshot could not be loaded.' : '',
|
||||||
|
)
|
||||||
|
|
||||||
|
useHead({
|
||||||
|
title: 'Pulse Engine · SIT',
|
||||||
|
meta: [
|
||||||
|
{
|
||||||
|
name: 'description',
|
||||||
|
content:
|
||||||
|
'Three operational decisions from one privacy-preserving sensing engine: staffing, smart micro-climate routing and PreZero container priority.',
|
||||||
|
},
|
||||||
|
{ name: 'theme-color', content: '#081723' },
|
||||||
|
],
|
||||||
|
})
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<div class="flex min-h-dvh flex-col">
|
||||||
|
<main class="w-full flex-1 bg-[#081723] pt-16">
|
||||||
|
<div class="mx-auto flex w-full max-w-[1240px] flex-col gap-6 px-4 pb-12 pt-4 md:px-8">
|
||||||
|
<!-- Section heading -->
|
||||||
|
<section class="flex flex-col justify-between gap-4 pt-4 md:flex-row md:items-end">
|
||||||
|
<div class="flex max-w-2xl flex-col gap-1.5">
|
||||||
|
<div class="flex flex-wrap items-center gap-2">
|
||||||
|
<span class="text-[11px] font-bold uppercase tracking-widest text-[#00C3CD]">
|
||||||
|
Section 03 / Operational decisions
|
||||||
|
</span>
|
||||||
|
<span class="text-[#64748B]" aria-hidden="true">•</span>
|
||||||
|
<span class="text-[12px] font-medium text-[#94A3B8]">{{ activeTab.title }}</span>
|
||||||
|
</div>
|
||||||
|
<h1 class="text-2xl font-bold leading-tight tracking-tight text-white md:text-3xl lg:text-[34px]">
|
||||||
|
Real-time decision intelligence.
|
||||||
|
</h1>
|
||||||
|
<p class="max-w-2xl text-sm font-normal text-[#94A3B8] md:text-base">
|
||||||
|
One crisp answer per use case, with the real mathematical rationale attached. No invented confidence
|
||||||
|
scores.
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="flex items-center gap-3 self-start rounded-xl border border-[#1e3a52] bg-[#0e2233] px-4 py-2.5 md:self-auto">
|
||||||
|
<Icon name="material-symbols:bolt" class="text-[22px] text-[#00C3CD]" />
|
||||||
|
<div class="flex flex-col">
|
||||||
|
<span class="text-[11px] font-semibold uppercase tracking-wider text-[#94A3B8]">Decision latency</span>
|
||||||
|
<span class="font-mono text-lg font-bold leading-tight text-[#00C3CD]">
|
||||||
|
{{ activeLatency ? `${activeLatency} ms` : '—' }}
|
||||||
|
</span>
|
||||||
|
<span class="text-[9px] text-[#64748B]">last data load</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<UseCaseTabs :active="active" />
|
||||||
|
|
||||||
|
<LiveTelemetryBar
|
||||||
|
:status="live.status"
|
||||||
|
:scenario-id="scenarioName"
|
||||||
|
:sensor-count="sensorCount"
|
||||||
|
:cadence-min="cadenceMin"
|
||||||
|
:last-event-at="live.lastEventAt"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<div
|
||||||
|
v-if="active === 'routing' && routeErrorText"
|
||||||
|
class="rounded-xl border border-[#1e3a52] bg-[#132b40] p-4 text-sm text-[#94A3B8]"
|
||||||
|
role="alert"
|
||||||
|
>
|
||||||
|
{{ routeErrorText }} The map and comparison are hidden rather than filled with estimates.
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
v-if="active === 'routing' && routePending && !routeErrorText"
|
||||||
|
class="rounded-xl border border-[#1e3a52] bg-[#132b40] p-4 text-sm text-[#94A3B8]"
|
||||||
|
role="status"
|
||||||
|
>
|
||||||
|
Route/shade bundle pending. No estimates shown.
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<RoutingPanel
|
||||||
|
v-if="active === 'routing'"
|
||||||
|
:bundle="bundle"
|
||||||
|
:buildings="buildings?.buildings ?? null"
|
||||||
|
:places="places"
|
||||||
|
:sensors="sensors ?? null"
|
||||||
|
:time="time"
|
||||||
|
@update:time="selectTime"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<StaffingPanel
|
||||||
|
v-else-if="active === 'staffing'"
|
||||||
|
:plan="plan ?? null"
|
||||||
|
:sensors="sensors ?? null"
|
||||||
|
:context="context ?? null"
|
||||||
|
:sensor-id="sensorId"
|
||||||
|
:pending="planPending"
|
||||||
|
:error="planErrorText"
|
||||||
|
@update:sensor-id="sensorId = $event"
|
||||||
|
@refresh="refreshPlan"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<PrezeroPanel
|
||||||
|
v-else
|
||||||
|
:bundle="prezero ?? null"
|
||||||
|
:error="prezeroErrorText"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</main>
|
||||||
|
|
||||||
|
<footer class="w-full border-t border-[#1e3a52] bg-[#0e2233] py-6">
|
||||||
|
<div class="mx-auto flex max-w-[1240px] flex-col items-center justify-between gap-4 px-4 text-xs font-normal text-[#94A3B8] md:flex-row md:px-8">
|
||||||
|
<div class="flex flex-wrap items-center gap-3">
|
||||||
|
<span>© 2026 Schwarz Digits. All rights reserved.</span>
|
||||||
|
<span class="text-[#64748B]" aria-hidden="true">|</span>
|
||||||
|
<span class="flex items-center gap-1 font-medium text-[#00C3CD]">
|
||||||
|
<Icon name="material-symbols:verified-user" class="text-[15px]" />
|
||||||
|
Counts, not identities · GDPR by design
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<div class="flex flex-wrap items-center gap-3">
|
||||||
|
<span class="flex items-center gap-1.5">
|
||||||
|
<span
|
||||||
|
class="h-2 w-2 rounded-full"
|
||||||
|
:class="
|
||||||
|
live.status === 'live'
|
||||||
|
? 'animate-pulse bg-[#00C3CD]'
|
||||||
|
: live.status === 'offline'
|
||||||
|
? 'bg-[#64748B]'
|
||||||
|
: 'bg-[#94A3B8]'
|
||||||
|
"
|
||||||
|
aria-hidden="true"
|
||||||
|
/>
|
||||||
|
<span class="font-medium text-white">
|
||||||
|
{{ live.status === 'live' ? 'System status: stream live' : `System status: ${live.status}` }}
|
||||||
|
</span>
|
||||||
|
</span>
|
||||||
|
<span class="text-[#64748B]" aria-hidden="true">|</span>
|
||||||
|
<span class="rounded border border-[#1e3a52] bg-[#132b40] px-2 py-0.5 font-mono text-[11px] font-semibold text-[#00C3CD]">
|
||||||
|
v1.10-use-cases
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</footer>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
@@ -0,0 +1,165 @@
|
|||||||
|
import type { Point } from '../../shared/types'
|
||||||
|
|
||||||
|
export const HEATMAP_HOURS = [8, 10, 12, 14, 16, 18] as const
|
||||||
|
|
||||||
|
const partsFormatter = new Intl.DateTimeFormat('en-CA', {
|
||||||
|
timeZone: 'Europe/Berlin',
|
||||||
|
year: 'numeric',
|
||||||
|
month: '2-digit',
|
||||||
|
day: '2-digit',
|
||||||
|
hour: '2-digit',
|
||||||
|
minute: '2-digit',
|
||||||
|
hourCycle: 'h23',
|
||||||
|
})
|
||||||
|
|
||||||
|
function berlinParts(iso: string): { date: string; hour: number; weekday: number } {
|
||||||
|
const parts = Object.fromEntries(
|
||||||
|
partsFormatter.formatToParts(new Date(iso)).map((part) => [part.type, part.value]),
|
||||||
|
)
|
||||||
|
const date = `${parts.year}-${parts.month}-${parts.day}`
|
||||||
|
return {
|
||||||
|
date,
|
||||||
|
hour: Number(parts.hour),
|
||||||
|
weekday: (new Date(`${date}T12:00:00Z`).getUTCDay() + 6) % 7,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface ForecastSummary {
|
||||||
|
count: number
|
||||||
|
peak: Point | null
|
||||||
|
mean: number
|
||||||
|
total: number
|
||||||
|
intervalHours: number
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface HeatmapCell {
|
||||||
|
hour: number
|
||||||
|
value: number | null
|
||||||
|
intensity: number
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface HeatmapRow {
|
||||||
|
date: string
|
||||||
|
weekday: number
|
||||||
|
cells: HeatmapCell[]
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface Heatmap {
|
||||||
|
hours: number[]
|
||||||
|
rows: HeatmapRow[]
|
||||||
|
max: number
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface ScenarioDelta {
|
||||||
|
peakDelta: number
|
||||||
|
peakDeltaPct: number | null
|
||||||
|
meanDelta: number
|
||||||
|
meanDeltaPct: number | null
|
||||||
|
}
|
||||||
|
|
||||||
|
export function summarizeForecast(points: Point[]): ForecastSummary {
|
||||||
|
if (!points.length) {
|
||||||
|
return { count: 0, peak: null, mean: 0, total: 0, intervalHours: 1 }
|
||||||
|
}
|
||||||
|
|
||||||
|
const sorted = [...points].sort((a, b) => Date.parse(a.t) - Date.parse(b.t))
|
||||||
|
const first = Date.parse(sorted[0]!.t)
|
||||||
|
const second = Date.parse(sorted[1]?.t ?? sorted[0]!.t)
|
||||||
|
const intervalHours = sorted.length > 1 && Number.isFinite(second - first) && second > first
|
||||||
|
? (second - first) / 3_600_000
|
||||||
|
: 1
|
||||||
|
|
||||||
|
let peak = sorted[0]!
|
||||||
|
let total = 0
|
||||||
|
for (const point of sorted) {
|
||||||
|
total += point.v
|
||||||
|
if (point.v > peak.v) peak = point
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
count: sorted.length,
|
||||||
|
peak,
|
||||||
|
mean: total / sorted.length,
|
||||||
|
total: total * intervalHours,
|
||||||
|
intervalHours,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export function formatBand(lo?: number | null, hi?: number | null): string {
|
||||||
|
if (
|
||||||
|
lo === null ||
|
||||||
|
lo === undefined ||
|
||||||
|
hi === null ||
|
||||||
|
hi === undefined ||
|
||||||
|
!Number.isFinite(lo) ||
|
||||||
|
!Number.isFinite(hi)
|
||||||
|
) {
|
||||||
|
return '—'
|
||||||
|
}
|
||||||
|
const format = (value: number) => (Number.isInteger(value) ? String(value) : value.toFixed(1))
|
||||||
|
return `${format(lo)} – ${format(hi)}`
|
||||||
|
}
|
||||||
|
|
||||||
|
export function scenarioDelta(selected: ForecastSummary, base: ForecastSummary): ScenarioDelta {
|
||||||
|
const selectedPeak = selected.peak?.v ?? 0
|
||||||
|
const basePeak = base.peak?.v ?? 0
|
||||||
|
const peakDelta = selectedPeak - basePeak
|
||||||
|
const meanDelta = selected.mean - base.mean
|
||||||
|
return {
|
||||||
|
peakDelta,
|
||||||
|
peakDeltaPct: basePeak ? (peakDelta / basePeak) * 100 : null,
|
||||||
|
meanDelta,
|
||||||
|
meanDeltaPct: base.mean ? (meanDelta / base.mean) * 100 : null,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Group forecast points into local Berlin weekday × exact-hour cells. */
|
||||||
|
export function buildHeatmap(points: Point[]): Heatmap {
|
||||||
|
const buckets = new Map<string, { date: string; weekday: number; hour: number; sum: number; count: number }>()
|
||||||
|
|
||||||
|
for (const point of points) {
|
||||||
|
const local = berlinParts(point.t)
|
||||||
|
if (!HEATMAP_HOURS.includes(local.hour as (typeof HEATMAP_HOURS)[number])) continue
|
||||||
|
const key = `${local.date}|${local.hour}`
|
||||||
|
const bucket = buckets.get(key)
|
||||||
|
if (bucket) {
|
||||||
|
bucket.sum += point.v
|
||||||
|
bucket.count += 1
|
||||||
|
} else {
|
||||||
|
buckets.set(key, {
|
||||||
|
date: local.date,
|
||||||
|
weekday: local.weekday,
|
||||||
|
hour: local.hour,
|
||||||
|
sum: point.v,
|
||||||
|
count: 1,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const dates = [...new Set([...buckets.values()].map((bucket) => bucket.date))].sort()
|
||||||
|
let maximum = 0
|
||||||
|
for (const bucket of buckets.values()) {
|
||||||
|
maximum = Math.max(maximum, bucket.sum / bucket.count)
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
hours: [...HEATMAP_HOURS],
|
||||||
|
max: maximum,
|
||||||
|
rows: dates.map((date) => {
|
||||||
|
const dayBuckets = [...buckets.values()].filter((bucket) => bucket.date === date)
|
||||||
|
return {
|
||||||
|
date,
|
||||||
|
weekday: dayBuckets[0]?.weekday ?? 0,
|
||||||
|
cells: HEATMAP_HOURS.map((hour) => {
|
||||||
|
const bucket = dayBuckets.find((item) => item.hour === hour)
|
||||||
|
const value = bucket ? bucket.sum / bucket.count : null
|
||||||
|
return {
|
||||||
|
hour,
|
||||||
|
value,
|
||||||
|
intensity: value === null || maximum <= 0 ? 0 : Math.min(1, value / maximum),
|
||||||
|
}
|
||||||
|
}),
|
||||||
|
}
|
||||||
|
}),
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
# Copy claims — current state
|
||||||
|
|
||||||
|
The v1.5 page copy has been updated. Remaining items to confirm before the pitch:
|
||||||
|
|
||||||
|
- **Footer:** updated to © 2026; ISO 27701 certification claim removed in favour of
|
||||||
|
"Privacy by design". Keep it that way until a certificate is available.
|
||||||
|
- **Accuracy:** now shows the verified paper numbers
|
||||||
|
(**MAE 3.32 vs 5.40 seasonal naive**, 28-day holdout). The page no longer shows
|
||||||
|
the old MAE 4.2 / MAPE 3.8% / 730-day figures.
|
||||||
|
- **"Deployed on STACKIT"** in the footer should be confirmed by the infra owner.
|
||||||
|
- **"Zero PII" / "Zero personally identifiable information (PII) processed"**
|
||||||
|
remains in the hero trust line. Phrase precisely what the sensor pipeline
|
||||||
|
processes (anonymous counts rather than identities) and avoid claiming zero PII
|
||||||
|
across the entire system unless that has been verified end to end.
|
||||||
@@ -0,0 +1,237 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
|
||||||
|
<html class="dark" lang="en"><head><meta charset="utf-8"/><meta content="width=device-width, initial-scale=1.0" name="viewport"/><meta content="web_standard" name="shell-type"/><link href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200" rel="stylesheet"/>
|
||||||
|
<link href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:wght,FILL@100..700,0..1&display=swap" rel="stylesheet"/>
|
||||||
|
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@100..900&display=swap" rel="stylesheet"/><style>@layer base{html,body{margin:0;padding:0;}body{overscroll-behavior:none;}main>:first-child{margin-top:0!important;}main>:last-child{margin-bottom:0!important;}}::-webkit-scrollbar{display:none;}</style><script src="https://cdn.tailwindcss.com?plugins=forms,container-queries"></script><script id="tailwind-config">tailwind.config={darkMode:"class",theme:{extend:{"colors":{"dark-bg":"#081723","dark-card":"#0e2233","dark-surface":"#132b40","dark-border":"#1e3a52","dark-text":"#FFFFFF","dark-muted":"#94A3B8","dark-accent":"#00C3CD"},"borderRadius":{"DEFAULT":"0.25rem","lg":"0.5rem","xl":"0.75rem","full":"9999px"},"spacing":{"space-xl":"1.5rem","space-2xl":"2rem","space-xs":"0.25rem","gutter":"1rem","margin":"1rem","margin-desktop":"2rem","gutter-desktop":"1.5rem","space-sm":"0.5rem","space-lg":"1rem","space-md":"0.75rem"},"fontFamily":{"headline-lg":["Inter"],"body-sm":["Inter"],"headline-xl":["Inter"],"tabular-stat-md":["Inter"],"body-md":["Inter"],"tabular-stat-lg":["Inter"],"headline-md":["Inter"],"headline-sm":["Inter"],"body-lg":["Inter"],"label-md":["Inter"],"label-sm":["Inter"],"headline-xl-mobile":["Inter"]}}}}</script></head><body class="bg-[#081723] text-[#FFFFFF] font-body-md"><header class="fixed top-0 left-0 right-0 z-50 bg-[#081723]/95 backdrop-blur-md border-b border-[#1e3a52] shadow-[0_1px_8px_rgba(0,0,0,0.3)]"><div class="h-16 max-w-[1200px] mx-auto px-margin-desktop flex items-center justify-between gap-space-lg"><div class="flex items-center gap-space-md shrink-0"><img alt="Schwarz Sensing Engine Logo" class="h-8 w-auto object-contain brightness-0 invert" src="https://lh3.googleusercontent.com/aida/ALJJyrCNxLn9636LeBvNQ9xgc1tPAR-NnMkUOlz6fEu2IU82YAhVBNixjwgJmwo0cAG2XefOjV2c3I8g8ozRtMqRIZxTxVW5Xda-62jbzgmFuOm9m6LwwWn2ELEb1jkvei4wTEgs_tpGTSqsFMI9_vF1qZtubfUQ6QUM0Ux9w3Vz9YA1WnKp1BlIY6rrST1tAwRXn7E6-bIrj498cqAcUXVwpHf8qGA9cSb3w7XJif-Fvlc"/><div class="flex flex-col"><span class="font-headline-sm text-headline-sm text-[#FFFFFF] tracking-tight">Schwarz IT</span><span class="font-label-sm text-label-sm text-[#94A3B8] uppercase tracking-wider -mt-1">Sensing Engine</span></div></div><nav class="hidden md:flex items-center gap-space-xl"><a aria-current="page" class="transition-colors py-space-sm text-[#00C3CD] font-semibold border-b-2 border-[#00C3CD]" data-path="engine" href="#">Engine</a><a class="font-label-md text-label-md text-[#94A3B8] hover:text-[#FFFFFF] transition-colors py-space-sm" data-path="sensing-options" href="#">Sensing Options</a><a class="font-label-md text-label-md text-[#94A3B8] hover:text-[#FFFFFF] transition-colors py-space-sm" data-path="use-cases" href="#">Use Cases</a><a class="font-label-md text-label-md text-[#94A3B8] hover:text-[#FFFFFF] transition-colors py-space-sm" data-path="playground" href="#">Playground</a></nav><div class="flex items-center gap-space-md shrink-0"><div class="flex items-center bg-[#0e2233] p-space-xs rounded-lg border border-[#1e3a52]"><button class="px-space-sm py-1 rounded bg-[#132b40] text-[#00C3CD] font-label-sm text-label-sm shadow-[0_1px_3px_rgba(0,0,0,0.3)] transition-all font-semibold" type="button">UC1: Staffing</button><button class="px-space-sm py-1 rounded text-[#94A3B8] hover:text-[#FFFFFF] font-label-sm text-label-sm transition-all" type="button">UC2: Smart Routing</button><button class="px-space-sm py-1 rounded text-[#94A3B8] hover:text-[#FFFFFF] font-label-sm text-label-sm transition-all" type="button">UC3: PreZero Depot</button></div><div class="w-8 h-8 rounded-full bg-[#132b40] border border-[#1e3a52] flex items-center justify-center shrink-0"><span class="material-symbols-outlined text-[#00C3CD] text-[18px]">person</span></div></div></div></header><main class="w-full pt-16 bg-[#081723] min-h-[calc(100vh-160px)]"><div class="flex flex-col w-full">
|
||||||
|
<!-- Interactive & Style Setup for Flow Visualization -->
|
||||||
|
<style>
|
||||||
|
@keyframes pulseDataFlow {
|
||||||
|
0% { transform: translateX(0); opacity: 0.15; }
|
||||||
|
50% { opacity: 0.95; }
|
||||||
|
100% { transform: translateX(64px); opacity: 0.15; }
|
||||||
|
}
|
||||||
|
.animate-flow {
|
||||||
|
animation: pulseDataFlow 2.4s cubic-bezier(0.4, 0, 0.2, 1) infinite;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<!-- Above-The-Fold Master Container (1200px max width aligned) -->
|
||||||
|
<section class="w-full bg-[#081723] pt-space-2xl pb-space-xl">
|
||||||
|
<div class="max-w-[1200px] mx-auto px-margin-desktop flex flex-col gap-space-2xl">
|
||||||
|
<!-- HERO TWO-COLUMN GRID (50% / 50%) -->
|
||||||
|
<div class="grid grid-cols-1 lg:grid-cols-12 gap-space-xl items-center">
|
||||||
|
<!-- LEFT COLUMN: Value Proposition & CTAs -->
|
||||||
|
<div class="lg:col-span-6 flex flex-col justify-center gap-space-lg">
|
||||||
|
<!-- Eyebrow Pill Badge -->
|
||||||
|
<div class="inline-flex items-center gap-2 self-start px-3 py-1 rounded-full bg-[#0e2233] border border-[#1e3a52] shadow-sm">
|
||||||
|
<span class="w-1.5 h-1.5 rounded-full bg-[#00C3CD]"></span>
|
||||||
|
<span class="font-label-sm text-label-sm text-[#94A3B8] uppercase tracking-wider font-semibold">
|
||||||
|
Schwarz IT · Sensing & Prediction Platform
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<!-- Headline -->
|
||||||
|
<h1 class="text-[52px] leading-[58px] tracking-[-0.03em] font-semibold text-[#FFFFFF]">
|
||||||
|
You bring the data.<br/>
|
||||||
|
<span class="text-[#00C3CD]">We bring the engine.</span>
|
||||||
|
</h1>
|
||||||
|
<!-- Subline -->
|
||||||
|
<p class="font-body-lg text-body-lg text-[#94A3B8] max-w-[500px] leading-relaxed">
|
||||||
|
Privacy-preserving sensor counts in, decisions out. Turn raw edge signals into verified operational foresight without compromising individual identity.
|
||||||
|
</p>
|
||||||
|
<!-- CTAs Row -->
|
||||||
|
<div class="flex flex-wrap items-center gap-space-md pt-space-xs">
|
||||||
|
<a class="inline-flex items-center justify-center gap-2 px-6 h-12 rounded-xl bg-[#00C3CD] text-[#081723] font-label-md text-label-md font-semibold hover:bg-[#00d8e4] transition-all shadow-[0_2px_12px_rgba(0,195,205,0.25)] active:scale-[0.99] group" href="#playground">
|
||||||
|
<span>Try the engine</span>
|
||||||
|
<span class="material-symbols-outlined text-[18px] group-hover:translate-x-0.5 transition-transform text-[#081723]">arrow_forward</span>
|
||||||
|
</a>
|
||||||
|
<a class="inline-flex items-center justify-center gap-2 px-6 h-12 rounded-xl bg-[#0e2233] text-[#FFFFFF] border border-[#1e3a52] font-label-md text-label-md hover:bg-[#132b40] transition-all shadow-sm" href="#use-cases">
|
||||||
|
<span class="material-symbols-outlined text-[18px] text-[#00C3CD]">visibility</span>
|
||||||
|
<span>See live use cases</span>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
<!-- Trust Micro-Copy -->
|
||||||
|
<div class="flex items-center gap-2 pt-space-xs font-body-sm text-body-sm text-[#94A3B8]">
|
||||||
|
<span class="material-symbols-outlined text-[17px] text-[#00C3CD]" style="font-variation-settings: 'FILL' 1;">verified_user</span>
|
||||||
|
<span>Zero personally identifiable information (PII) processed. GDPR Art. 25 Privacy by Design.</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- RIGHT COLUMN: Pipeline Architecture Diagram Card -->
|
||||||
|
<div class="lg:col-span-6 w-full">
|
||||||
|
<div class="w-full bg-[#0e2233] border border-[#1e3a52] rounded-xl shadow-xl p-space-lg flex flex-col gap-space-md relative overflow-hidden">
|
||||||
|
<!-- Card Header Badge -->
|
||||||
|
<div class="flex items-center justify-between pb-space-xs border-b border-[#1e3a52]/60">
|
||||||
|
<div class="flex items-center gap-2">
|
||||||
|
<span class="w-2 h-2 rounded-full bg-[#00C3CD] animate-pulse"></span>
|
||||||
|
<span class="font-label-sm text-label-sm uppercase tracking-wider text-[#FFFFFF] font-semibold">Real-Time Core Pipeline</span>
|
||||||
|
</div>
|
||||||
|
<span class="font-label-sm text-label-sm bg-[#132b40] border border-[#1e3a52] px-2 py-0.5 rounded text-[#94A3B8] font-mono font-medium">v2.4-deterministic</span>
|
||||||
|
</div>
|
||||||
|
<!-- Pipeline Diagram Stage -->
|
||||||
|
<div class="bg-[#081723]/60 border border-[#1e3a52] rounded-xl p-space-md flex flex-col gap-space-md relative">
|
||||||
|
<!-- 3-Node Horizontal Pipeline Layout -->
|
||||||
|
<div class="flex items-center justify-between gap-1 w-full">
|
||||||
|
<!-- NODE 1: Ingest -->
|
||||||
|
<div class="w-[30%] bg-[#0e2233] border border-[#1e3a52] rounded-xl p-space-sm flex flex-col items-center text-center shadow-sm">
|
||||||
|
<div class="w-10 h-10 rounded-lg bg-[#132b40] border border-[#1e3a52] flex items-center justify-center text-[#00C3CD] mb-1">
|
||||||
|
<span class="material-symbols-outlined text-[20px]">sensors</span>
|
||||||
|
</div>
|
||||||
|
<span class="font-headline-sm text-[13px] leading-tight text-[#FFFFFF] font-semibold">Anonymous Counts</span>
|
||||||
|
<span class="font-body-sm text-[11px] text-[#94A3B8] mt-1">LiDAR, FLUX, In/Out Edge Turnstile</span>
|
||||||
|
<div class="mt-2 w-full bg-[#132b40] border border-[#1e3a52]/80 px-1 py-0.5 rounded text-[10px] text-[#94A3B8] font-mono">
|
||||||
|
Σ counts/min
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- CONNECTOR 1 -->
|
||||||
|
<div class="flex-1 flex flex-col items-center justify-center px-1 relative">
|
||||||
|
<div class="w-full h-[2px] bg-[#1e3a52] relative overflow-hidden flex items-center">
|
||||||
|
<div class="w-1/2 h-[2px] bg-[#00C3CD] animate-flow"></div>
|
||||||
|
</div>
|
||||||
|
<span class="text-[9px] text-[#00C3CD] font-mono tracking-tighter mt-1 uppercase">100% PII-Free</span>
|
||||||
|
</div>
|
||||||
|
<!-- NODE 2: SENSING ENGINE (Centerpiece) -->
|
||||||
|
<div class="w-[38%] bg-[#132b40] border-2 border-[#00C3CD] text-[#FFFFFF] rounded-xl p-space-md flex flex-col items-center text-center shadow-lg relative overflow-hidden group">
|
||||||
|
<div class="absolute -right-6 -bottom-6 w-20 h-20 rounded-full bg-[#00C3CD]/15 blur-xl pointer-events-none"></div>
|
||||||
|
<div class="w-9 h-9 rounded-full bg-[#00C3CD]/20 border border-[#00C3CD]/40 flex items-center justify-center text-[#00C3CD] mb-1">
|
||||||
|
<span class="material-symbols-outlined text-[19px]">hub</span>
|
||||||
|
</div>
|
||||||
|
<span class="font-headline-sm text-[14px] leading-tight text-[#FFFFFF] font-semibold tracking-tight">SENSING ENGINE</span>
|
||||||
|
<span class="font-label-sm text-[10px] text-[#00C3CD] uppercase tracking-wider font-semibold">Fuse + Predict</span>
|
||||||
|
</div>
|
||||||
|
<!-- CONNECTOR 2 -->
|
||||||
|
<div class="flex-1 flex flex-col items-center justify-center px-1 relative">
|
||||||
|
<div class="w-full h-[2px] bg-[#1e3a52] relative overflow-hidden flex items-center">
|
||||||
|
<div class="w-1/2 h-[2px] bg-[#00C3CD] animate-flow"></div>
|
||||||
|
</div>
|
||||||
|
<span class="text-[9px] text-[#00C3CD] font-mono tracking-tighter mt-1 uppercase">Inference</span>
|
||||||
|
</div>
|
||||||
|
<!-- NODE 3: Decisions -->
|
||||||
|
<div class="w-[30%] bg-[#0e2233] border border-[#1e3a52] rounded-xl p-space-sm flex flex-col items-center text-center shadow-sm">
|
||||||
|
<div class="w-10 h-10 rounded-lg bg-[#132b40] border border-[#1e3a52] flex items-center justify-center text-[#00C3CD] mb-1">
|
||||||
|
<span class="material-symbols-outlined text-[20px]">bolt</span>
|
||||||
|
</div>
|
||||||
|
<span class="font-headline-sm text-[13px] leading-tight text-[#FFFFFF] font-semibold">Decisions</span>
|
||||||
|
<span class="font-body-sm text-[11px] text-[#94A3B8] mt-1">Staff shift, dynamic routing, bin dispatch</span>
|
||||||
|
<div class="mt-2 w-full bg-[#132b40] border border-[#1e3a52]/80 px-1 py-0.5 rounded text-[10px] text-[#00C3CD] font-mono font-semibold">
|
||||||
|
Action Output
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- Real-world Context Fusion Ribbon -->
|
||||||
|
<div class="flex flex-col gap-1.5 pt-1">
|
||||||
|
<div class="flex items-center justify-between text-[#94A3B8] px-1">
|
||||||
|
<span class="font-label-sm text-[11px] tracking-wider uppercase font-semibold text-[#94A3B8]">Contextual Signals Fused in Real-Time</span>
|
||||||
|
<span class="text-[10px] font-mono text-[#00C3CD]">4 Global Feeds Active</span>
|
||||||
|
</div>
|
||||||
|
<div class="grid grid-cols-2 md:grid-cols-4 gap-1.5">
|
||||||
|
<div class="flex items-center gap-1.5 px-2 py-1.5 rounded-lg bg-[#0e2233] border border-[#1e3a52] shadow-sm">
|
||||||
|
<span class="text-[13px]">☀️</span>
|
||||||
|
<div class="flex flex-col min-w-0">
|
||||||
|
<span class="font-label-sm text-[11px] text-[#FFFFFF] truncate font-semibold">Sun Position</span>
|
||||||
|
<span class="text-[9px] text-[#94A3B8] truncate">Solar Azimuth</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="flex items-center gap-1.5 px-2 py-1.5 rounded-lg bg-[#0e2233] border border-[#1e3a52] shadow-sm">
|
||||||
|
<span class="text-[13px]">🌦️</span>
|
||||||
|
<div class="flex flex-col min-w-0">
|
||||||
|
<span class="font-label-sm text-[11px] text-[#FFFFFF] truncate font-semibold">DWD Weather</span>
|
||||||
|
<span class="text-[9px] text-[#94A3B8] truncate">Hyperlocal Rain/Temp</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="flex items-center gap-1.5 px-2 py-1.5 rounded-lg bg-[#0e2233] border border-[#1e3a52] shadow-sm">
|
||||||
|
<span class="text-[13px]">📅</span>
|
||||||
|
<div class="flex flex-col min-w-0">
|
||||||
|
<span class="font-label-sm text-[11px] text-[#FFFFFF] truncate font-semibold">Calendar Sync</span>
|
||||||
|
<span class="text-[9px] text-[#94A3B8] truncate">Retail, Holidays, Paydays</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="flex items-center gap-1.5 px-2 py-1.5 rounded-lg bg-[#0e2233] border border-[#1e3a52] shadow-sm">
|
||||||
|
<span class="text-[13px]">🗺️</span>
|
||||||
|
<div class="flex flex-col min-w-0">
|
||||||
|
<span class="font-label-sm text-[11px] text-[#FFFFFF] truncate font-semibold">Geo-Mesh Map</span>
|
||||||
|
<span class="text-[9px] text-[#94A3B8] truncate">Store & Depot Spatial</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- Mini Telemetry Footer Bar -->
|
||||||
|
<div class="flex items-center justify-between text-[#94A3B8] px-space-xs font-mono text-[11px]">
|
||||||
|
<div class="flex items-center gap-1.5">
|
||||||
|
<span class="material-symbols-outlined text-[14px] text-[#00C3CD]">speed</span>
|
||||||
|
<span>Pipeline Latency: <strong class="text-[#FFFFFF]">< 42ms</strong></span>
|
||||||
|
</div>
|
||||||
|
<div class="flex items-center gap-1.5">
|
||||||
|
<span class="material-symbols-outlined text-[14px] text-[#00C3CD]">sync</span>
|
||||||
|
<span>Edge aggregation: <strong class="text-[#FFFFFF]">60s epoch</strong></span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- COMPLIANCE & ACCURACY STRIP (Full 1200px span) -->
|
||||||
|
<div class="w-full bg-[#0e2233] border border-[#1e3a52] rounded-xl shadow-sm p-space-lg flex flex-col lg:flex-row items-center justify-between gap-space-lg">
|
||||||
|
<!-- 4 Verified Core Value Pillars -->
|
||||||
|
<div class="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-space-md w-full lg:w-auto flex-1">
|
||||||
|
<!-- Pillar 1 -->
|
||||||
|
<div class="flex items-start gap-2.5">
|
||||||
|
<div class="w-6 h-6 rounded-full bg-[#132b40] border border-[#1e3a52] flex items-center justify-center shrink-0 shadow-sm mt-0.5">
|
||||||
|
<span class="material-symbols-outlined text-[15px] text-[#00C3CD]" style="font-variation-settings: 'FILL' 1;">check_circle</span>
|
||||||
|
</div>
|
||||||
|
<div class="flex flex-col">
|
||||||
|
<span class="font-label-md text-label-md text-[#FFFFFF] font-semibold">Privacy-Preserving Sensors</span>
|
||||||
|
<span class="font-body-sm text-body-sm text-[#94A3B8] leading-tight">No identities, only counts.</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- Pillar 2 -->
|
||||||
|
<div class="flex items-start gap-2.5">
|
||||||
|
<div class="w-6 h-6 rounded-full bg-[#132b40] border border-[#1e3a52] flex items-center justify-center shrink-0 shadow-sm mt-0.5">
|
||||||
|
<span class="material-symbols-outlined text-[15px] text-[#00C3CD]" style="font-variation-settings: 'FILL' 1;">check_circle</span>
|
||||||
|
</div>
|
||||||
|
<div class="flex flex-col">
|
||||||
|
<span class="font-label-md text-label-md text-[#FFFFFF] font-semibold">Real-World Context</span>
|
||||||
|
<span class="font-body-sm text-body-sm text-[#94A3B8] leading-tight">Weather, sun, calendar, map.</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- Pillar 3 -->
|
||||||
|
<div class="flex items-start gap-2.5">
|
||||||
|
<div class="w-6 h-6 rounded-full bg-[#132b40] border border-[#1e3a52] flex items-center justify-center shrink-0 shadow-sm mt-0.5">
|
||||||
|
<span class="material-symbols-outlined text-[15px] text-[#00C3CD]" style="font-variation-settings: 'FILL' 1;">check_circle</span>
|
||||||
|
</div>
|
||||||
|
<div class="flex flex-col">
|
||||||
|
<span class="font-label-md text-label-md text-[#FFFFFF] font-semibold">Intuitive Visual Story</span>
|
||||||
|
<span class="font-body-sm text-body-sm text-[#94A3B8] leading-tight">One answer per screen.</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- Pillar 4 -->
|
||||||
|
<div class="flex items-start gap-2.5">
|
||||||
|
<div class="w-6 h-6 rounded-full bg-[#132b40] border border-[#1e3a52] flex items-center justify-center shrink-0 shadow-sm mt-0.5">
|
||||||
|
<span class="material-symbols-outlined text-[15px] text-[#00C3CD]" style="font-variation-settings: 'FILL' 1;">check_circle</span>
|
||||||
|
</div>
|
||||||
|
<div class="flex flex-col">
|
||||||
|
<span class="font-label-md text-label-md text-[#FFFFFF] font-semibold">Predictive Engine</span>
|
||||||
|
<span class="font-body-sm text-body-sm text-[#94A3B8] leading-tight">Hindsight becomes foresight.</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- ACCURACY BADGE (Far right telemetry badge) -->
|
||||||
|
<div class="shrink-0 flex items-center gap-3 bg-[#132b40] border border-[#1e3a52] px-space-md py-2.5 rounded-lg shadow-sm w-full lg:w-auto justify-between lg:justify-start">
|
||||||
|
<div class="flex items-center gap-2">
|
||||||
|
<div class="w-7 h-7 rounded-md bg-[#0e2233] border border-[#1e3a52] flex items-center justify-center text-[#00C3CD]">
|
||||||
|
<span class="material-symbols-outlined text-[18px]">verified</span>
|
||||||
|
</div>
|
||||||
|
<div class="flex flex-col">
|
||||||
|
<span class="font-label-sm text-[10px] text-[#94A3B8] uppercase tracking-wider font-semibold">Model Accuracy</span>
|
||||||
|
<div class="flex items-center gap-1.5 font-mono text-[13px] font-semibold text-[#FFFFFF]">
|
||||||
|
<span>Backtest MAE 4.2</span>
|
||||||
|
<span class="text-[#1e3a52]">·</span>
|
||||||
|
<span class="text-[#00C3CD]">MAPE 3.8%</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="hidden sm:flex items-center text-[11px] font-mono bg-[#0e2233] border border-[#1e3a52] px-2 py-1 rounded text-[#94A3B8]">
|
||||||
|
730 days backtested
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
</div></main><footer class="w-full bg-[#081723] border-t border-[#1e3a52] py-space-xl"><div class="max-w-[1200px] mx-auto px-margin-desktop flex flex-col md:flex-row items-center justify-between gap-space-lg font-body-sm text-body-sm text-[#94A3B8]"><div class="flex flex-wrap items-center gap-space-md"><span>© 2024 Schwarz IT KG. All rights reserved.</span><span class="text-[#1e3a52]">|</span><span class="flex items-center gap-1 text-[#00C3CD] font-label-sm text-label-sm"><span class="material-symbols-outlined text-[16px]">verified_user</span>GDPR / ISO 27701 compliant</span></div><div class="flex flex-wrap items-center gap-space-md"><div class="flex items-center gap-1.5"><span class="w-2 h-2 rounded-full bg-[#00C3CD] animate-pulse"></span><span class="font-label-sm text-label-sm text-[#FFFFFF]">System Status: All Engines Operational</span></div><span class="text-[#1e3a52]">|</span><span class="bg-[#0e2233] px-2 py-0.5 rounded font-label-sm text-label-sm font-semibold text-[#94A3B8] border border-[#1e3a52]">v2.4-prod</span></div></div></footer></body></html>
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 199 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 121 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 40 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 110 KiB |
+83
-10
@@ -6,9 +6,79 @@ const useMock =
|
|||||||
export default defineNuxtConfig({
|
export default defineNuxtConfig({
|
||||||
compatibilityDate: '2026-11-01',
|
compatibilityDate: '2026-11-01',
|
||||||
ssr: true,
|
ssr: true,
|
||||||
modules: ['@sit-onyx/nuxt'],
|
modules: ['@sit-onyx/nuxt', '@nuxt/icon'],
|
||||||
css: ['~/assets/css/main.css', '~/assets/css/cool.css'],
|
css: ['~/assets/css/main.css', '~/assets/css/cool.css', '~/assets/css/tailwind.css'],
|
||||||
|
postcss: {
|
||||||
|
plugins: {
|
||||||
|
tailwindcss: {},
|
||||||
|
autoprefixer: {},
|
||||||
|
},
|
||||||
|
},
|
||||||
devtools: { enabled: false },
|
devtools: { enabled: false },
|
||||||
|
icon: {
|
||||||
|
mode: 'svg',
|
||||||
|
serverBundle: { collections: ['material-symbols'] },
|
||||||
|
clientBundle: {
|
||||||
|
icons: [
|
||||||
|
'material-symbols:menu',
|
||||||
|
'material-symbols:close',
|
||||||
|
'material-symbols:arrow-forward',
|
||||||
|
'material-symbols:visibility-outline',
|
||||||
|
'material-symbols:verified-user',
|
||||||
|
'material-symbols:sensors',
|
||||||
|
'material-symbols:hub-outline',
|
||||||
|
'material-symbols:bolt-outline',
|
||||||
|
'material-symbols:speed',
|
||||||
|
'material-symbols:sync',
|
||||||
|
'material-symbols:check-circle',
|
||||||
|
'material-symbols:sunny',
|
||||||
|
'material-symbols:partly-cloudy-day',
|
||||||
|
'material-symbols:calendar-month',
|
||||||
|
'material-symbols:map-outline',
|
||||||
|
'material-symbols:psychology',
|
||||||
|
'material-symbols:dns',
|
||||||
|
'material-symbols:shield-lock',
|
||||||
|
'material-symbols:warning',
|
||||||
|
'material-symbols:tune',
|
||||||
|
'material-symbols:cancel',
|
||||||
|
'material-symbols:stars',
|
||||||
|
'material-symbols:videocam-off',
|
||||||
|
'material-symbols:wifi-off',
|
||||||
|
'material-symbols:functions',
|
||||||
|
'material-symbols:verified',
|
||||||
|
'material-symbols:shield-with-heart',
|
||||||
|
'material-symbols:restart-alt',
|
||||||
|
'material-symbols:progress-activity',
|
||||||
|
'material-symbols:bolt',
|
||||||
|
'material-symbols:error',
|
||||||
|
'material-symbols:cloud-off',
|
||||||
|
'material-symbols:water-drop',
|
||||||
|
'material-symbols:info',
|
||||||
|
'material-symbols:add',
|
||||||
|
'material-symbols:cloud',
|
||||||
|
'material-symbols:database',
|
||||||
|
'material-symbols:download',
|
||||||
|
'material-symbols:eco',
|
||||||
|
'material-symbols:expand-more',
|
||||||
|
'material-symbols:groups',
|
||||||
|
'material-symbols:inventory-2',
|
||||||
|
'material-symbols:layers',
|
||||||
|
'material-symbols:local-drink',
|
||||||
|
'material-symbols:my-location',
|
||||||
|
'material-symbols:open-in-new',
|
||||||
|
'material-symbols:query-stats',
|
||||||
|
'material-symbols:recycling',
|
||||||
|
'material-symbols:refresh',
|
||||||
|
'material-symbols:remove',
|
||||||
|
'material-symbols:table-chart',
|
||||||
|
'material-symbols:wb-sunny',
|
||||||
|
'material-symbols:trending-up',
|
||||||
|
'material-symbols:route',
|
||||||
|
],
|
||||||
|
scan: true,
|
||||||
|
},
|
||||||
|
fallbackToApi: false,
|
||||||
|
},
|
||||||
runtimeConfig: {
|
runtimeConfig: {
|
||||||
// Server-side Go API. K8s sets NUXT_API_INTERNAL_BASE=http://api:8080.
|
// Server-side Go API. K8s sets NUXT_API_INTERNAL_BASE=http://api:8080.
|
||||||
apiBase:
|
apiBase:
|
||||||
@@ -32,18 +102,21 @@ export default defineNuxtConfig({
|
|||||||
},
|
},
|
||||||
app: {
|
app: {
|
||||||
head: {
|
head: {
|
||||||
htmlAttrs: { lang: 'en' },
|
htmlAttrs: { lang: 'en', class: 'dark' },
|
||||||
title: 'PulseCast — footfall to shifts',
|
title: 'Pulse Engine · SIT',
|
||||||
meta: [
|
meta: [
|
||||||
{ name: 'viewport', content: 'width=device-width, initial-scale=1, viewport-fit=cover' },
|
{ name: 'viewport', content: 'width=device-width, initial-scale=1' },
|
||||||
|
{ name: 'theme-color', content: '#081723' },
|
||||||
|
],
|
||||||
|
link: [
|
||||||
|
{ rel: 'preconnect', href: 'https://fonts.googleapis.com' },
|
||||||
|
{ rel: 'preconnect', href: 'https://fonts.gstatic.com', crossorigin: '' },
|
||||||
{
|
{
|
||||||
name: 'description',
|
rel: 'stylesheet',
|
||||||
content:
|
href: 'https://fonts.googleapis.com/css2?family=Inter:wght@100..900&display=swap',
|
||||||
'PulseCast turns inner-city footfall into a transparent staffing plan for Heilbronn retailers: the peak shift, the week cost, coverage and the assumptions behind them.',
|
|
||||||
},
|
},
|
||||||
{ name: 'theme-color', content: '#f4efe6' },
|
{ rel: 'icon', type: 'image/svg+xml', href: '/schwarz-digits-logo.svg' },
|
||||||
],
|
],
|
||||||
link: [{ rel: 'icon', type: 'image/svg+xml', href: '/logo.svg' }],
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
nitro: {
|
nitro: {
|
||||||
|
|||||||
Generated
+578
@@ -17,11 +17,43 @@
|
|||||||
"sit-onyx": "1.22.0"
|
"sit-onyx": "1.22.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
"@iconify-json/material-symbols": "^1.2.99",
|
||||||
|
"@nuxt/icon": "^2.6.2",
|
||||||
"@types/qrcode": "1.5.5",
|
"@types/qrcode": "1.5.5",
|
||||||
|
"autoprefixer": "^10.6.2",
|
||||||
|
"postcss": "^8.5.33",
|
||||||
|
"tailwindcss": "3.4.17",
|
||||||
"typescript": "5.9.3",
|
"typescript": "5.9.3",
|
||||||
"vitest": "3.2.4"
|
"vitest": "3.2.4"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/@alloc/quick-lru": {
|
||||||
|
"version": "5.3.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/@alloc/quick-lru/-/quick-lru-5.3.0.tgz",
|
||||||
|
"integrity": "sha512-U4+70Pc5ZS9osnCBCE5Jha/ciHM+Yp+CNMNC/7HvYbNRk1Ldd+f7qO65W5qfhu/TCv+/ozljlXXe9Nj8419DMA==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=10"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/sponsors/sindresorhus"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@antfu/install-pkg": {
|
||||||
|
"version": "2.1.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/@antfu/install-pkg/-/install-pkg-2.1.0.tgz",
|
||||||
|
"integrity": "sha512-sdg9NxU3zR4Mnawfbc/x6GB5Wf17WYud5qOuEuxXjaKpYpMkISSJEjItGebXJ2bQ4DIcly4NYH23mtkGJjvKUw==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"package-manager-detector": "^1.8.0",
|
||||||
|
"tinyexec": "^1.3.1"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/sponsors/antfu"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/@babel/code-frame": {
|
"node_modules/@babel/code-frame": {
|
||||||
"version": "7.29.7",
|
"version": "7.29.7",
|
||||||
"resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.29.7.tgz",
|
"resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.29.7.tgz",
|
||||||
@@ -974,6 +1006,61 @@
|
|||||||
"node": ">=18"
|
"node": ">=18"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/@iconify-json/material-symbols": {
|
||||||
|
"version": "1.2.99",
|
||||||
|
"resolved": "https://registry.npmjs.org/@iconify-json/material-symbols/-/material-symbols-1.2.99.tgz",
|
||||||
|
"integrity": "sha512-c7CBI249CmvZDeT7sml1iwKEjsbiB8NUG2Bg1KPd7jnvLQ/8iQv7TQWnqq9a2357SkPjnyVTxxTgkWO2rlUtCw==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "Apache-2.0",
|
||||||
|
"dependencies": {
|
||||||
|
"@iconify/types": "*"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@iconify/collections": {
|
||||||
|
"version": "1.0.764",
|
||||||
|
"resolved": "https://registry.npmjs.org/@iconify/collections/-/collections-1.0.764.tgz",
|
||||||
|
"integrity": "sha512-cjPAaJBUaQMSfPF3pBwB35GHJWrD8u26B6aLx/aWo+abiaPyOHF1j0BJ7zBviiCU3TC1j9Mje2rV+X/9evaIBw==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"@iconify/types": "*"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@iconify/types": {
|
||||||
|
"version": "2.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/@iconify/types/-/types-2.0.0.tgz",
|
||||||
|
"integrity": "sha512-+wluvCrRhXrhyOmRDJ3q8mux9JkKy5SJ/v8ol2tu4FVjyYvtEzkc/3pK15ET6RKg4b4w4BmTk1+gsCUhf21Ykg==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT"
|
||||||
|
},
|
||||||
|
"node_modules/@iconify/utils": {
|
||||||
|
"version": "3.1.7",
|
||||||
|
"resolved": "https://registry.npmjs.org/@iconify/utils/-/utils-3.1.7.tgz",
|
||||||
|
"integrity": "sha512-JZHlwdID+dy+lTgbYC8NEC4zeugqeYsc6jewvzb4c58kHauJn+X7rNwQjxz5p2qSjqaEeQoLkCIQ9v/H4PK0/w==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"@antfu/install-pkg": "^2.0.1",
|
||||||
|
"@iconify/types": "^2.0.0",
|
||||||
|
"import-meta-resolve": "^4.2.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@iconify/vue": {
|
||||||
|
"version": "5.0.5",
|
||||||
|
"resolved": "https://registry.npmjs.org/@iconify/vue/-/vue-5.0.5.tgz",
|
||||||
|
"integrity": "sha512-O4SHjEKCQ2KTupa0tOd7MIuDdi8Pg6y9fCvsqccX8nYW8Wuy+ZbEgpzw7gZTN3ThyFjY9uo29ZLZ8MQjjMJRBw==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"@iconify/types": "^2.0.0"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/sponsors/cyberalien"
|
||||||
|
},
|
||||||
|
"peerDependencies": {
|
||||||
|
"vue": ">=3.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/@ioredis/commands": {
|
"node_modules/@ioredis/commands": {
|
||||||
"version": "1.10.0",
|
"version": "1.10.0",
|
||||||
"resolved": "https://registry.npmjs.org/@ioredis/commands/-/commands-1.10.0.tgz",
|
"resolved": "https://registry.npmjs.org/@ioredis/commands/-/commands-1.10.0.tgz",
|
||||||
@@ -1381,6 +1468,30 @@
|
|||||||
"devtools-wizard": "cli.mjs"
|
"devtools-wizard": "cli.mjs"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/@nuxt/icon": {
|
||||||
|
"version": "2.6.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/@nuxt/icon/-/icon-2.6.2.tgz",
|
||||||
|
"integrity": "sha512-eNVXbKzj1fmrkzcakkix8Pn/7lpd0I1b7xG0shjrlefr2wWIG3o0DrU9EvvT1BCf9UD33MAzoLF1l2Z99CKoTg==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"@iconify/collections": "^1.0.755",
|
||||||
|
"@iconify/types": "^2.0.0",
|
||||||
|
"@iconify/utils": "^3.1.7",
|
||||||
|
"@iconify/vue": "^5.0.4",
|
||||||
|
"@nuxt/devtools-kit": "^3.4.4",
|
||||||
|
"@nuxt/kit": "^4.6.3",
|
||||||
|
"consola": "^3.4.2",
|
||||||
|
"fnv1a-64": "^0.1.2",
|
||||||
|
"local-pkg": "^1.2.1",
|
||||||
|
"mlly": "^1.8.2",
|
||||||
|
"ohash": "^2.0.12",
|
||||||
|
"picomatch": "^4.0.7",
|
||||||
|
"std-env": "^4.3.0",
|
||||||
|
"tinyglobby": "^0.2.17",
|
||||||
|
"ufo": "^1.6.4"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/@nuxt/kit": {
|
"node_modules/@nuxt/kit": {
|
||||||
"version": "4.6.4",
|
"version": "4.6.4",
|
||||||
"resolved": "https://registry.npmjs.org/@nuxt/kit/-/kit-4.6.4.tgz",
|
"resolved": "https://registry.npmjs.org/@nuxt/kit/-/kit-4.6.4.tgz",
|
||||||
@@ -3305,6 +3416,13 @@
|
|||||||
"node": ">=14"
|
"node": ">=14"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/any-promise": {
|
||||||
|
"version": "1.3.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/any-promise/-/any-promise-1.3.0.tgz",
|
||||||
|
"integrity": "sha512-7UvmKalWRt1wgjL1RrGxoSJW/0QZFIegpeGvZG9kjp8vrRu55XTHbwnqq2GpXm9uLbcuhxm3IqX9OB4MZR1b2A==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT"
|
||||||
|
},
|
||||||
"node_modules/anymatch": {
|
"node_modules/anymatch": {
|
||||||
"version": "3.1.3",
|
"version": "3.1.3",
|
||||||
"resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz",
|
"resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz",
|
||||||
@@ -3362,6 +3480,13 @@
|
|||||||
"url": "https://github.com/sponsors/sindresorhus"
|
"url": "https://github.com/sponsors/sindresorhus"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/arg": {
|
||||||
|
"version": "5.0.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/arg/-/arg-5.0.2.tgz",
|
||||||
|
"integrity": "sha512-PYjyFOLKQ9y57JvQ6QLo8dAgNqswh8M1RMJYdQduT6xbWSgK36P/Z/v+p888pM69jMMfS8Xd8F6I1kQ/I9HUGg==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT"
|
||||||
|
},
|
||||||
"node_modules/args-tokenizer": {
|
"node_modules/args-tokenizer": {
|
||||||
"version": "0.3.0",
|
"version": "0.3.0",
|
||||||
"resolved": "https://registry.npmjs.org/args-tokenizer/-/args-tokenizer-0.3.0.tgz",
|
"resolved": "https://registry.npmjs.org/args-tokenizer/-/args-tokenizer-0.3.0.tgz",
|
||||||
@@ -3685,6 +3810,19 @@
|
|||||||
"require-from-string": "^2.0.2"
|
"require-from-string": "^2.0.2"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/binary-extensions": {
|
||||||
|
"version": "2.3.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.3.0.tgz",
|
||||||
|
"integrity": "sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=8"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/sponsors/sindresorhus"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/bindings": {
|
"node_modules/bindings": {
|
||||||
"version": "1.5.0",
|
"version": "1.5.0",
|
||||||
"resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz",
|
"resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz",
|
||||||
@@ -3866,6 +4004,16 @@
|
|||||||
"node": ">=6"
|
"node": ">=6"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/camelcase-css": {
|
||||||
|
"version": "2.0.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/camelcase-css/-/camelcase-css-2.0.1.tgz",
|
||||||
|
"integrity": "sha512-QOSvevhslijgYwRx6Rv7zKdMF8lbRmx+uQGx2+vDc+KI/eBnsy9kit5aj23AgGu3pa4t9AgwbnXWqS+iOY+2aA==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 6"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/caniuse-api": {
|
"node_modules/caniuse-api": {
|
||||||
"version": "4.0.0",
|
"version": "4.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/caniuse-api/-/caniuse-api-4.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/caniuse-api/-/caniuse-api-4.0.0.tgz",
|
||||||
@@ -4395,6 +4543,13 @@
|
|||||||
"node": ">=18"
|
"node": ">=18"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/didyoumean": {
|
||||||
|
"version": "1.2.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/didyoumean/-/didyoumean-1.2.2.tgz",
|
||||||
|
"integrity": "sha512-gxtyfqMg7GKyhQmb056K7M3xszy/myH8w+B4RT+QXBQsvAOdc3XymqDDPHx1BgPgsdAA5SIifona89YtRATDzw==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "Apache-2.0"
|
||||||
|
},
|
||||||
"node_modules/diff": {
|
"node_modules/diff": {
|
||||||
"version": "9.0.0",
|
"version": "9.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/diff/-/diff-9.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/diff/-/diff-9.0.0.tgz",
|
||||||
@@ -4410,6 +4565,13 @@
|
|||||||
"integrity": "sha512-qiSlmBq9+BCdCA/L46dw8Uy93mloxsPSbwnm5yrKn2vMPiy8KyAskTF6zuV/j5BMsmOGZDPs7KjU+mjb670kfA==",
|
"integrity": "sha512-qiSlmBq9+BCdCA/L46dw8Uy93mloxsPSbwnm5yrKn2vMPiy8KyAskTF6zuV/j5BMsmOGZDPs7KjU+mjb670kfA==",
|
||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
},
|
},
|
||||||
|
"node_modules/dlv": {
|
||||||
|
"version": "1.1.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/dlv/-/dlv-1.1.3.tgz",
|
||||||
|
"integrity": "sha512-+HlytyjlPKnIG8XuRG8WvmBP8xs8P71y+SKKS6ZXWoEgLuePxtDoUEiH7WkdePWrQ5JBpE6aoVqfZfJUQkjXwA==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT"
|
||||||
|
},
|
||||||
"node_modules/dot-prop": {
|
"node_modules/dot-prop": {
|
||||||
"version": "10.2.0",
|
"version": "10.2.0",
|
||||||
"resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-10.2.0.tgz",
|
"resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-10.2.0.tgz",
|
||||||
@@ -5162,6 +5324,17 @@
|
|||||||
"integrity": "sha512-rKANCbmsJCZ3/q87GTWZ+8MhOvhPLjsScznVtqvBoTu6Tyq8FzdPoBUMl/ZxQXy+/5I+C1vxXwS1jSwmHgmDLQ==",
|
"integrity": "sha512-rKANCbmsJCZ3/q87GTWZ+8MhOvhPLjsScznVtqvBoTu6Tyq8FzdPoBUMl/ZxQXy+/5I+C1vxXwS1jSwmHgmDLQ==",
|
||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
},
|
},
|
||||||
|
"node_modules/import-meta-resolve": {
|
||||||
|
"version": "4.2.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/import-meta-resolve/-/import-meta-resolve-4.2.0.tgz",
|
||||||
|
"integrity": "sha512-Iqv2fzaTQN28s/FwZAoFq0ZSs/7hMAHJVX+w8PZl3cY19Pxk6jFFalxQoIfW2826i/fDLXv8IiEZRIT0lDuWcg==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"funding": {
|
||||||
|
"type": "github",
|
||||||
|
"url": "https://github.com/sponsors/wooorm"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/impound": {
|
"node_modules/impound": {
|
||||||
"version": "1.2.1",
|
"version": "1.2.1",
|
||||||
"resolved": "https://registry.npmjs.org/impound/-/impound-1.2.1.tgz",
|
"resolved": "https://registry.npmjs.org/impound/-/impound-1.2.1.tgz",
|
||||||
@@ -5224,6 +5397,19 @@
|
|||||||
"url": "https://github.com/sponsors/brc-dd"
|
"url": "https://github.com/sponsors/brc-dd"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/is-binary-path": {
|
||||||
|
"version": "2.1.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz",
|
||||||
|
"integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"binary-extensions": "^2.0.0"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=8"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/is-core-module": {
|
"node_modules/is-core-module": {
|
||||||
"version": "2.18.0",
|
"version": "2.18.0",
|
||||||
"resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.18.0.tgz",
|
"resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.18.0.tgz",
|
||||||
@@ -5796,6 +5982,26 @@
|
|||||||
"url": "https://opencollective.com/parcel"
|
"url": "https://opencollective.com/parcel"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/lilconfig": {
|
||||||
|
"version": "3.1.5",
|
||||||
|
"resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-3.1.5.tgz",
|
||||||
|
"integrity": "sha512-aRAOI9Ia43ygL4o1EOmC/sc/0OFxrm7qcQngiIyWaqVnSnz932ybJ07zyCcgMNGSDP8Yxaf88Xj1zHEXmvQ4SA==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=14"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/sponsors/antonk52"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/lines-and-columns": {
|
||||||
|
"version": "1.2.4",
|
||||||
|
"resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz",
|
||||||
|
"integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT"
|
||||||
|
},
|
||||||
"node_modules/listhen": {
|
"node_modules/listhen": {
|
||||||
"version": "1.10.1",
|
"version": "1.10.1",
|
||||||
"resolved": "https://registry.npmjs.org/listhen/-/listhen-1.10.1.tgz",
|
"resolved": "https://registry.npmjs.org/listhen/-/listhen-1.10.1.tgz",
|
||||||
@@ -6214,6 +6420,18 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/mz": {
|
||||||
|
"version": "2.7.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/mz/-/mz-2.7.0.tgz",
|
||||||
|
"integrity": "sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"any-promise": "^1.0.0",
|
||||||
|
"object-assign": "^4.0.1",
|
||||||
|
"thenify-all": "^1.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/nanoid": {
|
"node_modules/nanoid": {
|
||||||
"version": "3.3.20",
|
"version": "3.3.20",
|
||||||
"resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.20.tgz",
|
"resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.20.tgz",
|
||||||
@@ -6661,6 +6879,26 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/object-assign": {
|
||||||
|
"version": "4.1.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz",
|
||||||
|
"integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=0.10.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/object-hash": {
|
||||||
|
"version": "3.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/object-hash/-/object-hash-3.0.0.tgz",
|
||||||
|
"integrity": "sha512-RSn9F68PjH9HqtltsSnqYC1XXoWe9Bju5+213R98cNGttag9q9yAOTzdbsqvIa7aNm5WffBZFpWYr2aWrklWAw==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 6"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/object-identity": {
|
"node_modules/object-identity": {
|
||||||
"version": "0.2.3",
|
"version": "0.2.3",
|
||||||
"resolved": "https://registry.npmjs.org/object-identity/-/object-identity-0.2.3.tgz",
|
"resolved": "https://registry.npmjs.org/object-identity/-/object-identity-0.2.3.tgz",
|
||||||
@@ -6934,6 +7172,16 @@
|
|||||||
"url": "https://github.com/sponsors/jonschlinkert"
|
"url": "https://github.com/sponsors/jonschlinkert"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/pirates": {
|
||||||
|
"version": "4.0.7",
|
||||||
|
"resolved": "https://registry.npmjs.org/pirates/-/pirates-4.0.7.tgz",
|
||||||
|
"integrity": "sha512-TfySrs/5nm8fQJDcBDuUng3VOUKsd7S+zqvbOTiGXHfxX4wK31ard+hoNuvkicM/2YFzlpDgABOevKSsB4G/FA==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 6"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/pkg-types": {
|
"node_modules/pkg-types": {
|
||||||
"version": "2.4.0",
|
"version": "2.4.0",
|
||||||
"resolved": "https://registry.npmjs.org/pkg-types/-/pkg-types-2.4.0.tgz",
|
"resolved": "https://registry.npmjs.org/pkg-types/-/pkg-types-2.4.0.tgz",
|
||||||
@@ -6997,6 +7245,125 @@
|
|||||||
"postcss": "^8.5.29"
|
"postcss": "^8.5.29"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/postcss-import": {
|
||||||
|
"version": "15.1.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/postcss-import/-/postcss-import-15.1.0.tgz",
|
||||||
|
"integrity": "sha512-hpr+J05B2FVYUAXHeK1YyI267J/dDDhMU6B6civm8hSY1jYJnBXxzKDKDswzJmtLHryrjhnDjqqp/49t8FALew==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"postcss-value-parser": "^4.0.0",
|
||||||
|
"read-cache": "^1.0.0",
|
||||||
|
"resolve": "^1.1.7"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=14.0.0"
|
||||||
|
},
|
||||||
|
"peerDependencies": {
|
||||||
|
"postcss": "^8.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/postcss-js": {
|
||||||
|
"version": "4.1.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/postcss-js/-/postcss-js-4.1.0.tgz",
|
||||||
|
"integrity": "sha512-oIAOTqgIo7q2EOwbhb8UalYePMvYoIeRY2YKntdpFQXNosSu3vLrniGgmH9OKs/qAkfoj5oB3le/7mINW1LCfw==",
|
||||||
|
"dev": true,
|
||||||
|
"funding": [
|
||||||
|
{
|
||||||
|
"type": "opencollective",
|
||||||
|
"url": "https://opencollective.com/postcss/"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "github",
|
||||||
|
"url": "https://github.com/sponsors/ai"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"camelcase-css": "^2.0.1"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": "^12 || ^14 || >= 16"
|
||||||
|
},
|
||||||
|
"peerDependencies": {
|
||||||
|
"postcss": "^8.4.21"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/postcss-load-config": {
|
||||||
|
"version": "4.0.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/postcss-load-config/-/postcss-load-config-4.0.2.tgz",
|
||||||
|
"integrity": "sha512-bSVhyJGL00wMVoPUzAVAnbEoWyqRxkjv64tUl427SKnPrENtq6hJwUojroMz2VB+Q1edmi4IfrAPpami5VVgMQ==",
|
||||||
|
"dev": true,
|
||||||
|
"funding": [
|
||||||
|
{
|
||||||
|
"type": "opencollective",
|
||||||
|
"url": "https://opencollective.com/postcss/"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "github",
|
||||||
|
"url": "https://github.com/sponsors/ai"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"lilconfig": "^3.0.0",
|
||||||
|
"yaml": "^2.3.4"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 14"
|
||||||
|
},
|
||||||
|
"peerDependencies": {
|
||||||
|
"postcss": ">=8.0.9",
|
||||||
|
"ts-node": ">=9.0.0"
|
||||||
|
},
|
||||||
|
"peerDependenciesMeta": {
|
||||||
|
"postcss": {
|
||||||
|
"optional": true
|
||||||
|
},
|
||||||
|
"ts-node": {
|
||||||
|
"optional": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/postcss-nested": {
|
||||||
|
"version": "6.2.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/postcss-nested/-/postcss-nested-6.2.0.tgz",
|
||||||
|
"integrity": "sha512-HQbt28KulC5AJzG+cZtj9kvKB93CFCdLvog1WFLf1D+xmMvPGlBstkpTEZfK5+AN9hfJocyBFCNiqyS48bpgzQ==",
|
||||||
|
"dev": true,
|
||||||
|
"funding": [
|
||||||
|
{
|
||||||
|
"type": "opencollective",
|
||||||
|
"url": "https://opencollective.com/postcss/"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "github",
|
||||||
|
"url": "https://github.com/sponsors/ai"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"postcss-selector-parser": "^6.1.1"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=12.0"
|
||||||
|
},
|
||||||
|
"peerDependencies": {
|
||||||
|
"postcss": "^8.2.14"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/postcss-selector-parser": {
|
||||||
|
"version": "6.1.6",
|
||||||
|
"resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-6.1.6.tgz",
|
||||||
|
"integrity": "sha512-BK87/Qgti3DIcgS2PaCVoteFIkjIFvCJBizZDIVSjdlFNg4Jv+SRqbN2JONb/qQUH4ZFqfXYF+izg15W2HVRvA==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"util-deprecate": "^1.0.2"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=4"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/postcss-value-parser": {
|
"node_modules/postcss-value-parser": {
|
||||||
"version": "4.2.0",
|
"version": "4.2.0",
|
||||||
"resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-4.2.0.tgz",
|
"resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-4.2.0.tgz",
|
||||||
@@ -7281,6 +7648,13 @@
|
|||||||
"destr": "^2.0.5"
|
"destr": "^2.0.5"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/read-cache": {
|
||||||
|
"version": "1.0.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/read-cache/-/read-cache-1.0.2.tgz",
|
||||||
|
"integrity": "sha512-/peqiBB/n07gQGLsWaHho3WfvUyRscw0gYTsEFMhrIe/nWLkYaf5SbKYjGYqtRV3aPwykJgF2VEMo1ac4bnsGA==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT"
|
||||||
|
},
|
||||||
"node_modules/readable-stream": {
|
"node_modules/readable-stream": {
|
||||||
"version": "4.8.0",
|
"version": "4.8.0",
|
||||||
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-4.8.0.tgz",
|
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-4.8.0.tgz",
|
||||||
@@ -8015,6 +8389,39 @@
|
|||||||
"integrity": "sha512-10ZL5r77LhknxlP1FBiCW+VdnuWOEFLdSS2SKtjyEV+L4qP1hUEIMIZW94LC3jKxRmT/Dj7KkD1mqh/IY6lhKQ==",
|
"integrity": "sha512-10ZL5r77LhknxlP1FBiCW+VdnuWOEFLdSS2SKtjyEV+L4qP1hUEIMIZW94LC3jKxRmT/Dj7KkD1mqh/IY6lhKQ==",
|
||||||
"license": "ISC"
|
"license": "ISC"
|
||||||
},
|
},
|
||||||
|
"node_modules/sucrase": {
|
||||||
|
"version": "3.35.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/sucrase/-/sucrase-3.35.1.tgz",
|
||||||
|
"integrity": "sha512-DhuTmvZWux4H1UOnWMB3sk0sbaCVOoQZjv8u1rDoTV0HTdGem9hkAZtl4JZy8P2z4Bg0nT+YMeOFyVr4zcG5Tw==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"@jridgewell/gen-mapping": "^0.3.2",
|
||||||
|
"commander": "^4.0.0",
|
||||||
|
"lines-and-columns": "^1.1.6",
|
||||||
|
"mz": "^2.7.0",
|
||||||
|
"pirates": "^4.0.1",
|
||||||
|
"tinyglobby": "^0.2.11",
|
||||||
|
"ts-interface-checker": "^0.1.9"
|
||||||
|
},
|
||||||
|
"bin": {
|
||||||
|
"sucrase": "bin/sucrase",
|
||||||
|
"sucrase-node": "bin/sucrase-node"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=16 || 14 >=14.17"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/sucrase/node_modules/commander": {
|
||||||
|
"version": "4.1.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/commander/-/commander-4.1.1.tgz",
|
||||||
|
"integrity": "sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 6"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/supports-color": {
|
"node_modules/supports-color": {
|
||||||
"version": "10.2.2",
|
"version": "10.2.2",
|
||||||
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-10.2.2.tgz",
|
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-10.2.2.tgz",
|
||||||
@@ -8051,6 +8458,131 @@
|
|||||||
"url": "https://github.com/sponsors/sindresorhus"
|
"url": "https://github.com/sponsors/sindresorhus"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/tailwindcss": {
|
||||||
|
"version": "3.4.17",
|
||||||
|
"resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-3.4.17.tgz",
|
||||||
|
"integrity": "sha512-w33E2aCvSDP0tW9RZuNXadXlkHXqFzSkQew/aIa2i/Sj8fThxwovwlXHSPXTbAHwEIhBFXAedUhP2tueAKP8Og==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"@alloc/quick-lru": "^5.2.0",
|
||||||
|
"arg": "^5.0.2",
|
||||||
|
"chokidar": "^3.6.0",
|
||||||
|
"didyoumean": "^1.2.2",
|
||||||
|
"dlv": "^1.1.3",
|
||||||
|
"fast-glob": "^3.3.2",
|
||||||
|
"glob-parent": "^6.0.2",
|
||||||
|
"is-glob": "^4.0.3",
|
||||||
|
"jiti": "^1.21.6",
|
||||||
|
"lilconfig": "^3.1.3",
|
||||||
|
"micromatch": "^4.0.8",
|
||||||
|
"normalize-path": "^3.0.0",
|
||||||
|
"object-hash": "^3.0.0",
|
||||||
|
"picocolors": "^1.1.1",
|
||||||
|
"postcss": "^8.4.47",
|
||||||
|
"postcss-import": "^15.1.0",
|
||||||
|
"postcss-js": "^4.0.1",
|
||||||
|
"postcss-load-config": "^4.0.2",
|
||||||
|
"postcss-nested": "^6.2.0",
|
||||||
|
"postcss-selector-parser": "^6.1.2",
|
||||||
|
"resolve": "^1.22.8",
|
||||||
|
"sucrase": "^3.35.0"
|
||||||
|
},
|
||||||
|
"bin": {
|
||||||
|
"tailwind": "lib/cli.js",
|
||||||
|
"tailwindcss": "lib/cli.js"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=14.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/tailwindcss/node_modules/chokidar": {
|
||||||
|
"version": "3.6.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.6.0.tgz",
|
||||||
|
"integrity": "sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"anymatch": "~3.1.2",
|
||||||
|
"braces": "~3.0.2",
|
||||||
|
"glob-parent": "~5.1.2",
|
||||||
|
"is-binary-path": "~2.1.0",
|
||||||
|
"is-glob": "~4.0.1",
|
||||||
|
"normalize-path": "~3.0.0",
|
||||||
|
"readdirp": "~3.6.0"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 8.10.0"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"url": "https://paulmillr.com/funding/"
|
||||||
|
},
|
||||||
|
"optionalDependencies": {
|
||||||
|
"fsevents": "~2.3.2"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/tailwindcss/node_modules/chokidar/node_modules/glob-parent": {
|
||||||
|
"version": "5.1.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz",
|
||||||
|
"integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "ISC",
|
||||||
|
"dependencies": {
|
||||||
|
"is-glob": "^4.0.1"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 6"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/tailwindcss/node_modules/glob-parent": {
|
||||||
|
"version": "6.0.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz",
|
||||||
|
"integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "ISC",
|
||||||
|
"dependencies": {
|
||||||
|
"is-glob": "^4.0.3"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=10.13.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/tailwindcss/node_modules/jiti": {
|
||||||
|
"version": "1.21.7",
|
||||||
|
"resolved": "https://registry.npmjs.org/jiti/-/jiti-1.21.7.tgz",
|
||||||
|
"integrity": "sha512-/imKNG4EbWNrVjoNC/1H5/9GFy+tqjGBHCaSsN+P2RnPqjsLmv6UD3Ej+Kj8nBWaRAwyk7kK5ZUc+OEatnTR3A==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"bin": {
|
||||||
|
"jiti": "bin/jiti.js"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/tailwindcss/node_modules/picomatch": {
|
||||||
|
"version": "2.3.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.2.tgz",
|
||||||
|
"integrity": "sha512-V7+vQEJ06Z+c5tSye8S+nHUfI51xoXIXjHQ99cQtKUkQqqO1kO/KCJUfZXuB47h/YBlDhah2H3hdUGXn8ie0oA==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=8.6"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/sponsors/jonschlinkert"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/tailwindcss/node_modules/readdirp": {
|
||||||
|
"version": "3.6.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz",
|
||||||
|
"integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"picomatch": "^2.2.1"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=8.10.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/tar": {
|
"node_modules/tar": {
|
||||||
"version": "7.5.23",
|
"version": "7.5.23",
|
||||||
"resolved": "https://registry.npmjs.org/tar/-/tar-7.5.23.tgz",
|
"resolved": "https://registry.npmjs.org/tar/-/tar-7.5.23.tgz",
|
||||||
@@ -8124,6 +8656,29 @@
|
|||||||
"b4a": "^1.6.4"
|
"b4a": "^1.6.4"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/thenify": {
|
||||||
|
"version": "3.3.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/thenify/-/thenify-3.3.1.tgz",
|
||||||
|
"integrity": "sha512-RVZSIV5IG10Hk3enotrhvz0T9em6cyHBLkH/YAZuKqd8hRkKhSfCGIcP2KUY0EPxndzANBmNllzWPwak+bheSw==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"any-promise": "^1.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/thenify-all": {
|
||||||
|
"version": "1.6.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/thenify-all/-/thenify-all-1.6.0.tgz",
|
||||||
|
"integrity": "sha512-RNxQH/qI8/t3thXJDwcstUO4zeqo64+Uy/+sNVRBx4Xn2OX+OZ9oP+iJnNFqplFra2ZUVeKCSa2oVWi3T4uVmA==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"thenify": ">= 3.1.0 < 4"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=0.8"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/tiny-invariant": {
|
"node_modules/tiny-invariant": {
|
||||||
"version": "1.3.3",
|
"version": "1.3.3",
|
||||||
"resolved": "https://registry.npmjs.org/tiny-invariant/-/tiny-invariant-1.3.3.tgz",
|
"resolved": "https://registry.npmjs.org/tiny-invariant/-/tiny-invariant-1.3.3.tgz",
|
||||||
@@ -8243,6 +8798,13 @@
|
|||||||
"integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==",
|
"integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==",
|
||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
},
|
},
|
||||||
|
"node_modules/ts-interface-checker": {
|
||||||
|
"version": "0.1.13",
|
||||||
|
"resolved": "https://registry.npmjs.org/ts-interface-checker/-/ts-interface-checker-0.1.13.tgz",
|
||||||
|
"integrity": "sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "Apache-2.0"
|
||||||
|
},
|
||||||
"node_modules/tslib": {
|
"node_modules/tslib": {
|
||||||
"version": "2.9.1",
|
"version": "2.9.1",
|
||||||
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.9.1.tgz",
|
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.9.1.tgz",
|
||||||
@@ -9598,6 +10160,22 @@
|
|||||||
"integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==",
|
"integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==",
|
||||||
"license": "ISC"
|
"license": "ISC"
|
||||||
},
|
},
|
||||||
|
"node_modules/yaml": {
|
||||||
|
"version": "2.9.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/yaml/-/yaml-2.9.1.tgz",
|
||||||
|
"integrity": "sha512-3NxN8+78OdzbT7C/WjGsyfPAtJaN3FNDsWxv7Y7mcDsT/oOmgW8BpyQQFFBnvZE3j9Y2Sdz1ULFLezL7Eb2yFw==",
|
||||||
|
"devOptional": true,
|
||||||
|
"license": "ISC",
|
||||||
|
"bin": {
|
||||||
|
"yaml": "bin.mjs"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 14.6"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/sponsors/eemeli"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/yargs": {
|
"node_modules/yargs": {
|
||||||
"version": "18.2.0",
|
"version": "18.2.0",
|
||||||
"resolved": "https://registry.npmjs.org/yargs/-/yargs-18.2.0.tgz",
|
"resolved": "https://registry.npmjs.org/yargs/-/yargs-18.2.0.tgz",
|
||||||
|
|||||||
@@ -22,7 +22,12 @@
|
|||||||
"sit-onyx": "1.22.0"
|
"sit-onyx": "1.22.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
"@iconify-json/material-symbols": "^1.2.99",
|
||||||
|
"@nuxt/icon": "^2.6.2",
|
||||||
"@types/qrcode": "1.5.5",
|
"@types/qrcode": "1.5.5",
|
||||||
|
"autoprefixer": "^10.6.2",
|
||||||
|
"postcss": "^8.5.33",
|
||||||
|
"tailwindcss": "3.4.17",
|
||||||
"typescript": "5.9.3",
|
"typescript": "5.9.3",
|
||||||
"vitest": "3.2.4"
|
"vitest": "3.2.4"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,6 @@
|
|||||||
|
export default {
|
||||||
|
plugins: {
|
||||||
|
tailwindcss: {},
|
||||||
|
autoprefixer: {},
|
||||||
|
},
|
||||||
|
}
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
{"source":"OpenStreetMap contributors, ODbL","generated":"2026-11-14","bounds":{"minlat":49.1394,"maxlat":49.1432,"minlon":9.2169,"maxlon":9.2212},"buildings":[{"name":"Galeria Kaufhof","kind":"retail","points":[[9.217234,49.14003],[9.218368,49.140169],[9.218594,49.140196],[9.218709,49.139793],[9.218446,49.139761],[9.218451,49.139745],[9.218229,49.139718],[9.218217,49.139759],[9.217871,49.139717],[9.217342,49.139652],[9.217333,49.139682],[9.217252,49.139967],[9.217234,49.14003]]},{"name":"Klosterhof","kind":"retail","points":[[9.219945,49.141147],[9.220166,49.141526],[9.220209,49.141642],[9.22039,49.141588],[9.220465,49.141571],[9.220498,49.141567],[9.220502,49.141589],[9.220623,49.141572],[9.22076,49.141554],[9.220791,49.141622],[9.220803,49.141665],[9.220851,49.141658],[9.220852,49.141661],[9.221174,49.14138],[9.220895,49.141412],[9.220765,49.140947],[9.219945,49.141147]]},{"name":null,"kind":"apartments","points":[[9.217057,49.142312],[9.217105,49.142493],[9.217134,49.142588],[9.217184,49.142667],[9.217324,49.142883],[9.217967,49.142714],[9.217962,49.142692],[9.218102,49.142682],[9.218081,49.14255],[9.218058,49.142549],[9.21805,49.142484],[9.218098,49.142478],[9.218158,49.142475],[9.218156,49.142461],[9.218157,49.142454],[9.218169,49.142452],[9.218131,49.142282],[9.218008,49.142302],[9.218012,49.142322],[9.217959,49.142339],[9.21796,49.142385],[9.217964,49.142469],[9.217831,49.14248],[9.217853,49.142616],[9.217816,49.142627],[9.217413,49.142737],[9.217295,49.142556],[9.217273,49.142477],[9.217251,49.142392],[9.21728,49.142387],[9.217371,49.142374],[9.217315,49.142264],[9.217188,49.142288],[9.21718,49.14227],[9.217057,49.142312]]},{"name":null,"kind":"commercial","points":[[9.219126,49.139658],[9.219223,49.139686],[9.219263,49.139638],[9.219402,49.139685],[9.219371,49.13973],[9.219519,49.139782],[9.21945,49.139872],[9.219604,49.139921],[9.219663,49.139846],[9.219701,49.139855],[9.219638,49.139936],[9.219812,49.139992],[9.219875,49.139911],[9.220056,49.139984],[9.220231,49.139798],[9.219261,49.139474],[9.219126,49.139658]]},{"name":"Stadtgalerie","kind":"public","points":[[9.216965,49.140699],[9.21707,49.140657],[9.217226,49.14034],[9.217606,49.140368],[9.21827,49.140332],[9.218329,49.140318],[9.218398,49.140296],[9.218447,49.140275],[9.218444,49.140269],[9.218458,49.140258],[9.218459,49.140246],[9.218373,49.140232],[9.217333,49.140098],[9.216965,49.140699]]},{"name":"Kilianskirche","kind":"church","points":[[9.219108,49.141871],[9.219628,49.141799],[9.219632,49.141817],[9.219774,49.141803],[9.219814,49.141798],[9.219856,49.14176],[9.219834,49.141756],[9.219847,49.141717],[9.21987,49.1417],[9.219889,49.141704],[9.219893,49.141692],[9.219871,49.141689],[9.219866,49.141664],[9.219884,49.141656],[9.219875,49.141648],[9.219798,49.141622],[9.219792,49.141608],[9.219814,49.1416],[9.219807,49.141593],[9.219741,49.141589],[9.219733,49.141556],[9.219718,49.141557],[9.21968,49.141561],[9.219677,49.141547],[9.219575,49.141558],[9.219565,49.141605],[9.219503,49.141591],[9.21905,49.141642],[9.2189,49.14169],[9.218924,49.141778],[9.218905,49.141778],[9.218905,49.141797],[9.21891,49.141797],[9.218918,49.141817],[9.218967,49.14183],[9.218979,49.141849],[9.218962,49.141861],[9.219108,49.141871]]},{"name":"Deutschhof","kind":"public","points":[[9.2172,49.141208],[9.217327,49.141209],[9.217409,49.140619],[9.217477,49.140531],[9.2175,49.14054],[9.217928,49.140516],[9.21798,49.140513],[9.217997,49.140415],[9.217369,49.140451],[9.217268,49.140583],[9.217267,49.140588],[9.217257,49.140628],[9.217176,49.141206],[9.2172,49.141208]]},{"name":"Parkhaus Klosterhof - Kiliansplatz","kind":"building","points":[[9.220895,49.141412],[9.221174,49.14138],[9.221107,49.141122],[9.221063,49.140888],[9.22096,49.140907],[9.220765,49.140947],[9.220895,49.141412]]},{"name":"St. Peter und Paul","kind":"church","points":[[9.217219,49.141341],[9.217383,49.141345],[9.217381,49.141365],[9.217375,49.141369],[9.21738,49.141373],[9.217528,49.141364],[9.217539,49.141396],[9.217552,49.141364],[9.217809,49.141377],[9.217815,49.141374],[9.217807,49.141369],[9.217808,49.141326],[9.217876,49.141309],[9.21788,49.141264],[9.217828,49.141229],[9.217602,49.141239],[9.217611,49.141151],[9.217582,49.141131],[9.217537,49.14113],[9.217522,49.14114],[9.217382,49.141138],[9.217381,49.141182],[9.217329,49.141181],[9.217327,49.141209],[9.2172,49.141208],[9.21721,49.141274],[9.217219,49.141341]]},{"name":"Holiday Inn Express","kind":"building","points":[[9.220683,49.140836],[9.220685,49.140841],[9.220612,49.140856],[9.220533,49.1408],[9.220699,49.140522],[9.220862,49.140568],[9.220803,49.140664],[9.220839,49.140675],[9.221055,49.140627],[9.221041,49.140601],[9.221131,49.14058],[9.221138,49.140596],[9.221104,49.14075],[9.221109,49.14076],[9.221061,49.14077],[9.221056,49.14076],[9.220683,49.140836]]},{"name":"REWE City","kind":"commercial","points":[[9.219065,49.140621],[9.219114,49.140709],[9.219154,49.140782],[9.219754,49.140629],[9.219711,49.14052],[9.219302,49.14057],[9.Line truncated
|
||||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1 @@
|
|||||||
|
{"meta":{"source":"glass_fill_levels_anonymized_f.csv","generated_at":"2026-11-14T16:53:20Z","rows":11701,"containers":449,"material_series":1338,"date_from":"2025-10-17","date_to":"2026-09-30","reference_date":"2026-09-30","overfull_readings":1192,"priority_rule":"high: overfull_count >= 5 or (overfull_count >= 2 and overfull_rate >= 0.25); medium: overfull_count >= 1 and not high; low: 0","limitations":["No coordinates in the dataset; this is a priority proof, not a route.","No container capacity or depot data.","Overfull is a reported state, not a measured volume."]},"summary":{"priority_counts":{"high":88,"medium":248,"low":113},"by_material":{"white":{"readings":4432,"overfull":731},"green":{"readings":4169,"overfull":357},"brown":{"readings":3100,"overfull":104}}},"top":[{"location_id":"eecbf6fa-decf-46da-b110-bf014e7c181d","priority":"high","priority_score":21.525,"readings":80,"overfull_count":21,"overfull_rate":0.2625,"p95_fill":100,"max_fill":100,"mean_fill":64.24,"last_fill":null,"last_is_overfull":true,"last_date":"2026-09-29","days_since_last":1,"trend":30,"materials":{"white":{"readings":29,"overfull_count":12,"last_fill":null,"last_is_overfull":true,"last_date":"2026-09-29"},"green":{"readings":29,"overfull_count":6,"last_fill":null,"last_is_overfull":true,"last_date":"2026-09-29"},"brown":{"readings":22,"overfull_count":3,"last_fill":null,"last_is_overfull":true,"last_date":"2026-09-29"}}},{"location_id":"fdccb1ff-bce6-4e0f-842d-305a11a8de2e","priority":"high","priority_score":20.4396,"readings":91,"overfull_count":20,"overfull_rate":0.21978021978021978,"p95_fill":100,"max_fill":100,"mean_fill":65.07,"last_fill":80,"last_is_overfull":false,"last_date":"2026-09-09","days_since_last":21,"trend":30,"materials":{"white":{"readings":33,"overfull_count":9,"last_fill":80,"last_is_overfull":false,"last_date":"2026-09-09"},"green":{"readings":32,"overfull_count":7,"last_fill":70,"last_is_overfull":false,"last_date":"2026-09-09"},"brown":{"readings":26,"overfull_count":4,"last_fill":20,"last_is_overfull":false,"last_date":"2026-09-09"}}},{"location_id":"80b7f22a-d2e7-44a8-a6d7-c1948331fa51","priority":"high","priority_score":18.8372,"readings":43,"overfull_count":18,"overfull_rate":0.4186046511627907,"p95_fill":100,"max_fill":100,"mean_fill":70.4,"last_fill":null,"last_is_overfull":true,"last_date":"2026-09-28","days_since_last":2,"trend":0,"materials":{"white":{"readings":17,"overfull_count":6,"last_fill":null,"last_is_overfull":true,"last_date":"2026-09-28"},"green":{"readings":17,"overfull_count":9,"last_fill":null,"last_is_overfull":true,"last_date":"2026-09-28"},"brown":{"readings":9,"overfull_count":3,"last_fill":null,"last_is_overfull":true,"last_date":"2026-09-28"}}},{"location_id":"2a91cfc0-cda2-454b-bfd1-bbf0035a2c06","priority":"high","priority_score":13.4483,"readings":58,"overfull_count":13,"overfull_rate":0.22413793103448276,"p95_fill":100,"max_fill":100,"mean_fill":63.11,"last_fill":40,"last_is_overfull":false,"last_date":"2026-09-17","days_since_last":13,"trend":10,"materials":{"white":{"readings":21,"overfull_count":8,"last_fill":40,"last_is_overfull":false,"last_date":"2026-09-17"},"green":{"readings":20,"overfull_count":3,"last_fill":40,"last_is_overfull":false,"last_date":"2026-09-17"},"brown":{"readings":17,"overfull_count":2,"last_fill":20,"last_is_overfull":false,"last_date":"2026-09-17"}}},{"location_id":"9dc40dd4-2ad6-4d7e-a920-71ff3c5c9356","priority":"high","priority_score":11.4681,"readings":47,"overfull_count":11,"overfull_rate":0.23404255319148937,"p95_fill":100,"max_fill":100,"mean_fill":60.56,"last_fill":60,"last_is_overfull":false,"last_date":"2026-09-17","days_since_last":13,"trend":10,"materials":{"white":{"readings":18,"overfull_count":6,"last_fill":60,"last_is_overfull":false,"last_date":"2026-09-17"},"green":{"readings":18,"overfull_count":4,"last_fill":20,"last_is_overfull":false,"last_date":"2026-09-17"},"brown":{"readings":11,"overfull_count":1,"last_fill":40,"last_is_overfull":false,"last_date":"2026-09-17"}}},{"location_id":"e5466d8a-3c44-4f2b-a624-d944703ff27b","priority":"high","priority_score":11.4074,"readings":54,"overfull_count":11,"overfull_rate":0.2037037037037037,"p95_fill":100,"max_fill":100,"mean_fill":65.81,"last_fill":90,"last_is_overfull":false,"last_date":"2026-09-17","days_since_last":13,"trend":35,"materials":{"white":{"readings":20,"overfull_count":7,"last_fill":90,"last_is_overfull":false,"last_date":"2026-09-17"},"green":{"readings":19,"overfull_count":3,"last_fill":60,"last_is_overfull":false,"last_date":"2026-09-17"},"brown":{"readings":15,"overfull_count":1,"last_fill":20,"last_is_overfull":false,"last_date":"2026-09-17"}}},{"location_id":"cf3c2e1a-6061-471c-8e22-9dded9f30184","priority":"high","priority_score":11.3333,"readings":66,"overfull_count":11,"overfull_rate":0.16666666666666666,"p95_fill":100,"max_fill":100,"mean_fill":59.64,"last_fill":50,"last_is_overfull":false,"last_date":"2026-09-17","days_since_last":13,"trend":15,"mateLine truncated
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
<svg width="180" height="40" viewBox="0 0 180 40" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<g clip-path="url(#clip0_931_1595)">
|
||||||
|
<path fill-rule="evenodd" clip-rule="evenodd" d="M102.884 0.61925C102.884 0.16508 102.724 0 102.284 0H98.6418C98.2417 0 98.0414 0.165482 98.0414 0.61925V8.75164C96.7209 8.58656 94.9998 8.50402 92.9189 8.50402C85.5151 8.50402 83.7543 10.981 83.7543 20.1449C83.7543 29.3914 85.5151 31.7444 93.5993 31.7444C96.4804 31.7444 98.7616 31.5793 102.163 31.0011C102.644 30.9186 102.884 30.7125 102.884 30.1343V0.61925ZM88.5965 20.1445C88.5965 14.2001 89.1973 12.838 93.6793 12.838H98.041V27.0795C96.6409 27.2856 94.8 27.4097 93.5591 27.4097C89.0369 27.4097 88.5965 25.7585 88.5965 20.1445ZM110.085 5.86164C111.966 5.86164 112.967 4.87076 112.967 3.01341C112.967 1.19673 111.966 0.206249 110.085 0.206249C108.204 0.206249 107.204 1.19713 107.204 3.01341C107.204 4.87116 108.204 5.86164 110.085 5.86164ZM112.527 9.32911C112.527 8.91641 112.326 8.70986 111.926 8.70986H108.245C107.844 8.70986 107.644 8.91641 107.644 9.32911V30.9183C107.644 31.331 107.844 31.5376 108.245 31.5376H111.926C112.326 31.5376 112.527 31.331 112.527 30.9183V9.32911ZM135.019 9.24658C135.499 9.28806 135.78 9.57674 135.78 10.072V30.2165C135.739 37.3991 134.379 39.9997 126.255 39.9997C124.254 39.9997 121.853 39.8757 119.692 39.5455C119.331 39.463 119.132 39.2564 119.132 38.8848V36.4493C119.132 35.9955 119.331 35.83 119.732 35.83H125.975C129.977 35.83 130.937 34.8396 130.937 31.5782V31.3717C129.217 31.6608 127.695 31.7433 125.815 31.7433C118.411 31.7433 116.61 29.2667 116.61 19.9373C116.61 10.8559 118.451 8.50292 126.495 8.50292C129.977 8.50292 132.978 8.83348 135.019 9.24658ZM126.335 12.8377C121.933 12.8377 121.493 14.4478 121.493 20.1028C121.493 26.0058 122.093 27.3679 126.575 27.3679C127.896 27.3679 129.537 27.3264 130.938 27.1203V12.8381H126.335L126.335 12.8377ZM142.982 5.86164C144.864 5.86164 145.864 4.87076 145.864 3.01341C145.864 1.19673 144.864 0.206249 142.982 0.206249C141.101 0.206249 140.101 1.19713 140.101 3.01341C140.101 4.87116 141.101 5.86164 142.982 5.86164ZM145.424 9.32911C145.424 8.91641 145.223 8.70986 144.823 8.70986H141.141C140.741 8.70986 140.541 8.91641 140.541 9.32911V30.9183C140.541 31.331 140.741 31.5376 141.141 31.5376H144.823C145.223 31.5376 145.424 31.331 145.424 30.9183V9.32911ZM155.667 2.39423C156.108 2.27022 156.347 2.51824 156.347 2.97241V8.75141H160.309C160.71 8.75141 160.95 8.95796 160.95 9.37066V11.9713C160.95 12.425 160.71 12.6316 160.309 12.6316H156.347V25.2219C156.347 27.0382 156.868 27.4098 158.828 27.4098H160.59C161.07 27.4098 161.27 27.5749 161.27 27.988V30.7126C161.27 31.1664 161.07 31.373 160.67 31.4555C159.549 31.662 158.428 31.7446 157.828 31.7446C154.707 31.7446 151.465 31.662 151.465 26.7084V12.6316H149.184C148.784 12.6316 148.544 12.425 148.544 11.9713V9.37066C148.544 8.95796 148.783 8.75141 149.184 8.75141H151.465V4.00436C151.465 3.59166 151.665 3.42618 152.025 3.34364L155.667 2.39423ZM179.119 9.61851C179.119 9.24688 178.919 9.04033 178.519 8.95779V8.95819C176.198 8.58656 173.997 8.50402 172.276 8.50402C167.273 8.50402 163.672 9.53597 163.672 14.0354V14.8612C163.672 17.2967 164.552 19.7733 167.673 20.9293L172.956 22.9932C174.757 23.695 175.237 24.3553 175.237 25.3462V25.7589C175.237 27.2039 174.397 27.5341 171.716 27.5341H163.952C163.471 27.5341 163.311 27.7406 163.311 28.1948V30.7539C163.311 31.1256 163.431 31.3317 163.912 31.3732C165.232 31.4972 168.234 31.7448 171.715 31.7448C176.958 31.7448 180 30.6714 180 25.9654V25.4287C180 22.8692 179.439 20.7638 175.918 19.4017L170.675 17.4203C168.994 16.7596 168.474 15.9753 168.474 14.9848V14.4896C168.474 13.21 169.434 12.6733 171.115 12.6733H178.479C178.919 12.6733 179.119 12.4667 179.119 12.054V9.61851Z" fill="white"/>
|
||||||
|
<path fill-rule="evenodd" clip-rule="evenodd" d="M23.492 5.30318C23.492 5.09945 23.3932 4.97705 23.1957 4.97705H20.8642C20.6667 4.97705 20.5679 5.09945 20.5679 5.30318V20.4241C20.5679 20.6483 20.6468 20.7502 20.8443 20.7502H23.2153C23.4128 20.7502 23.5115 20.6483 23.5115 20.4241V11.8448H25.29C27.1074 11.8448 27.4236 11.9873 27.4236 14.9016V20.4241C27.4236 20.6483 27.5025 20.7502 27.7004 20.7502H30.051C30.2486 20.7502 30.3477 20.6483 30.3477 20.4241V14.1269C30.3477 9.9697 29.3597 9.2361 25.5862 9.2361C25.0331 9.2361 24.2231 9.25664 23.492 9.33797V5.30318ZM18.3745 9.50105C18.5919 9.54171 18.7102 9.64358 18.7102 9.90851V11.5182C18.7102 11.7425 18.5916 11.8444 18.3745 11.8444H15.1541C13.3367 11.8444 13.0599 12.4761 13.0599 15.0437C13.0599 17.5912 13.3367 18.2434 15.1541 18.2434H18.3745C18.5919 18.2434 18.7102 18.3453 18.7102 18.549V20.1793C18.7102 20.4237 18.5916 20.5259 18.3745 20.5666C17.3077 20.811 15.8853 20.8521 15.1541 20.8521C10.9462 20.8521 10.1362 19.6905 10.1362 15.0441C10.1362 10.3977 10.9462 9.23611 15.1541 9.23611C15.8853 9.23611 17.3077 9.27678 18.3745 9.50105ZM7.82298 9.501C8.05992 9.5622 8.13916 9.64353 8.13916 9.82713V11.3761C8.13916 11.6003 8.06031 11.7022 7.80346 11.7022H4.24739C3.47684 11.7022 3.0818 11.9265 3.0818 12.4358V12.6395C3.0818 13.0269 3.31875 13.3119 4.03035 13.5769L6.55942 14.4941C8.2387 15.1053 8.63374 16.165 8.63374 17.5508V17.877C8.63374 20.2408 6.93416 20.8524 4.42538 20.8524C2.70668 20.8524 1.28425 20.7506 0.3357 20.6487C0.0788505 20.6487 0 20.5674 0 20.3431V18.6923C0 18.468 0.0987583 18.3867 0.3357 18.3867H4.38596C5.43327 18.3867 5.74906 18.2442 5.74906 17.6938V17.5102C5.74906 17.1228 5.53163 16.8579 4.66233 16.5523L2.23201 15.6557C0.6714 15.1053 0.217034 13.8623 0.217034 12.5582V12.1709C0.217034 9.9902 1.85689 9.23647 4.70175 9.23647C5.55154 9.23647 6.6777 9.29767 7.82337 9.5014L7.82298 9.501ZM48.2288 9.33819C48.4263 9.33819 48.4856 9.39939 48.4657 9.62326L46.7665 18.8142C46.4308 20.628 45.8777 20.8523 44.0595 20.8523C41.7876 20.8523 41.5503 20.628 41.1556 18.8142L40.1876 14.2902L39.2195 18.8142C38.8444 20.628 38.5875 20.8523 36.3352 20.8523C34.4979 20.8523 33.9643 20.628 33.6086 18.8142L31.9294 9.62326C31.8895 9.39899 31.9692 9.33819 32.1663 9.33819H34.6755C34.7941 9.33819 34.8531 9.39939 34.8929 9.62326L36.256 17.9376C36.3352 18.2839 36.3942 18.325 36.5722 18.325C36.79 18.325 36.829 18.2843 36.8887 17.9376L38.7261 9.96952C38.7851 9.74525 38.8838 9.68405 39.0423 9.68405H41.3539C41.4921 9.68405 41.6108 9.74525 41.6502 9.96952L43.4876 17.9376C43.5668 18.2839 43.6063 18.325 43.8042 18.325C43.9818 18.325 44.0606 18.2843 44.1399 17.9376L45.503 9.62326C45.5424 9.39899 45.5818 9.33819 45.7204 9.33819H48.2288ZM58.78 19.7924V12.7415L58.7804 12.7419C58.7804 10.5407 57.9107 9.23655 53.999 9.23655C52.7741 9.23655 51.6284 9.29775 50.423 9.54215C50.2255 9.58322 50.1467 9.62389 50.1467 9.86829V11.5392C50.1467 11.7836 50.2056 11.8448 50.423 11.8448H53.999C55.2634 11.8448 55.8563 12.2728 55.8563 13.2508V13.9844H53.3471C50.7197 13.9844 49.3367 14.5755 49.2969 17.3267C49.3363 20.526 50.8969 20.8521 53.8604 20.8521C55.2235 20.8521 56.9622 20.7503 58.3452 20.4241C58.7008 20.3017 58.78 20.1185 58.78 19.7924ZM52.2007 17.1636C52.2007 16.2875 52.5563 15.9408 53.5837 15.9408H53.5841H55.8559V18.2028C55.2829 18.3659 54.2754 18.4065 53.88 18.4065C52.6351 18.4065 52.2007 18.1416 52.2007 17.1636ZM67.2379 9.46034C67.4553 9.52154 67.5541 9.60287 67.5541 9.86781V11.5387C67.5541 11.7425 67.4354 11.8443 67.2184 11.8443H65.3611C64.3337 11.8443 63.9781 12.0074 63.9781 12.8835V20.4236C63.9781 20.6479 63.8793 20.7498 63.6818 20.7498H61.3308C61.1332 20.7498 61.0345 20.6479 61.0345 20.4236V12.1093C61.0345 9.54167 62.8129 9.23567 64.6105 9.23567C65.1835 9.23567 66.5466 9.29728 67.2379 9.46034ZM77.6495 9.64372C77.6495 9.43999 77.5312 9.33813 77.3138 9.33813L77.3134 9.33772H68.9763C68.7394 9.33772 68.6406 9.43959 68.6406 9.64332V11.5792C68.6406 11.7829 68.7394 11.8848 68.9763 11.8848H73.5598L68.5419 18.7118C68.4431 18.8548 68.4037 18.9566 68.4037 19.0992V20.4238C68.4037 20.6481 68.5224 20.75 68.7593 20.75H77.5707C77.7877 20.75 77.9063 20.6481 77.9063 20.4238V18.4473C77.9063 18.2436 77.7881 18.1417 77.5707 18.1417H72.6511L77.5113 11.4169C77.5906 11.2945 77.6495 11.1927 77.6495 11.0296V9.64372Z" fill="#00C3CD"/>
|
||||||
|
</g>
|
||||||
|
<defs>
|
||||||
|
<clipPath id="clip0_931_1595">
|
||||||
|
<rect width="180" height="40" fill="white"/>
|
||||||
|
</clipPath>
|
||||||
|
</defs>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 8.0 KiB |
@@ -0,0 +1,221 @@
|
|||||||
|
// Build the small, committed data artifacts used by /use-cases.
|
||||||
|
//
|
||||||
|
// Sources (outside this repo):
|
||||||
|
// ../../cool-city-data/route/raw/area_osm.xml OSM extract, ODbL
|
||||||
|
// ../../ML-py.git/feat-prezero-api/artifacts/prezero_priority.json
|
||||||
|
//
|
||||||
|
// Outputs:
|
||||||
|
// public/cool-city/buildings.json real building footprints around the routes
|
||||||
|
// public/prezero/priority.json summary + top priority containers
|
||||||
|
//
|
||||||
|
// Run from the web repo root:
|
||||||
|
// node scripts/build-use-case-data.mjs
|
||||||
|
import fs from 'node:fs'
|
||||||
|
import path from 'node:path'
|
||||||
|
|
||||||
|
const root = process.cwd()
|
||||||
|
const dataRoot = path.resolve(root, '../..')
|
||||||
|
|
||||||
|
// Route window with a small margin: the three routes span
|
||||||
|
// lat 49.14023..49.14254, lon 9.21753..9.22039.
|
||||||
|
const BOUNDS = { minlat: 49.1394, maxlat: 49.1432, minlon: 9.2169, maxlon: 9.2212 }
|
||||||
|
const SIMPLIFY_TOLERANCE = 0.000018
|
||||||
|
|
||||||
|
function decodeXml(value) {
|
||||||
|
return value
|
||||||
|
.replaceAll('&', '&')
|
||||||
|
.replaceAll('"', '"')
|
||||||
|
.replaceAll(''', "'")
|
||||||
|
.replaceAll('<', '<')
|
||||||
|
.replaceAll('>', '>')
|
||||||
|
}
|
||||||
|
|
||||||
|
function readOsm(file) {
|
||||||
|
const xml = fs.readFileSync(file, 'utf8')
|
||||||
|
const nodes = new Map()
|
||||||
|
const nodeRe = /<node\b([^>]*?)\/?>/g
|
||||||
|
let match
|
||||||
|
while ((match = nodeRe.exec(xml))) {
|
||||||
|
const attrs = match[1]
|
||||||
|
const id = attrs.match(/\bid="(-?\d+)"/)?.[1]
|
||||||
|
const lat = Number(attrs.match(/\blat="(-?[\d.]+)"/)?.[1])
|
||||||
|
const lon = Number(attrs.match(/\blon="(-?[\d.]+)"/)?.[1])
|
||||||
|
if (!id || !Number.isFinite(lat) || !Number.isFinite(lon)) continue
|
||||||
|
const tags = {}
|
||||||
|
const tagRe = /<tag\b([^>]*?)\/?>/g
|
||||||
|
let tag
|
||||||
|
while ((tag = tagRe.exec(match[0]))) {
|
||||||
|
const k = tag[1].match(/\bk="([^"]*)"/)?.[1]
|
||||||
|
const v = tag[1].match(/\bv="([^"]*)"/)?.[1]
|
||||||
|
if (k) tags[decodeXml(k)] = decodeXml(v ?? '')
|
||||||
|
}
|
||||||
|
nodes.set(id, { lat, lon, tags })
|
||||||
|
}
|
||||||
|
|
||||||
|
const ways = []
|
||||||
|
const wayRe = /<way\b([^>]*)>([\s\S]*?)<\/way>/g
|
||||||
|
while ((match = wayRe.exec(xml))) {
|
||||||
|
const body = match[2]
|
||||||
|
const refs = [...body.matchAll(/<nd\b[^>]*\bref="(-?\d+)"/g)].map((row) => row[1])
|
||||||
|
const tags = {}
|
||||||
|
const tagRe = /<tag\b([^>]*?)\/?>/g
|
||||||
|
let tag
|
||||||
|
while ((tag = tagRe.exec(body))) {
|
||||||
|
const k = tag[1].match(/\bk="([^"]*)"/)?.[1]
|
||||||
|
const v = tag[1].match(/\bv="([^"]*)"/)?.[1]
|
||||||
|
if (k) tags[decodeXml(k)] = decodeXml(v ?? '')
|
||||||
|
}
|
||||||
|
ways.push({ refs, tags })
|
||||||
|
}
|
||||||
|
return { nodes, ways }
|
||||||
|
}
|
||||||
|
|
||||||
|
function inBounds(point, bounds) {
|
||||||
|
return (
|
||||||
|
point.lat >= bounds.minlat &&
|
||||||
|
point.lat <= bounds.maxlat &&
|
||||||
|
point.lon >= bounds.minlon &&
|
||||||
|
point.lon <= bounds.maxlon
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
function distanceToSegment(p, a, b) {
|
||||||
|
const dx = b[0] - a[0]
|
||||||
|
const dy = b[1] - a[1]
|
||||||
|
if (dx === 0 && dy === 0) return Math.hypot(p[0] - a[0], p[1] - a[1])
|
||||||
|
const t = Math.max(
|
||||||
|
0,
|
||||||
|
Math.min(1, ((p[0] - a[0]) * dx + (p[1] - a[1]) * dy) / (dx * dx + dy * dy)),
|
||||||
|
)
|
||||||
|
return Math.hypot(p[0] - (a[0] + t * dx), p[1] - (a[1] + t * dy))
|
||||||
|
}
|
||||||
|
|
||||||
|
function simplify(points, tolerance) {
|
||||||
|
if (points.length <= 4) return points
|
||||||
|
let maxDistance = 0
|
||||||
|
let index = 0
|
||||||
|
for (let i = 1; i < points.length - 1; i += 1) {
|
||||||
|
const distance = distanceToSegment(points[i], points[0], points.at(-1))
|
||||||
|
if (distance > maxDistance) {
|
||||||
|
maxDistance = distance
|
||||||
|
index = i
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (maxDistance > tolerance) {
|
||||||
|
const left = simplify(points.slice(0, index + 1), tolerance)
|
||||||
|
const right = simplify(points.slice(index), tolerance)
|
||||||
|
return [...left.slice(0, -1), ...right]
|
||||||
|
}
|
||||||
|
return [points[0], points.at(-1)]
|
||||||
|
}
|
||||||
|
|
||||||
|
function buildBuildings(source) {
|
||||||
|
const { nodes, ways } = readOsm(source)
|
||||||
|
const buildings = []
|
||||||
|
for (const way of ways) {
|
||||||
|
if (!way.tags.building && !way.tags['building:part']) continue
|
||||||
|
if (way.tags['building:part'] === 'yes' && !way.tags.building) {
|
||||||
|
// Roof-only parts duplicate the main footprint at this zoom.
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
const points = way.refs
|
||||||
|
.map((ref) => nodes.get(ref))
|
||||||
|
.filter(Boolean)
|
||||||
|
.filter((node) => inBounds(node, BOUNDS))
|
||||||
|
.map((node) => [node.lon, node.lat])
|
||||||
|
if (points.length < 3) continue
|
||||||
|
if (points[0][0] !== points.at(-1)[0] || points[0][1] !== points.at(-1)[1]) {
|
||||||
|
points.push(points[0])
|
||||||
|
}
|
||||||
|
const simplified = simplify(points, SIMPLIFY_TOLERANCE)
|
||||||
|
if (simplified.length < 3) continue
|
||||||
|
buildings.push({
|
||||||
|
name: way.tags.name || null,
|
||||||
|
kind: way.tags.building === 'yes' ? 'building' : way.tags.building || 'building',
|
||||||
|
points: simplified.map(([lon, lat]) => [
|
||||||
|
Math.round(lon * 1e6) / 1e6,
|
||||||
|
Math.round(lat * 1e6) / 1e6,
|
||||||
|
]),
|
||||||
|
})
|
||||||
|
}
|
||||||
|
buildings.sort((a, b) => {
|
||||||
|
const areaA = polygonArea(a.points)
|
||||||
|
const areaB = polygonArea(b.points)
|
||||||
|
return areaB - areaA
|
||||||
|
})
|
||||||
|
return {
|
||||||
|
source: 'OpenStreetMap contributors, ODbL',
|
||||||
|
generated: new Date().toISOString().slice(0, 10),
|
||||||
|
bounds: BOUNDS,
|
||||||
|
buildings,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function polygonArea(points) {
|
||||||
|
let area = 0
|
||||||
|
for (let i = 0; i < points.length - 1; i += 1) {
|
||||||
|
area += points[i][0] * points[i + 1][1] - points[i + 1][0] * points[i][1]
|
||||||
|
}
|
||||||
|
return Math.abs(area / 2)
|
||||||
|
}
|
||||||
|
|
||||||
|
function buildPrezero(source) {
|
||||||
|
const full = JSON.parse(fs.readFileSync(source, 'utf8'))
|
||||||
|
const containers = [...full.containers]
|
||||||
|
.sort((a, b) => {
|
||||||
|
const rank = { high: 0, medium: 1, low: 2 }
|
||||||
|
return (
|
||||||
|
rank[a.priority] - rank[b.priority] ||
|
||||||
|
b.priority_score - a.priority_score ||
|
||||||
|
b.overfull_count - a.overfull_count
|
||||||
|
)
|
||||||
|
})
|
||||||
|
.slice(0, 24)
|
||||||
|
.map((row) => ({
|
||||||
|
location_id: row.location_id,
|
||||||
|
priority: row.priority,
|
||||||
|
priority_score: row.priority_score,
|
||||||
|
readings: row.readings,
|
||||||
|
overfull_count: row.overfull_count,
|
||||||
|
overfull_rate: row.overfull_rate,
|
||||||
|
p95_fill: row.p95_fill,
|
||||||
|
max_fill: row.max_fill,
|
||||||
|
mean_fill: row.mean_fill,
|
||||||
|
last_fill: row.last_fill,
|
||||||
|
last_is_overfull: row.last_is_overfull,
|
||||||
|
last_date: row.last_date,
|
||||||
|
days_since_last: row.days_since_last,
|
||||||
|
trend: row.trend,
|
||||||
|
materials: row.materials,
|
||||||
|
}))
|
||||||
|
return {
|
||||||
|
meta: full.meta,
|
||||||
|
summary: full.summary,
|
||||||
|
top: containers,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const buildings = buildBuildings(
|
||||||
|
path.join(dataRoot, 'cool-city-data/route/raw/area_osm.xml'),
|
||||||
|
)
|
||||||
|
fs.mkdirSync(path.join(root, 'public/cool-city'), { recursive: true })
|
||||||
|
fs.writeFileSync(
|
||||||
|
path.join(root, 'public/cool-city/buildings.json'),
|
||||||
|
`${JSON.stringify(buildings)}\n`,
|
||||||
|
)
|
||||||
|
|
||||||
|
const prezero = buildPrezero(
|
||||||
|
path.join(dataRoot, 'ML-py.git/feat-prezero-api/artifacts/prezero_priority.json'),
|
||||||
|
)
|
||||||
|
fs.mkdirSync(path.join(root, 'public/prezero'), { recursive: true })
|
||||||
|
fs.writeFileSync(
|
||||||
|
path.join(root, 'public/prezero/priority.json'),
|
||||||
|
`${JSON.stringify(prezero)}\n`,
|
||||||
|
)
|
||||||
|
|
||||||
|
console.log(
|
||||||
|
`buildings: ${buildings.buildings.length} -> public/cool-city/buildings.json`,
|
||||||
|
)
|
||||||
|
console.log(
|
||||||
|
`prezero: ${prezero.top.length} of ${prezero.meta.containers} containers -> public/prezero/priority.json`,
|
||||||
|
)
|
||||||
@@ -0,0 +1,67 @@
|
|||||||
|
import { HORIZONS, SCENARIOS } from '../../shared/types'
|
||||||
|
import type {
|
||||||
|
Horizon,
|
||||||
|
PlaygroundForecastResponse,
|
||||||
|
Scenario,
|
||||||
|
} from '../../shared/types'
|
||||||
|
import { apiRequest, enumParam, isMockMode, sensorParam } from '../utils/api'
|
||||||
|
|
||||||
|
function numberParam(
|
||||||
|
value: unknown,
|
||||||
|
name: string,
|
||||||
|
min: number,
|
||||||
|
max: number,
|
||||||
|
): number | undefined {
|
||||||
|
if (value === undefined || value === '') return undefined
|
||||||
|
const raw = Array.isArray(value) ? value[0] : value
|
||||||
|
const parsed = Number(raw)
|
||||||
|
if (!Number.isFinite(parsed)) {
|
||||||
|
throw createError({ statusCode: 400, statusMessage: `${name} must be a number` })
|
||||||
|
}
|
||||||
|
if (parsed < min || parsed > max) {
|
||||||
|
throw createError({
|
||||||
|
statusCode: 400,
|
||||||
|
statusMessage: `${name} must be between ${min} and ${max}`,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
return parsed
|
||||||
|
}
|
||||||
|
|
||||||
|
function booleanParam(value: unknown, name: string): boolean | undefined {
|
||||||
|
if (value === undefined || value === '') return undefined
|
||||||
|
const raw = String(Array.isArray(value) ? value[0] : value).toLowerCase()
|
||||||
|
if (raw === 'true' || raw === '1') return true
|
||||||
|
if (raw === 'false' || raw === '0') return false
|
||||||
|
throw createError({ statusCode: 400, statusMessage: `${name} must be a boolean` })
|
||||||
|
}
|
||||||
|
|
||||||
|
// Browser-facing playground proxy. The page calls /api/playground; only this
|
||||||
|
// Nitro route talks to the public Go endpoint.
|
||||||
|
export default defineEventHandler(async (event) => {
|
||||||
|
const query = getQuery(event)
|
||||||
|
const sensor = sensorParam(query.sensor)
|
||||||
|
const horizon = enumParam<Horizon>(query.horizon, HORIZONS, 'horizon', '48h')
|
||||||
|
const scenario = enumParam<Scenario>(query.scenario, SCENARIOS, 'scenario', 'base')
|
||||||
|
const tempC = numberParam(query.temp_c, 'temp_c', -30, 50)
|
||||||
|
const precipMm = numberParam(query.precip_mm, 'precip_mm', 0, 50)
|
||||||
|
const isHoliday = booleanParam(query.is_holiday, 'is_holiday')
|
||||||
|
|
||||||
|
if (isMockMode()) {
|
||||||
|
throw createError({
|
||||||
|
statusCode: 503,
|
||||||
|
statusMessage:
|
||||||
|
'Mock mode is enabled, but the playground has no demo forecast. Start the real Python and Go services or unset NUXT_PUBLIC_USE_MOCK.',
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
return apiRequest<PlaygroundForecastResponse>('/api/playground/forecast', {
|
||||||
|
query: {
|
||||||
|
sensor,
|
||||||
|
horizon,
|
||||||
|
scenario,
|
||||||
|
...(tempC === undefined ? {} : { temp_c: tempC }),
|
||||||
|
...(precipMm === undefined ? {} : { precip_mm: precipMm }),
|
||||||
|
...(isHoliday === undefined ? {} : { is_holiday: isHoliday }),
|
||||||
|
},
|
||||||
|
})
|
||||||
|
})
|
||||||
@@ -166,6 +166,25 @@ export interface ScenarioPreset extends ScenarioDefinition {
|
|||||||
description: string
|
description: string
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface PlaygroundRequestContext {
|
||||||
|
temp_c?: number
|
||||||
|
precip_mm?: number
|
||||||
|
is_holiday?: boolean
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Public playground forecast: the normal forecast plus the inputs the model saw. */
|
||||||
|
export interface PlaygroundForecastResponse {
|
||||||
|
sensor: string
|
||||||
|
horizon: Horizon
|
||||||
|
scenario: Scenario
|
||||||
|
points: Point[]
|
||||||
|
data_version: string
|
||||||
|
model_version: string
|
||||||
|
context_version: string
|
||||||
|
weather_source: 'forecast' | 'override'
|
||||||
|
request: PlaygroundRequestContext
|
||||||
|
}
|
||||||
|
|
||||||
export interface DemoClock {
|
export interface DemoClock {
|
||||||
now: string
|
now: string
|
||||||
plan_start: string
|
plan_start: string
|
||||||
|
|||||||
@@ -0,0 +1,435 @@
|
|||||||
|
import { COOL_TIMES } from './cool'
|
||||||
|
import type { CoolRouteBundle, CoolRouteId, CoolRouteValues, CoolTime } from './cool'
|
||||||
|
import { berlinParts } from './staffing'
|
||||||
|
import type { Sensor, StaffingHour, StaffingResponse, Shift } from './types'
|
||||||
|
|
||||||
|
/**
|
||||||
|
* UC1 Staffing · UC2 Smart Routing · UC3 PreZero.
|
||||||
|
*
|
||||||
|
* These helpers are shared by the page, the panels and the tests. Every number
|
||||||
|
* comes from a real bundle/API payload; no value is generated in the browser.
|
||||||
|
*/
|
||||||
|
export type UseCaseId = 'staffing' | 'routing' | 'prezero'
|
||||||
|
|
||||||
|
export interface UseCaseTab {
|
||||||
|
id: UseCaseId
|
||||||
|
eyebrow: string
|
||||||
|
title: string
|
||||||
|
subtitle: string
|
||||||
|
icon: string
|
||||||
|
}
|
||||||
|
|
||||||
|
export const USE_CASE_TABS: readonly UseCaseTab[] = [
|
||||||
|
{
|
||||||
|
id: 'staffing',
|
||||||
|
eyebrow: 'UC1: Staffing optimization',
|
||||||
|
title: 'Hourly occupancy vs workforce',
|
||||||
|
subtitle: 'Turn the forecast into a shift plan.',
|
||||||
|
icon: 'material-symbols:trending-up',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 'routing',
|
||||||
|
eyebrow: 'UC2: Smart micro-climate routing',
|
||||||
|
title: 'Fastest path with modeled shade and access',
|
||||||
|
subtitle: 'Modeled shade, solar position and street access.',
|
||||||
|
icon: 'material-symbols:route',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 'prezero',
|
||||||
|
eyebrow: 'UC3: PreZero depot logistics',
|
||||||
|
title: 'Container collection priority',
|
||||||
|
subtitle: 'Rank 449 anonymized container locations from reported states.',
|
||||||
|
icon: 'material-symbols:recycling',
|
||||||
|
},
|
||||||
|
] as const
|
||||||
|
|
||||||
|
export const DEFAULT_USE_CASE: UseCaseId = 'routing'
|
||||||
|
|
||||||
|
export function isUseCaseId(value: unknown): value is UseCaseId {
|
||||||
|
return value === 'staffing' || value === 'routing' || value === 'prezero'
|
||||||
|
}
|
||||||
|
|
||||||
|
export function useCaseById(id: UseCaseId): UseCaseTab {
|
||||||
|
return USE_CASE_TABS.find((tab) => tab.id === id) ?? USE_CASE_TABS[1]!
|
||||||
|
}
|
||||||
|
|
||||||
|
export function isCoolTimeValue(value: unknown): value is CoolTime {
|
||||||
|
return typeof value === 'string' && (COOL_TIMES as readonly string[]).includes(value)
|
||||||
|
}
|
||||||
|
|
||||||
|
/* -------------------------------------------------------------------------- */
|
||||||
|
/* Routing */
|
||||||
|
/* -------------------------------------------------------------------------- */
|
||||||
|
|
||||||
|
const ROUTE_TITLES: Record<CoolRouteId, string> = {
|
||||||
|
shortest: 'Shortest route',
|
||||||
|
shaded: 'Shaded route',
|
||||||
|
accessible: 'Accessible route',
|
||||||
|
}
|
||||||
|
|
||||||
|
export const ROUTE_ORDER: readonly CoolRouteId[] = ['shortest', 'shaded', 'accessible'] as const
|
||||||
|
|
||||||
|
export interface RouteComparisonRow {
|
||||||
|
id: CoolRouteId
|
||||||
|
title: string
|
||||||
|
description: string
|
||||||
|
values: CoolRouteValues
|
||||||
|
recommended: boolean
|
||||||
|
penaltyMin: number
|
||||||
|
tag: string
|
||||||
|
}
|
||||||
|
|
||||||
|
export function routeTitle(id: CoolRouteId): string {
|
||||||
|
return ROUTE_TITLES[id]
|
||||||
|
}
|
||||||
|
|
||||||
|
export function routeValuesFor(
|
||||||
|
bundle: CoolRouteBundle | null | undefined,
|
||||||
|
id: CoolRouteId,
|
||||||
|
time: CoolTime | string,
|
||||||
|
): CoolRouteValues | null {
|
||||||
|
return bundle?.routes.find((route) => route.id === id)?.values[time] ?? null
|
||||||
|
}
|
||||||
|
|
||||||
|
export function recommendedRouteId(
|
||||||
|
bundle: CoolRouteBundle | null | undefined,
|
||||||
|
time: CoolTime | string,
|
||||||
|
): CoolRouteId {
|
||||||
|
return bundle?.recommendationByTime[time] ?? 'shortest'
|
||||||
|
}
|
||||||
|
|
||||||
|
export function recommendedRoute(
|
||||||
|
bundle: CoolRouteBundle | null | undefined,
|
||||||
|
time: CoolTime | string,
|
||||||
|
) {
|
||||||
|
if (!bundle) return null
|
||||||
|
return bundle.routes.find((route) => route.id === recommendedRouteId(bundle, time)) ?? null
|
||||||
|
}
|
||||||
|
|
||||||
|
export function recommendedValues(
|
||||||
|
bundle: CoolRouteBundle | null | undefined,
|
||||||
|
time: CoolTime | string,
|
||||||
|
): CoolRouteValues | null {
|
||||||
|
return routeValuesFor(bundle, recommendedRouteId(bundle, time), time)
|
||||||
|
}
|
||||||
|
|
||||||
|
export function routeTag(
|
||||||
|
id: CoolRouteId,
|
||||||
|
recommended: boolean,
|
||||||
|
values: CoolRouteValues,
|
||||||
|
): string {
|
||||||
|
if (recommended) return 'Recommended'
|
||||||
|
if (id === 'shortest') return values.stepFree ? 'Fastest · 15% ramp' : 'Fastest'
|
||||||
|
if (id === 'shaded') return 'Shaded · longer walk'
|
||||||
|
return 'Step-free · water & benches'
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Candidate rows for the comparison card. `penaltyMin` is the duration after
|
||||||
|
* the fastest candidate, so the values stay real even when the model picks a
|
||||||
|
* slower, step-free route.
|
||||||
|
*/
|
||||||
|
export function routeComparison(
|
||||||
|
bundle: CoolRouteBundle | null | undefined,
|
||||||
|
time: CoolTime | string,
|
||||||
|
): RouteComparisonRow[] {
|
||||||
|
if (!bundle) return []
|
||||||
|
const recommended = recommendedRouteId(bundle, time)
|
||||||
|
const rows = ROUTE_ORDER.flatMap((id) => {
|
||||||
|
const values = routeValuesFor(bundle, id, time)
|
||||||
|
const route = bundle.routes.find((entry) => entry.id === id)
|
||||||
|
if (!values || !route) return []
|
||||||
|
return [
|
||||||
|
{
|
||||||
|
id,
|
||||||
|
title: routeTitle(id),
|
||||||
|
description: route.description,
|
||||||
|
values,
|
||||||
|
recommended: id === recommended,
|
||||||
|
penaltyMin: 0,
|
||||||
|
tag: '',
|
||||||
|
},
|
||||||
|
]
|
||||||
|
})
|
||||||
|
const fastest = Math.min(...rows.map((row) => row.values.durationMin))
|
||||||
|
return rows.map((row) => ({
|
||||||
|
...row,
|
||||||
|
penaltyMin: Math.round((row.values.durationMin - fastest) * 10) / 10,
|
||||||
|
tag: routeTag(row.id, row.recommended, row.values),
|
||||||
|
}))
|
||||||
|
}
|
||||||
|
|
||||||
|
export function routeRationale(
|
||||||
|
bundle: CoolRouteBundle | null | undefined,
|
||||||
|
time: CoolTime | string,
|
||||||
|
): string {
|
||||||
|
if (!bundle) return 'The route bundle is unavailable. Nothing is estimated.'
|
||||||
|
const route = recommendedRoute(bundle, time)
|
||||||
|
const values = recommendedValues(bundle, time)
|
||||||
|
if (!route || !values) return 'The route bundle has no values for this hour.'
|
||||||
|
|
||||||
|
const fastest = routeComparison(bundle, time)
|
||||||
|
.slice()
|
||||||
|
.sort((a, b) => a.values.durationMin - b.values.durationMin)[0]
|
||||||
|
const delta =
|
||||||
|
fastest && fastest.id !== route.id
|
||||||
|
? ` It is ${formatMinutes(values.durationMin - fastest.values.durationMin)} longer than the fastest candidate.`
|
||||||
|
: ' It is also the fastest candidate.'
|
||||||
|
const access = values.stepFree
|
||||||
|
? values.rampInclinePct === null || values.rampInclinePct === undefined
|
||||||
|
? ' The route is step-free with no ramp.'
|
||||||
|
: ` The route is step-free but includes a ${values.rampInclinePct}% ramp.`
|
||||||
|
: ' The route is not step-free.'
|
||||||
|
const weather = bundle.hotDay
|
||||||
|
? `${bundle.hotDay.temperature_max_c} °C on the modeled ${bundle.hotDay.date} hot day`
|
||||||
|
: 'the modeled hot day'
|
||||||
|
|
||||||
|
return `Fusing ${weather}, the ${solarAzimuthLabel(bundle, time)}, and modeled shade from OSM buildings and tree crowns: the ${routeTitle(route.id).toLowerCase()} is ${formatPercent(values.shadePct)} shaded with ${formatMinutes(values.directSunMin)} of direct sun and ${values.waterStops} water ${values.waterStops === 1 ? 'stop' : 'stops'}.${access}${delta}`
|
||||||
|
}
|
||||||
|
|
||||||
|
export function solarPosition(
|
||||||
|
bundle: CoolRouteBundle | null | undefined,
|
||||||
|
time: CoolTime | string,
|
||||||
|
): { altitude_deg: number; azimuth_deg: number } | null {
|
||||||
|
return bundle?.meta?.solarPositions?.[time] ?? null
|
||||||
|
}
|
||||||
|
|
||||||
|
export function solarAzimuthLabel(
|
||||||
|
bundle: CoolRouteBundle | null | undefined,
|
||||||
|
time: CoolTime | string,
|
||||||
|
): string {
|
||||||
|
const position = solarPosition(bundle, time)
|
||||||
|
if (!position) return 'solar position unavailable'
|
||||||
|
return `solar azimuth ${Math.round(position.azimuth_deg)}° ${compassDirection(position.azimuth_deg)}`
|
||||||
|
}
|
||||||
|
|
||||||
|
export function compassDirection(degrees: number): string {
|
||||||
|
const points = ['N', 'NE', 'E', 'SE', 'S', 'SW', 'W', 'NW']
|
||||||
|
const index = Math.round(((degrees % 360) + 360) % 360 / 45) % 8
|
||||||
|
return points[index]!
|
||||||
|
}
|
||||||
|
|
||||||
|
export function formatMinutes(value: number): string {
|
||||||
|
const rounded = Math.round(value * 10) / 10
|
||||||
|
return `${Number.isInteger(rounded) ? rounded : rounded.toFixed(1)} min`
|
||||||
|
}
|
||||||
|
|
||||||
|
export function formatPercent(value: number, digits = 1): string {
|
||||||
|
return `${value.toFixed(digits)}%`
|
||||||
|
}
|
||||||
|
|
||||||
|
/** A GPX 1.1 track from the real OSM route geometry. */
|
||||||
|
export function buildGpx(
|
||||||
|
bundle: CoolRouteBundle,
|
||||||
|
routeId: CoolRouteId,
|
||||||
|
time: CoolTime | string,
|
||||||
|
generatedAt = new Date().toISOString(),
|
||||||
|
): string {
|
||||||
|
const route = bundle.routes.find((entry) => entry.id === routeId)
|
||||||
|
if (!route || route.geometry.length === 0) {
|
||||||
|
throw new Error(`No geometry for route ${routeId}`)
|
||||||
|
}
|
||||||
|
const values = route.values[time]
|
||||||
|
const name = `${routeTitle(routeId)} · ${bundle.origin.name} → ${bundle.destination.name}`
|
||||||
|
const desc = values
|
||||||
|
? `${formatPercent(values.shadePct)} modeled shade, ${formatMinutes(values.directSunMin)} direct sun, ${formatMinutes(values.durationMin)} walk at ${time}. ${bundle.shadeLabel}.`
|
||||||
|
: `${bundle.shadeLabel}.`
|
||||||
|
const points = route.geometry
|
||||||
|
.map(
|
||||||
|
([lon, lat]) =>
|
||||||
|
` <trkpt lat="${lat.toFixed(6)}" lon="${lon.toFixed(6)}" />`,
|
||||||
|
)
|
||||||
|
.join('\n')
|
||||||
|
|
||||||
|
return `<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<gpx version="1.1" creator="Sensing Engine" xmlns="http://www.topografix.com/GPX/1/1">
|
||||||
|
<metadata>
|
||||||
|
<name>${escapeXml(name)}</name>
|
||||||
|
<desc>${escapeXml(desc)}</desc>
|
||||||
|
<time>${generatedAt}</time>
|
||||||
|
</metadata>
|
||||||
|
<trk>
|
||||||
|
<name>${escapeXml(name)}</name>
|
||||||
|
<desc>${escapeXml(desc)}</desc>
|
||||||
|
<trkseg>
|
||||||
|
${points}
|
||||||
|
</trkseg>
|
||||||
|
</trk>
|
||||||
|
</gpx>
|
||||||
|
`
|
||||||
|
}
|
||||||
|
|
||||||
|
function escapeXml(value: string): string {
|
||||||
|
return value
|
||||||
|
.replaceAll('&', '&')
|
||||||
|
.replaceAll('<', '<')
|
||||||
|
.replaceAll('>', '>')
|
||||||
|
.replaceAll('"', '"')
|
||||||
|
.replaceAll("'", ''')
|
||||||
|
}
|
||||||
|
|
||||||
|
/* -------------------------------------------------------------------------- */
|
||||||
|
/* Staffing */
|
||||||
|
/* -------------------------------------------------------------------------- */
|
||||||
|
|
||||||
|
export interface StaffingSnapshot {
|
||||||
|
peakHour: StaffingHour | null
|
||||||
|
peakShift: Shift | null
|
||||||
|
staffHours: number
|
||||||
|
peakFootfall: number
|
||||||
|
savedEur: number
|
||||||
|
savedPct: number
|
||||||
|
coveragePct: number
|
||||||
|
overstaffedHours: number
|
||||||
|
understaffedHours: number
|
||||||
|
days: number
|
||||||
|
}
|
||||||
|
|
||||||
|
export function staffingSnapshot(plan: StaffingResponse | null | undefined): StaffingSnapshot {
|
||||||
|
if (!plan) {
|
||||||
|
return {
|
||||||
|
peakHour: null,
|
||||||
|
peakShift: null,
|
||||||
|
staffHours: 0,
|
||||||
|
peakFootfall: 0,
|
||||||
|
savedEur: 0,
|
||||||
|
savedPct: 0,
|
||||||
|
coveragePct: 0,
|
||||||
|
overstaffedHours: 0,
|
||||||
|
understaffedHours: 0,
|
||||||
|
days: 0,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
let peakHour: StaffingHour | null = null
|
||||||
|
for (const hour of plan.hours) {
|
||||||
|
if (!peakHour || hour.footfall > peakHour.footfall) peakHour = hour
|
||||||
|
}
|
||||||
|
|
||||||
|
let peakShift: Shift | null = null
|
||||||
|
for (const shift of plan.shifts) {
|
||||||
|
if (
|
||||||
|
!peakShift ||
|
||||||
|
shift.staff > peakShift.staff ||
|
||||||
|
(shift.staff === peakShift.staff && shift.date < peakShift.date)
|
||||||
|
) {
|
||||||
|
peakShift = shift
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const staffHours = plan.hours.reduce((sum, hour) => sum + hour.scheduled_staff, 0)
|
||||||
|
const savedEur = Math.max(0, plan.summary.flat_schedule_cost_eur - plan.summary.cost_eur)
|
||||||
|
const days = new Set(plan.hours.map((hour) => berlinParts(hour.t).date)).size
|
||||||
|
|
||||||
|
return {
|
||||||
|
peakHour,
|
||||||
|
peakShift,
|
||||||
|
staffHours,
|
||||||
|
peakFootfall: peakHour?.footfall ?? 0,
|
||||||
|
savedEur,
|
||||||
|
savedPct:
|
||||||
|
plan.summary.flat_schedule_cost_eur > 0
|
||||||
|
? (savedEur / plan.summary.flat_schedule_cost_eur) * 100
|
||||||
|
: 0,
|
||||||
|
coveragePct: plan.summary.coverage_pct,
|
||||||
|
overstaffedHours: plan.summary.overstaffed_hours,
|
||||||
|
understaffedHours: plan.summary.understaffed_hours,
|
||||||
|
days,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export function sensorForPlan(
|
||||||
|
sensors: Sensor[] | null | undefined,
|
||||||
|
plan: StaffingResponse | null | undefined,
|
||||||
|
): Sensor | null {
|
||||||
|
return sensors?.find((sensor) => sensor.id === plan?.sensor) ?? null
|
||||||
|
}
|
||||||
|
|
||||||
|
/* -------------------------------------------------------------------------- */
|
||||||
|
/* PreZero */
|
||||||
|
/* -------------------------------------------------------------------------- */
|
||||||
|
|
||||||
|
export interface PrezeroMaterialStats {
|
||||||
|
readings: number
|
||||||
|
overfull: number
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface PrezeroMeta {
|
||||||
|
source: string
|
||||||
|
generated_at: string
|
||||||
|
rows: number
|
||||||
|
containers: number
|
||||||
|
material_series: number
|
||||||
|
date_from: string
|
||||||
|
date_to: string
|
||||||
|
reference_date: string
|
||||||
|
overfull_readings: number
|
||||||
|
priority_rule: string
|
||||||
|
limitations: string[]
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface PrezeroContainerMaterial {
|
||||||
|
readings: number
|
||||||
|
overfull_count: number
|
||||||
|
last_fill: number | null
|
||||||
|
last_is_overfull: boolean
|
||||||
|
last_date: string | null
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface PrezeroContainer {
|
||||||
|
location_id: string
|
||||||
|
priority: 'high' | 'medium' | 'low'
|
||||||
|
priority_score: number
|
||||||
|
readings: number
|
||||||
|
overfull_count: number
|
||||||
|
overfull_rate: number
|
||||||
|
p95_fill: number
|
||||||
|
max_fill: number
|
||||||
|
mean_fill: number
|
||||||
|
last_fill: number | null
|
||||||
|
last_is_overfull: boolean
|
||||||
|
last_date: string | null
|
||||||
|
days_since_last: number | null
|
||||||
|
trend: number | null
|
||||||
|
materials: Record<string, PrezeroContainerMaterial>
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface PrezeroBundle {
|
||||||
|
meta: PrezeroMeta
|
||||||
|
summary: {
|
||||||
|
priority_counts: { high: number; medium: number; low: number }
|
||||||
|
by_material: Record<string, PrezeroMaterialStats>
|
||||||
|
}
|
||||||
|
top: PrezeroContainer[]
|
||||||
|
}
|
||||||
|
|
||||||
|
export const PRIORITY_ORDER: readonly PrezeroContainer['priority'][] = [
|
||||||
|
'high',
|
||||||
|
'medium',
|
||||||
|
'low',
|
||||||
|
] as const
|
||||||
|
|
||||||
|
export function prezeroTotal(bundle: PrezeroBundle | null | undefined): number {
|
||||||
|
if (!bundle) return 0
|
||||||
|
const counts = bundle.summary.priority_counts
|
||||||
|
return counts.high + counts.medium + counts.low
|
||||||
|
}
|
||||||
|
|
||||||
|
export function priorityShare(bundle: PrezeroBundle | null | undefined, priority: string): number {
|
||||||
|
const total = prezeroTotal(bundle)
|
||||||
|
if (!total || !bundle) return 0
|
||||||
|
return (bundle.summary.priority_counts[priority as 'high' | 'medium' | 'low'] / total) * 100
|
||||||
|
}
|
||||||
|
|
||||||
|
export function shortContainerId(id: string): string {
|
||||||
|
return id.slice(0, 8)
|
||||||
|
}
|
||||||
|
|
||||||
|
/** One-line reason, built only from fields present in the artifact. */
|
||||||
|
export function prezeroReason(container: PrezeroContainer): string {
|
||||||
|
const pct = formatPercent(container.overfull_rate * 100, 0)
|
||||||
|
if (container.overfull_count > 0) {
|
||||||
|
return `${container.overfull_count} overfull ${container.overfull_count === 1 ? 'reading' : 'readings'} (${pct} of visits); p95 fill ${Math.round(container.p95_fill)}%.`
|
||||||
|
}
|
||||||
|
return `${container.readings} readings; p95 fill ${Math.round(container.p95_fill)}%; no overfull state reported.`
|
||||||
|
}
|
||||||
@@ -0,0 +1,51 @@
|
|||||||
|
/** @type {import('tailwindcss').Config} */
|
||||||
|
export default {
|
||||||
|
darkMode: 'class',
|
||||||
|
content: ['./app/**/*.{vue,js,ts}'],
|
||||||
|
theme: {
|
||||||
|
extend: {
|
||||||
|
colors: {
|
||||||
|
'dark-bg': '#081723',
|
||||||
|
'dark-card': '#0e2233',
|
||||||
|
'dark-surface': '#132b40',
|
||||||
|
'dark-border': '#1e3a52',
|
||||||
|
'dark-text': '#FFFFFF',
|
||||||
|
'dark-muted': '#94A3B8',
|
||||||
|
'dark-accent': '#00C3CD',
|
||||||
|
},
|
||||||
|
borderRadius: {
|
||||||
|
DEFAULT: '0.25rem',
|
||||||
|
lg: '0.5rem',
|
||||||
|
xl: '0.75rem',
|
||||||
|
full: '9999px',
|
||||||
|
},
|
||||||
|
spacing: {
|
||||||
|
'space-xl': '1.5rem',
|
||||||
|
'space-2xl': '2rem',
|
||||||
|
'space-xs': '0.25rem',
|
||||||
|
gutter: '1rem',
|
||||||
|
margin: '1rem',
|
||||||
|
'margin-desktop': '2rem',
|
||||||
|
'gutter-desktop': '1.5rem',
|
||||||
|
'space-sm': '0.5rem',
|
||||||
|
'space-lg': '1rem',
|
||||||
|
'space-md': '0.75rem',
|
||||||
|
},
|
||||||
|
fontFamily: {
|
||||||
|
'headline-lg': ['Inter'],
|
||||||
|
'body-sm': ['Inter'],
|
||||||
|
'headline-xl': ['Inter'],
|
||||||
|
'tabular-stat-md': ['Inter'],
|
||||||
|
'body-md': ['Inter'],
|
||||||
|
'tabular-stat-lg': ['Inter'],
|
||||||
|
'headline-md': ['Inter'],
|
||||||
|
'headline-sm': ['Inter'],
|
||||||
|
'body-lg': ['Inter'],
|
||||||
|
'label-md': ['Inter'],
|
||||||
|
'label-sm': ['Inter'],
|
||||||
|
'headline-xl-mobile': ['Inter'],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
plugins: [],
|
||||||
|
}
|
||||||
@@ -0,0 +1,144 @@
|
|||||||
|
import { describe, expect, it } from 'vitest'
|
||||||
|
import type { Point } from '../shared/types'
|
||||||
|
import {
|
||||||
|
buildHeatmap,
|
||||||
|
formatBand,
|
||||||
|
scenarioDelta,
|
||||||
|
summarizeForecast,
|
||||||
|
} from '../app/utils/playground'
|
||||||
|
import type { ForecastSummary } from '../app/utils/playground'
|
||||||
|
|
||||||
|
const hourly: Point[] = [
|
||||||
|
{ t: '2026-11-16T07:00:00Z', v: 10, lo: 8, hi: 12 },
|
||||||
|
{ t: '2026-11-16T08:00:00Z', v: 20, lo: 16, hi: 24 },
|
||||||
|
{ t: '2026-11-16T09:00:00Z', v: 30, lo: 24, hi: 36 },
|
||||||
|
]
|
||||||
|
|
||||||
|
describe('summarizeForecast', () => {
|
||||||
|
it('returns peak, mean and modeled device-hours for hourly points', () => {
|
||||||
|
const summary = summarizeForecast(hourly)
|
||||||
|
|
||||||
|
expect(summary.count).toBe(3)
|
||||||
|
expect(summary.peak?.t).toBe('2026-11-16T09:00:00Z')
|
||||||
|
expect(summary.peak?.v).toBe(30)
|
||||||
|
expect(summary.mean).toBe(20)
|
||||||
|
expect(summary.total).toBe(60)
|
||||||
|
expect(summary.intervalHours).toBe(1)
|
||||||
|
})
|
||||||
|
|
||||||
|
it('scales total by the real 15-minute spacing', () => {
|
||||||
|
const points: Point[] = [
|
||||||
|
{ t: '2026-11-16T07:00:00Z', v: 10 },
|
||||||
|
{ t: '2026-11-16T07:15:00Z', v: 20 },
|
||||||
|
{ t: '2026-11-16T07:30:00Z', v: 30 },
|
||||||
|
]
|
||||||
|
const summary = summarizeForecast(points)
|
||||||
|
|
||||||
|
expect(summary.intervalHours).toBe(0.25)
|
||||||
|
expect(summary.total).toBe(15)
|
||||||
|
expect(summary.mean).toBe(20)
|
||||||
|
})
|
||||||
|
|
||||||
|
it('handles an empty forecast without inventing a point', () => {
|
||||||
|
const summary = summarizeForecast([])
|
||||||
|
|
||||||
|
expect(summary.count).toBe(0)
|
||||||
|
expect(summary.peak).toBeNull()
|
||||||
|
expect(summary.mean).toBe(0)
|
||||||
|
expect(summary.total).toBe(0)
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
describe('buildHeatmap', () => {
|
||||||
|
const points: Point[] = [
|
||||||
|
{ t: '2026-11-16T07:00:00Z', v: 10 },
|
||||||
|
{ t: '2026-11-16T09:00:00Z', v: 20 },
|
||||||
|
{ t: '2026-11-16T09:30:00Z', v: 40 },
|
||||||
|
{ t: '2026-11-17T07:00:00Z', v: 55 },
|
||||||
|
{ t: '2026-11-17T08:00:00Z', v: 99 },
|
||||||
|
]
|
||||||
|
|
||||||
|
it('groups by Berlin local date and hour and leaves gaps empty', () => {
|
||||||
|
const heatmap = buildHeatmap(points)
|
||||||
|
|
||||||
|
expect(heatmap.hours).toEqual([8, 10, 12, 14, 16, 18])
|
||||||
|
expect(heatmap.rows.map((row) => row.date)).toEqual([
|
||||||
|
'2026-11-16',
|
||||||
|
'2026-11-17',
|
||||||
|
])
|
||||||
|
|
||||||
|
const monday = heatmap.rows[0]!
|
||||||
|
expect(monday.cells.map((cell) => cell.value)).toEqual([
|
||||||
|
10,
|
||||||
|
30,
|
||||||
|
null,
|
||||||
|
null,
|
||||||
|
null,
|
||||||
|
null,
|
||||||
|
])
|
||||||
|
expect(monday.cells[2]!.value).toBeNull()
|
||||||
|
expect(monday.cells[2]!.intensity).toBe(0)
|
||||||
|
})
|
||||||
|
|
||||||
|
it('averages every point inside the same local hour bucket', () => {
|
||||||
|
const heatmap = buildHeatmap(points)
|
||||||
|
const mondayTen = heatmap.rows[0]!.cells[1]!
|
||||||
|
|
||||||
|
expect(mondayTen.hour).toBe(10)
|
||||||
|
expect(mondayTen.value).toBe(30)
|
||||||
|
})
|
||||||
|
|
||||||
|
it('scales intensity against the busiest filled bucket', () => {
|
||||||
|
const heatmap = buildHeatmap(points)
|
||||||
|
|
||||||
|
expect(heatmap.max).toBe(55)
|
||||||
|
expect(heatmap.rows[1]!.cells[0]!.intensity).toBe(1)
|
||||||
|
expect(heatmap.rows[0]!.cells[0]!.intensity).toBeCloseTo(10 / 55)
|
||||||
|
})
|
||||||
|
|
||||||
|
it('returns no rows for an empty forecast', () => {
|
||||||
|
const heatmap = buildHeatmap([])
|
||||||
|
|
||||||
|
expect(heatmap.rows).toEqual([])
|
||||||
|
expect(heatmap.max).toBe(0)
|
||||||
|
expect(heatmap.hours).toEqual([8, 10, 12, 14, 16, 18])
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
describe('formatBand', () => {
|
||||||
|
it('formats the empirical band with one optional decimal', () => {
|
||||||
|
expect(formatBand(9, 13)).toBe('9 – 13')
|
||||||
|
expect(formatBand(7.4, 17.2)).toBe('7.4 – 17.2')
|
||||||
|
expect(formatBand(undefined, 17.2)).toBe('—')
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
describe('scenarioDelta', () => {
|
||||||
|
function summary(peak: number, mean: number): ForecastSummary {
|
||||||
|
return {
|
||||||
|
count: 2,
|
||||||
|
peak: { t: '2026-11-16T09:00:00Z', v: peak },
|
||||||
|
mean,
|
||||||
|
total: mean * 2,
|
||||||
|
intervalHours: 1,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
it('compares peak and mean against base', () => {
|
||||||
|
const delta = scenarioDelta(summary(120, 90), summary(100, 80))
|
||||||
|
|
||||||
|
expect(delta.peakDelta).toBe(20)
|
||||||
|
expect(delta.peakDeltaPct).toBeCloseTo(20)
|
||||||
|
expect(delta.meanDelta).toBe(10)
|
||||||
|
expect(delta.meanDeltaPct).toBeCloseTo(12.5)
|
||||||
|
})
|
||||||
|
|
||||||
|
it('returns a null percentage when base is zero', () => {
|
||||||
|
const delta = scenarioDelta(summary(12, 6), summary(0, 0))
|
||||||
|
|
||||||
|
expect(delta.peakDelta).toBe(12)
|
||||||
|
expect(delta.peakDeltaPct).toBeNull()
|
||||||
|
expect(delta.meanDelta).toBe(6)
|
||||||
|
expect(delta.meanDeltaPct).toBeNull()
|
||||||
|
})
|
||||||
|
})
|
||||||
@@ -0,0 +1,272 @@
|
|||||||
|
import { describe, expect, it } from 'vitest'
|
||||||
|
import type { CoolRouteBundle, CoolRouteOption } from '../shared/cool'
|
||||||
|
import {
|
||||||
|
buildGpx,
|
||||||
|
compassDirection,
|
||||||
|
isUseCaseId,
|
||||||
|
prezeroReason,
|
||||||
|
prezeroTotal,
|
||||||
|
priorityShare,
|
||||||
|
routeComparison,
|
||||||
|
routeRationale,
|
||||||
|
routeTitle,
|
||||||
|
routeValuesFor,
|
||||||
|
staffingSnapshot,
|
||||||
|
} from '../shared/use-cases'
|
||||||
|
import type { PrezeroBundle, PrezeroContainer } from '../shared/use-cases'
|
||||||
|
import type { StaffingResponse } from '../shared/types'
|
||||||
|
|
||||||
|
function route(
|
||||||
|
id: CoolRouteOption['id'],
|
||||||
|
durationMin: number,
|
||||||
|
shadePct: number,
|
||||||
|
directSunMin: number,
|
||||||
|
rampInclinePct: number | null,
|
||||||
|
): CoolRouteOption {
|
||||||
|
return {
|
||||||
|
id,
|
||||||
|
label: id,
|
||||||
|
longName: id,
|
||||||
|
description: `${id} description`,
|
||||||
|
fullDescription: `${id} full description`,
|
||||||
|
values: {
|
||||||
|
'16:00': {
|
||||||
|
shadePct,
|
||||||
|
directSunMin,
|
||||||
|
distanceM: 400,
|
||||||
|
durationMin,
|
||||||
|
stepFree: true,
|
||||||
|
waterStops: 2,
|
||||||
|
benchStops: 6,
|
||||||
|
rampInclinePct,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
ramp: rampInclinePct
|
||||||
|
? { incline: `${rampInclinePct}%`, location: 'Marktplatz', wheelchair: 'yes' }
|
||||||
|
: null,
|
||||||
|
accessibilityNotes: [],
|
||||||
|
geometry: [
|
||||||
|
[9.2184, 49.1402],
|
||||||
|
[9.2189, 49.141],
|
||||||
|
[9.2193, 49.1423],
|
||||||
|
],
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const bundle: CoolRouteBundle = {
|
||||||
|
status: 'ready',
|
||||||
|
generatedAt: '2026-08-14',
|
||||||
|
hotDay: {
|
||||||
|
date: '2026-08-14',
|
||||||
|
temperature_max_c: 35,
|
||||||
|
temperature_min_c: 18.2,
|
||||||
|
precipitation_mm: 0,
|
||||||
|
sunshine_hours: 13.9,
|
||||||
|
source: 'Open-Meteo',
|
||||||
|
},
|
||||||
|
label: 'modeled day',
|
||||||
|
shadeLabel: 'modeled shade, not measured',
|
||||||
|
origin: { name: 'Stadtgalerie', lat: 49.140269, lon: 9.218444 },
|
||||||
|
destination: { name: 'Marktplatz', lat: 49.142318, lon: 9.218659 },
|
||||||
|
times: ['10:00', '12:00', '14:00', '16:00'],
|
||||||
|
routes: [
|
||||||
|
route('shortest', 4.8, 43.8, 2.7, 15),
|
||||||
|
route('shaded', 9.8, 50, 4.9, 15),
|
||||||
|
route('accessible', 5.8, 43.8, 3.3, null),
|
||||||
|
],
|
||||||
|
recommendationByTime: { '10:00': 'shortest', '12:00': 'shortest', '14:00': 'accessible', '16:00': 'accessible' },
|
||||||
|
modelLabel: 'Accessible for Ruth',
|
||||||
|
water: [],
|
||||||
|
meta: {
|
||||||
|
city: 'Heilbronn',
|
||||||
|
shadeLabel: 'modeled shade, not measured',
|
||||||
|
method: 'test method',
|
||||||
|
solarPositions: {
|
||||||
|
'16:00': { altitude_deg: 43.3, azimuth_deg: 235.1 },
|
||||||
|
},
|
||||||
|
dataGaps: ['test gap'],
|
||||||
|
walkingSpeedMps: 1.25,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
const container: PrezeroContainer = {
|
||||||
|
location_id: 'eecbf6fa-decf-46da-b110-bf014e7c181d',
|
||||||
|
priority: 'high',
|
||||||
|
priority_score: 21.5,
|
||||||
|
readings: 80,
|
||||||
|
overfull_count: 21,
|
||||||
|
overfull_rate: 0.2625,
|
||||||
|
p95_fill: 100,
|
||||||
|
max_fill: 100,
|
||||||
|
mean_fill: 64.24,
|
||||||
|
last_fill: null,
|
||||||
|
last_is_overfull: true,
|
||||||
|
last_date: '2026-09-29',
|
||||||
|
days_since_last: 1,
|
||||||
|
trend: 30,
|
||||||
|
materials: {},
|
||||||
|
}
|
||||||
|
|
||||||
|
const prezero: PrezeroBundle = {
|
||||||
|
meta: {
|
||||||
|
source: 'test.csv',
|
||||||
|
generated_at: '2026-11-14T16:53:20Z',
|
||||||
|
rows: 11701,
|
||||||
|
containers: 449,
|
||||||
|
material_series: 1338,
|
||||||
|
date_from: '2025-10-17',
|
||||||
|
date_to: '2026-09-30',
|
||||||
|
reference_date: '2026-09-30',
|
||||||
|
overfull_readings: 1192,
|
||||||
|
priority_rule: 'high ...',
|
||||||
|
limitations: ['No coordinates'],
|
||||||
|
},
|
||||||
|
summary: {
|
||||||
|
priority_counts: { high: 88, medium: 248, low: 113 },
|
||||||
|
by_material: {
|
||||||
|
white: { readings: 4432, overfull: 731 },
|
||||||
|
green: { readings: 4169, overfull: 357 },
|
||||||
|
brown: { readings: 3100, overfull: 104 },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
top: [container],
|
||||||
|
}
|
||||||
|
|
||||||
|
describe('use case ids', () => {
|
||||||
|
it('accepts only the three implemented use cases', () => {
|
||||||
|
expect(isUseCaseId('staffing')).toBe(true)
|
||||||
|
expect(isUseCaseId('routing')).toBe(true)
|
||||||
|
expect(isUseCaseId('prezero')).toBe(true)
|
||||||
|
expect(isUseCaseId('uc4')).toBe(false)
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
describe('route comparison', () => {
|
||||||
|
it('uses the model recommendation and real duration penalties', () => {
|
||||||
|
const rows = routeComparison(bundle, '16:00')
|
||||||
|
|
||||||
|
expect(rows.map((row) => row.id)).toEqual(['shortest', 'shaded', 'accessible'])
|
||||||
|
expect(rows.find((row) => row.recommended)?.id).toBe('accessible')
|
||||||
|
expect(rows.find((row) => row.id === 'shaded')?.penaltyMin).toBe(5)
|
||||||
|
expect(rows.find((row) => row.id === 'accessible')?.penaltyMin).toBe(1)
|
||||||
|
expect(rows.find((row) => row.recommended)?.tag).toBe('Recommended')
|
||||||
|
})
|
||||||
|
|
||||||
|
it('returns no rows when the bundle is missing', () => {
|
||||||
|
expect(routeComparison(null, '16:00')).toEqual([])
|
||||||
|
})
|
||||||
|
|
||||||
|
it('keeps the real shade and sun values', () => {
|
||||||
|
expect(routeValuesFor(bundle, 'accessible', '16:00')?.shadePct).toBe(43.8)
|
||||||
|
expect(routeValuesFor(bundle, 'accessible', '16:00')?.rampInclinePct).toBe(null)
|
||||||
|
expect(routeTitle('shaded')).toBe('Shaded route')
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
describe('route rationale', () => {
|
||||||
|
it('mentions the actual solar position, shade and the step-free trade-off', () => {
|
||||||
|
const text = routeRationale(bundle, '16:00')
|
||||||
|
|
||||||
|
expect(text).toContain('solar azimuth 235° SW')
|
||||||
|
expect(text).toContain('43.8% shaded')
|
||||||
|
expect(text).toContain('3.3 min of direct sun')
|
||||||
|
expect(text).toContain('step-free with no ramp')
|
||||||
|
expect(text).toContain('1 min longer')
|
||||||
|
expect(text).not.toContain('4.8')
|
||||||
|
})
|
||||||
|
|
||||||
|
it('never invents a route when the bundle is unavailable', () => {
|
||||||
|
expect(routeRationale(null, '16:00')).toContain('unavailable')
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
describe('compass and GPX', () => {
|
||||||
|
it('maps solar azimuth to a compass label', () => {
|
||||||
|
expect(compassDirection(0)).toBe('N')
|
||||||
|
expect(compassDirection(110.8)).toBe('E')
|
||||||
|
expect(compassDirection(235.1)).toBe('SW')
|
||||||
|
})
|
||||||
|
|
||||||
|
it('exports the real geometry as GPX 1.1', () => {
|
||||||
|
const xml = buildGpx(bundle, 'accessible', '16:00', '2026-11-14T20:00:00Z')
|
||||||
|
|
||||||
|
expect(xml).toContain('<gpx version="1.1"')
|
||||||
|
expect(xml).toContain('<trkpt lat="49.140200" lon="9.218400" />')
|
||||||
|
expect(xml).toContain('modeled shade, not measured')
|
||||||
|
expect(xml).toContain('<time>2026-11-14T20:00:00Z</time>')
|
||||||
|
})
|
||||||
|
|
||||||
|
it('refuses to export a route without geometry', () => {
|
||||||
|
const empty = { ...bundle, routes: [{ ...bundle.routes[0]!, geometry: [] }] }
|
||||||
|
expect(() => buildGpx(empty, 'shortest', '16:00')).toThrow('No geometry')
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
describe('staffing snapshot', () => {
|
||||||
|
const plan: StaffingResponse = {
|
||||||
|
sensor: 'hn-stadtgalerie-01',
|
||||||
|
scenario: 'base',
|
||||||
|
standard: 'standard',
|
||||||
|
assumptions: {
|
||||||
|
visitors_per_staff_hour: 25,
|
||||||
|
safety_factor: 1.15,
|
||||||
|
min_staff: 1,
|
||||||
|
shift_length_h: 4,
|
||||||
|
labor_cost_eur_h: 16,
|
||||||
|
store_hours: { open: '10:00', close: '20:00', tz: 'Europe/Berlin' },
|
||||||
|
},
|
||||||
|
hours: [
|
||||||
|
{ t: '2026-11-16T09:00:00Z', footfall: 10, required_staff: 1, scheduled_staff: 2, coverage: 'over' },
|
||||||
|
{ t: '2026-11-16T10:00:00Z', footfall: 90, required_staff: 5, scheduled_staff: 5, coverage: 'ok' },
|
||||||
|
{ t: '2026-11-16T11:00:00Z', footfall: 50, required_staff: 3, scheduled_staff: 5, coverage: 'over' },
|
||||||
|
],
|
||||||
|
shifts: [
|
||||||
|
{ date: '2026-11-16', start: '10:00', end: '14:00', staff: 5 },
|
||||||
|
{ date: '2026-11-16', start: '14:00', end: '18:00', staff: 4 },
|
||||||
|
],
|
||||||
|
summary: {
|
||||||
|
coverage_pct: 100,
|
||||||
|
cost_eur: 192,
|
||||||
|
flat_schedule_cost_eur: 320,
|
||||||
|
overstaffed_hours: 2,
|
||||||
|
understaffed_hours: 0,
|
||||||
|
},
|
||||||
|
why: ['forecast peak'],
|
||||||
|
cached: false,
|
||||||
|
data_version: 'd',
|
||||||
|
model_version: 'm',
|
||||||
|
context_version: 'c',
|
||||||
|
}
|
||||||
|
|
||||||
|
it('finds the peak hour, peak shift, staff hours and savings', () => {
|
||||||
|
const snapshot = staffingSnapshot(plan)
|
||||||
|
|
||||||
|
expect(snapshot.peakHour?.footfall).toBe(90)
|
||||||
|
expect(snapshot.peakShift?.staff).toBe(5)
|
||||||
|
expect(snapshot.staffHours).toBe(12)
|
||||||
|
expect(snapshot.savedEur).toBe(128)
|
||||||
|
expect(snapshot.savedPct).toBe(40)
|
||||||
|
expect(snapshot.days).toBe(1)
|
||||||
|
})
|
||||||
|
|
||||||
|
it('returns a safe empty snapshot without a plan', () => {
|
||||||
|
const snapshot = staffingSnapshot(null)
|
||||||
|
expect(snapshot.peakHour).toBeNull()
|
||||||
|
expect(snapshot.staffHours).toBe(0)
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
describe('prezero helpers', () => {
|
||||||
|
it('counts all locations and their shares', () => {
|
||||||
|
expect(prezeroTotal(prezero)).toBe(449)
|
||||||
|
expect(priorityShare(prezero, 'high')).toBeCloseTo(19.6, 1)
|
||||||
|
expect(prezeroTotal(null)).toBe(0)
|
||||||
|
})
|
||||||
|
|
||||||
|
it('builds a reason from the artifact fields only', () => {
|
||||||
|
const reason = prezeroReason(container)
|
||||||
|
expect(reason).toContain('21 overfull readings')
|
||||||
|
expect(reason).toContain('26% of visits')
|
||||||
|
expect(reason).toContain('p95 fill 100%')
|
||||||
|
})
|
||||||
|
})
|
||||||
Reference in new issue
Block a user