@kahwee/sf-map-svg 0.3.0 → 1.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.
Files changed (70) hide show
  1. package/CHANGELOG.md +44 -3
  2. package/LICENSE +23 -4
  3. package/README.md +267 -74
  4. package/SOURCES.md +4 -0
  5. package/{data → dist/data}/README.md +2 -1
  6. package/dist/data/bart-stations.json +134 -0
  7. package/dist/data/catalog.json +4718 -0
  8. package/dist/data/coast.json +36 -0
  9. package/dist/data/districts-2002.json +325 -0
  10. package/dist/data/districts-2012.json +325 -0
  11. package/dist/data/districts-2022.json +325 -0
  12. package/dist/data/highways.json +4138 -0
  13. package/dist/data/index.d.ts +26 -0
  14. package/{data → dist/data}/index.js +37 -39
  15. package/dist/data/key-roads.json +12662 -0
  16. package/dist/data/landmarks.json +167 -0
  17. package/dist/data/neighborhoods-analysis.json +817 -0
  18. package/dist/data/neighborhoods-realtor.json +1978 -0
  19. package/dist/data/neighborhoods.json +2267 -0
  20. package/dist/data/types.d.ts +117 -0
  21. package/dist/data/types.js +1 -0
  22. package/dist/src/data.d.ts +25 -0
  23. package/{src → dist/src}/data.js +17 -20
  24. package/dist/src/explorer-layout.d.ts +23 -0
  25. package/dist/src/explorer-layout.js +72 -0
  26. package/dist/src/explorer.d.ts +4 -0
  27. package/dist/src/explorer.js +961 -0
  28. package/dist/src/geometry.d.ts +5 -0
  29. package/dist/src/geometry.js +53 -0
  30. package/dist/src/immutable.d.ts +2 -0
  31. package/dist/src/immutable.js +9 -0
  32. package/dist/src/index.d.ts +13 -0
  33. package/dist/src/index.js +125 -0
  34. package/dist/src/interactive.d.ts +4 -0
  35. package/dist/src/interactive.js +5 -0
  36. package/dist/src/layers.d.ts +36 -0
  37. package/dist/src/layers.js +64 -0
  38. package/dist/src/navigation.d.ts +6 -0
  39. package/dist/src/navigation.js +145 -0
  40. package/dist/src/overlays.d.ts +25 -0
  41. package/dist/src/overlays.js +15 -0
  42. package/dist/src/svg.d.ts +4 -0
  43. package/dist/src/svg.js +7 -0
  44. package/dist/src/transit.d.ts +3 -0
  45. package/dist/src/transit.js +105 -0
  46. package/dist/src/types.d.ts +112 -0
  47. package/dist/src/types.js +1 -0
  48. package/dist/src/viewport.d.ts +5 -0
  49. package/dist/src/viewport.js +27 -0
  50. package/package.json +40 -25
  51. package/data/bart-stations.json +0 -134
  52. package/data/catalog.json +0 -4699
  53. package/data/coast.json +0 -36
  54. package/data/districts-2002.json +0 -325
  55. package/data/districts-2012.json +0 -325
  56. package/data/districts-2022.json +0 -325
  57. package/data/highways.json +0 -4138
  58. package/data/index.d.ts +0 -117
  59. package/data/landmarks.json +0 -167
  60. package/data/neighborhoods-analysis.json +0 -817
  61. package/data/neighborhoods-realtor.json +0 -1978
  62. package/data/neighborhoods.json +0 -2267
  63. package/src/geometry.d.ts +0 -8
  64. package/src/geometry.js +0 -51
  65. package/src/immutable.js +0 -8
  66. package/src/index.d.ts +0 -51
  67. package/src/index.js +0 -122
  68. package/src/layers.js +0 -54
  69. package/src/overlays.js +0 -18
  70. package/src/svg.js +0 -12
package/data/index.d.ts DELETED
@@ -1,117 +0,0 @@
1
- export type Position = readonly [number, number, ...number[]];
2
- export type Bounds = readonly [number, number, number, number];
3
- export type Geometry =
4
- | { readonly type: 'Point'; readonly coordinates: Position }
5
- | { readonly type: 'LineString' | 'MultiPoint'; readonly coordinates: readonly Position[] }
6
- | {
7
- readonly type: 'Polygon' | 'MultiLineString';
8
- readonly coordinates: readonly (readonly Position[])[];
9
- }
10
- | {
11
- readonly type: 'MultiPolygon';
12
- readonly coordinates: readonly (readonly (readonly Position[])[])[];
13
- }
14
- | { readonly type: 'GeometryCollection'; readonly geometries: readonly Geometry[] };
15
- export interface Feature<P = Readonly<Record<string, unknown>>> {
16
- readonly type: 'Feature';
17
- readonly id: string;
18
- readonly bbox: Bounds;
19
- readonly properties: P;
20
- readonly geometry: Geometry;
21
- }
22
- export interface DataSource {
23
- readonly id: string;
24
- readonly title: string;
25
- readonly url: string;
26
- readonly retrievedAt: string;
27
- readonly definitionYear?: number;
28
- readonly licenseUrl: string;
29
- }
30
- export interface Definition {
31
- readonly kind: string;
32
- readonly year?: number;
33
- readonly description: string;
34
- }
35
- export interface FeatureCollection<P = Readonly<Record<string, unknown>>> {
36
- readonly type: 'FeatureCollection';
37
- readonly schemaVersion: 1;
38
- readonly id: string;
39
- readonly title: string;
40
- readonly coordinateSystem: string;
41
- readonly definition: Definition;
42
- readonly sources: readonly DataSource[];
43
- readonly topology?: {
44
- readonly policy: 'disjoint-interiors';
45
- readonly sharedBoundariesAllowed: boolean;
46
- readonly method: string;
47
- readonly tool: string;
48
- readonly processedAt: string;
49
- readonly sourceOverlapPairs: number;
50
- };
51
- readonly features: readonly Feature<P>[];
52
- }
53
- export type NeighborhoodSource = 'sf-find' | 'analysis' | 'realtor';
54
- export interface NeighborhoodProperties {
55
- readonly name: string;
56
- readonly canonicalName: string;
57
- readonly sourceName: string;
58
- readonly aliases: readonly string[];
59
- readonly definitionSource: NeighborhoodSource;
60
- readonly nameSources: readonly string[];
61
- readonly note?: string;
62
- readonly sourceCode?: string;
63
- readonly realtorDistrict?: string;
64
- }
65
- export interface NeighborhoodEntry extends NeighborhoodProperties {
66
- readonly id: string;
67
- readonly source: NeighborhoodSource;
68
- readonly file: string;
69
- readonly bbox: Bounds;
70
- }
71
- export interface DistrictProperties {
72
- readonly district: number;
73
- readonly name: string;
74
- readonly year: 2002 | 2012 | 2022;
75
- readonly label: Position;
76
- readonly labelPoints: readonly Position[];
77
- readonly displayExtras: Geometry | null;
78
- }
79
- export interface Catalog {
80
- readonly schemaVersion: 1;
81
- readonly description: string;
82
- readonly datasets: readonly {
83
- readonly id: string;
84
- readonly file: string;
85
- readonly title: string;
86
- readonly featureCount: number;
87
- readonly definition: Definition;
88
- readonly sources: readonly DataSource[];
89
- }[];
90
- readonly neighborhoods: readonly NeighborhoodEntry[];
91
- }
92
- export declare const coast: FeatureCollection<{ readonly name: string }>;
93
- export declare const districtMaps: Readonly<
94
- Record<2002 | 2012 | 2022, FeatureCollection<DistrictProperties>>
95
- >;
96
- export declare const neighborhoods: FeatureCollection<NeighborhoodProperties>;
97
- export declare const neighborhoodCollections: Readonly<
98
- Record<NeighborhoodSource, FeatureCollection<NeighborhoodProperties>>
99
- >;
100
- export declare const neighborhoodSources: readonly NeighborhoodSource[];
101
- export declare const highways: FeatureCollection<{ readonly route: string }>;
102
- export declare const landmarks: FeatureCollection<{
103
- readonly name: string;
104
- readonly label: Position;
105
- readonly offset: readonly [number, number];
106
- readonly anchor: 'middle' | 'start' | 'end';
107
- }>;
108
- export declare const bartStations: FeatureCollection<{ readonly name: string }>;
109
- export declare const catalog: Catalog;
110
- export declare function getNeighborhood(
111
- name: string,
112
- options?: { source?: NeighborhoodSource },
113
- ): Feature<NeighborhoodProperties> | undefined;
114
- export declare function searchNeighborhoods(
115
- query?: string,
116
- options?: { source?: NeighborhoodSource },
117
- ): NeighborhoodEntry[];