@seanyeh77/ui 0.48.3 → 0.49.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bundle.js +2 -2
- package/dist/components/FloorPlan/FloorPlan.d.ts +65 -0
- package/dist/components/FloorPlan/FloorPlan.js +822 -0
- package/dist/components/FloorPlan/FloorPlan.js.map +1 -0
- package/dist/components/ZoneMap/ZoneMap.d.ts +3 -0
- package/dist/components/ZoneMap/ZoneMap.js +6 -20
- package/dist/components/ZoneMap/ZoneMap.js.map +1 -1
- package/dist/css/FloorPlan.css +270 -0
- package/dist/css/ZoneMap.css +0 -97
- package/dist/css/base.css +99 -0
- package/dist/i18n.js +6 -0
- package/dist/i18n.js.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +2 -1
- package/dist/internal/zone.js +48 -0
- package/dist/internal/zone.js.map +1 -0
- package/dist/styles.css +364 -97
- package/docs/DataColors.md +1 -1
- package/docs/FloorPlan.md +43 -0
- package/docs/ZoneMap.md +2 -2
- package/docs/agents.md +5 -5
- package/docs/components.json +4 -0
- package/docs/data.md +2 -1
- package/docs/monitoring.md +7 -1
- package/package.json +2 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FloorPlan.js","names":["phPlus","phMinus","phCornersOut"],"sources":["../../../src/components/FloorPlan/FloorPlan.tsx"],"sourcesContent":["import * as React from 'react';\nimport { devWarn } from '../../internal/dev';\nimport { cx, reduced, resizeObserver, useMedia, useNarrow } from '../../internal/util';\nimport { heatRange, noData, zoneText } from '../../internal/zone';\nimport { format } from '../../format';\nimport { tr } from '../../i18n';\nimport phCornersOut from '../../icons/ph/corners-out';\nimport phMinus from '../../icons/ph/minus';\nimport phPlus from '../../icons/ph/plus';\nimport { includeIcons } from '../../icons/store';\nimport { IconButton } from '../IconButton/IconButton';\nimport type { Zone } from '../ZoneMap/ZoneMap';\n\nincludeIcons(phPlus, phMinus, phCornersOut);\n\n/** A MultiPolygon in metres: [polygon][ring][point][x, y]. The first ring of a polygon is its outline, the others are\n * holes (even-odd). y points north (up). */\nexport type MultiPolygon = number[][][][];\n\nexport interface FloorPlanZone extends Omit<Zone, 'area'> {\n /** The zone's outline, a MultiPolygon in metres (y up): several polygons for a zone in pieces, inner rings for holes. */\n outline: MultiPolygon;\n /** Where its label sits, [x, y] in metres, worked out by the caller (e.g. the pole of inaccessibility). */\n label: [number, number];\n /** 'muted': a secondary zone, drawn fainter with a smaller label; still selectable, and 「⚠」 still shows. Default\n * 'primary'. */\n emphasis?: 'primary' | 'muted';\n /** The id of the group it belongs to (`groups`). */\n group?: string;\n}\n\nexport interface FloorPlanGroup {\n /** Unique id, named by the zones' `group`. */\n id: string;\n /** Shown on its outline, e.g. 「北側機櫃列」. */\n name: string;\n}\n\nexport interface FloorPlanEdge {\n /** The id of the zone on one side. */\n a: string;\n /** The id of the zone on the other side. */\n b: string;\n /** The boundary as polylines in metres: [line][point][x, y]. */\n segs: [number, number][][];\n}\n\nexport interface FloorPlanProps {\n /** The zones. Tab moves through primary zones before muted ones, each from the smallest area up. */\n zones: FloorPlanZone[];\n /** What the plan shows, for screen readers, e.g. 「機房平面圖」. */\n label: string;\n /** Groups of zones: each gets a thin outline around its zones and its name. No group figures are worked out. */\n groups?: FloorPlanGroup[];\n /** The building's outline, drawn under the zones (a MultiPolygon in metres, y up). */\n shell?: MultiPolygon;\n /** Boundaries between zones, drawn as dashed lines. */\n edges?: FloorPlanEdge[];\n /** Bottom of the heat scale for zones without a fill. Default: the smallest value among the zones. */\n min?: number;\n /** Top of the heat scale for zones without a fill. Default: the largest value among the zones. */\n max?: number;\n /** The watch line on the legend's scale, in the zones' unit (from the caller; nothing is assumed). */\n warn?: number;\n /** The limit mark on the legend's scale, in the zones' unit. */\n limit?: number;\n /** false: no legend under the plan. Default true. */\n legend?: boolean;\n /** The selected zone's id (controlled); null for none. */\n value?: string | null;\n /** A zone was picked (click, tap, Enter or Space): its id, and the zone. */\n onChange?: (id: string, zone: FloorPlanZone) => void;\n /** The plan grows to fill the height it is given (in ConsoleLayout's main view, or any flex column), never below\n * 240 px. Without it the plan keeps the outline's proportions, 240 to 640 px high. */\n fill?: boolean;\n /** Extra class on the root element. */\n className?: string;\n}\n\n/* ---------- Geometry (exported for tests) ---------- */\n\n/** One ring as SVG path data, y flipped (north up on screen). */\nexport function ringPath(ring: number[][]): string {\n return ring.length ? 'M' + ring.map(([x, y]) => fmt(x) + ' ' + fmt(-y)).join('L') + 'Z' : '';\n}\nconst fmt = (n: number) => String(Math.round(n * 1000) / 1000);\n\n/** A MultiPolygon as one SVG path; drawn with fill-rule evenodd, inner rings are holes. */\nexport function polygonPath(mp: MultiPolygon): string {\n return mp.map((poly) => poly.map(ringPath).join('')).join('');\n}\n\nexport interface Box {\n x: number;\n y: number;\n w: number;\n h: number;\n}\n\n/** The viewBox (in flipped coordinates: y down) holding every zone and the shell, with a margin of 4 % of the longer\n * side on each edge. */\nexport function planBox(shapes: MultiPolygon[]): Box {\n let [x0, y0, x1, y1] = [Infinity, Infinity, -Infinity, -Infinity];\n for (const mp of shapes)\n for (const poly of mp)\n for (const ring of poly)\n for (const [x, y] of ring) {\n x0 = Math.min(x0, x);\n x1 = Math.max(x1, x);\n y0 = Math.min(y0, -y);\n y1 = Math.max(y1, -y);\n }\n if (!Number.isFinite(x0)) return { x: 0, y: 0, w: 1, h: 1 };\n const w = Math.max(x1 - x0, 1e-6);\n const h = Math.max(y1 - y0, 1e-6);\n const m = Math.max(w, h) * 0.04;\n return { x: x0 - m, y: y0 - m, w: w + 2 * m, h: h + 2 * m };\n}\n\n/** The area in m²: outlines minus holes. */\nexport function polygonArea(mp: MultiPolygon): number {\n let total = 0;\n for (const poly of mp)\n poly.forEach((ring, i) => {\n let a = 0;\n for (let k = 0; k < ring.length; k++) {\n const [xa, ya] = ring[k];\n const [xb, yb] = ring[(k + 1) % ring.length];\n a += xa * yb - xb * ya;\n }\n total += (i === 0 ? 1 : -1) * Math.abs(a / 2);\n });\n return total;\n}\n\n/** Whether [x, y] (metres, y up) is inside, by the even-odd rule over every ring. */\nexport function insidePolygon(x: number, y: number, mp: MultiPolygon): boolean {\n let inside = false;\n for (const poly of mp)\n for (const ring of poly)\n for (let i = 0, j = ring.length - 1; i < ring.length; j = i++) {\n const [xi, yi] = ring[i];\n const [xj, yj] = ring[j];\n if (yi > y !== yj > y && x < ((xj - xi) * (y - yi)) / (yj - yi) + xi) inside = !inside;\n }\n return inside;\n}\n\nfunction bounds(mp: MultiPolygon) {\n return planBox([mp]);\n}\n\n/** Primary zones first, then muted ones; each from the smallest area up. The Tab order, and the order labels are\n * given room in. */\nexport function zoneOrder<T extends Pick<FloorPlanZone, 'outline' | 'emphasis'>>(zones: readonly T[]): T[] {\n const area = new Map(zones.map((z) => [z, polygonArea(z.outline)]));\n return [...zones].sort((a, b) => Number(a.emphasis === 'muted') - Number(b.emphasis === 'muted') || (area.get(a) ?? 0) - (area.get(b) ?? 0));\n}\n\n/** The screen transform for a viewBox shown in W × H px (preserveAspectRatio xMidYMid meet): px per metre, and the\n * screen point of a point in metres (y up). */\nexport function screenOf(view: Box, W: number, H: number) {\n const s = Math.min(W / view.w, H / view.h);\n const ox = (W - view.w * s) / 2 - view.x * s;\n const oy = (H - view.h * s) / 2 - view.y * s;\n return {\n s,\n at: (x: number, y: number): [number, number] => [x * s + ox, -y * s + oy],\n back: (px: number, py: number): [number, number] => [(px - ox) / s, -(py - oy) / s],\n };\n}\n\n/** Width in px of text at a font size: a fixed estimate (CJK 1 em, Geist Mono 0.6 em, other Latin 0.58 em), so\n * labels are laid out the same before and after web fonts load, on the server and in tests. */\nexport function textWidth(text: string, size: number, mono = false): number {\n let w = 0;\n for (const ch of text) {\n const c = ch.codePointAt(0) ?? 0;\n w += c >= 0x2e80 ? 1 : ch === ' ' || ch === ' ' ? 0.3 : mono ? 0.6 : /[A-Z0-9]/.test(ch) ? 0.64 : 0.54;\n }\n return Math.ceil(w * size);\n}\n\nexport type LabelKind = 'full' | 'pill' | null;\nexport interface LabelSpot {\n kind: LabelKind;\n x: number;\n y: number;\n w: number;\n h: number;\n}\n\ninterface LabelInput {\n id: string;\n outline: MultiPolygon;\n label: [number, number];\n muted: boolean;\n slender: boolean;\n full: [number, number];\n pill: [number, number];\n}\n\n/** Places labels in the given order (zoneOrder): the full label where it fits inside the zone's outline and clear of\n * labels already placed, else the one-line pill where it is clear, else none (the zone still shows its tooltip).\n * Slender zones (bounding box over 4 : 1) get the pill only. `taken` holds boxes already in use (group names). */\nexport function placeLabels(items: readonly LabelInput[], view: Box, W: number, H: number, taken: Box[] = []): Map<string, LabelSpot> {\n const { at, back } = screenOf(view, W, H);\n const out = new Map<string, LabelSpot>();\n const used = [...taken];\n const clear = (b: Box) =>\n b.x >= 0 &&\n b.y >= 0 &&\n b.x + b.w <= W &&\n b.y + b.h <= H &&\n used.every((u) => b.x + b.w + 2 <= u.x || u.x + u.w + 2 <= b.x || b.y + b.h + 2 <= u.y || u.y + u.h + 2 <= b.y);\n for (const it of items) {\n const [cx, cy] = at(it.label[0], it.label[1]);\n const box = ([w, h]: [number, number]): Box => ({ x: cx - w / 2, y: cy - h / 2, w, h });\n let spot: LabelSpot = { kind: null, x: cx, y: cy, w: 0, h: 0 };\n if (!it.slender) {\n const b = box(it.full);\n const probes: [number, number][] = [\n [b.x, b.y],\n [b.x + b.w, b.y],\n [b.x, b.y + b.h],\n [b.x + b.w, b.y + b.h],\n [cx, b.y],\n [cx, b.y + b.h],\n [b.x, cy],\n [b.x + b.w, cy],\n ];\n if (probes.every(([px, py]) => insidePolygon(...back(px, py), it.outline)) && clear(b)) spot = { kind: 'full', ...b };\n }\n if (!spot.kind) {\n const b = box(it.pill);\n if (clear(b)) spot = { kind: 'pill', ...b };\n }\n if (spot.kind) used.push(spot);\n out.set(it.id, spot);\n }\n return out;\n}\n\n/* ---------- Component ---------- */\n\nconst MIN_H = 240;\nconst MAX_H = 640;\nconst MAX_ZOOM = 8;\n\n/** A floor plan of zones with any outline (L shapes, pieces, holes), each filled by its value on the heat scale with\n * its name, figure and state. Zones are buttons in Tab order (primary first, smaller first); Enter or Space selects.\n * Wheel, pinch, drag, + − and the arrow keys zoom and pan; 「重設視角」 shows the whole plan again. */\nexport function FloorPlan({ zones, label, groups = [], shell, edges = [], legend = true, fill = false, className, ...p }: FloorPlanProps) {\n const id = 'fp' + React.useId().replace(/[^a-zA-Z0-9]/g, '');\n const ids = React.useMemo(() => new Map(zones.map((z) => [z.id, z])), [zones]);\n devWarn(ids.size !== zones.length, 'FloorPlan', 'two zones share an id: give each zone its own id, value and onChange use it.');\n devWarn(\n () => edges.some((e) => !ids.has(e.a) || !ids.has(e.b)),\n 'FloorPlan',\n () =>\n `an edge names a zone that is not in zones (${edges\n .filter((e) => !ids.has(e.a) || !ids.has(e.b))\n .map((e) => e.a + '–' + e.b)\n .join(', ')}).`,\n );\n devWarn(\n () => zones.some((z) => !insidePolygon(z.label[0], z.label[1], z.outline)),\n 'FloorPlan',\n () =>\n `the label point of ${zones\n .filter((z) => !insidePolygon(z.label[0], z.label[1], z.outline))\n .map((z) => z.id)\n .join(', ')} is outside its outline: pass a point inside (e.g. the pole of inaccessibility).`,\n );\n\n const [min, max] = heatRange(zones, p.min, p.max);\n const base = React.useMemo(() => planBox([...zones.map((z) => z.outline), ...(shell ? [shell] : [])]), [zones, shell]);\n const order = React.useMemo(() => zoneOrder(zones), [zones]);\n const paths = React.useMemo(() => new Map(zones.map((z) => [z.id, polygonPath(z.outline)])), [zones]);\n\n // Size of the drawing in px, measured; a first guess for the server and the first render.\n const box = React.useRef<HTMLDivElement>(null);\n const [size, setSize] = React.useState<[number, number]>(() => [800, Math.max(MIN_H, Math.min(MAX_H, (800 * base.h) / base.w))]);\n React.useLayoutEffect(() => {\n const el = box.current;\n if (!el) return;\n const measure = () => {\n const r = el.getBoundingClientRect();\n if (r.width > 0 && r.height > 0) setSize((s) => (Math.abs(s[0] - r.width) < 0.5 && Math.abs(s[1] - r.height) < 0.5 ? s : [r.width, r.height]));\n };\n measure();\n const ro = resizeObserver(measure);\n ro?.observe(el);\n return () => ro?.disconnect();\n }, []);\n const [W, H] = size;\n\n // The view: a viewBox inside (or around) the whole plan. Zoom is base.w / view.w, from 1 to MAX_ZOOM.\n // Kept with the plan it was made for: a new outline shows the whole plan again.\n const baseKey = `${base.x},${base.y},${base.w},${base.h}`;\n const [viewState, setViewState] = React.useState<{ key: string; view: Box }>({ key: baseKey, view: base });\n const view = viewState.key === baseKey ? viewState.view : base;\n const setView = React.useCallback((v: Box) => setViewState({ key: baseKey, view: v }), [baseKey]);\n const clampView = React.useCallback(\n (v: Box): Box => {\n // The whole plan: nothing to pan.\n if (v.w >= base.w * 0.999) return base;\n const w = Math.max(base.w / MAX_ZOOM, v.w);\n const h = (w * base.h) / base.w;\n const cx = Math.min(base.x + base.w, Math.max(base.x, v.x + v.w / 2));\n const cy = Math.min(base.y + base.h, Math.max(base.y, v.y + v.h / 2));\n return { x: cx - w / 2, y: cy - h / 2, w, h };\n },\n [base],\n );\n const viewRef = React.useRef(view);\n React.useLayoutEffect(() => {\n viewRef.current = view;\n });\n const anim = React.useRef(0);\n const goTo = React.useCallback(\n (to: Box, animate: boolean) => {\n cancelAnimationFrame(anim.current);\n const target = clampView(to);\n if (!animate || reduced() || typeof requestAnimationFrame !== 'function') return setView(target);\n const from = viewRef.current;\n const t0 = performance.now();\n const step = (now: number) => {\n const t = Math.min(1, (now - t0) / 200);\n const e = 1 - (1 - t) ** 3;\n if (t >= 1) return setView(target);\n setView({\n x: from.x + (target.x - from.x) * e,\n y: from.y + (target.y - from.y) * e,\n w: from.w + (target.w - from.w) * e,\n h: from.h + (target.h - from.h) * e,\n });\n anim.current = requestAnimationFrame(step);\n };\n anim.current = requestAnimationFrame(step);\n },\n [clampView, setView],\n );\n React.useEffect(() => () => cancelAnimationFrame(anim.current), []);\n /** Zoom by factor around a screen point (px in the drawing); default its middle. */\n const zoomAt = React.useCallback(\n (factor: number, px = W / 2, py = H / 2, animate = false) => {\n const v = viewRef.current;\n const { back } = screenOf(v, W, H);\n const [mx, my] = back(px, py);\n const fy = -my;\n const w = v.w / factor;\n const h = v.h / factor;\n goTo({ x: mx - ((mx - v.x) / v.w) * w, y: fy - ((fy - v.y) / v.h) * h, w, h }, animate);\n },\n [W, H, goTo],\n );\n const zoomed = Math.abs(view.w - base.w) > base.w * 1e-3 || Math.abs(view.x - base.x) > base.w * 1e-3 || Math.abs(view.y - base.y) > base.h * 1e-3;\n\n const svg = React.useRef<SVGSVGElement>(null);\n // The wheel zooms (a non-passive listener, so the page does not scroll under the plan).\n React.useEffect(() => {\n const el = svg.current;\n if (!el) return;\n const onWheel = (e: WheelEvent) => {\n e.preventDefault();\n const r = el.getBoundingClientRect();\n zoomAt(Math.exp(-e.deltaY * (e.deltaMode === 1 ? 0.05 : 0.0015)), e.clientX - r.left, e.clientY - r.top);\n };\n el.addEventListener('wheel', onWheel, { passive: false });\n return () => el.removeEventListener('wheel', onWheel);\n }, [zoomAt]);\n\n // Drag pans, two fingers pinch. A press that moved more than 4 px is not a click.\n const pointers = React.useRef(new Map<number, [number, number]>());\n const gesture = React.useRef<{ moved: boolean; start: [number, number]; dist?: number }>({ moved: false, start: [0, 0] });\n const local = (e: React.PointerEvent): [number, number] => {\n const r = svg.current?.getBoundingClientRect();\n return r ? [e.clientX - r.left, e.clientY - r.top] : [0, 0];\n };\n const onPointerDown = (e: React.PointerEvent) => {\n if (e.button !== 0) return;\n pointers.current.set(e.pointerId, local(e));\n if (pointers.current.size === 1) gesture.current = { moved: false, start: local(e) };\n else gesture.current.dist = undefined;\n };\n const onPointerMove = (e: React.PointerEvent) => {\n const prev = pointers.current.get(e.pointerId);\n if (!prev) return;\n const now = local(e);\n const g = gesture.current;\n if (!g.moved && Math.hypot(now[0] - g.start[0], now[1] - g.start[1]) > 4) {\n g.moved = true;\n if (typeof svg.current?.setPointerCapture === 'function') for (const pid of pointers.current.keys()) svg.current.setPointerCapture(pid);\n }\n if (!g.moved) {\n pointers.current.set(e.pointerId, now);\n return;\n }\n const v = viewRef.current;\n const s = Math.min(W / v.w, H / v.h);\n if (pointers.current.size === 1) goTo({ ...v, x: v.x - (now[0] - prev[0]) / s, y: v.y - (now[1] - prev[1]) / s }, false);\n pointers.current.set(e.pointerId, now);\n if (pointers.current.size === 2) {\n const [a, b] = [...pointers.current.values()];\n const d = Math.hypot(a[0] - b[0], a[1] - b[1]);\n if (g.dist) zoomAt(d / g.dist, (a[0] + b[0]) / 2, (a[1] + b[1]) / 2);\n g.dist = d;\n }\n };\n const onPointerUp = (e: React.PointerEvent) => {\n pointers.current.delete(e.pointerId);\n if (pointers.current.size < 2) gesture.current.dist = undefined;\n };\n const pick = (z: FloorPlanZone) => {\n if (gesture.current.moved) return;\n p.onChange?.(z.id, z);\n };\n\n // Keyboard: + − zoom, arrows pan (anywhere in the plan, including on a zone).\n const onKeyDown = (e: React.KeyboardEvent) => {\n if (e.altKey || e.ctrlKey || e.metaKey) return;\n const v = viewRef.current;\n const pan: Record<string, [number, number]> = { ArrowLeft: [-1, 0], ArrowRight: [1, 0], ArrowUp: [0, -1], ArrowDown: [0, 1] };\n if (e.key === '+' || e.key === '=') zoomAt(1.5, undefined, undefined, true);\n else if (e.key === '-' || e.key === '_') zoomAt(1 / 1.5, undefined, undefined, true);\n else if (pan[e.key]) goTo({ ...v, x: v.x + pan[e.key][0] * v.w * 0.15, y: v.y + pan[e.key][1] * v.h * 0.15 }, true);\n else return;\n e.preventDefault();\n };\n\n // Hover and focus show a tooltip at the pointer, or at the label point for focus.\n const [tip, setTip] = React.useState<{ id: string; x: number; y: number } | null>(null);\n const [focused, setFocused] = React.useState<string | null>(null);\n const [focusRing, setFocusRing] = React.useState<string | null>(null);\n\n const narrow = useNarrow();\n const coarse = useMedia('(pointer: coarse)');\n const scr = screenOf(view, W, H);\n const s = scr.s;\n\n // Labels: sizes in px, then placed for the current view.\n const texts = new Map(zones.map((z) => [z.id, zoneText(z, min, max, z.emphasis === 'muted' ? [tr('次要')] : [])]));\n const textOf = (z: FloorPlanZone) => texts.get(z.id) ?? zoneText(z, min, max);\n const groupBoxes: { g: FloorPlanGroup; members: FloorPlanZone[]; b: Box }[] = [];\n for (const g of groups) {\n const members = zones.filter((z) => z.group === g.id);\n if (members.length) groupBoxes.push({ g, members, b: planBox(members.map((m) => m.outline)) });\n }\n const groupLabels = groupBoxes.map(({ g, b }) => {\n // Top left of the group, just above its outline (b holds the 4 % margin of planBox; undo it).\n const m = (Math.max(b.w, b.h) / 1.08) * 0.04;\n const [x, y] = scr.at(b.x + m, -(b.y + m));\n const w = textWidth(g.name, 13) + 12;\n return { g, box: { x: Math.max(0, Math.min(W - w, x)), y: Math.max(0, y - 26), w, h: 22 } };\n });\n const spots = placeLabels(\n order.map((z) => {\n const t = textOf(z);\n const muted = z.emphasis === 'muted' || noData(z);\n const warn = !!z.tone && z.tone !== 'normal';\n const bb = bounds(z.outline);\n const ratio = Math.max(bb.w, bb.h) / Math.max(1e-9, Math.min(bb.w, bb.h));\n const unitW = z.unit ? textWidth(' ' + z.unit, muted ? 13 : 16) : 0;\n const head = noData(z) ? tr('沒有資料') : t.state;\n const full: [number, number] = muted\n ? [Math.max(textWidth((warn ? '⚠ ' : '') + z.name, 13), textWidth(noData(z) ? head : t.figure, 16, !noData(z)) + unitW) + 12, 46]\n : [Math.max(textWidth(z.name, 16), textWidth(t.figure, 25, true) + unitW, textWidth(head, 13)) + 16, 80];\n const pillText = (warn ? '⚠ ' : '') + z.name + ' ';\n const pill: [number, number] = [\n textWidth(pillText, 13) + (noData(z) ? textWidth(tr('沒有資料'), 13) : textWidth(t.figure, 13, true) + (z.unit ? textWidth(' ' + z.unit, 13) : 0)) + 18,\n 24,\n ];\n return { id: z.id, outline: z.outline, label: z.label, muted, slender: ratio > 4, full, pill };\n }),\n view,\n W,\n H,\n groupLabels.map((l) => l.box),\n );\n\n const u = (px: number) => px / s; // px in user units (metres) at the current zoom\n const all = { x: view.x - view.w, y: view.y - view.h, w: view.w * 3, h: view.h * 3 };\n const selected = p.value != null ? ids.get(p.value) : undefined;\n const ring = (zid: string, inner: number, width: number, color: string, key: string) => (\n <React.Fragment key={key}>\n <mask id={`${id}-${key}`} maskUnits=\"userSpaceOnUse\" x={all.x} y={all.y} width={all.w} height={all.h}>\n <path d={paths.get(zid)} fill=\"#fff\" stroke=\"#fff\" strokeWidth={u(2 * (inner + width))} strokeLinejoin=\"round\" fillRule=\"evenodd\" />\n <path d={paths.get(zid)} fill=\"#000\" stroke=\"#000\" strokeWidth={u(2 * inner)} strokeLinejoin=\"round\" fillRule=\"evenodd\" />\n </mask>\n <rect x={all.x} y={all.y} width={all.w} height={all.h} style={{ fill: color }} mask={`url(#${id}-${key})`} pointerEvents=\"none\" />\n </React.Fragment>\n );\n const hasMuted = zones.some((z) => z.emphasis === 'muted');\n const unit = zones.find((z) => z.unit)?.unit;\n const tipZone = tip ? ids.get(tip.id) : undefined;\n const tipAt = tip ?? { x: 0, y: 0 };\n const tipText = tipZone ? texts.get(tipZone.id) : undefined;\n const hint = `${id}-hint`;\n\n return (\n <div className={cx('ui-floorplan', fill && 'is-fill', className)} role=\"group\" aria-label={label} aria-describedby={hint} onKeyDown={onKeyDown}>\n <span id={hint} className=\"ui-visually-hidden\">\n {tr('+ − 縮放,方向鍵平移')}\n </span>\n <div\n ref={box}\n className=\"ui-fp-box\"\n style={fill ? undefined : ({ aspectRatio: `${base.w} / ${base.h}` } as React.CSSProperties)}\n onPointerLeave={() => setTip((t) => (t && focused === t.id ? t : null))}\n >\n <svg\n ref={svg}\n className=\"ui-fp-svg\"\n viewBox={`${view.x} ${view.y} ${view.w} ${view.h}`}\n preserveAspectRatio=\"xMidYMid meet\"\n onPointerDown={onPointerDown}\n onPointerMove={onPointerMove}\n onPointerUp={onPointerUp}\n onPointerCancel={onPointerUp}\n >\n <defs>\n <pattern id={`${id}-stripes`} patternUnits=\"userSpaceOnUse\" width={u(9)} height={u(9)} patternTransform=\"rotate(45)\">\n <rect width={u(4)} height={u(9)} className=\"ui-fp-stripe\" />\n </pattern>\n {zones.map((z) =>\n z.tone && z.tone !== 'normal' && !noData(z) ? (\n <clipPath key={z.id} id={`${id}-clip-${z.id}`}>\n <path d={paths.get(z.id)} clipRule=\"evenodd\" />\n </clipPath>\n ) : null,\n )}\n </defs>\n {shell ? <path className=\"ui-fp-shell\" d={polygonPath(shell)} fillRule=\"evenodd\" /> : null}\n {order.map((z) => {\n const d = paths.get(z.id) ?? '';\n if (noData(z)) return <path key={z.id} className=\"ui-fp-empty\" d={d} fillRule=\"evenodd\" />;\n const t = textOf(z);\n const muted = z.emphasis === 'muted';\n const on = p.value === z.id;\n return (\n <g\n key={z.id}\n role=\"button\"\n tabIndex={0}\n aria-pressed={on}\n aria-label={t.label}\n className={cx('ui-fp-zone', 'is-' + t.tone, muted && 'is-muted', on && 'is-selected')}\n data-id={z.id}\n onClick={() => pick(z)}\n onKeyDown={(e) => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault();\n p.onChange?.(z.id, z);\n }\n }}\n onPointerEnter={(e) => {\n const r = box.current?.getBoundingClientRect();\n if (r && e.pointerType === 'mouse') setTip({ id: z.id, x: e.clientX - r.left, y: e.clientY - r.top });\n }}\n onPointerMove={(e) => {\n const r = box.current?.getBoundingClientRect();\n if (r && e.pointerType === 'mouse' && pointers.current.size === 0) setTip({ id: z.id, x: e.clientX - r.left, y: e.clientY - r.top });\n }}\n onPointerLeave={() => setTip((v) => (v?.id === z.id && focused !== z.id ? null : v))}\n onFocus={(e) => {\n setFocused(z.id);\n if ((e.target as Element).matches?.(':focus-visible')) {\n setFocusRing(z.id);\n const [x, y] = scr.at(z.label[0], z.label[1]);\n setTip({ id: z.id, x, y });\n }\n }}\n onBlur={() => {\n setFocused(null);\n setFocusRing(null);\n setTip((v) => (v?.id === z.id ? null : v));\n }}\n >\n <path className=\"ui-fp-fill\" d={d} fillRule=\"evenodd\" style={{ fill: muted ? `color-mix(in srgb, ${t.bg} 40%, var(--surface))` : t.bg }} />\n {z.forecast ? <path d={d} fillRule=\"evenodd\" fill={`url(#${id}-stripes)`} pointerEvents=\"none\" /> : null}\n {t.tone !== 'normal' ? (\n <path className=\"ui-fp-tone\" d={d} fill=\"none\" strokeWidth={u(8)} clipPath={`url(#${id}-clip-${z.id})`} pointerEvents=\"none\" />\n ) : null}\n {/* Small zones on touch screens get a 48 px round target at their label point. */}\n {(narrow || coarse) && (Math.min(bounds(z.outline).w, bounds(z.outline).h) / 1.08) * s < 48 ? (\n <circle cx={z.label[0]} cy={-z.label[1]} r={u(24)} fill=\"transparent\" />\n ) : null}\n </g>\n );\n })}\n {edges.map((e, i) =>\n e.segs.map((seg, k) => (\n <polyline\n key={i + '-' + k}\n className=\"ui-fp-edge\"\n points={seg.map(([x, y]) => `${fmt(x)},${fmt(-y)}`).join(' ')}\n vectorEffect=\"non-scaling-stroke\"\n />\n )),\n )}\n {groupBoxes.map(({ g, members }) => (\n <React.Fragment key={g.id}>\n <mask id={`${id}-g-${g.id}`} maskUnits=\"userSpaceOnUse\" x={all.x} y={all.y} width={all.w} height={all.h}>\n {members.map((m) => (\n <path key={m.id} d={paths.get(m.id)} fill=\"#fff\" stroke=\"#fff\" strokeWidth={u(2 * 3.5)} strokeLinejoin=\"round\" fillRule=\"evenodd\" />\n ))}\n {members.map((m) => (\n <path key={m.id} d={paths.get(m.id)} fill=\"#000\" stroke=\"#000\" strokeWidth={u(2 * 2)} strokeLinejoin=\"round\" fillRule=\"evenodd\" />\n ))}\n </mask>\n <rect x={all.x} y={all.y} width={all.w} height={all.h} className=\"ui-fp-group\" mask={`url(#${id}-g-${g.id})`} />\n </React.Fragment>\n ))}\n {selected && !noData(selected) ? ring(selected.id, 4, 2, 'var(--ink)', 'sel') : null}\n {focusRing ? ring(focusRing, 1, 2, 'var(--focus)', 'focus') : null}\n </svg>\n <div className=\"ui-fp-labels\" aria-hidden=\"true\">\n {groupLabels.map(({ g, box: b }) => (\n <span key={g.id} className=\"ui-fp-group-name\" style={{ left: b.x, top: b.y, width: b.w }}>\n {g.name}\n </span>\n ))}\n {order.map((z) => {\n const spot = spots.get(z.id);\n if (!spot?.kind) return null;\n const t = textOf(z);\n const empty = noData(z);\n const muted = z.emphasis === 'muted' || empty;\n const warn = t.tone !== 'normal' && !empty;\n const pos = { left: spot.x, top: spot.y, width: spot.w, height: spot.h };\n const unitEl = z.unit && !empty ? <span className=\"ui-fp-unit\">{' ' + z.unit}</span> : null;\n if (spot.kind === 'pill')\n return (\n <span key={z.id} className={cx('ui-fp-pill', empty && 'is-empty')} style={pos}>\n {(warn ? '⚠ ' : '') + z.name + ' '}\n <span className={empty ? undefined : 'ui-fp-num'}>{empty ? tr('沒有資料') : t.figure}</span>\n {unitEl}\n </span>\n );\n return (\n <span\n key={z.id}\n className={cx('ui-fp-label', muted && 'is-muted', empty && 'is-empty')}\n data-fill={muted ? undefined : t.fill}\n style={{ ...pos, color: muted ? undefined : t.color }}\n >\n <span className=\"ui-fp-name\">{(muted && warn ? '⚠ ' : '') + z.name}</span>\n {empty ? (\n <span className=\"ui-fp-state\">{tr('沒有資料')}</span>\n ) : (\n <span className=\"ui-fp-value\">\n {t.figure}\n {unitEl}\n </span>\n )}\n {muted ? null : <span className=\"ui-fp-state\">{t.state}</span>}\n </span>\n );\n })}\n </div>\n {tipZone && tipText ? (\n <div className=\"ui-fp-tip\" aria-hidden=\"true\" style={tipStyle(tipAt.x, tipAt.y, W, H)}>\n <span className=\"ui-fp-tip-name\">{tipZone.name}</span>\n <span>\n <span className=\"ui-fp-num\">{tipText.figure}</span>\n {tipZone.unit ? ' ' + tipZone.unit : ''}\n {tr(',') + tipText.state}\n {tipZone.emphasis === 'muted' ? tr(',') + tr('次要') : ''}\n </span>\n {tipZone.detail ? <span>{tipZone.detail}</span> : null}\n </div>\n ) : null}\n <div className=\"ui-fp-controls\">\n <IconButton\n icon=\"plus\"\n label={tr('放大')}\n tooltip={false}\n onClick={() => zoomAt(1.5, undefined, undefined, true)}\n disabled={view.w <= base.w / MAX_ZOOM + 1e-9}\n />\n <IconButton icon=\"minus\" label={tr('縮小')} tooltip={false} onClick={() => zoomAt(1 / 1.5, undefined, undefined, true)} disabled={!zoomed} />\n <IconButton icon=\"corners-out\" label={tr('重設視角')} tooltip={false} onClick={() => goTo(base, true)} disabled={!zoomed} />\n </div>\n </div>\n {legend ? (\n <Legend\n min={min}\n max={max}\n unit={unit}\n warn={p.warn}\n limit={p.limit}\n decimals={zones.find((z) => z.decimals != null)?.decimals ?? 1}\n muted={hasMuted}\n />\n ) : null}\n </div>\n );\n}\n\n/** The tooltip beside the point, kept inside the drawing. */\nfunction tipStyle(x: number, y: number, W: number, H: number): React.CSSProperties {\n const right = x > W - 240;\n const below = y < 90;\n return {\n left: right ? undefined : Math.max(4, x + 14),\n right: right ? Math.max(4, W - x + 14) : undefined,\n top: below ? Math.min(H - 4, y + 18) : undefined,\n bottom: below ? undefined : Math.max(4, H - y + 10),\n };\n}\n\nfunction Legend({\n min,\n max,\n unit,\n warn,\n limit,\n decimals,\n muted,\n}: {\n min: number;\n max: number;\n unit?: string;\n warn?: number;\n limit?: number;\n decimals: number;\n muted: boolean;\n}) {\n const pct = (v: number) => `${Math.min(100, Math.max(0, ((v - min) / (max - min)) * 100))}%`;\n const num = (v: number) => format.number(v, decimals) + (unit ? ' ' + unit : '');\n return (\n <div className=\"ui-fp-legend\">\n <span className=\"ui-fp-scale\">\n <span className=\"ui-fp-num\">{format.number(min, decimals)}</span>\n <span className=\"ui-fp-bar\">\n {[1, 2, 3, 4, 5, 6, 7].map((n) => (\n <span key={n} style={{ background: `var(--heat-${n})` }} />\n ))}\n {warn != null ? <span className=\"ui-fp-tick is-warning\" style={{ left: pct(warn) }} /> : null}\n {limit != null ? <span className=\"ui-fp-tick is-danger\" style={{ left: pct(limit) }} /> : null}\n </span>\n <span>\n <span className=\"ui-fp-num\">{format.number(max, decimals)}</span>\n {unit ? ' ' + unit : ''}\n </span>\n </span>\n {warn != null ? <span className=\"ui-fp-key is-warning\">{tr('注意 {v}', { v: num(warn) })}</span> : null}\n {limit != null ? <span className=\"ui-fp-key is-danger\">{tr('上限 {v}', { v: num(limit) })}</span> : null}\n {muted ? <span className=\"ui-fp-key is-muted\">{tr('淡色=次要區域')}</span> : null}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;AAaA,aAAaA,cAAQC,eAASC,mBAAY;;AAqE1C,SAAgB,SAAS,MAA0B;CACjD,OAAO,KAAK,SAAS,MAAM,KAAK,KAAK,CAAC,GAAG,OAAO,IAAI,CAAC,IAAI,MAAM,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,GAAG,IAAI,MAAM;AAC5F;AACA,MAAM,OAAO,MAAc,OAAO,KAAK,MAAM,IAAI,GAAI,IAAI,GAAI;;AAG7D,SAAgB,YAAY,IAA0B;CACpD,OAAO,GAAG,KAAK,SAAS,KAAK,IAAI,QAAQ,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,KAAK,EAAE;AAC9D;;;AAWA,SAAgB,QAAQ,QAA6B;CACnD,IAAI,CAAC,IAAI,IAAI,IAAI,MAAM;EAAC;EAAU;EAAU;EAAW;CAAS;CAChE,KAAK,MAAM,MAAM,QACf,KAAK,MAAM,QAAQ,IACjB,KAAK,MAAM,QAAQ,MACjB,KAAK,MAAM,CAAC,GAAG,MAAM,MAAM;EACzB,KAAK,KAAK,IAAI,IAAI,CAAC;EACnB,KAAK,KAAK,IAAI,IAAI,CAAC;EACnB,KAAK,KAAK,IAAI,IAAI,CAAC,CAAC;EACpB,KAAK,KAAK,IAAI,IAAI,CAAC,CAAC;CACtB;CACN,IAAI,CAAC,OAAO,SAAS,EAAE,GAAG,OAAO;EAAE,GAAG;EAAG,GAAG;EAAG,GAAG;EAAG,GAAG;CAAE;CAC1D,MAAM,IAAI,KAAK,IAAI,KAAK,IAAI,IAAI;CAChC,MAAM,IAAI,KAAK,IAAI,KAAK,IAAI,IAAI;CAChC,MAAM,IAAI,KAAK,IAAI,GAAG,CAAC,IAAI;CAC3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A,OAAO,OAAO,KAAK,QAAQ;KAAQ,CAAA,GAC/D,OAAO,SAAM,OAAO,EACjB,EAAA,CAAA;IACF;;GACL,QAAQ,OAAO,oBAAC,QAAD;IAAM,WAAU;IAAwB,UAAA,GAAG,UAAU,EAAE,GAAG,IAAI,IAAI,EAAE,CAAC;GAAQ,CAAA,IAAI;GAChG,SAAS,OAAO,oBAAC,QAAD;IAAM,WAAU;IAAuB,UAAA,GAAG,UAAU,EAAE,GAAG,IAAI,KAAK,EAAE,CAAC;GAAQ,CAAA,IAAI;GACjG,QAAQ,oBAAC,QAAD;IAAM,WAAU;IAAsB,UAAA,GAAG,SAAS;GAAQ,CAAA,IAAI;EACpE;;AAET"}
|
|
@@ -56,4 +56,7 @@ export interface ZoneMapProps {
|
|
|
56
56
|
/** Extra class on the root element. */
|
|
57
57
|
className?: string;
|
|
58
58
|
}
|
|
59
|
+
/** A floor plan of zones as rectangles on a grid, each filled by its value (heat scale) with its name, state, figure
|
|
60
|
+
* and one detail line. Zones are buttons: Tab moves between them, Enter or Space selects. The selected zone has an
|
|
61
|
+
* ink outline outside it; a zone needing attention has a 4 px warning or danger border and 「⚠」 in its state. */
|
|
59
62
|
export declare function ZoneMap({ zones, label, columns, rowHeight, fill, className, ...p }: ZoneMapProps): React.JSX.Element;
|
|
@@ -1,23 +1,18 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { devWarn } from "../../internal/dev.js";
|
|
3
3
|
import { cx } from "../../internal/util.js";
|
|
4
|
-
import { format } from "../../format.js";
|
|
5
4
|
import { tr } from "../../i18n.js";
|
|
6
|
-
import {
|
|
5
|
+
import { heatRange, noData, zoneText } from "../../internal/zone.js";
|
|
7
6
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
7
|
// src/components/ZoneMap/ZoneMap.tsx
|
|
9
8
|
/** A floor plan of zones as rectangles on a grid, each filled by its value (heat scale) with its name, state, figure
|
|
10
9
|
* and one detail line. Zones are buttons: Tab moves between them, Enter or Space selects. The selected zone has an
|
|
11
10
|
* ink outline outside it; a zone needing attention has a 4 px warning or danger border and 「⚠」 in its state. */
|
|
12
|
-
const DATA_TOKEN = /^(heat-[1-7]|diverge-(neg|pos)(-strong)?|diverge-zero|chart-[1-4])$/;
|
|
13
11
|
function ZoneMap({ zones, label, columns = 4, rowHeight = 120, fill = false, className, ...p }) {
|
|
14
12
|
devWarn(p.selectedId !== void 0 || p.onSelect !== void 0, "ZoneMap", "selectedId and onSelect are renamed value and onChange (id, zone); pass those instead.");
|
|
15
13
|
const selectedId = p.value !== void 0 ? p.value : p.selectedId;
|
|
16
14
|
const pick = (z) => p.onChange ? p.onChange(z.id, z) : p.onSelect?.(z);
|
|
17
|
-
const
|
|
18
|
-
const lo = p.min ?? (values.length ? Math.min(...values) : 0);
|
|
19
|
-
const hiRaw = p.max ?? (values.length ? Math.max(...values) : 1);
|
|
20
|
-
const [min, max] = hiRaw > lo ? [lo, hiRaw] : [lo - 1, lo + 1];
|
|
15
|
+
const [min, max] = heatRange(zones, p.min, p.max);
|
|
21
16
|
return /* @__PURE__ */ jsx("div", {
|
|
22
17
|
className: cx("ui-zonemap", fill && "is-fill", className),
|
|
23
18
|
role: "group",
|
|
@@ -31,7 +26,7 @@ function ZoneMap({ zones, label, columns = 4, rowHeight = 120, fill = false, cla
|
|
|
31
26
|
gridRow: `${z.area.row} / span ${z.area.rows ?? 1}`,
|
|
32
27
|
gridColumn: `${z.area.col} / span ${z.area.cols ?? 1}`
|
|
33
28
|
} : void 0;
|
|
34
|
-
if (z
|
|
29
|
+
if (noData(z)) return /* @__PURE__ */ jsxs("div", {
|
|
35
30
|
className: "ui-zone is-empty",
|
|
36
31
|
style: place,
|
|
37
32
|
children: [/* @__PURE__ */ jsx("span", {
|
|
@@ -42,11 +37,7 @@ function ZoneMap({ zones, label, columns = 4, rowHeight = 120, fill = false, cla
|
|
|
42
37
|
children: tr("沒有資料")
|
|
43
38
|
})]
|
|
44
39
|
}, z.id);
|
|
45
|
-
const tone = z
|
|
46
|
-
const fill = z.fill ?? (z.value != null ? heatToken(z.value, min, max) : "surface-sub");
|
|
47
|
-
const bg = /^[a-z][a-z0-9-]*$/.test(fill) ? `var(--${fill})` : fill;
|
|
48
|
-
const state = (tone === "normal" ? "" : "⚠ ") + (z.state ?? (z.forecast ? tr("預測") : tr("正常")));
|
|
49
|
-
const figure = z.value != null ? format.number(z.value, z.decimals ?? 1) : "—";
|
|
40
|
+
const { tone, fill, bg, color, state, figure, label: name } = zoneText(z, min, max);
|
|
50
41
|
const on = selectedId === z.id;
|
|
51
42
|
return /* @__PURE__ */ jsxs("button", {
|
|
52
43
|
type: "button",
|
|
@@ -55,15 +46,10 @@ function ZoneMap({ zones, label, columns = 4, rowHeight = 120, fill = false, cla
|
|
|
55
46
|
style: {
|
|
56
47
|
...place,
|
|
57
48
|
background: bg,
|
|
58
|
-
color
|
|
49
|
+
color
|
|
59
50
|
},
|
|
60
51
|
"aria-pressed": on,
|
|
61
|
-
"aria-label":
|
|
62
|
-
z.name,
|
|
63
|
-
figure + (z.unit ? " " + z.unit : ""),
|
|
64
|
-
state.replace("⚠ ", ""),
|
|
65
|
-
z.detail
|
|
66
|
-
].filter(Boolean).join(tr(",")),
|
|
52
|
+
"aria-label": name,
|
|
67
53
|
onClick: () => pick(z),
|
|
68
54
|
children: [
|
|
69
55
|
/* @__PURE__ */ jsxs("span", {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ZoneMap.js","names":[],"sources":["../../../src/components/ZoneMap/ZoneMap.tsx"],"sourcesContent":["import type * as React from 'react';\nimport { devWarn } from '../../internal/dev';\nimport { cx } from '../../internal/util';\nimport {
|
|
1
|
+
{"version":3,"file":"ZoneMap.js","names":[],"sources":["../../../src/components/ZoneMap/ZoneMap.tsx"],"sourcesContent":["import type * as React from 'react';\nimport { devWarn } from '../../internal/dev';\nimport { cx } from '../../internal/util';\nimport { tr } from '../../i18n';\nimport { heatRange, noData, zoneText } from '../../internal/zone';\n\nexport interface Zone {\n /** Unique id: value and onChange use it. */\n id: string;\n /** 「A 區」. */\n name: string;\n /** The main figure; null or undefined: no data (a dashed outline, not selectable). */\n value?: number | null;\n /** After the figure, smaller: '°C'. */\n unit?: string;\n /** Decimals of the figure. Default 1. */\n decimals?: number;\n /** The fill: a token name such as 'heat-5' or a color. Default: from the value on the heat scale (min, max). */\n fill?: string;\n /** `warning` or `danger`: a 4 px border in that color, and 「⚠」 before the state. Default normal. */\n tone?: 'normal' | 'warning' | 'danger';\n /** The state in words, e.g. 「正常」「注意」「超過上限」. Default 「正常」, or 「預測」 for a forecast. */\n state?: string;\n /** A forecast, not a measurement: the forecast stripes over the fill. */\n forecast?: boolean;\n /** One line of secondary information, e.g. 「進氣 26.1 °C」. */\n detail?: string;\n /** Where it sits on the grid (1-based); default: the next free cell. */\n area?: { row: number; col: number; rows?: number; cols?: number };\n}\n\nexport interface ZoneMapProps {\n /** The zones, in order (placed by `area` or flowing into the grid). */\n zones: Zone[];\n /** What the map shows, for screen readers, e.g. 「設施分區」. */\n label: string;\n /** Columns of the grid. Default 4. Where a zone would be narrower than 150 px (phones), fewer columns are used and\n * `area` placements are dropped, so zones flow in order. */\n columns?: number;\n /** Height of one grid row in px. Default 120. With `fill`, the least height of a row. */\n rowHeight?: number;\n /** Rows grow to fill the height the map is given (in ConsoleLayout's main view, or any flex column), never below\n * `rowHeight`. */\n fill?: boolean;\n /** Bottom of the heat scale for zones without a fill. Default: the smallest value among the zones. */\n min?: number;\n /** Top of the heat scale for zones without a fill. Default: the largest value among the zones. */\n max?: number;\n /** The selected zone's id (controlled); null for none. */\n value?: string | null;\n /** A zone was picked (click, Enter or Space): its id, and the zone. */\n onChange?: (id: string, zone: Zone) => void;\n /** @deprecated use value. */\n selectedId?: string | null;\n /** @deprecated use onChange (it gets the id first, the zone second). */\n onSelect?: (zone: Zone) => void;\n /** Extra class on the root element. */\n className?: string;\n}\n\n/** A floor plan of zones as rectangles on a grid, each filled by its value (heat scale) with its name, state, figure\n * and one detail line. Zones are buttons: Tab moves between them, Enter or Space selects. The selected zone has an\n * ink outline outside it; a zone needing attention has a 4 px warning or danger border and 「⚠」 in its state. */\nexport function ZoneMap({ zones, label, columns = 4, rowHeight = 120, fill = false, className, ...p }: ZoneMapProps) {\n devWarn(\n p.selectedId !== undefined || p.onSelect !== undefined,\n 'ZoneMap',\n 'selectedId and onSelect are renamed value and onChange (id, zone); pass those instead.',\n );\n const selectedId = p.value !== undefined ? p.value : p.selectedId;\n const pick = (z: Zone) => (p.onChange ? p.onChange(z.id, z) : p.onSelect?.(z));\n // The heat scale spans the zones' own values unless min and max are given: a map of humidity or load reads as well as\n // one of temperatures.\n const [min, max] = heatRange(zones, p.min, p.max);\n return (\n <div\n className={cx('ui-zonemap', fill && 'is-fill', className)}\n role=\"group\"\n aria-label={label}\n style={{ '--zone-cols': columns, gridAutoRows: fill ? `minmax(${rowHeight}px, 1fr)` : rowHeight + 'px' } as React.CSSProperties}\n >\n {zones.map((z) => {\n const place = z.area ? { gridRow: `${z.area.row} / span ${z.area.rows ?? 1}`, gridColumn: `${z.area.col} / span ${z.area.cols ?? 1}` } : undefined;\n if (noData(z))\n return (\n <div key={z.id} className=\"ui-zone is-empty\" style={place}>\n <span className=\"ui-zone-name\">{z.name}</span>\n <span className=\"ui-zone-detail\">{tr('沒有資料')}</span>\n </div>\n );\n const { tone, fill, bg, color, state, figure, label: name } = zoneText(z, min, max);\n const on = selectedId === z.id;\n return (\n <button\n key={z.id}\n type=\"button\"\n className={cx('ui-zone', 'is-' + tone, z.forecast && 'ui-forecast', on && 'is-selected')}\n data-fill={fill}\n // Text on the data tokens comes from CSS (it follows the theme); other fills are measured here.\n style={{ ...place, background: bg, color }}\n aria-pressed={on}\n aria-label={name}\n onClick={() => pick(z)}\n >\n <span className=\"ui-zone-head\">\n <span className=\"ui-zone-name\">{z.name}</span>\n <span className=\"ui-zone-state\">{state}</span>\n </span>\n <span className=\"ui-zone-value\">\n {figure}\n {/* The space before the unit sits in the unit's text font (a Geist Mono space at h2 size is about 20 px wide)\n and does not break: the shown text is 「23.1 °C」, the same as the button's name (WCAG 2.5.3). */}\n {z.unit ? <span className=\"ui-zone-unit\">{'\\u00a0' + z.unit}</span> : null}\n </span>\n {z.detail ? <span className=\"ui-zone-detail\">{z.detail}</span> : null}\n </button>\n );\n })}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;AA+DA,SAAgB,QAAQ,EAAE,OAAO,OAAO,UAAU,GAAG,YAAY,KAAK,OAAO,OAAO,WAAW,GAAG,KAAmB;CACnH,QACE,EAAE,eAAe,KAAA,KAAa,EAAE,aAAa,KAAA,GAC7C,WACA,wFACF;CACA,MAAM,aAAa,EAAE,UAAU,KAAA,IAAY,EAAE,QAAQ,EAAE;CACvD,MAAM,QAAQ,MAAa,EAAE,WAAW,EAAE,SAAS,EAAE,IAAI,CAAC,IAAI,EAAE,WAAW,CAAC;CAG5E,MAAM,CAAC,KAAK,OAAO,UAAU,OAAO,EAAE,KAAK,EAAE,GAAG;CAChD,OACE,oBAAC,OAAD;EACE,WAAW,GAAG,cAAc,QAAQ,WAAW,SAAS;EACxD,MAAK;EACL,cAAY;EACZ,OAAO;GAAE,eAAe;GAAS,cAAc,OAAO,UAAU,UAAU,YAAY,YAAY;EAAK;EAEtG,UAAA,MAAM,KAAK,MAAM;GAChB,MAAM,QAAQ,EAAE,OAAO;IAAE,SAAS,GAAG,EAAE,KAAK,IAAI,UAAU,EAAE,KAAK,QAAQ;IAAK,YAAY,GAAG,EAAE,KAAK,IAAI,UAAU,EAAE,KAAK,QAAQ;GAAI,IAAI,KAAA;GACzI,IAAI,OAAO,CAAC,GACV,OACE,qBAAC,OAAD;IAAgB,WAAU;IAAmB,OAAO;IAApD,UAAA,CACE,oBAAC,QAAD;KAAM,WAAU;KAAgB,UAAA,EAAE;IAAW,CAAA,GAC7C,oBAAC,QAAD;KAAM,WAAU;KAAkB,UAAA,GAAG,MAAM;IAAQ,CAAA,CAChD;GAHK,GAAA,EAAE,EAGP;GAET,MAAM,EAAE,MAAM,MAAM,IAAI,OAAO,OAAO,QAAQ,OAAO,SAAS,SAAS,GAAG,KAAK,GAAG;GAClF,MAAM,KAAK,eAAe,EAAE;GAC5B,OACE,qBAAC,UAAD;IAEE,MAAK;IACL,WAAW,GAAG,WAAW,QAAQ,MAAM,EAAE,YAAY,eAAe,MAAM,aAAa;IACvF,aAAW;IAEX,OAAO;KAAE,GAAG;KAAO,YAAY;KAAI;IAAM;IACzC,gBAAc;IACd,cAAY;IACZ,eAAe,KAAK,CAAC;IATvB,UAAA;KAWE,qBAAC,QAAD;MAAM,WAAU;MAAhB,UAAA,CACE,oBAAC,QAAD;OAAM,WAAU;OAAgB,UAAA,EAAE;MAAW,CAAA,GAC7C,oBAAC,QAAD;OAAM,WAAU;OAAiB,UAAA;MAAY,CAAA,CACzC;;KACN,qBAAC,QAAD;MAAM,WAAU;MAAhB,UAAA,CACG,QAGA,EAAE,OAAO,oBAAC,QAAD;OAAM,WAAU;OAAgB,UAAA,SAAW,EAAE;MAAW,CAAA,IAAI,IAClE;;KACL,EAAE,SAAS,oBAAC,QAAD;MAAM,WAAU;MAAkB,UAAA,EAAE;KAAa,CAAA,IAAI;IAC3D;GArBD,GAAA,EAAE,EAqBD;EAEZ,CAAC;CACE,CAAA;AAET"}
|
|
@@ -0,0 +1,270 @@
|
|
|
1
|
+
@layer theme, base, ui, components, utilities;
|
|
2
|
+
@layer ui.tokens, ui.components;
|
|
3
|
+
@import './IconButton.css';
|
|
4
|
+
@layer ui.components {
|
|
5
|
+
/* FloorPlan: zones with any outline in an SVG, labels as HTML on top (the same size at every zoom). Fills, the 4 px
|
|
6
|
+
attention border, the forecast stripes, the selection outline (ink, 2 px, 4 px outside) and the label type follow
|
|
7
|
+
ZoneMap. */
|
|
8
|
+
.ui-floorplan {
|
|
9
|
+
display: flex;
|
|
10
|
+
flex-direction: column;
|
|
11
|
+
gap: var(--space-3);
|
|
12
|
+
min-width: 0;
|
|
13
|
+
}
|
|
14
|
+
.ui-floorplan.is-fill {
|
|
15
|
+
flex: 1 1 auto;
|
|
16
|
+
min-height: 0;
|
|
17
|
+
}
|
|
18
|
+
.ui-fp-box {
|
|
19
|
+
position: relative;
|
|
20
|
+
width: 100%;
|
|
21
|
+
min-height: 240px;
|
|
22
|
+
max-height: 640px;
|
|
23
|
+
overflow: hidden;
|
|
24
|
+
border-radius: var(--radius-md);
|
|
25
|
+
}
|
|
26
|
+
.ui-floorplan.is-fill .ui-fp-box {
|
|
27
|
+
flex: 1 1 auto;
|
|
28
|
+
max-height: none;
|
|
29
|
+
}
|
|
30
|
+
.ui-fp-svg {
|
|
31
|
+
position: absolute;
|
|
32
|
+
inset: 0;
|
|
33
|
+
display: block;
|
|
34
|
+
width: 100%;
|
|
35
|
+
height: 100%;
|
|
36
|
+
touch-action: none;
|
|
37
|
+
-webkit-user-select: none;
|
|
38
|
+
user-select: none;
|
|
39
|
+
}
|
|
40
|
+
.ui-fp-shell {
|
|
41
|
+
fill: var(--surface-sub);
|
|
42
|
+
stroke: var(--line-strong);
|
|
43
|
+
stroke-width: 1.5px;
|
|
44
|
+
vector-effect: non-scaling-stroke;
|
|
45
|
+
}
|
|
46
|
+
.ui-fp-zone {
|
|
47
|
+
cursor: pointer;
|
|
48
|
+
outline: none;
|
|
49
|
+
}
|
|
50
|
+
.ui-fp-fill {
|
|
51
|
+
stroke: var(--surface);
|
|
52
|
+
stroke-width: 1.5px;
|
|
53
|
+
stroke-linejoin: round;
|
|
54
|
+
vector-effect: non-scaling-stroke;
|
|
55
|
+
}
|
|
56
|
+
.ui-fp-zone.is-warning .ui-fp-tone {
|
|
57
|
+
stroke: var(--warning);
|
|
58
|
+
}
|
|
59
|
+
.ui-fp-zone.is-danger .ui-fp-tone {
|
|
60
|
+
stroke: var(--danger);
|
|
61
|
+
}
|
|
62
|
+
.ui-fp-stripe {
|
|
63
|
+
fill: var(--forecast-stripe);
|
|
64
|
+
}
|
|
65
|
+
.ui-fp-empty {
|
|
66
|
+
fill: transparent;
|
|
67
|
+
stroke: var(--line-strong);
|
|
68
|
+
stroke-width: 1px;
|
|
69
|
+
stroke-dasharray: 4 3;
|
|
70
|
+
vector-effect: non-scaling-stroke;
|
|
71
|
+
}
|
|
72
|
+
.ui-fp-edge {
|
|
73
|
+
fill: none;
|
|
74
|
+
stroke: var(--ink-muted);
|
|
75
|
+
stroke-width: 1.5px;
|
|
76
|
+
stroke-dasharray: 5 4;
|
|
77
|
+
vector-effect: non-scaling-stroke;
|
|
78
|
+
pointer-events: none;
|
|
79
|
+
}
|
|
80
|
+
.ui-fp-group {
|
|
81
|
+
fill: var(--ink-muted);
|
|
82
|
+
pointer-events: none;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/* Labels: centred on the zone's label point, sized by FloorPlan (width and height set inline). */
|
|
86
|
+
.ui-fp-labels {
|
|
87
|
+
position: absolute;
|
|
88
|
+
inset: 0;
|
|
89
|
+
pointer-events: none;
|
|
90
|
+
}
|
|
91
|
+
.ui-fp-labels > * {
|
|
92
|
+
position: absolute;
|
|
93
|
+
box-sizing: border-box;
|
|
94
|
+
overflow: hidden;
|
|
95
|
+
white-space: nowrap;
|
|
96
|
+
}
|
|
97
|
+
.ui-fp-label {
|
|
98
|
+
display: flex;
|
|
99
|
+
flex-direction: column;
|
|
100
|
+
align-items: center;
|
|
101
|
+
justify-content: center;
|
|
102
|
+
color: var(--ink);
|
|
103
|
+
text-align: center;
|
|
104
|
+
}
|
|
105
|
+
.ui-fp-name {
|
|
106
|
+
max-width: 100%;
|
|
107
|
+
overflow: hidden;
|
|
108
|
+
text-overflow: ellipsis;
|
|
109
|
+
font-size: var(--text-body);
|
|
110
|
+
font-weight: 600;
|
|
111
|
+
line-height: 22px;
|
|
112
|
+
}
|
|
113
|
+
.ui-fp-value {
|
|
114
|
+
font-family: var(--font-mono);
|
|
115
|
+
font-size: var(--text-h3);
|
|
116
|
+
font-weight: 700;
|
|
117
|
+
line-height: 32px;
|
|
118
|
+
font-variant-numeric: tabular-nums;
|
|
119
|
+
}
|
|
120
|
+
.ui-fp-unit {
|
|
121
|
+
font-family: var(--font-sans);
|
|
122
|
+
font-size: var(--text-body);
|
|
123
|
+
font-weight: 500;
|
|
124
|
+
}
|
|
125
|
+
.ui-fp-state {
|
|
126
|
+
font-size: var(--text-small);
|
|
127
|
+
font-weight: 600;
|
|
128
|
+
line-height: 20px;
|
|
129
|
+
}
|
|
130
|
+
.ui-fp-label.is-muted .ui-fp-name {
|
|
131
|
+
font-size: var(--text-small);
|
|
132
|
+
line-height: 20px;
|
|
133
|
+
}
|
|
134
|
+
.ui-fp-label.is-muted .ui-fp-value {
|
|
135
|
+
font-size: var(--text-body);
|
|
136
|
+
line-height: 22px;
|
|
137
|
+
}
|
|
138
|
+
.ui-fp-label.is-muted .ui-fp-unit {
|
|
139
|
+
font-size: var(--text-small);
|
|
140
|
+
}
|
|
141
|
+
.ui-fp-label.is-empty .ui-fp-state {
|
|
142
|
+
color: var(--ink-muted);
|
|
143
|
+
font-weight: 400;
|
|
144
|
+
}
|
|
145
|
+
/* One line on a pill of its own ground: slender zones, and zones too small for the full label. */
|
|
146
|
+
.ui-fp-pill {
|
|
147
|
+
padding: 0 8px;
|
|
148
|
+
border: 1px solid var(--line-strong);
|
|
149
|
+
border-radius: var(--radius-full);
|
|
150
|
+
background: var(--surface);
|
|
151
|
+
color: var(--ink);
|
|
152
|
+
font-size: var(--text-small);
|
|
153
|
+
font-weight: 600;
|
|
154
|
+
line-height: 22px;
|
|
155
|
+
text-align: center;
|
|
156
|
+
}
|
|
157
|
+
.ui-fp-pill.is-empty {
|
|
158
|
+
color: var(--ink-muted);
|
|
159
|
+
}
|
|
160
|
+
.ui-fp-num {
|
|
161
|
+
font-family: var(--font-mono);
|
|
162
|
+
font-variant-numeric: tabular-nums;
|
|
163
|
+
}
|
|
164
|
+
.ui-fp-group-name {
|
|
165
|
+
padding: 0 6px;
|
|
166
|
+
border-radius: var(--radius-xs);
|
|
167
|
+
background: var(--surface);
|
|
168
|
+
color: var(--ink-muted);
|
|
169
|
+
font-size: var(--text-small);
|
|
170
|
+
font-weight: 600;
|
|
171
|
+
line-height: 22px;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
/* Tooltip: the look of Tooltip, beside the pointer (or the label point, for keyboard focus). */
|
|
175
|
+
.ui-fp-tip {
|
|
176
|
+
position: absolute;
|
|
177
|
+
z-index: var(--z-raised);
|
|
178
|
+
display: flex;
|
|
179
|
+
flex-direction: column;
|
|
180
|
+
max-width: 240px;
|
|
181
|
+
padding: 6px 10px;
|
|
182
|
+
border-radius: var(--radius-chip);
|
|
183
|
+
background: var(--ink);
|
|
184
|
+
color: var(--bg);
|
|
185
|
+
font-size: var(--text-small);
|
|
186
|
+
line-height: 20px;
|
|
187
|
+
pointer-events: none;
|
|
188
|
+
}
|
|
189
|
+
.ui-fp-tip-name {
|
|
190
|
+
font-weight: 600;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
.ui-fp-controls {
|
|
194
|
+
position: absolute;
|
|
195
|
+
right: var(--space-2);
|
|
196
|
+
bottom: var(--space-2);
|
|
197
|
+
display: flex;
|
|
198
|
+
gap: var(--space-1);
|
|
199
|
+
}
|
|
200
|
+
.ui-fp-controls > * {
|
|
201
|
+
background: var(--surface);
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
/* Legend: the heat scale with its ends, the watch and limit marks, and a note when there are muted zones. */
|
|
205
|
+
.ui-fp-legend {
|
|
206
|
+
display: flex;
|
|
207
|
+
flex-wrap: wrap;
|
|
208
|
+
align-items: center;
|
|
209
|
+
gap: var(--space-2) var(--space-4);
|
|
210
|
+
color: var(--ink-muted);
|
|
211
|
+
font-size: var(--text-small);
|
|
212
|
+
line-height: 20px;
|
|
213
|
+
}
|
|
214
|
+
.ui-fp-scale {
|
|
215
|
+
display: inline-flex;
|
|
216
|
+
align-items: center;
|
|
217
|
+
gap: var(--space-2);
|
|
218
|
+
}
|
|
219
|
+
.ui-fp-bar {
|
|
220
|
+
position: relative;
|
|
221
|
+
display: inline-flex;
|
|
222
|
+
width: 168px;
|
|
223
|
+
height: 12px;
|
|
224
|
+
border-radius: var(--radius-xs);
|
|
225
|
+
}
|
|
226
|
+
.ui-fp-bar > span:not(.ui-fp-tick) {
|
|
227
|
+
flex: 1;
|
|
228
|
+
}
|
|
229
|
+
.ui-fp-bar > span:first-child {
|
|
230
|
+
border-radius: var(--radius-xs) 0 0 var(--radius-xs);
|
|
231
|
+
}
|
|
232
|
+
.ui-fp-bar > span:nth-child(7) {
|
|
233
|
+
border-radius: 0 var(--radius-xs) var(--radius-xs) 0;
|
|
234
|
+
}
|
|
235
|
+
.ui-fp-tick {
|
|
236
|
+
position: absolute;
|
|
237
|
+
top: -4px;
|
|
238
|
+
width: 2px;
|
|
239
|
+
height: 20px;
|
|
240
|
+
margin-left: -1px;
|
|
241
|
+
}
|
|
242
|
+
.ui-fp-tick.is-warning,
|
|
243
|
+
.ui-fp-key.is-warning::before {
|
|
244
|
+
background: var(--warning);
|
|
245
|
+
}
|
|
246
|
+
.ui-fp-tick.is-danger,
|
|
247
|
+
.ui-fp-key.is-danger::before {
|
|
248
|
+
background: var(--danger);
|
|
249
|
+
}
|
|
250
|
+
.ui-fp-key {
|
|
251
|
+
display: inline-flex;
|
|
252
|
+
align-items: center;
|
|
253
|
+
gap: 6px;
|
|
254
|
+
}
|
|
255
|
+
.ui-fp-key::before {
|
|
256
|
+
content: '';
|
|
257
|
+
width: 2px;
|
|
258
|
+
height: 14px;
|
|
259
|
+
}
|
|
260
|
+
.ui-fp-key.is-muted::before {
|
|
261
|
+
width: 14px;
|
|
262
|
+
border-radius: 3px;
|
|
263
|
+
background: color-mix(in srgb, var(--heat-4) 40%, var(--surface));
|
|
264
|
+
box-shadow: inset 0 0 0 1px var(--line);
|
|
265
|
+
}
|
|
266
|
+
.ui-fp-pill .ui-fp-unit {
|
|
267
|
+
font-size: inherit;
|
|
268
|
+
font-weight: inherit;
|
|
269
|
+
}
|
|
270
|
+
}
|
package/dist/css/ZoneMap.css
CHANGED
|
@@ -1,103 +1,6 @@
|
|
|
1
1
|
@layer theme, base, ui, components, utilities;
|
|
2
2
|
@layer ui.tokens, ui.components;
|
|
3
3
|
@layer ui.components {
|
|
4
|
-
.ui-zone[data-fill='heat-1'] {
|
|
5
|
-
color: #ffffff;
|
|
6
|
-
}
|
|
7
|
-
.ui-zone[data-fill='heat-2'] {
|
|
8
|
-
color: #171512;
|
|
9
|
-
}
|
|
10
|
-
.ui-zone[data-fill='heat-3'] {
|
|
11
|
-
color: #171512;
|
|
12
|
-
}
|
|
13
|
-
.ui-zone[data-fill='heat-4'] {
|
|
14
|
-
color: #171512;
|
|
15
|
-
}
|
|
16
|
-
.ui-zone[data-fill='heat-5'] {
|
|
17
|
-
color: #171512;
|
|
18
|
-
}
|
|
19
|
-
.ui-zone[data-fill='heat-6'] {
|
|
20
|
-
color: #171512;
|
|
21
|
-
}
|
|
22
|
-
.ui-zone[data-fill='heat-7'] {
|
|
23
|
-
color: #ffffff;
|
|
24
|
-
}
|
|
25
|
-
.ui-zone[data-fill='diverge-neg-strong'] {
|
|
26
|
-
color: #ffffff;
|
|
27
|
-
}
|
|
28
|
-
.ui-zone[data-fill='diverge-neg'] {
|
|
29
|
-
color: #171512;
|
|
30
|
-
}
|
|
31
|
-
.ui-zone[data-fill='diverge-zero'] {
|
|
32
|
-
color: #171512;
|
|
33
|
-
}
|
|
34
|
-
.ui-zone[data-fill='diverge-pos'] {
|
|
35
|
-
color: #171512;
|
|
36
|
-
}
|
|
37
|
-
.ui-zone[data-fill='diverge-pos-strong'] {
|
|
38
|
-
color: #ffffff;
|
|
39
|
-
}
|
|
40
|
-
.ui-zone[data-fill='chart-1'] {
|
|
41
|
-
color: #ffffff;
|
|
42
|
-
}
|
|
43
|
-
.ui-zone[data-fill='chart-2'] {
|
|
44
|
-
color: #171512;
|
|
45
|
-
}
|
|
46
|
-
.ui-zone[data-fill='chart-3'] {
|
|
47
|
-
color: #171512;
|
|
48
|
-
}
|
|
49
|
-
.ui-zone[data-fill='chart-4'] {
|
|
50
|
-
color: #171512;
|
|
51
|
-
}
|
|
52
|
-
[data-theme='dark'] .ui-zone[data-fill='heat-1'] {
|
|
53
|
-
color: #ffffff;
|
|
54
|
-
}
|
|
55
|
-
[data-theme='dark'] .ui-zone[data-fill='heat-2'] {
|
|
56
|
-
color: #171512;
|
|
57
|
-
}
|
|
58
|
-
[data-theme='dark'] .ui-zone[data-fill='heat-3'] {
|
|
59
|
-
color: #171512;
|
|
60
|
-
}
|
|
61
|
-
[data-theme='dark'] .ui-zone[data-fill='heat-4'] {
|
|
62
|
-
color: #ffffff;
|
|
63
|
-
}
|
|
64
|
-
[data-theme='dark'] .ui-zone[data-fill='heat-5'] {
|
|
65
|
-
color: #171512;
|
|
66
|
-
}
|
|
67
|
-
[data-theme='dark'] .ui-zone[data-fill='heat-6'] {
|
|
68
|
-
color: #171512;
|
|
69
|
-
}
|
|
70
|
-
[data-theme='dark'] .ui-zone[data-fill='heat-7'] {
|
|
71
|
-
color: #171512;
|
|
72
|
-
}
|
|
73
|
-
[data-theme='dark'] .ui-zone[data-fill='diverge-neg-strong'] {
|
|
74
|
-
color: #171512;
|
|
75
|
-
}
|
|
76
|
-
[data-theme='dark'] .ui-zone[data-fill='diverge-neg'] {
|
|
77
|
-
color: #171512;
|
|
78
|
-
}
|
|
79
|
-
[data-theme='dark'] .ui-zone[data-fill='diverge-zero'] {
|
|
80
|
-
color: #ffffff;
|
|
81
|
-
}
|
|
82
|
-
[data-theme='dark'] .ui-zone[data-fill='diverge-pos'] {
|
|
83
|
-
color: #171512;
|
|
84
|
-
}
|
|
85
|
-
[data-theme='dark'] .ui-zone[data-fill='diverge-pos-strong'] {
|
|
86
|
-
color: #171512;
|
|
87
|
-
}
|
|
88
|
-
[data-theme='dark'] .ui-zone[data-fill='chart-1'] {
|
|
89
|
-
color: #171512;
|
|
90
|
-
}
|
|
91
|
-
[data-theme='dark'] .ui-zone[data-fill='chart-2'] {
|
|
92
|
-
color: #171512;
|
|
93
|
-
}
|
|
94
|
-
[data-theme='dark'] .ui-zone[data-fill='chart-3'] {
|
|
95
|
-
color: #171512;
|
|
96
|
-
}
|
|
97
|
-
[data-theme='dark'] .ui-zone[data-fill='chart-4'] {
|
|
98
|
-
color: #171512;
|
|
99
|
-
}
|
|
100
|
-
|
|
101
4
|
/* ZoneMap: zones on a grid, filled by value. Name 16 px and state on one line, the figure 31 px with a 16 px unit,
|
|
102
5
|
one 13 px detail line. Selected: an ink outline 4 px outside; attention: a 4 px warning or danger border. */
|
|
103
6
|
.ui-zonemap {
|