@geolith/globe 0.0.0-stage → 0.1.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.
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":["isIndex"],"sources":["../src/components/GlobeSkeleton.ts","../src/utils/camera.ts","../src/utils/handover.ts","../src/utils/palette.ts","../src/composables/use-globe-map.ts","../src/components/GlobeCanvas.ts","../src/components/GlobeLock.ts","../src/components/GlobeReadout.ts","../src/components/GlobeTimeSlider.ts","../src/composables/use-globe-state.ts","../src/composables/use-globe-fields.ts","../src/composables/use-globe-particles.ts","../src/composables/use-globe-districts.ts"],"sourcesContent":["import { defineComponent, h } from 'vue';\nimport type { Component } from 'vue';\n\n/**\n * What the globe shows before a frame is ready: the planet's silhouette, not a\n * black rectangle. `data-globe-skeleton` is what the canvas test and the UI\n * sweep assert on.\n */\nconst GlobeSkeletonComponent = defineComponent({\n name: 'GlobeSkeleton',\n setup() {\n return () =>\n h('div', { 'data-globe-skeleton': '', class: 'globe-skeleton' }, [\n h('span', { class: 'globe-skeleton-ring', 'aria-hidden': 'true' }),\n h('span', { class: 'globe-skeleton-label' }, 'Loading the globe'),\n ]);\n },\n});\n\nexport const GlobeSkeleton: Component = GlobeSkeletonComponent;\n","/**\n * The globe opens at a fixed zoom and pitch, over one place: the visitor's\n * country when the caller resolved it, the world otherwise.\n */\nexport const OPEN_ZOOM = 1.8;\n\n/** The globe is never tilted on open: a tilted planet hides half the field. */\nexport const OPEN_PITCH = 0;\n\n/**\n * Slow rotation so a still visitor sees a planet, not a poster. One full turn\n * takes five minutes; faster reads as a loading spinner.\n */\nexport const ROTATE_DEGREES_PER_SECOND = 1.2;\n\n/** The world view: equirectangular centre of the planet, 20° north. */\nexport const WORLD_CENTRE: readonly [number, number] = [0, 20];\n\n/** Where the globe opens. */\nexport interface OpeningCamera {\n readonly center: [number, number];\n readonly zoom: number;\n readonly pitch: number;\n}\n\n/**\n * The opening camera: the visitor's country's centroid when it is known, the\n * world otherwise.\n *\n * @param centroid - `[lon, lat]` of the visitor's country, or null when unknown.\n */\nexport function openingCamera(\n centroid: readonly [number, number] | null,\n): OpeningCamera {\n const centre: [number, number] = centroid\n ? [centroid[0], centroid[1]]\n : [WORLD_CENTRE[0], WORLD_CENTRE[1]];\n return { center: centre, zoom: OPEN_ZOOM, pitch: OPEN_PITCH };\n}\n\n/**\n * Whether the globe should rotate right now. Reduced motion is honoured, and the\n * first interaction hands control to the visitor for good.\n */\nexport function shouldRotate(\n reducedMotion: boolean,\n interacted: boolean,\n): boolean {\n return !reducedMotion && !interacted;\n}\n","/**\n * Zoom range over which the field fades out and the districts fade in. They are\n * the same two numbers on purpose: the globe is always showing one of them, and\n * a seam between the ramps would show as a flash of bare basemap.\n */\nexport const FIELD_FADE: readonly [number, number] = [6.5, 8];\n\n/** The districts' half of the same handover. */\nexport const DISTRICT_FADE: readonly [number, number] = [6.5, 8];\n\n/** The desktop particle count the spike measured as free on a desktop GPU. */\nexport const PARTICLE_CAP = 42_000;\n\nconst RAMP: readonly [number, number] = FIELD_FADE;\n\n/**\n * Opacity of the global field at a zoom: 1 below the ramp, 0 above it, linear\n * between.\n */\nexport function fieldOpacity(zoom: number): number {\n const [from, to] = RAMP;\n if (zoom <= from) return 1;\n if (zoom >= to) return 0;\n return (to - zoom) / (to - from);\n}\n\n/** Opacity of the district fill at a zoom; the field's complement. */\nexport function districtOpacity(zoom: number): number {\n return 1 - fieldOpacity(zoom);\n}\n\n/**\n * How many particles to draw. A phone is given fewer because the fragment cost\n * is per device pixel, and a visitor who prefers reduced motion gets none.\n *\n * @param width - The map's width in CSS pixels.\n * @param dpr - The device pixel ratio the map draws at.\n */\nexport function particleCount(\n width: number,\n dpr: number,\n reducedMotion: boolean,\n): number {\n if (reducedMotion) return 0;\n const density = width < 600 ? (dpr >= 2 ? 18 : 26) : 30;\n return Math.min(PARTICLE_CAP, Math.round(width * density));\n}\n","/**\n * The field ramps. They are data ramps, not brand colours: a shader needs plain\n * RGB stops, and these are perceptually spaced so a 1 mm cell never looks like a\n * 40 mm cell. A caller may pass its own stops to `WeatherFieldLayer`.\n */\nexport const RAIN_RAMP: readonly string[] = [\n '#f7fbff',\n '#deebf7',\n '#9ecae1',\n '#4292c6',\n '#2171b5',\n '#08519c',\n '#5e3c99',\n];\n\n/** Cold to hot, through a neutral middle so 0 °C is not tinted. */\nexport const TEMPERATURE_RAMP: readonly string[] = [\n '#2166ac',\n '#67a9cf',\n '#d1e5f0',\n '#f7f7f7',\n '#fddbc7',\n '#f4a582',\n '#d6604d',\n '#b2182b',\n];\n\n/** Calm to strong, the magma ramp. */\nexport const WIND_RAMP: readonly string[] = [\n '#3b0f70',\n '#8c2981',\n '#de4968',\n '#fe9f6d',\n '#fcfdbf',\n];\n\n/** Every ramp the globe ships, keyed by the field family it draws. */\nexport const FIELD_PALETTES: Readonly<\n Record<'rain' | 'temperature' | 'wind', readonly string[]>\n> = {\n rain: RAIN_RAMP,\n temperature: TEMPERATURE_RAMP,\n wind: WIND_RAMP,\n};\n\n/**\n * The ramp for a field name: rain grids take the rain ramp, both temperature\n * fields the temperature ramp, both wind components the wind ramp.\n */\nexport function paletteFor(field: string): readonly string[] {\n if (field === 'rain') return RAIN_RAMP;\n if (field === 'tmax' || field === 'tmin') return TEMPERATURE_RAMP;\n return WIND_RAMP;\n}\n","import { shallowRef, watch } from 'vue';\nimport type { Ref } from 'vue';\nimport type { Map as MapLibreMap, StyleSpecification } from 'maplibre-gl';\nimport {\n WeatherFieldLayer,\n WindParticleLayer,\n} from '@geoql/maplibre-gl-weather';\nimport type { Grid } from '@geoql/maplibre-gl-weather';\nimport type { GlobeDataSource } from '../types';\nimport {\n ROTATE_DEGREES_PER_SECOND,\n openingCamera,\n shouldRotate,\n} from '../utils/camera';\nimport { fieldOpacity, particleCount } from '../utils/handover';\nimport type { WindPair } from './use-globe-particles';\nimport { paletteFor } from '../utils/palette';\n\n/** A district source the map may draw. */\nexport interface DistrictSource {\n readonly country: string;\n readonly url: string;\n}\n\n/** Everything the map needs from the component. */\nexport interface UseGlobeMapInput {\n readonly host: Ref<HTMLElement | null>;\n readonly style: StyleSpecification;\n readonly centroid: readonly [number, number] | null;\n readonly reducedMotion: boolean;\n readonly source: GlobeDataSource;\n readonly frames: Ref<readonly Grid[]>;\n readonly mix: Ref<number>;\n readonly palette: readonly string[] | null;\n readonly wind: Ref<WindPair | null>;\n readonly district: Ref<DistrictSource | null>;\n /** True once the caller's data is ready; the map mounts then. */\n readonly mountWhen: Ref<boolean>;\n readonly onIdle: () => void;\n}\n\n/** The map handle and its lifecycle. */\nexport interface GlobeMap {\n readonly map: Ref<MapLibreMap | null>;\n mount(): Promise<void>;\n dispose(): void;\n}\n\nconst DEFAULT_FIELD_OPACITY = 0.85;\n\n/**\n * The map's lifecycle and its layers. Mounts only when its host measures non\n * zero in both axes, so a hidden page (or a test with no layout) mounts\n * nothing and logs nothing.\n */\nexport function useGlobeMap(input: UseGlobeMapInput): GlobeMap {\n const map = shallowRef<MapLibreMap | null>(null);\n let field: WeatherFieldLayer | null = null;\n let particles: WindParticleLayer | null = null;\n let frame = 0;\n let interacted = false;\n let wired = false;\n\n const stopRotation = (): void => {\n if (frame !== 0) cancelAnimationFrame(frame);\n frame = 0;\n };\n\n const rotate = (): void => {\n const instance = map.value;\n if (!instance || !shouldRotate(input.reducedMotion, interacted)) return;\n const centre = instance.getCenter();\n const lng = centre.lng + ROTATE_DEGREES_PER_SECOND / 60;\n instance.setCenter([lng > 180 ? lng - 360 : lng, centre.lat]);\n frame = requestAnimationFrame(rotate);\n };\n\n const addField = (instance: MapLibreMap): void => {\n const frames = input.frames.value;\n if (frames.length === 0 || field) return;\n const first = frames[0];\n const palette = input.palette ?? paletteFor(first?.meta.field ?? 'rain');\n field = new WeatherFieldLayer({\n frames,\n mix: input.mix.value,\n palette,\n opacity: DEFAULT_FIELD_OPACITY,\n });\n instance.addLayer(field);\n instance.on('zoom', () => {\n field?.setOpacity(\n DEFAULT_FIELD_OPACITY * fieldOpacity(instance.getZoom()),\n );\n });\n };\n\n const addParticles = (instance: MapLibreMap): void => {\n const wind = input.wind.value;\n if (!wind || particles) return;\n const width = input.host.value?.clientWidth ?? 0;\n const dpr = globalThis.devicePixelRatio ?? 1;\n particles = new WindParticleLayer({\n u: wind.u,\n v: wind.v,\n count: particleCount(width, dpr, input.reducedMotion),\n animated: !input.reducedMotion,\n });\n instance.addLayer(particles);\n };\n\n const addDistricts = (instance: MapLibreMap): void => {\n const district = input.district.value;\n if (!district) return;\n const sourceId = `globe-districts-${district.country}`;\n if (instance.getSource(sourceId)) return;\n instance.addSource(sourceId, { type: 'vector', tiles: [district.url] });\n instance.addLayer({\n id: `${sourceId}-fill`,\n type: 'fill',\n source: sourceId,\n paint: {\n 'fill-color': paletteFor('rain')[3] ?? '#4292c6',\n // The handover ramp, read by MapLibre at paint time.\n 'fill-opacity': ['interpolate', ['linear'], ['zoom'], 6.5, 0, 8, 1],\n },\n });\n };\n\n const wire = (): void => {\n const instance = map.value;\n if (!instance || !wired) return;\n addField(instance);\n addParticles(instance);\n addDistricts(instance);\n };\n\n const mount = async (): Promise<void> => {\n if (map.value) return;\n const host = input.host.value;\n if (!host || typeof window === 'undefined') return;\n const rect = host.getBoundingClientRect();\n if (rect.width === 0 || rect.height === 0) return;\n\n const { Map } = await import('maplibre-gl');\n const camera = openingCamera(input.centroid);\n const created = new Map({\n container: host,\n style: input.style,\n center: camera.center,\n zoom: camera.zoom,\n pitch: camera.pitch,\n attributionControl: false,\n });\n // MapLibre 6 sets the projection on the map, not in its options: a globe\n // draws with projectTile(), the mercator prelude never runs.\n created.setProjection({ type: 'globe' });\n map.value = created;\n created.once('idle', () => {\n wired = true;\n wire();\n input.onIdle();\n });\n const stop = (): void => {\n interacted = true;\n stopRotation();\n };\n const canvas = created.getCanvas();\n canvas.addEventListener('pointerdown', stop, { once: true });\n canvas.addEventListener('wheel', stop, { once: true });\n canvas.addEventListener('touchstart', stop, { once: true });\n if (shouldRotate(input.reducedMotion, interacted)) {\n frame = requestAnimationFrame(rotate);\n }\n };\n\n watch(input.frames, () => {\n if (field) field.setFrames(input.frames.value, input.mix.value);\n else wire();\n });\n watch(input.mix, (value) => field?.setMix(value));\n watch(input.wind, () => wire());\n watch(input.district, () => wire());\n watch(input.mountWhen, (ready) => {\n if (ready) void mount();\n });\n\n const dispose = (): void => {\n stopRotation();\n field = null;\n particles = null;\n wired = false;\n map.value?.remove();\n map.value = null;\n };\n\n return { map, mount, dispose };\n}\n","import {\n defineComponent,\n h,\n onBeforeUnmount,\n onMounted,\n ref,\n watch,\n} from 'vue';\nimport type { Component, PropType } from 'vue';\nimport type { StyleSpecification } from 'maplibre-gl';\nimport type { Grid } from '@geoql/maplibre-gl-weather';\nimport type { GlobeDataSource, GlobeLayer } from '../types';\nimport { GlobeSkeleton } from './GlobeSkeleton';\nimport { useGlobeMap } from '../composables/use-globe-map';\nimport type { DistrictSource } from '../composables/use-globe-map';\nimport type { WindPair } from '../composables/use-globe-particles';\n\n/** Everything the globe draws; the page supplies all of it. */\nexport interface GlobeCanvasProps {\n readonly layers: readonly GlobeLayer[];\n readonly dataSource: GlobeDataSource;\n readonly style: StyleSpecification;\n readonly status: 'loading' | 'ready' | 'empty' | 'error';\n readonly centroid?: readonly [number, number] | null;\n readonly reducedMotion?: boolean;\n readonly frames?: readonly Grid[];\n readonly mix?: number;\n readonly palette?: readonly string[] | null;\n readonly wind?: WindPair | null;\n readonly district?: DistrictSource | null;\n}\n\n/**\n * The globe itself. It draws the skeleton until the caller's data is ready,\n * mounts a WebGL map only where its host has a size, and rotates slowly until\n * the visitor touches it. `data-globe` carries the caller's status: it is what\n * the 2.5 s budget waits for.\n */\nconst GlobeCanvasComponent = defineComponent({\n name: 'GlobeCanvas',\n props: {\n layers: { type: Array as PropType<readonly GlobeLayer[]>, required: true },\n dataSource: { type: Object as PropType<GlobeDataSource>, required: true },\n style: { type: Object as PropType<StyleSpecification>, required: true },\n status: { type: String, required: true },\n centroid: {\n type: Array as unknown as PropType<readonly [number, number] | null>,\n default: null,\n },\n reducedMotion: { type: Boolean, default: false },\n frames: { type: Array as PropType<readonly Grid[]>, default: () => [] },\n mix: { type: Number, default: 0 },\n palette: {\n type: Array as PropType<readonly string[] | null>,\n default: null,\n },\n wind: { type: Object as PropType<WindPair | null>, default: null },\n district: {\n type: Object as PropType<DistrictSource | null>,\n default: null,\n },\n },\n emits: ['idle'],\n setup(props, { emit }) {\n const host = ref<HTMLElement | null>(null);\n const frames = ref<readonly Grid[]>(props.frames);\n const mix = ref<number>(props.mix);\n const wind = ref<WindPair | null>(props.wind);\n const district = ref<DistrictSource | null>(props.district);\n const mountWhen = ref(props.status === 'ready');\n\n const globe = useGlobeMap({\n host,\n style: props.style,\n centroid: props.centroid,\n reducedMotion: props.reducedMotion,\n source: props.dataSource,\n frames,\n mix,\n palette: props.palette,\n wind,\n district,\n mountWhen,\n onIdle: () => emit('idle'),\n });\n\n watch(\n () => props.frames,\n (value) => {\n frames.value = value;\n },\n );\n watch(\n () => props.mix,\n (value) => {\n mix.value = value;\n },\n );\n watch(\n () => props.wind,\n (value) => {\n wind.value = value;\n },\n );\n watch(\n () => props.district,\n (value) => {\n district.value = value;\n },\n );\n watch(\n () => props.status,\n (value) => {\n mountWhen.value = value === 'ready';\n },\n );\n\n onMounted(() => {\n if (props.status === 'ready') void globe.mount();\n });\n onBeforeUnmount(() => globe.dispose());\n\n return () =>\n h(\n 'div',\n {\n ref: host,\n class: 'globe-canvas',\n 'data-globe': props.status,\n 'data-globe-host': '',\n },\n props.status === 'loading' ? [h(GlobeSkeleton)] : [],\n );\n },\n});\n\nexport const GlobeCanvas: Component = GlobeCanvasComponent;\n","import { defineComponent, h } from 'vue';\nimport type { Component } from 'vue';\n\n/** The locked country and the hook a page uses to open its own ask. */\nexport interface GlobeLockProps {\n readonly country: string;\n}\n\n/**\n * The locked state for a country whose district numbers the caller may not\n * show: one sentence in the catalogue's words, and a button the page answers\n * with its own unlock flow.\n */\nconst GlobeLockComponent = defineComponent({\n name: 'GlobeLock',\n props: {\n country: { type: String, required: true },\n },\n emits: ['unlock-request'],\n setup(props, { emit }) {\n return () =>\n h('div', { class: 'globe-lock', 'data-globe-lock': props.country }, [\n h(\n 'p',\n { class: 'globe-lock-copy' },\n 'District data is not open for this country yet.',\n ),\n h(\n 'button',\n {\n type: 'button',\n class: 'globe-lock-action',\n onClick: () => emit('unlock-request', { country: props.country }),\n },\n 'Unlock district data for 230 countries',\n ),\n ]);\n },\n});\n\nexport const GlobeLock: Component = GlobeLockComponent;\n","import { defineComponent, h } from 'vue';\nimport type { Component } from 'vue';\n\n/** The pointer readout: a value and its unit, or nothing at all. */\nexport interface GlobeReadoutProps {\n readonly value: number | null;\n readonly unit: string;\n}\n\n/**\n * Shows the field's value under the pointer. A cell with no data prints\n * nothing — never `NaN`, never `0`, which a reader would take for a measurement.\n */\nconst GlobeReadoutComponent = defineComponent({\n name: 'GlobeReadout',\n props: {\n value: { type: Number, default: null },\n unit: { type: String, required: true },\n },\n setup(props) {\n return () => {\n const value: number | null = props.value;\n if (value === null) return h('span', { class: 'globe-readout' });\n const shown = Math.round(value * 10) / 10;\n return h(\n 'span',\n { class: 'globe-readout', 'data-globe-readout': '' },\n `${shown} ${props.unit}`,\n );\n };\n },\n});\n\nexport const GlobeReadout: Component = GlobeReadoutComponent;\n","import { defineComponent, h } from 'vue';\nimport type { Component, PropType } from 'vue';\nimport { SliderRange, SliderRoot, SliderThumb, SliderTrack } from 'reka-ui';\n\n/** The 7-day slider: the run's own day labels, a play toggle, and a thumb. */\nexport interface GlobeTimeSliderProps {\n /** Day labels from the field index, in the run's order. */\n readonly labels: readonly string[];\n readonly modelValue: number;\n readonly playing: boolean;\n}\n\n/**\n * The time axis of the globe. The label is the index's label (a UTC day), never\n * a date computed here, and it is the slider's `aria-valuetext`, so a screen\n * reader and the visible caption read the same value.\n */\nconst GlobeTimeSliderComponent = defineComponent({\n name: 'GlobeTimeSlider',\n props: {\n labels: { type: Array as PropType<readonly string[]>, required: true },\n modelValue: { type: Number, required: true },\n playing: { type: Boolean, default: false },\n },\n emits: ['update:modelValue', 'toggle'],\n setup(props, { emit }) {\n const label = (): string => props.labels[props.modelValue] ?? '';\n\n const update = (value: number[] | undefined): void => {\n const next = value?.[0];\n if (typeof next === 'number') emit('update:modelValue', next);\n };\n\n return () =>\n h('div', { class: 'globe-slider', 'data-globe-slider': '' }, [\n h(\n 'button',\n {\n type: 'button',\n class: 'globe-slider-play',\n 'aria-label': props.playing ? 'Pause' : 'Play',\n 'aria-pressed': props.playing ? 'true' : 'false',\n onClick: () => emit('toggle'),\n },\n props.playing ? 'Pause' : 'Play',\n ),\n h(\n SliderRoot,\n {\n class: 'globe-slider-root',\n modelValue: [props.modelValue],\n max: Math.max(props.labels.length - 1, 0),\n step: 1,\n 'onUpdate:modelValue': update,\n },\n () => [\n h(SliderTrack, { class: 'globe-slider-track' }, () => [\n h(SliderRange, { class: 'globe-slider-range' }),\n ]),\n h(SliderThumb, {\n class: 'globe-slider-thumb',\n 'aria-valuetext': label(),\n 'aria-label': 'Forecast day',\n }),\n ],\n ),\n h('span', { class: 'globe-slider-label' }, label()),\n ]);\n },\n});\n\nexport const GlobeTimeSlider: Component = GlobeTimeSliderComponent;\n","import { computed, ref } from 'vue';\nimport type { ComputedRef, Ref } from 'vue';\nimport type { GlobeLayer, GlobeModel, GlobeSelection } from '../types';\n\n/** What the visitor has explored: which layers, and since when (epoch ms). */\nexport interface Explored {\n readonly layers: ReadonlySet<string>;\n readonly startedAt: number;\n}\n\n/** Everything a globe page drives from one place. */\nexport interface GlobeState {\n readonly selection: Ref<GlobeSelection>;\n readonly playing: Ref<boolean>;\n readonly explored: Ref<Explored>;\n /** The layer the selection names, or null when the catalogue has no match. */\n readonly layer: ComputedRef<GlobeLayer | null>;\n /** The last frame index the caller's run published. */\n readonly lastDay: ComputedRef<number>;\n select(layerId: string): void;\n setModel(model: GlobeModel): void;\n setDay(index: number): void;\n togglePlaying(value?: boolean): void;\n /** False when `country` may show district numbers. */\n lockFor(country: string): boolean;\n}\n\nconst clamp = (value: number, max: number): number => {\n if (!Number.isFinite(value)) return 0;\n const whole = Math.trunc(value);\n if (whole < 0) return 0;\n return whole > max ? max : whole;\n};\n\n/**\n * The globe's state machine: which layer, model and day are showing, whether it\n * plays, and which countries may show district numbers.\n *\n * Pure Vue reactivity — no browser API and no HTTP — so a page and a test share\n * one behaviour. `now` is injected so a test can advance the exploration clock\n * without sleeping.\n */\nexport function useGlobeState(initial: {\n readonly layers: readonly GlobeLayer[];\n readonly days: number;\n readonly unlocked: boolean;\n readonly unlockedCountries: readonly string[];\n readonly now?: () => number;\n}): GlobeState {\n const { layers, unlocked, unlockedCountries } = initial;\n const now = initial.now ?? (() => Date.now());\n const dayCount = clamp(initial.days, Number.MAX_SAFE_INTEGER);\n const opening = layers[0];\n\n const selection = ref<GlobeSelection>({\n layerId: opening?.id ?? '',\n // A field layer opens on its first published model; a district layer has\n // none, and the model of the opening layer stays for the readout.\n model: opening?.models[0] ?? 'ecmwf-ifs',\n dayIndex: 0,\n });\n\n const playing = ref(false);\n\n // The opening layer counts as explored: the visitor is looking at it.\n const explored = ref<Explored>({\n layers: new Set(opening ? [opening.id] : []),\n startedAt: now(),\n });\n const lastDay = computed(() => clamp(dayCount, Number.MAX_SAFE_INTEGER) - 1);\n\n const layer = computed<GlobeLayer | null>(\n () => layers.find((entry) => entry.id === selection.value.layerId) ?? null,\n );\n\n const remember = (layerId: string): void => {\n if (explored.value.layers.has(layerId)) return;\n explored.value = {\n layers: new Set([...explored.value.layers, layerId]),\n startedAt: explored.value.startedAt,\n };\n };\n\n const select = (layerId: string): void => {\n const next = layers.find((entry) => entry.id === layerId);\n if (!next) return;\n const model = next.models.includes(selection.value.model)\n ? selection.value.model\n : (next.models[0] ?? selection.value.model);\n selection.value = { ...selection.value, layerId, model };\n remember(layerId);\n };\n\n const setModel = (model: GlobeModel): void => {\n if (!layer.value?.models.includes(model)) return;\n selection.value = { ...selection.value, model };\n };\n\n const setDay = (index: number): void => {\n selection.value = {\n ...selection.value,\n dayIndex: clamp(index, lastDay.value),\n };\n };\n\n const togglePlaying = (value?: boolean): void => {\n playing.value = value ?? !playing.value;\n };\n\n const lockFor = (country: string): boolean => {\n if (unlocked) return false;\n const key = country.trim().toLowerCase();\n return !unlockedCountries.some((entry) => entry.toLowerCase() === key);\n };\n\n return {\n selection,\n playing,\n explored,\n layer,\n lastDay,\n select,\n setModel,\n setDay,\n togglePlaying,\n lockFor,\n };\n}\n","import { ref } from 'vue';\nimport type { Ref } from 'vue';\nimport { decodeGrid } from '@geoql/maplibre-gl-weather';\nimport type { Grid } from '@geoql/maplibre-gl-weather';\nimport type {\n FieldIndexDto,\n GlobeDataSource,\n GlobeField,\n GlobeSelection,\n} from '../types';\n\n/** What the field layer is doing, as the page reports it. */\nexport type GlobeStatus = 'idle' | 'loading' | 'ready' | 'empty' | 'error';\n\n/** Everything `useGlobeFields` reads. */\nexport interface GlobeFieldsInput {\n readonly source: GlobeDataSource;\n readonly selection: Ref<GlobeSelection>;\n /** The catalogue layer's fields; the first one is drawn and blended. */\n readonly fields?: readonly GlobeField[];\n readonly fetchJson: (url: string) => Promise<unknown>;\n /** The grid's decoded bytes: the transport un-gzips, never the shader. */\n readonly fetchBytes: (url: string) => Promise<Uint8Array>;\n}\n\n/** The field frames and their state. */\nexport interface GlobeFields {\n readonly index: Ref<FieldIndexDto | null>;\n readonly frames: Ref<readonly Grid[]>;\n /** `0` shows `frames[0]`, `1` shows `frames[1]`. */\n readonly mix: Ref<number>;\n readonly status: Ref<GlobeStatus>;\n /** The index's own day labels, in order. */\n readonly labels: Ref<readonly string[]>;\n load(): Promise<void>;\n}\n\nconst isIndex = (value: unknown): value is FieldIndexDto => {\n if (typeof value !== 'object' || value === null) return false;\n const candidate = value as Partial<FieldIndexDto>;\n return (\n typeof candidate.run === 'string' &&\n Array.isArray(candidate.days) &&\n typeof candidate.width === 'number' &&\n typeof candidate.height === 'number' &&\n typeof candidate.step === 'number'\n );\n};\n\n/** A 404 is a country or run with no data, not a broken globe. */\nconst isMissing = (error: unknown): boolean => {\n const status = (error as { status?: unknown } | null)?.status;\n if (status === 404) return true;\n return /404|not found/i.test(String(error));\n};\n\n/** `'forecast-rain'` → `'rain'`, for a caller that passes no field list. */\nconst fieldFromLayer = (layerId: string): GlobeField => {\n const tail = layerId.split('-').pop() ?? '';\n if (tail === 'rain') return 'rain';\n if (tail === 'temperature' || tail === 'tmax' || tail === 'tmin')\n return 'tmax';\n return 'wind-u';\n};\n\n/**\n * Loads one field's index, then the selected day and the day after it, so the\n * shader can blend. The composable never invents a zero field: no data is\n * `'empty'` and a failed grid after a good index keeps the frames it had.\n */\nexport function useGlobeFields(input: GlobeFieldsInput): GlobeFields {\n const index = ref<FieldIndexDto | null>(null);\n const frames = ref<readonly Grid[]>([]);\n const mix = ref(0);\n const status = ref<GlobeStatus>('idle');\n const labels = ref<readonly string[]>([]);\n\n let run = 0;\n\n const meta = (dto: FieldIndexDto, day: string) => ({\n field: dto.field,\n run: dto.run,\n day,\n width: dto.width,\n height: dto.height,\n lonMin: dto.lonMin,\n latMax: dto.latMax,\n step: dto.step,\n scale: dto.scale,\n offset: dto.offset,\n unit: dto.unit,\n });\n\n const load = async (): Promise<void> => {\n const ticket = ++run;\n const { source, selection } = input;\n const field = input.fields?.[0] ?? fieldFromLayer(selection.value.layerId);\n const model = selection.value.model;\n status.value = 'loading';\n\n let dto: FieldIndexDto;\n try {\n const raw = await input.fetchJson(source.indexUrl(model, field));\n if (!isIndex(raw)) throw new Error('field index is not an index');\n dto = raw;\n } catch (error) {\n if (ticket !== run) return;\n frames.value = [];\n index.value = null;\n labels.value = [];\n mix.value = 0;\n status.value = isMissing(error) ? 'empty' : 'error';\n return;\n }\n\n if (ticket !== run) return;\n index.value = dto;\n labels.value = dto.days;\n\n const at = Math.min(\n Math.max(selection.value.dayIndex, 0),\n dto.days.length - 1,\n );\n const day = dto.days[at];\n if (day === undefined) {\n frames.value = [];\n status.value = 'empty';\n return;\n }\n const nextDay = dto.days[at + 1] ?? day;\n\n try {\n const first = await input.fetchBytes(\n source.gridUrl(model, field, dto.run, day),\n );\n const second =\n nextDay === day\n ? first\n : await input.fetchBytes(\n source.gridUrl(model, field, dto.run, nextDay),\n );\n if (ticket !== run) return;\n frames.value = [\n decodeGrid(first, meta(dto, day)),\n decodeGrid(second, meta(dto, nextDay)),\n ];\n mix.value = 0;\n status.value = 'ready';\n } catch (error) {\n if (ticket !== run) return;\n status.value = isMissing(error) ? 'empty' : 'error';\n }\n };\n\n return { index, frames, mix, status, labels, load };\n}\n","import { ref } from 'vue';\nimport type { Ref } from 'vue';\nimport type { Grid } from '@geoql/maplibre-gl-weather';\nimport { decodeGrid } from '@geoql/maplibre-gl-weather';\nimport type { FieldIndexDto, GlobeDataSource, GlobeSelection } from '../types';\nimport type { GlobeStatus } from './use-globe-fields';\n\n/** The wind pair the particle layer advects through. */\nexport interface WindPair {\n readonly u: Grid;\n readonly v: Grid;\n}\n\n/** Everything `useGlobeParticles` reads. */\nexport interface GlobeParticlesInput {\n readonly source: GlobeDataSource;\n readonly selection: Ref<GlobeSelection>;\n readonly fetchJson: (url: string) => Promise<unknown>;\n readonly fetchBytes: (url: string) => Promise<Uint8Array>;\n}\n\n/** The wind grids and their state. */\nexport interface GlobeParticles {\n readonly wind: Ref<WindPair | null>;\n readonly status: Ref<GlobeStatus>;\n load(): Promise<void>;\n}\n\nconst isIndex = (value: unknown): value is FieldIndexDto => {\n if (typeof value !== 'object' || value === null) return false;\n const candidate = value as Partial<FieldIndexDto>;\n return (\n typeof candidate.run === 'string' &&\n Array.isArray(candidate.days) &&\n typeof candidate.width === 'number' &&\n typeof candidate.height === 'number'\n );\n};\n\nconst dayOf = (dto: FieldIndexDto, index: number): string | null => {\n const at = Math.min(Math.max(index, 0), dto.days.length - 1);\n return dto.days[at] ?? null;\n};\n\n/**\n * Loads the 10 m wind pair (`u` east, `v` north) for the selected day. A layer\n * with no wind fields, or a run that published none, is `'empty'` — the globe\n * then draws the field alone, never particles advected by zero wind.\n */\nexport function useGlobeParticles(input: GlobeParticlesInput): GlobeParticles {\n const wind = ref<WindPair | null>(null);\n const status = ref<GlobeStatus>('idle');\n\n let run = 0;\n\n const one = async (\n model: GlobeSelection['model'],\n field: 'wind-u' | 'wind-v',\n dayIndex: number,\n ): Promise<Grid | null> => {\n const raw = await input.fetchJson(input.source.indexUrl(model, field));\n if (!isIndex(raw)) throw new Error('wind index is not an index');\n const day = dayOf(raw, dayIndex);\n if (day === null) return null;\n const bytes = await input.fetchBytes(\n input.source.gridUrl(model, field, raw.run, day),\n );\n return decodeGrid(bytes, {\n field,\n run: raw.run,\n day,\n width: raw.width,\n height: raw.height,\n lonMin: raw.lonMin,\n latMax: raw.latMax,\n step: raw.step,\n scale: raw.scale,\n offset: raw.offset,\n unit: raw.unit,\n });\n };\n\n const load = async (): Promise<void> => {\n const ticket = ++run;\n status.value = 'loading';\n const { model, dayIndex } = input.selection.value;\n try {\n const [u, v] = await Promise.all([\n one(model, 'wind-u', dayIndex),\n one(model, 'wind-v', dayIndex),\n ]);\n if (ticket !== run) return;\n if (!u || !v) {\n wind.value = null;\n status.value = 'empty';\n return;\n }\n wind.value = { u, v };\n status.value = 'ready';\n } catch (error) {\n if (ticket !== run) return;\n const missing = (error as { status?: unknown } | null)?.status === 404;\n status.value = missing ? 'empty' : 'error';\n if (missing) wind.value = null;\n }\n };\n\n return { wind, status, load };\n}\n","/** A district source the globe may draw, or nothing for a locked country. */\nexport interface DistrictLayer {\n readonly id: string;\n readonly source: string;\n}\n\n/** What a caller must tell the districts composable. */\nexport interface GlobeDistrictsInput {\n /** True when the account may see district numbers everywhere. */\n readonly unlocked: boolean;\n /** The caller's own MVT template; a locked country is never asked for one. */\n readonly districtUrl: (dataset: string, country: string) => string;\n /** The dataset segment of `districtUrl`; defaults to `'boundaries'`. */\n readonly dataset?: string;\n}\n\n/** The districts' half of the globe. */\nexport interface GlobeDistricts {\n /** The layer for a country, or null when the caller may not show it. */\n layerFor(country: string): DistrictLayer | null;\n}\n\n/**\n * Decides whether a country's districts may be drawn at all. A locked country\n * gets `null`, so the component never mounts a source it may not show: no\n * district geometry reaches a browser that may not read it.\n */\nexport function useGlobeDistricts(input: GlobeDistrictsInput): GlobeDistricts {\n const dataset = input.dataset ?? 'boundaries';\n\n const layerFor = (country: string): DistrictLayer | null => {\n if (!input.unlocked) return null;\n const key = country.trim().toLowerCase();\n if (key === '') return null;\n return {\n id: `globe-districts-${key}`,\n source: input.districtUrl(dataset, key),\n };\n };\n\n return { layerFor };\n}\n"],"mappings":";;;AAmBA,MAAa,gBAXkB,gBAAgB;CAC7C,MAAM;CACN,QAAQ;EACN,aACE,EAAE,OAAO;GAAE,uBAAuB;GAAI,OAAO;EAAiB,GAAG,CAC/D,EAAE,QAAQ;GAAE,OAAO;GAAuB,eAAe;EAAO,CAAC,GACjE,EAAE,QAAQ,EAAE,OAAO,uBAAuB,GAAG,mBAAmB,CAClE,CAAC;CACL;AACF,CAEwC;;;;;;ACfxC,MAAa,YAAY;;AAGzB,MAAa,aAAa;;;;;AAM1B,MAAa,4BAA4B;;AAGzC,MAAa,eAA0C,CAAC,GAAG,EAAE;;;;;;;AAe7D,SAAgB,cACd,UACe;CAIf,OAAO;EAAE,QAHwB,WAC7B,CAAC,SAAS,IAAI,SAAS,EAAE,IACzB,CAAC,aAAa,IAAI,aAAa,EAAE;EACZ,MAAM;EAAW,OAAA;CAAkB;AAC9D;;;;;AAMA,SAAgB,aACd,eACA,YACS;CACT,OAAO,CAAC,iBAAiB,CAAC;AAC5B;;;;;;;AC5CA,MAAa,aAAwC,CAAC,KAAK,CAAC;;AAG5D,MAAa,gBAA2C,CAAC,KAAK,CAAC;;AAG/D,MAAa,eAAe;AAE5B,MAAM,OAAkC;;;;;AAMxC,SAAgB,aAAa,MAAsB;CACjD,MAAM,CAAC,MAAM,MAAM;CACnB,IAAI,QAAQ,MAAM,OAAO;CACzB,IAAI,QAAQ,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3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.1.0",
4
+ "private": false,
5
+ "description": "One MapLibre globe component: weather fields, wind particles and districts",
6
+ "keywords": [
7
+ "districts",
8
+ "globe",
9
+ "maplibre",
10
+ "particles",
11
+ "weather",
12
+ "wind"
13
+ ],
14
+ "homepage": "https://geolith.app",
15
+ "bugs": {
16
+ "url": "https://geolith.app/about"
17
+ },
18
+ "license": "Apache-2.0",
19
+ "author": {
20
+ "name": "Vinayak Kulkarni",
21
+ "url": "https://vinayakkulkarni.dev"
22
+ },
23
+ "repository": {
24
+ "type": "git",
25
+ "url": "git+https://github.com/geolith/globe.git"
26
+ },
27
+ "files": [
28
+ "dist"
29
+ ],
30
+ "type": "module",
31
+ "sideEffects": false,
32
+ "main": "./dist/index.js",
33
+ "module": "./dist/index.js",
34
+ "types": "./dist/index.d.ts",
35
+ "exports": {
36
+ ".": {
37
+ "types": "./dist/index.d.ts",
38
+ "import": "./dist/index.js"
39
+ }
40
+ },
41
+ "publishConfig": {
42
+ "access": "public"
43
+ },
44
+ "scripts": {
45
+ "prepare": "is-ci || husky",
46
+ "build": "vp pack",
47
+ "test": "vp test run",
48
+ "lint": "vp lint",
49
+ "format": "vp fmt --check",
50
+ "format:fix": "vp fmt --write",
51
+ "typecheck": "vp check --no-fmt --no-lint"
52
+ },
53
+ "dependencies": {
54
+ "reka-ui": "^2.12.0"
55
+ },
56
+ "devDependencies": {
57
+ "@commitlint/cli": "^21.3.0",
58
+ "@commitlint/config-conventional": "^21.3.0",
59
+ "@geoql/maplibre-gl-weather": "^0.2.0",
60
+ "@types/node": "^26.6.11",
61
+ "@vue/test-utils": "^2.6.0",
62
+ "happy-dom": "^21.0.4",
63
+ "husky": "^9.1.7",
64
+ "is-ci": "^4.1.0",
65
+ "lint-staged": "^17.6.3",
66
+ "maplibre-gl": "^6.21.0",
67
+ "typescript": "^7.0.2",
68
+ "vite-plus": "catalog:",
69
+ "vue": "^3.5.47"
70
+ },
71
+ "peerDependencies": {
72
+ "@geoql/maplibre-gl-weather": "^0.2.0",
73
+ "maplibre-gl": ">=6.21.0",
74
+ "vue": "^3.5.0"
75
+ },
76
+ "devEngines": {
77
+ "runtime": {
78
+ "name": "node",
79
+ "version": ">=26.x"
80
+ }
81
+ },
82
+ "engines": {
83
+ "node": ">=26"
84
+ },
85
+ "packageManager": "pnpm@12.15.0"
86
+ }