Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 62 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Deploy to GitHub Pages

# Publishes the same demo that `pnpm run dev` opens (index.html and demo/worldfile-fit.html).
on:
push:
branches:
- master
workflow_dispatch:

# Least privilege by default; only the deploy job gets the Pages token scopes.
permissions:
contents: read

concurrency:
group: pages
cancel-in-progress: false

jobs:
build:
name: Build demo site
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
- name: Install pnpm
uses: pnpm/action-setup@ea17c68df8912ef543352723c149a84f56e3d413 # v6.1.0
with:
version: 11.27.0
- name: Setup Node.js
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
with:
node-version: 24
cache: pnpm
# pnpm 11 reads allowBuilds only from pnpm-workspace.yaml, which is kept out of the
# repository root for local development (see the comment in ci/pnpm-workspace.ci.yaml).
- name: Use CI pnpm settings
run: cp ci/pnpm-workspace.ci.yaml pnpm-workspace.yaml
- name: Install dependencies
run: pnpm install --frozen-lockfile
# The demo imports src directly, so no package build is needed first.
- name: Build and verify demo site
run: pnpm run verify:demo
- name: Setup Pages
uses: actions/configure-pages@983d7736d9b0ae728b81ab479565c72886d7745b # v5
- name: Upload artifact
uses: actions/upload-pages-artifact@56afc609e74202658d3ffba0e8f6dda462b719fa # v3
with:
path: ./dist-demo

deploy:
name: Deploy to GitHub Pages
needs: build
runs-on: ubuntu-latest
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e # v4
34 changes: 31 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ on:
push:
pull_request:

# Daedalus は依存を 1 件も持たない(dependencies キー自体が無い)∴ 単体 checkout で完結する。
# 兄弟 checkout(m3-t1 設計 §6.4)は不要である。デモを持たないため deploy.yml も置かない
# (HR-m3-007 の「Pages にデプロイする設定〔あれば〕」の条件を満たさない。設計 K14)。
# Daedalus は依存を 1 件も持たない(dependencies キー自体が無い)∴ 単体 checkout で完結し、
# 兄弟リポジトリの checkout は不要である。デモ(index.html と demo/)は vite で作り、
# GitHub Pages への配備は deploy.yml が master への push で行う。ここではデモの build と
# Pages 用の成果物の形だけを検査する(verify:demo)。
jobs:
test:
name: Test
Expand All @@ -33,3 +34,30 @@ jobs:
run: pnpm run test:types
- name: Build package
run: pnpm run build
- name: Build and verify demo site
run: pnpm run verify:demo

# deploy.yml runs only on pushes to master, so its install path would otherwise be
# tried for the first time after merging. This job repeats the same steps (pnpm
# 11.27.0, Node.js 24, the CI pnpm settings and --frozen-lockfile) on every push
# and pull request, so a failing install shows up before the merge.
deploy-build:
name: Deploy build (same install as deploy.yml)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
- name: Install pnpm
uses: pnpm/action-setup@ea17c68df8912ef543352723c149a84f56e3d413 # v6.1.0
with:
version: 11.27.0
- name: Setup Node.js
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
with:
node-version: 24
cache: pnpm
- name: Use CI pnpm settings
run: cp ci/pnpm-workspace.ci.yaml pnpm-workspace.yaml
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Build and verify demo site
run: pnpm run verify:demo
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
node_modules/
dist/
*.tsbuildinfo
dist-demo/
10 changes: 10 additions & 0 deletions README.ja.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,16 @@

English README is [here](./README.md).

## デモ

デモは GitHub Pages で公開しています: <https://code4history.dev/Daedalus/>(当てはめのページは [`demo/worldfile-fit.html`](https://code4history.dev/Daedalus/demo/worldfile-fit.html))。`pnpm run dev` で同じページが手元で開きます。プリセットのボタンで、明確に違う結果になる GCP の組を切り替えられます。

- **モデル**: 回転と縮尺だけの地図は相似で当たり、同じ点に横方向の shear を加えると affine に切り替わります(F は臨界値を大きく超えます)。
- **点の数**: GCP 2 点は `preview`(仮の答え)、3 点は `adoptable` でも affine を評価せず、5 点で affine を評価して F の棒が出ます。
- **点の並び**: 一直線に近い組だけが `nearCollinearSource` を出し、affine を評価しません。
- **誤った点**: 1 点を約 75 m ずらしても品質の札は `adoptable` のままで、その点の長い残差の矢印と RMS でだけ見えます。品質の札は点の数で決まる判定で、誤差の大きさは見ません(デモでも札の横にそう書いています)。
- **点のドラッグ**: 点を手で動かすと、プリセットのボタンの押下が外れ、見え方の 1 行は「プリセットではない入力」の説明に替わります。

## 公開 API

```ts
Expand Down
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,16 @@

日本語のREADMEは[こちら](./README.ja.md)。

## Demo

The demo is published on GitHub Pages: <https://code4history.dev/Daedalus/> (the fitting page is [`demo/worldfile-fit.html`](https://code4history.dev/Daedalus/demo/worldfile-fit.html)). `pnpm run dev` opens the same pages locally. Preset buttons load GCP sets that produce clearly different results:

- **Model**: a map with rotation and scale only is fitted as a similarity; the same points with a horizontal shear switch to affine, with F far above its critical value.
- **Point count**: 2 GCPs give only a `preview` answer; 3 GCPs are `adoptable` but affine is not evaluated; with 5 GCPs affine is evaluated and the F bars appear.
- **Layout**: only the nearly collinear set warns `nearCollinearSource` and skips affine.
- **A wrong point**: moving one GCP by about 75 m keeps the quality gate at `adoptable`; only its long residual arrow and the RMS reveal it. The quality gate is decided by the number of points and does not look at the size of the errors, so the demo says so next to it.
- **Dragging a point**: once you move a point by hand, the preset button is released and the expectation line says the input is no longer a preset.

## Public API

```ts
Expand Down
17 changes: 17 additions & 0 deletions ci/pnpm-workspace.ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# CI-only pnpm settings. The workflows copy this file to pnpm-workspace.yaml right
# before `pnpm install --frozen-lockfile`.
#
# Why it is not committed as pnpm-workspace.yaml:
# pnpm 11 reads allowBuilds only from pnpm-workspace.yaml (not from .npmrc or the
# package.json "pnpm" field). A pnpm-workspace.yaml at the repository root would
# also make this directory a workspace root during local development, where the
# repository is used inside a larger workspace. CI clones the repository on its
# own, so the copy is harmless there.
#
# Where the list comes from: running `pnpm install --frozen-lockfile` with pnpm
# 11.27.0, CI=true, lifecycle scripts enabled and no node_modules fails with
# ERR_PNPM_IGNORED_BUILDS for the packages below (pnpm 11 sets strictDepBuilds
# to true by default). Re-measure the same way when dependencies change.

allowBuilds:
esbuild: true
Loading
Loading