@kahwee/sf-map-svg 5.1.2 → 5.1.4

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.
Files changed (44) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/dist/src/cluster-renderer.d.ts +1 -1
  3. package/dist/src/district-layer.d.ts +1 -1
  4. package/dist/src/district-layer.js +1 -1
  5. package/dist/src/district-style.d.ts +1 -1
  6. package/dist/src/explorer-data.d.ts +1 -1
  7. package/dist/src/guide-map.js +3 -3
  8. package/dist/src/interactive/configuration-controller.d.ts +21 -0
  9. package/dist/src/interactive/configuration-controller.js +43 -0
  10. package/dist/src/{district-controller.d.ts → interactive/district-controller.d.ts} +12 -12
  11. package/dist/src/{district-controller.js → interactive/district-controller.js} +9 -9
  12. package/dist/src/{explorer-sidebar.d.ts → interactive/explorer-sidebar.d.ts} +6 -6
  13. package/dist/src/{explorer-sidebar.js → interactive/explorer-sidebar.js} +4 -4
  14. package/dist/src/{label-coordinator.d.ts → interactive/label-coordinator.d.ts} +7 -7
  15. package/dist/src/{label-coordinator.js → interactive/label-coordinator.js} +2 -2
  16. package/dist/src/{label-renderer.d.ts → interactive/label-renderer.d.ts} +2 -2
  17. package/dist/src/{label-renderer.js → interactive/label-renderer.js} +2 -2
  18. package/dist/src/{explorer-controls.d.ts → interactive/map-controls.d.ts} +4 -4
  19. package/dist/src/{explorer-controls.js → interactive/map-controls.js} +4 -4
  20. package/dist/src/{explorer-core.d.ts → interactive/map-engine.d.ts} +9 -8
  21. package/dist/src/{explorer-core.js → interactive/map-engine.js} +154 -140
  22. package/dist/src/{explorer-shell.d.ts → interactive/map-shell.d.ts} +2 -2
  23. package/dist/src/{explorer-shell.js → interactive/map-shell.js} +2 -2
  24. package/dist/src/{marker-controller.d.ts → interactive/marker-controller.d.ts} +8 -8
  25. package/dist/src/{marker-controller.js → interactive/marker-controller.js} +3 -3
  26. package/dist/src/{marker-layer.d.ts → interactive/marker-renderer.d.ts} +3 -3
  27. package/dist/src/{marker-layer.js → interactive/marker-renderer.js} +2 -2
  28. package/dist/src/map.js +15 -38
  29. package/dist/src/marker-catalog.d.ts +2 -2
  30. package/dist/src/{layers.d.ts → rendering/svg-layers.d.ts} +5 -5
  31. package/dist/src/{layers.js → rendering/svg-layers.js} +1 -1
  32. package/dist/src/{map-core.d.ts → rendering/svg-map-renderer.d.ts} +4 -4
  33. package/dist/src/{map-core.js → rendering/svg-map-renderer.js} +6 -6
  34. package/dist/src/static-labels.d.ts +1 -1
  35. package/dist/src/static-labels.js +1 -1
  36. package/dist/src/static.d.ts +2 -2
  37. package/dist/src/static.js +1 -1
  38. package/dist/src/transit.js +1 -1
  39. package/dist/src/types.d.ts +2 -2
  40. package/llms-full.txt +29 -21
  41. package/llms.txt +1 -1
  42. package/package.json +1 -1
  43. /package/dist/src/{svg.d.ts → rendering/svg-primitives.d.ts} +0 -0
  44. /package/dist/src/{svg.js → rendering/svg-primitives.js} +0 -0
@@ -1,7 +1,7 @@
1
- import type { Geometry, Position } from '../data/types.js';
2
- import type { DistrictYear, SFMapOptions } from './types.js';
3
- export type { DistrictYear, MapMarker, MapOverlay, SFMapOptions } from './types.js';
4
- import { type Project } from './geometry.js';
1
+ import type { Geometry, Position } from '../../data/types.js';
2
+ import type { DistrictYear, SFMapOptions } from '../types.js';
3
+ export type { DistrictYear, MapMarker, MapOverlay, SFMapOptions } from '../types.js';
4
+ import { type Project } from '../geometry.js';
5
5
  export interface SFMapData {
6
6
  coast: Geometry;
7
7
  districts?: Readonly<Partial<Record<DistrictYear, readonly DistrictRowData[]>>>;
@@ -1,9 +1,9 @@
1
- import { validateMarkers, validateOverlays } from './validation.js';
2
- import { prepareDistrictStyles } from './district-style.js';
3
- import { geometryPath, positions, rawProject } from './geometry.js';
4
- import * as layers from './layers.js';
5
- import { normalizeStaticAnimation, staticAnimationStyle } from './static-animation.js';
6
- import { escapeXml, stroke } from './svg.js';
1
+ import { validateMarkers, validateOverlays } from '../validation.js';
2
+ import { prepareDistrictStyles } from '../district-style.js';
3
+ import { geometryPath, positions, rawProject } from '../geometry.js';
4
+ import { normalizeStaticAnimation, staticAnimationStyle } from '../static-animation.js';
5
+ import * as layers from './svg-layers.js';
6
+ import { escapeXml, stroke } from './svg-primitives.js';
7
7
  export const districtYears = Object.freeze([2002, 2012, 2022]);
8
8
  export const districtColors = Object.freeze([
9
9
  '#c8dce5',
@@ -1,5 +1,5 @@
1
1
  import type { Project } from './geometry.js';
2
- import type { SFMapData } from './map-core.js';
2
+ import type { SFMapData } from './rendering/svg-map-renderer.js';
3
3
  import type { SFMapOptions } from './types.js';
4
4
  /** Conservative portable metrics; the browser refines these with its actual font. */
5
5
  export declare function estimateLabelWidth(text: string, fontSize: number): number;
@@ -1,7 +1,7 @@
1
1
  import { interiorAnchor, layoutLabels, projectedBounds } from './explorer-layout.js';
2
2
  import { labelCandidates, styleLabels } from './label-candidates.js';
3
3
  import { spreadLabels } from './label-spread.js';
4
- import { escapeXml, number } from './svg.js';
4
+ import { escapeXml, number } from './rendering/svg-primitives.js';
5
5
  /** Conservative portable metrics; the browser refines these with its actual font. */
6
6
  export function estimateLabelWidth(text, fontSize) {
7
7
  return Array.from(text).reduce((width, char) => width +
@@ -1,9 +1,9 @@
1
1
  import type { InteractiveSFMapData } from './explorer-data.js';
2
- import { type SFMapData } from './map-core.js';
2
+ import { type SFMapData } from './rendering/svg-map-renderer.js';
3
3
  import type { SFMapOptions } from './types.js';
4
4
  /** Either compact static geography or the same source-aware geography used by createMap. */
5
5
  export type StaticMapInput = SFMapData | InteractiveSFMapData;
6
- export type { DistrictRowData, SFMapData as StaticMapData } from './map-core.js';
6
+ export type { DistrictRowData, SFMapData as StaticMapData } from './rendering/svg-map-renderer.js';
7
7
  export type { DistrictStyle, DistrictYear, SFMapOptions as StaticMapOptions, StaticMapAppearance, StaticMapLayers, } from './types.js';
8
8
  /** Server-safe SVG rendering with explicit data; returns SVG plus projection helpers. */
9
9
  export declare function renderMap(data: StaticMapInput, options?: SFMapOptions): {
@@ -1,6 +1,6 @@
1
1
  import { prepareAppearance } from './appearance.js';
2
2
  import { validateSwitchPatch } from './features.js';
3
- import { createSFMapWithData, getLayerPathsWithData } from './map-core.js';
3
+ import { createSFMapWithData, getLayerPathsWithData, } from './rendering/svg-map-renderer.js';
4
4
  import { normalizeStaticAnimation } from './static-animation.js';
5
5
  import { staticLabels } from './static-labels.js';
6
6
  import { assertOptions, validateMarkers, validateOverlays } from './validation.js';
@@ -2,7 +2,7 @@ import stations from '../data/bart-stations.json' with { type: 'json' };
2
2
  import coast from '../data/coast.json' with { type: 'json' };
3
3
  import districts from '../data/districts-2022.json' with { type: 'json' };
4
4
  import parks from '../data/landmarks.json' with { type: 'json' };
5
- import { createSFMapWithData } from './map-core.js';
5
+ import { createSFMapWithData } from './rendering/svg-map-renderer.js';
6
6
  const districtData = districts;
7
7
  const parkData = parks;
8
8
  const stationData = stations;
@@ -11,7 +11,7 @@ export type DistrictYear = 2002 | 2012 | 2022;
11
11
  export interface DistrictSelection {
12
12
  id: number;
13
13
  year: DistrictYear;
14
- district: import('./map-core.js').DistrictRowData;
14
+ district: import('./rendering/svg-map-renderer.js').DistrictRowData;
15
15
  }
16
16
  export interface DistrictStyle {
17
17
  fill?: string;
@@ -56,7 +56,7 @@ export interface SFMapOptions {
56
56
  neighborhoodLabels?: boolean;
57
57
  districtFills?: boolean;
58
58
  /** Evaluated once per district at construction/style/year updates; call setDistrictStyle again when external data changes. */
59
- districtStyle?: (district: import('./map-core.js').DistrictRowData) => DistrictStyle;
59
+ districtStyle?: (district: import('./rendering/svg-map-renderer.js').DistrictRowData) => DistrictStyle;
60
60
  districtLabels?: boolean;
61
61
  /** Hide all visible text labels while retaining geographic symbols and accessible titles. */
62
62
  labels?: boolean;
package/llms-full.txt CHANGED
@@ -2,13 +2,13 @@
2
2
 
3
3
  > Offline San Francisco SVG maps with explicit geographic imports, no runtime dependencies, static rendering, and a browser controller.
4
4
 
5
- @kahwee/sf-map-svg 5.1.2 · local working tree. Node >=24.0.0 for server rendering; browsers need a DOM and a JSON-capable bundler.
5
+ @kahwee/sf-map-svg 5.1.4 · local working tree. Node >=24.0.0 for server rendering; browsers need a DOM and a JSON-capable bundler.
6
6
 
7
7
  These are working-tree docs. Unreleased changelog entries may describe APIs absent from npm; verify the installed version before copying them.
8
8
 
9
9
  Use renderMap(data, options) for SVG strings; createMap(data, options) returns a controller. Mount map.element and destroy it on unmount. Choose mode explicitly: createMap defaults to basemap. Geography is separate; staticMapData and fullMapData have different shapes.
10
10
 
11
- <!-- Generated from README.md; @kahwee/sf-map-svg 5.1.2 · local working tree. -->
11
+ <!-- Generated from README.md; @kahwee/sf-map-svg 5.1.4 · local working tree. -->
12
12
 
13
13
  # SF Map SVG
14
14
 
@@ -267,7 +267,7 @@ for raw samples, output-equivalence checks, and reproducible commands.
267
267
 
268
268
  ---
269
269
 
270
- <!-- Generated from docs/developer-guide.md; @kahwee/sf-map-svg 5.1.2 · local working tree. -->
270
+ <!-- Generated from docs/developer-guide.md; @kahwee/sf-map-svg 5.1.4 · local working tree. -->
271
271
 
272
272
  # Developer guide
273
273
 
@@ -433,7 +433,7 @@ See [API options](https://github.com/kahwee/sf-map-svg/blob/main/docs/API.md), [
433
433
 
434
434
  ---
435
435
 
436
- <!-- Generated from docs/API.md; @kahwee/sf-map-svg 5.1.2 · local working tree. -->
436
+ <!-- Generated from docs/API.md; @kahwee/sf-map-svg 5.1.4 · local working tree. -->
437
437
 
438
438
  # Map options and lifecycle
439
439
 
@@ -619,7 +619,7 @@ Call `binding.setMarkers(next)` after `map.setMarkers(next)` when the catalog ch
619
619
 
620
620
  ---
621
621
 
622
- <!-- Generated from docs/EXAMPLES.md; @kahwee/sf-map-svg 5.1.2 · local working tree. -->
622
+ <!-- Generated from docs/EXAMPLES.md; @kahwee/sf-map-svg 5.1.4 · local working tree. -->
623
623
 
624
624
  # Examples
625
625
 
@@ -760,7 +760,7 @@ See [query semantics and limitations](https://github.com/kahwee/sf-map-svg/blob/
760
760
 
761
761
  ---
762
762
 
763
- <!-- Generated from docs/consumer-integration.md; @kahwee/sf-map-svg 5.1.2 · local working tree. -->
763
+ <!-- Generated from docs/consumer-integration.md; @kahwee/sf-map-svg 5.1.4 · local working tree. -->
764
764
 
765
765
  # Embedding and progressive enhancement
766
766
 
@@ -938,7 +938,7 @@ keyboard, focus, and dismissal behavior. See [coordinates and units](https://git
938
938
 
939
939
  ---
940
940
 
941
- <!-- Generated from docs/migration-v5.md; @kahwee/sf-map-svg 5.1.2 · local working tree. -->
941
+ <!-- Generated from docs/migration-v5.md; @kahwee/sf-map-svg 5.1.4 · local working tree. -->
942
942
 
943
943
  # Migrating to v5
944
944
 
@@ -1043,7 +1043,7 @@ collections. Shared edges can match more than one feature. See the
1043
1043
 
1044
1044
  ---
1045
1045
 
1046
- <!-- Generated from docs/migration-v3.md; @kahwee/sf-map-svg 5.1.2 · local working tree. -->
1046
+ <!-- Generated from docs/migration-v3.md; @kahwee/sf-map-svg 5.1.4 · local working tree. -->
1047
1047
 
1048
1048
  # Migrate to version 3
1049
1049
 
@@ -1084,7 +1084,7 @@ District styles are now prepared once per district on construction and style/yea
1084
1084
 
1085
1085
  ---
1086
1086
 
1087
- <!-- Generated from SOURCES.md; @kahwee/sf-map-svg 5.1.2 · local working tree. -->
1087
+ <!-- Generated from SOURCES.md; @kahwee/sf-map-svg 5.1.4 · local working tree. -->
1088
1088
 
1089
1089
  # Geometry and provenance
1090
1090
 
@@ -1321,7 +1321,7 @@ Report-history points preserve only actual validated source counts and their dis
1321
1321
 
1322
1322
  ---
1323
1323
 
1324
- <!-- Generated from CHANGELOG.md; @kahwee/sf-map-svg 5.1.2 · local working tree. -->
1324
+ <!-- Generated from CHANGELOG.md; @kahwee/sf-map-svg 5.1.4 · local working tree. -->
1325
1325
 
1326
1326
  # Changelog
1327
1327
 
@@ -1329,6 +1329,14 @@ User-visible changes are recorded here. Unreleased entries describe changes on `
1329
1329
 
1330
1330
  ## Unreleased
1331
1331
 
1332
+ ## 5.1.4 — 2026-11-05
1333
+
1334
+ - Group internal browser controllers, renderers and shells under `src/interactive`, and SVG generation under `src/rendering`. Rename the general map engine, controls and marker renderer to match their responsibilities; clarify selection-detail, neighborhood-results and layer-composition operations. Keep public package entry points unchanged.
1335
+
1336
+ ## 5.1.3 — 2026-11-05
1337
+
1338
+ - Give configuration snapshots and revisions a dedicated internal owner. Split presentation preparation from a guarded, single-use commit, rejecting stale or disposed updates before mutating presentation. Preserve public configuration and reset behavior.
1339
+
1332
1340
  ## 5.1.2 — 2026-11-05
1333
1341
 
1334
1342
  - Separate marker selection, activation and focus recovery into an internal controller; separate label candidate caching, screen-space collision layout and metrics invalidation into a label coordinator. Preserve the public API and shared animation frame scheduling.
@@ -1721,7 +1729,7 @@ consistent home, and makes animation and subscription ownership predictable.
1721
1729
 
1722
1730
  # Published type contracts
1723
1731
 
1724
- @kahwee/sf-map-svg 5.1.2 · local working tree. These declarations are generated by TypeScript. Use package export paths, not the internal filenames below. Imported relative contracts are included for context, not as additional public entry points.
1732
+ @kahwee/sf-map-svg 5.1.4 · local working tree. These declarations are generated by TypeScript. Use package export paths, not the internal filenames below. Imported relative contracts are included for context, not as additional public entry points.
1725
1733
 
1726
1734
  | Public import | Declaration |
1727
1735
  | --- | --- |
@@ -2107,7 +2115,7 @@ export type DistrictYear = 2002 | 2012 | 2022;
2107
2115
  export interface DistrictSelection {
2108
2116
  id: number;
2109
2117
  year: DistrictYear;
2110
- district: import('./map-core.js').DistrictRowData;
2118
+ district: import('./rendering/svg-map-renderer.js').DistrictRowData;
2111
2119
  }
2112
2120
  export interface DistrictStyle {
2113
2121
  fill?: string;
@@ -2152,7 +2160,7 @@ export interface SFMapOptions {
2152
2160
  neighborhoodLabels?: boolean;
2153
2161
  districtFills?: boolean;
2154
2162
  /** Evaluated once per district at construction/style/year updates; call setDistrictStyle again when external data changes. */
2155
- districtStyle?: (district: import('./map-core.js').DistrictRowData) => DistrictStyle;
2163
+ districtStyle?: (district: import('./rendering/svg-map-renderer.js').DistrictRowData) => DistrictStyle;
2156
2164
  districtLabels?: boolean;
2157
2165
  /** Hide all visible text labels while retaining geographic symbols and accessible titles. */
2158
2166
  labels?: boolean;
@@ -2374,7 +2382,7 @@ export type { MapAppearance, MapCamera, MapCapabilities, MapConfiguration, MapCo
2374
2382
 
2375
2383
  ```ts
2376
2384
  import type { DistrictProperties, FeatureCollection, NeighborhoodProperties, NeighborhoodSource } from '../data/types.js';
2377
- import type { SFMapData } from './map-core.js';
2385
+ import type { SFMapData } from './rendering/svg-map-renderer.js';
2378
2386
  import type { DistrictYear } from './types.js';
2379
2387
  /** Geographic inputs for the data-injected interactive map entry point. */
2380
2388
  export interface InteractiveSFMapData {
@@ -2384,13 +2392,13 @@ export interface InteractiveSFMapData {
2384
2392
  }
2385
2393
  ```
2386
2394
 
2387
- ### dist/src/map-core.d.ts
2395
+ ### dist/src/rendering/svg-map-renderer.d.ts
2388
2396
 
2389
2397
  ```ts
2390
- import type { Geometry, Position } from '../data/types.js';
2391
- import type { DistrictYear, SFMapOptions } from './types.js';
2392
- export type { DistrictYear, MapMarker, MapOverlay, SFMapOptions } from './types.js';
2393
- import { type Project } from './geometry.js';
2398
+ import type { Geometry, Position } from '../../data/types.js';
2399
+ import type { DistrictYear, SFMapOptions } from '../types.js';
2400
+ export type { DistrictYear, MapMarker, MapOverlay, SFMapOptions } from '../types.js';
2401
+ import { type Project } from '../geometry.js';
2394
2402
  export interface SFMapData {
2395
2403
  coast: Geometry;
2396
2404
  districts?: Readonly<Partial<Record<DistrictYear, readonly DistrictRowData[]>>>;
@@ -2512,11 +2520,11 @@ export declare function geometryContainsPoint(geometry: Geometry | null | undefi
2512
2520
 
2513
2521
  ```ts
2514
2522
  import type { InteractiveSFMapData } from './explorer-data.js';
2515
- import { type SFMapData } from './map-core.js';
2523
+ import { type SFMapData } from './rendering/svg-map-renderer.js';
2516
2524
  import type { SFMapOptions } from './types.js';
2517
2525
  /** Either compact static geography or the same source-aware geography used by createMap. */
2518
2526
  export type StaticMapInput = SFMapData | InteractiveSFMapData;
2519
- export type { DistrictRowData, SFMapData as StaticMapData } from './map-core.js';
2527
+ export type { DistrictRowData, SFMapData as StaticMapData } from './rendering/svg-map-renderer.js';
2520
2528
  export type { DistrictStyle, DistrictYear, SFMapOptions as StaticMapOptions, StaticMapAppearance, StaticMapLayers, } from './types.js';
2521
2529
  /** Server-safe SVG rendering with explicit data; returns SVG plus projection helpers. */
2522
2530
  export declare function renderMap(data: StaticMapInput, options?: SFMapOptions): {
package/llms.txt CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  > Offline San Francisco SVG maps with explicit geographic imports, no runtime dependencies, static rendering, and a browser controller.
4
4
 
5
- @kahwee/sf-map-svg 5.1.2 · local working tree. Node >=24.0.0 for server rendering; browsers need a DOM and a JSON-capable bundler.
5
+ @kahwee/sf-map-svg 5.1.4 · local working tree. Node >=24.0.0 for server rendering; browsers need a DOM and a JSON-capable bundler.
6
6
 
7
7
  These are working-tree docs. Unreleased changelog entries may describe APIs absent from npm; verify the installed version before copying them.
8
8
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kahwee/sf-map-svg",
3
- "version": "5.1.2",
3
+ "version": "5.1.4",
4
4
  "description": "Offline SVG maps of San Francisco with district boundaries, parks, landmarks, and BART stations.",
5
5
  "type": "module",
6
6
  "main": "./dist/src/api.js",