@a2f0/skyline 0.0.0-stage → 0.1.1
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/NOTICE.md +20 -0
- package/README.md +52 -2
- package/docs/package.md +222 -0
- package/docs/skyline-geography.md +503 -0
- package/lib/models/aon-center.d.ts +4 -0
- package/lib/models/aon-center.js +60 -0
- package/lib/models/aon-geographic.d.ts +9 -0
- package/lib/models/aon-geographic.js +35 -0
- package/lib/models/aon-tower.d.ts +23 -0
- package/lib/models/aon-tower.js +130 -0
- package/lib/models/blue-cross-geographic.d.ts +14 -0
- package/lib/models/blue-cross-geographic.js +248 -0
- package/lib/models/borg-warner-geographic.d.ts +20 -0
- package/lib/models/borg-warner-geographic.js +143 -0
- package/lib/models/buckingham-geographic.d.ts +10 -0
- package/lib/models/buckingham-geographic.js +121 -0
- package/lib/models/building-kit.d.ts +84 -0
- package/lib/models/building-kit.js +358 -0
- package/lib/models/celebrations.d.ts +39 -0
- package/lib/models/celebrations.js +44 -0
- package/lib/models/chicago-athletic-association-geographic.d.ts +32 -0
- package/lib/models/chicago-athletic-association-geographic.js +173 -0
- package/lib/models/crain-communications.d.ts +5 -0
- package/lib/models/crain-communications.js +75 -0
- package/lib/models/crain-geographic.d.ts +10 -0
- package/lib/models/crain-geographic.js +69 -0
- package/lib/models/crain-tower.d.ts +32 -0
- package/lib/models/crain-tower.js +378 -0
- package/lib/models/facade-grid.d.ts +18 -0
- package/lib/models/facade-grid.js +176 -0
- package/lib/models/gage-geographic.d.ts +19 -0
- package/lib/models/gage-geographic.js +154 -0
- package/lib/models/heritage-at-millennium-park.d.ts +3 -0
- package/lib/models/heritage-at-millennium-park.js +284 -0
- package/lib/models/heritage-geographic.d.ts +11 -0
- package/lib/models/heritage-geographic.js +208 -0
- package/lib/models/hyatt-west-tower-geographic.d.ts +26 -0
- package/lib/models/hyatt-west-tower-geographic.js +86 -0
- package/lib/models/keith-ascher-geographic.d.ts +29 -0
- package/lib/models/keith-ascher-geographic.js +110 -0
- package/lib/models/kemper-geographic.d.ts +8 -0
- package/lib/models/kemper-geographic.js +153 -0
- package/lib/models/kemper.d.ts +2 -0
- package/lib/models/kemper.js +78 -0
- package/lib/models/lake-view-geographic.d.ts +15 -0
- package/lib/models/lake-view-geographic.js +134 -0
- package/lib/models/maclean-center-geographic.d.ts +20 -0
- package/lib/models/maclean-center-geographic.js +162 -0
- package/lib/models/michigan-boulevard-geographic.d.ts +12 -0
- package/lib/models/michigan-boulevard-geographic.js +157 -0
- package/lib/models/michigan-plaza-south-geographic.d.ts +7 -0
- package/lib/models/michigan-plaza-south-geographic.js +84 -0
- package/lib/models/michigan-plaza-south.d.ts +2 -0
- package/lib/models/michigan-plaza-south.js +68 -0
- package/lib/models/millennium-park-plaza-geographic.d.ts +9 -0
- package/lib/models/millennium-park-plaza-geographic.js +103 -0
- package/lib/models/monroe-geographic.d.ts +19 -0
- package/lib/models/monroe-geographic.js +177 -0
- package/lib/models/north-michigan-180-geographic.d.ts +14 -0
- package/lib/models/north-michigan-180-geographic.js +117 -0
- package/lib/models/north-wabash-geographic.d.ts +14 -0
- package/lib/models/north-wabash-geographic.js +122 -0
- package/lib/models/on-the-park-geographic.d.ts +11 -0
- package/lib/models/on-the-park-geographic.js +245 -0
- package/lib/models/one-prudential-geographic.d.ts +12 -0
- package/lib/models/one-prudential-geographic.js +55 -0
- package/lib/models/one-prudential-plaza.d.ts +5 -0
- package/lib/models/one-prudential-plaza.js +72 -0
- package/lib/models/one-prudential-tower.d.ts +45 -0
- package/lib/models/one-prudential-tower.js +246 -0
- package/lib/models/peoples-gas-geographic.d.ts +23 -0
- package/lib/models/peoples-gas-geographic.js +250 -0
- package/lib/models/railway-exchange-geographic.d.ts +18 -0
- package/lib/models/railway-exchange-geographic.js +176 -0
- package/lib/models/river-plaza-geographic.d.ts +16 -0
- package/lib/models/river-plaza-geographic.js +104 -0
- package/lib/models/sheraton-grand-geographic.d.ts +24 -0
- package/lib/models/sheraton-grand-geographic.js +112 -0
- package/lib/models/six-north-michigan-geographic.d.ts +16 -0
- package/lib/models/six-north-michigan-geographic.js +180 -0
- package/lib/models/skyline-geography-data.d.ts +44 -0
- package/lib/models/skyline-geography-data.js +607 -0
- package/lib/models/skyline-geography.d.ts +23 -0
- package/lib/models/skyline-geography.js +322 -0
- package/lib/models/swissotel-geographic.d.ts +24 -0
- package/lib/models/swissotel-geographic.js +79 -0
- package/lib/models/three-illinois-center-geographic.d.ts +26 -0
- package/lib/models/three-illinois-center-geographic.js +86 -0
- package/lib/models/trump-geographic.d.ts +14 -0
- package/lib/models/trump-geographic.js +51 -0
- package/lib/models/trump-international-tower.d.ts +4 -0
- package/lib/models/trump-international-tower.js +84 -0
- package/lib/models/trump-tower.d.ts +43 -0
- package/lib/models/trump-tower.js +229 -0
- package/lib/models/two-illinois-center-geographic.d.ts +26 -0
- package/lib/models/two-illinois-center-geographic.js +85 -0
- package/lib/models/two-prudential-geographic.d.ts +25 -0
- package/lib/models/two-prudential-geographic.js +47 -0
- package/lib/models/two-prudential-plaza.d.ts +8 -0
- package/lib/models/two-prudential-plaza.js +55 -0
- package/lib/models/two-prudential-tower.d.ts +53 -0
- package/lib/models/two-prudential-tower.js +441 -0
- package/lib/models/university-club-geographic.d.ts +24 -0
- package/lib/models/university-club-geographic.js +217 -0
- package/lib/models/willoughby-tower-geographic.d.ts +17 -0
- package/lib/models/willoughby-tower-geographic.js +195 -0
- package/lib/models/window-illumination.d.ts +14 -0
- package/lib/models/window-illumination.js +64 -0
- package/lib/package-assets.d.ts +5 -0
- package/lib/package-assets.js +9 -0
- package/lib/skyline-package.d.ts +23 -0
- package/lib/skyline-package.js +25 -0
- package/lib/skyline-scene.d.ts +25 -0
- package/lib/skyline-scene.js +86 -0
- package/lib/study-types.d.ts +49 -0
- package/lib/study-types.js +1 -0
- package/lib/vendor/three-r186.d.ts +1 -0
- package/lib/vendor/three-r186.js +1 -0
- package/package.json +64 -4
- package/site/building-detail.html +54 -0
- package/site/building-detail.js +84 -0
- package/site/building-study.html +58 -0
- package/site/building-study.js +3 -0
- package/site/index.html +407 -0
- package/site/models/aon-center.js +60 -0
- package/site/models/aon-geographic.js +35 -0
- package/site/models/aon-tower.js +130 -0
- package/site/models/blue-cross-geographic.js +248 -0
- package/site/models/borg-warner-geographic.js +143 -0
- package/site/models/buckingham-geographic.js +121 -0
- package/site/models/building-kit.js +358 -0
- package/site/models/celebrations.js +44 -0
- package/site/models/chicago-athletic-association-geographic.js +173 -0
- package/site/models/crain-communications.js +75 -0
- package/site/models/crain-geographic.js +69 -0
- package/site/models/crain-reference.svg +10 -0
- package/site/models/crain-tower.js +378 -0
- package/site/models/facade-grid.js +176 -0
- package/site/models/gage-geographic.js +154 -0
- package/site/models/heritage-at-millennium-park.js +284 -0
- package/site/models/heritage-geographic.js +208 -0
- package/site/models/hyatt-west-tower-geographic.js +86 -0
- package/site/models/keith-ascher-geographic.js +110 -0
- package/site/models/kemper-geographic.js +153 -0
- package/site/models/kemper.js +78 -0
- package/site/models/lake-view-geographic.js +134 -0
- package/site/models/maclean-center-geographic.js +162 -0
- package/site/models/michigan-boulevard-geographic.js +157 -0
- package/site/models/michigan-plaza-south-geographic.js +84 -0
- package/site/models/michigan-plaza-south.js +68 -0
- package/site/models/millennium-park-plaza-geographic.js +103 -0
- package/site/models/monroe-geographic.js +177 -0
- package/site/models/north-michigan-180-geographic.js +117 -0
- package/site/models/north-wabash-geographic.js +122 -0
- package/site/models/on-the-park-geographic.js +245 -0
- package/site/models/one-prudential-geographic.js +55 -0
- package/site/models/one-prudential-plaza.js +72 -0
- package/site/models/one-prudential-tower.js +246 -0
- package/site/models/peoples-gas-geographic.js +250 -0
- package/site/models/railway-exchange-geographic.js +176 -0
- package/site/models/river-plaza-geographic.js +104 -0
- package/site/models/sheraton-grand-geographic.js +112 -0
- package/site/models/six-north-michigan-geographic.js +180 -0
- package/site/models/skyline-geography-data.js +607 -0
- package/site/models/skyline-geography.js +322 -0
- package/site/models/skyline-panorama.svg +3491 -0
- package/site/models/skyline-reference.svg +3090 -0
- package/site/models/swissotel-geographic.js +79 -0
- package/site/models/three-illinois-center-geographic.js +86 -0
- package/site/models/trump-geographic.js +51 -0
- package/site/models/trump-international-tower.js +84 -0
- package/site/models/trump-tower.js +229 -0
- package/site/models/two-illinois-center-geographic.js +85 -0
- package/site/models/two-prudential-geographic.js +47 -0
- package/site/models/two-prudential-plaza.js +55 -0
- package/site/models/two-prudential-tower.js +441 -0
- package/site/models/university-club-geographic.js +217 -0
- package/site/models/willoughby-tower-geographic.js +195 -0
- package/site/models/window-illumination.js +64 -0
- package/site/skyline-3d.html +92 -0
- package/site/skyline-3d.js +333 -0
- package/site/skyline-animated.svg +18795 -0
- package/site/skyline-comparison.js +97 -0
- package/site/skyline-original-fit.svg +18312 -0
- package/site/skyline-scene.js +86 -0
- package/site/skyline-study.html +83 -0
- package/site/skyline-study.js +109 -0
- package/site/skyline-webgl.html +667 -0
- package/site/stars.svg +176 -0
- package/site/study-loader.js +20 -0
- package/site/study-types.js +1 -0
- package/site/study-viewer.js +605 -0
- package/site/study.css +204 -0
- package/site/vendor/THREE-LICENSE.txt +21 -0
- package/site/vendor/three-r186.js +4228 -0
package/NOTICE.md
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# Notices
|
|
2
|
+
|
|
3
|
+
Package metadata uses `UNLICENSED`. This release does not add a license for the
|
|
4
|
+
project's source code or artwork.
|
|
5
|
+
|
|
6
|
+
The self-contained viewer includes Three.js r186 under the MIT license. Its full
|
|
7
|
+
notice is packaged at `site/vendor/THREE-LICENSE.txt`. Imported scene and building
|
|
8
|
+
modules use the consuming application's `three` dependency instead.
|
|
9
|
+
|
|
10
|
+
Mapped building footprints, building parts, and streets contain data from
|
|
11
|
+
© OpenStreetMap contributors, under the Open Database License (ODbL) 1.0:
|
|
12
|
+
|
|
13
|
+
- [OpenStreetMap copyright and attribution](https://www.openstreetmap.org/copyright)
|
|
14
|
+
- [Open Database License](https://opendatacommons.org/licenses/odbl/1-0/)
|
|
15
|
+
|
|
16
|
+
The complete viewer preserves its OpenStreetMap credit. Applications rendering
|
|
17
|
+
the scene/model modules themselves should carry the same credit. The data retains
|
|
18
|
+
its source way IDs and versions in `models/skyline-geography-data`; extraction
|
|
19
|
+
dates, measurements, assumptions, and source links are documented in the
|
|
20
|
+
repository's `docs/skyline-geography.md`.
|
package/README.md
CHANGED
|
@@ -1,3 +1,53 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Chicago Skyline
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
A grayscale Chicago skyline traced from a 2013 photograph taken on the lakefront by the Adler
|
|
4
|
+
Planetarium, and a 3D city of 34 mapped buildings seen through that photograph's own camera.
|
|
5
|
+
Hover a building for its name, right-click it for a close look, or switch to the animated drawing
|
|
6
|
+
it was fitted to. It is live at [skyline.devopsrockstars.com](https://skyline.devopsrockstars.com).
|
|
7
|
+
|
|
8
|
+
## Run it locally
|
|
9
|
+
|
|
10
|
+
With [Bun](https://bun.sh) installed (the version is pinned in `mise.toml`):
|
|
11
|
+
|
|
12
|
+
```sh
|
|
13
|
+
bun install --ignore-scripts
|
|
14
|
+
bun run build:site
|
|
15
|
+
python3 -m http.server -d dist
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
Then open `http://localhost:8000`. Serve `dist/` over HTTP rather than opening files directly:
|
|
19
|
+
WebGL and the 3D pages need it.
|
|
20
|
+
|
|
21
|
+
## Pages
|
|
22
|
+
|
|
23
|
+
| Page | Shows | Docs |
|
|
24
|
+
| --- | --- | --- |
|
|
25
|
+
| `index.html` | The viewer: opens on the 3D skyline, with the enhanced drawing, the original drawing, and a WebGL prototype one button away | [The viewer](docs/viewer.md) |
|
|
26
|
+
| `skyline-3d.html` | The full-screen 3D skyline on its own: camera views, streets, footprints, celebratory lights, and a building menu | [Full-screen 3D skyline](docs/viewer.md#full-screen-3d-skyline) |
|
|
27
|
+
| `building-detail.html?building=<id>` | One mapped building alone on its platform | [Building menu and detail](docs/viewer.md#building-menu-and-detail) |
|
|
28
|
+
| `skyline-study.html` | The 3D scene over the drawing, in the geographic layout or the original drawing's fit | [3D studies](docs/studies.md#skyline-study) |
|
|
29
|
+
| `building-study.html` | The Crain Communications Building beside its illustration | [3D studies](docs/studies.md#single-building-study) |
|
|
30
|
+
| `skyline-webgl.html` | The drawing's layers rendered as GPU textures | [WebGL prototype](docs/viewer.md#webgl-prototype) |
|
|
31
|
+
|
|
32
|
+
## Package
|
|
33
|
+
|
|
34
|
+
The repository also builds [`@a2f0/skyline`](https://www.npmjs.com/package/@a2f0/skyline), an ESM
|
|
35
|
+
package with the complete embeddable viewer, reusable Three.js scenes and building models, and
|
|
36
|
+
TypeScript declarations. Every merge to `main` publishes a new version to npm; run
|
|
37
|
+
`bun run build:package` or `bun pm pack` to build it locally. [The package guide](docs/package.md)
|
|
38
|
+
covers installing, asset copying, mounting, imports, and releases.
|
|
39
|
+
|
|
40
|
+
## Development
|
|
41
|
+
|
|
42
|
+
```sh
|
|
43
|
+
sh scripts/git/install-hooks.sh # once per clone
|
|
44
|
+
bun run check # typecheck, unit and browser suites; needs Google Chrome
|
|
45
|
+
bun run deploy # publish to Cloudflare; needs Node.js 22+ and wrangler login
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
[Development](docs/development.md) explains the checks, hooks, and PR workflow, and
|
|
49
|
+
[Deploying](docs/deploying.md) the release and its verification. To add a building or improve one,
|
|
50
|
+
start with [Adding a building](docs/adding-a-building.md) or the
|
|
51
|
+
[fidelity queue](docs/building-fidelity.md). Coding agents follow [`AGENTS.md`](AGENTS.md).
|
|
52
|
+
|
|
53
|
+
All documentation is indexed in [`docs/`](docs/README.md).
|
package/docs/package.md
ADDED
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
# Using Skyline as a package
|
|
2
|
+
|
|
3
|
+
`@a2f0/skyline` provides the complete viewer and separate Three.js scene/building
|
|
4
|
+
modules. Package builds emit ordinary ESM JavaScript and TypeScript declarations;
|
|
5
|
+
consumers of the published package do not compile repository sources or run installation
|
|
6
|
+
scripts. Browser code and Node/Bun build helpers have separate entrypoints.
|
|
7
|
+
|
|
8
|
+
## Install from npm
|
|
9
|
+
|
|
10
|
+
```sh
|
|
11
|
+
bun add --exact @a2f0/skyline
|
|
12
|
+
# or
|
|
13
|
+
npm install --save-exact @a2f0/skyline
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
Every merge to `main` publishes a new version (see [Releases](#releases)), each with npm
|
|
17
|
+
provenance linking it to the commit and workflow run that built it.
|
|
18
|
+
|
|
19
|
+
## Build and pack
|
|
20
|
+
|
|
21
|
+
From this repository:
|
|
22
|
+
|
|
23
|
+
Use the pinned Bun version, Node.js 22+ (with npm), and Google Chrome for checks.
|
|
24
|
+
|
|
25
|
+
```sh
|
|
26
|
+
bun install --ignore-scripts
|
|
27
|
+
bun run check:package
|
|
28
|
+
bun pm pack --destination /tmp
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
`prepack` builds the package automatically. The result is
|
|
32
|
+
`/tmp/a2f0-skyline-<version>.tgz`, named for the version in `package.json`. To try it
|
|
33
|
+
before publishing, install that tarball in the consuming application:
|
|
34
|
+
|
|
35
|
+
```sh
|
|
36
|
+
bun add /tmp/a2f0-skyline-<version>.tgz
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
The tarball includes `lib/` (ESM and declarations), `site/` (the complete static
|
|
40
|
+
viewer), package documentation, and third-party notices. Sources, test fixtures,
|
|
41
|
+
credentials, deployment configuration, and the unused source photograph are
|
|
42
|
+
excluded. No viewer assets load from a CDN.
|
|
43
|
+
|
|
44
|
+
## Install from GitHub with Bun
|
|
45
|
+
|
|
46
|
+
GitHub dependencies contain repository sources, rather than the generated
|
|
47
|
+
`lib/` and `site/` directories in a published tarball. Pin a full commit SHA:
|
|
48
|
+
|
|
49
|
+
```sh
|
|
50
|
+
bun add github:a2f0/skyline#<full-commit-sha>
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
Build the installed source explicitly with your application's pinned Bun and
|
|
54
|
+
TypeScript tools. Add this root `package.json` script so fresh installs and CI
|
|
55
|
+
prepare the same artifacts:
|
|
56
|
+
|
|
57
|
+
```json
|
|
58
|
+
{
|
|
59
|
+
"scripts": {
|
|
60
|
+
"postinstall": "bun node_modules/@a2f0/skyline/scripts/build-package.ts"
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
The host needs TypeScript 7, `@tsconfig/strictest`, `@types/bun`, and `@types/node`
|
|
66
|
+
as development dependencies. The build resolves those tools from the host;
|
|
67
|
+
it does not install Skyline's development dependencies or run dependency
|
|
68
|
+
lifecycle scripts. Keep `trustedDependencies` unchanged. Run `bun install` after
|
|
69
|
+
adding the script. Both the published tarball and this GitHub build expose the
|
|
70
|
+
same entrypoints, declarations, and complete viewer assets.
|
|
71
|
+
|
|
72
|
+
## Copy the viewer assets
|
|
73
|
+
|
|
74
|
+
Import the build helper from a Node 22+ or Bun build script:
|
|
75
|
+
|
|
76
|
+
```ts
|
|
77
|
+
import { copySkylineAssets } from '@a2f0/skyline/build';
|
|
78
|
+
|
|
79
|
+
await copySkylineAssets('./public/skyline');
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
Serve that directory over HTTP at `/skyline/`, preserving all its relative paths.
|
|
83
|
+
The helper copies files into the supplied directory; it does not clear unrelated
|
|
84
|
+
files already there. Use a dedicated directory for these assets. All HTML, CSS,
|
|
85
|
+
SVGs, compiled browser modules, and the viewer's vendored Three.js travel together.
|
|
86
|
+
|
|
87
|
+
In `~/github/devopsrockstars`, the existing `packages/frontend/tooling/build.ts`
|
|
88
|
+
copies `packages/frontend/static` into its build. Its development server also
|
|
89
|
+
serves `/static/` directly. A later integration can call the helper with
|
|
90
|
+
`path.join(frontendRoot, 'static', 'skyline')` in both build and development startup,
|
|
91
|
+
then use `/static/skyline/` as the browser URL. Keep the generated directory out of
|
|
92
|
+
that application's Git history.
|
|
93
|
+
|
|
94
|
+
## Mount the complete viewer
|
|
95
|
+
|
|
96
|
+
```ts
|
|
97
|
+
import { mountSkyline } from '@a2f0/skyline';
|
|
98
|
+
|
|
99
|
+
const skyline = mountSkyline(container, {
|
|
100
|
+
assetsUrl: '/skyline/',
|
|
101
|
+
title: 'Interactive Chicago skyline',
|
|
102
|
+
});
|
|
103
|
+
|
|
104
|
+
// When the page or component leaves:
|
|
105
|
+
skyline.destroy();
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
The container determines the viewer's size and placement; give it an explicit
|
|
109
|
+
height. The viewer fills it through an iframe, which isolates its styles and
|
|
110
|
+
controls from the application's header and CSS. Embedding hides the standalone
|
|
111
|
+
toolbar and study links so they do not overlap the host's navigation. Set
|
|
112
|
+
`navigation: true` to show them. It retains stars, the traced
|
|
113
|
+
loading silhouette, star controls, original comparison, and building details.
|
|
114
|
+
A small independent **show original** button remains available until the first
|
|
115
|
+
3D frame succeeds, and reappears if the graphics context is lost. The SVG stays
|
|
116
|
+
reachable even if WebGL, the scene document, or its bootstrap script cannot load.
|
|
117
|
+
Unmounting removes the entire document, its event handlers, and its WebGL context.
|
|
118
|
+
Imports themselves do not access `window` or `document`, so server rendering and
|
|
119
|
+
lazy loading are safe. Asset URLs may be relative or absolute HTTP(S) directories.
|
|
120
|
+
|
|
121
|
+
For the existing React route in `devopsrockstars`, an effect owns this lifecycle:
|
|
122
|
+
|
|
123
|
+
```tsx
|
|
124
|
+
import React, { useEffect, useRef } from 'react';
|
|
125
|
+
import { mountSkyline } from '@a2f0/skyline';
|
|
126
|
+
|
|
127
|
+
export default function Skyline() {
|
|
128
|
+
const container = useRef<HTMLDivElement>(null);
|
|
129
|
+
useEffect(() => {
|
|
130
|
+
const skyline = mountSkyline(container.current!, {
|
|
131
|
+
assetsUrl: '/static/skyline/',
|
|
132
|
+
});
|
|
133
|
+
return () => skyline.destroy();
|
|
134
|
+
}, []);
|
|
135
|
+
|
|
136
|
+
return <div id="skyline" ref={container} style={{ width: '100%', height: '100vh' }} />;
|
|
137
|
+
}
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
Keep the host's header, footer, sizing, and stacking in that application. Importing
|
|
141
|
+
`@a2f0/skyline` loads only the small mounting helper; scene geometry loads inside
|
|
142
|
+
the viewer when it boots. The cleanup also supports React Strict Mode's remounts.
|
|
143
|
+
|
|
144
|
+
## Import a scene or a building
|
|
145
|
+
|
|
146
|
+
For an application that owns its own renderer, install `three` from the r186
|
|
147
|
+
series (`~0.186.0`). `devopsrockstars` already uses a compatible version. The
|
|
148
|
+
complete iframe viewer does not need this peer; scene/model imports do.
|
|
149
|
+
|
|
150
|
+
```ts
|
|
151
|
+
import { Group } from 'three';
|
|
152
|
+
import { createGeographicSkyline, skylineAzimuth } from '@a2f0/skyline/scene';
|
|
153
|
+
import { createCrainBuilding } from '@a2f0/skyline/models/crain-communications';
|
|
154
|
+
import type { BuildingModel, StudyView } from '@a2f0/skyline';
|
|
155
|
+
|
|
156
|
+
const skyline = createGeographicSkyline();
|
|
157
|
+
const group = new Group();
|
|
158
|
+
for (const model of skyline.models) group.add(model.building);
|
|
159
|
+
group.add(skyline.ground.group);
|
|
160
|
+
|
|
161
|
+
const crain: BuildingModel = createCrainBuilding();
|
|
162
|
+
const view: StudyView = skyline.drawingView;
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
The scene factory returns models, ground, camera/framing settings, drawing view,
|
|
166
|
+
comparison views, and labels. Importing a module does not construct the scene.
|
|
167
|
+
Create it when needed. Individual building modules remain available under
|
|
168
|
+
`@a2f0/skyline/models/<filename>`, without the `.js` extension. Their Three.js
|
|
169
|
+
objects use the consuming application's engine, so they can join its existing
|
|
170
|
+
scene without bundling a second engine. The caller owns rendering, controls,
|
|
171
|
+
resource disposal, and OpenStreetMap attribution in this mode.
|
|
172
|
+
|
|
173
|
+
The geographic Blue Cross model exposes an optional `illumination`
|
|
174
|
+
controller; no other model has one. Its read-only `presets` list gives the
|
|
175
|
+
supported IDs, labels, wording and adaptation flag. Call `set(id)` to replace
|
|
176
|
+
its message or `set(null)` to turn it off, then render your scene. An
|
|
177
|
+
unsupported ID throws without changing the current display. `active` reports
|
|
178
|
+
the selection and `litWindows` counts illuminated office panes. Each instance
|
|
179
|
+
has its own state. Use the model from `createGeographicSkyline()` or
|
|
180
|
+
`createGeographicBuilding()` for these displays.
|
|
181
|
+
|
|
182
|
+
`@a2f0/skyline/models/building-kit` exposes the same plan runs and mesh builder
|
|
183
|
+
used by this repository, for adding buildings. Coordinate and model assumptions
|
|
184
|
+
are in [the geography notes](skyline-geography.md). Asset paths are also available
|
|
185
|
+
through `@a2f0/skyline/assets/<path>` for build tooling that resolves package
|
|
186
|
+
files directly; bundlers do not automatically copy that directory.
|
|
187
|
+
|
|
188
|
+
## Releases
|
|
189
|
+
|
|
190
|
+
ship-pr bumps the `package.json` patch version on every merge (see
|
|
191
|
+
[the PR workflow](development.md#pr-workflow)), and the
|
|
192
|
+
[publish workflow](../.github/workflows/npm-publish.yml) publishes each version newer than
|
|
193
|
+
npm's `latest` with [trusted publishing](https://docs.npmjs.com/trusted-publishers) and
|
|
194
|
+
provenance. No npm token is stored: the publish job runs in the `npm` environment, which
|
|
195
|
+
only `main` can deploy to, and npm's trusted publisher names that environment and
|
|
196
|
+
`npm-publish.yml`. A deliberate major or minor bump in a PR is kept. Runs never overlap,
|
|
197
|
+
and when merges land together only the newest pending run starts, so intermediate
|
|
198
|
+
versions can be skipped on npm.
|
|
199
|
+
|
|
200
|
+
The workflow installs, typechecks, runs the package suite (`bun run check:package`) in the
|
|
201
|
+
runner's Google Chrome, and packs the tarball, all without publish rights; the publish job
|
|
202
|
+
receives only that tarball and runs `npm publish --ignore-scripts`. The merged commit has
|
|
203
|
+
already passed the full `bun run check`.
|
|
204
|
+
|
|
205
|
+
npm adds a trusted publisher only to a package that already exists, so the first version
|
|
206
|
+
is published by hand from an up-to-date `main`. Until then the workflow fails with that
|
|
207
|
+
instruction rather than attempting a publish npm would reject:
|
|
208
|
+
|
|
209
|
+
```sh
|
|
210
|
+
npm login
|
|
211
|
+
npm publish # prepublishOnly runs bun run check; prepack builds lib/ and site/
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
Then, in the package's settings on npmjs.com, add a GitHub Actions trusted publisher for
|
|
215
|
+
repository `a2f0/skyline`, workflow `npm-publish.yml`, and environment `npm`, and re-run
|
|
216
|
+
the workflow; it reports the version as already published.
|
|
217
|
+
|
|
218
|
+
The package is ESM only, with no CommonJS entrypoint. Building requires this repository's
|
|
219
|
+
Bun/TypeScript tools; consuming the published package requires neither Bun nor build
|
|
220
|
+
scripts. Metadata uses `UNLICENSED` and preserves the third-party notices in
|
|
221
|
+
[NOTICE.md](../NOTICE.md). The standalone site's `bun run build:site` and Cloudflare
|
|
222
|
+
deployment flow remain separate from packaging.
|