@manakind/shiptight-ui 0.2.0 → 0.3.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.
- package/README.md +41 -3
- package/dist/chart-scene/chart-scene.css +46 -0
- package/dist/chart-scene/chart-scene.css.d.ts +2 -0
- package/dist/chart-scene/chart-scene.d.ts +75 -0
- package/dist/chart-scene/chart-scene.d.ts.map +1 -0
- package/dist/chart-scene/chart-scene.js +93 -0
- package/dist/chart-scene/chart-scene.js.map +1 -0
- package/dist/chart-scene/index.d.ts +3 -0
- package/dist/chart-scene/index.d.ts.map +1 -0
- package/dist/chart-scene/index.js +2 -0
- package/dist/chart-scene/index.js.map +1 -0
- package/dist/chart-scene/layout.d.ts +72 -0
- package/dist/chart-scene/layout.d.ts.map +1 -0
- package/dist/chart-scene/layout.js +120 -0
- package/dist/chart-scene/layout.js.map +1 -0
- package/dist/illustrations/anchor.d.ts +4 -0
- package/dist/illustrations/anchor.d.ts.map +1 -0
- package/dist/illustrations/anchor.js +6 -0
- package/dist/illustrations/anchor.js.map +1 -0
- package/dist/illustrations/chart.d.ts +4 -0
- package/dist/illustrations/chart.d.ts.map +1 -0
- package/dist/illustrations/chart.js +6 -0
- package/dist/illustrations/chart.js.map +1 -0
- package/dist/illustrations/course.d.ts +4 -0
- package/dist/illustrations/course.d.ts.map +1 -0
- package/dist/illustrations/course.js +6 -0
- package/dist/illustrations/course.js.map +1 -0
- package/dist/illustrations/day-sail.d.ts +4 -0
- package/dist/illustrations/day-sail.d.ts.map +1 -0
- package/dist/illustrations/day-sail.js +6 -0
- package/dist/illustrations/day-sail.js.map +1 -0
- package/dist/illustrations/fitting-out.d.ts +4 -0
- package/dist/illustrations/fitting-out.d.ts.map +1 -0
- package/dist/illustrations/fitting-out.js +6 -0
- package/dist/illustrations/fitting-out.js.map +1 -0
- package/dist/illustrations/frame.d.ts +12 -0
- package/dist/illustrations/frame.d.ts.map +1 -0
- package/dist/illustrations/frame.js +15 -0
- package/dist/illustrations/frame.js.map +1 -0
- package/dist/illustrations/half-hull.d.ts +4 -0
- package/dist/illustrations/half-hull.d.ts.map +1 -0
- package/dist/illustrations/half-hull.js +6 -0
- package/dist/illustrations/half-hull.js.map +1 -0
- package/dist/illustrations/index.d.ts +26 -0
- package/dist/illustrations/index.d.ts.map +1 -0
- package/dist/illustrations/index.js +39 -0
- package/dist/illustrations/index.js.map +1 -0
- package/dist/illustrations/keel.d.ts +4 -0
- package/dist/illustrations/keel.d.ts.map +1 -0
- package/dist/illustrations/keel.js +6 -0
- package/dist/illustrations/keel.js.map +1 -0
- package/dist/illustrations/landfall.d.ts +4 -0
- package/dist/illustrations/landfall.d.ts.map +1 -0
- package/dist/illustrations/landfall.js +6 -0
- package/dist/illustrations/landfall.js.map +1 -0
- package/dist/illustrations/lodestar.d.ts +4 -0
- package/dist/illustrations/lodestar.d.ts.map +1 -0
- package/dist/illustrations/lodestar.js +6 -0
- package/dist/illustrations/lodestar.js.map +1 -0
- package/dist/illustrations/log.d.ts +4 -0
- package/dist/illustrations/log.d.ts.map +1 -0
- package/dist/illustrations/log.js +6 -0
- package/dist/illustrations/log.js.map +1 -0
- package/dist/illustrations/paint.d.ts +10 -0
- package/dist/illustrations/paint.d.ts.map +1 -0
- package/dist/illustrations/paint.js +9 -0
- package/dist/illustrations/paint.js.map +1 -0
- package/dist/illustrations/passage-plan.d.ts +4 -0
- package/dist/illustrations/passage-plan.d.ts.map +1 -0
- package/dist/illustrations/passage-plan.js +6 -0
- package/dist/illustrations/passage-plan.js.map +1 -0
- package/dist/illustrations/passage.d.ts +4 -0
- package/dist/illustrations/passage.d.ts.map +1 -0
- package/dist/illustrations/passage.js +6 -0
- package/dist/illustrations/passage.js.map +1 -0
- package/dist/illustrations/scuttled.d.ts +4 -0
- package/dist/illustrations/scuttled.d.ts.map +1 -0
- package/dist/illustrations/scuttled.js +6 -0
- package/dist/illustrations/scuttled.js.map +1 -0
- package/dist/illustrations/sounding.d.ts +4 -0
- package/dist/illustrations/sounding.d.ts.map +1 -0
- package/dist/illustrations/sounding.js +6 -0
- package/dist/illustrations/sounding.js.map +1 -0
- package/dist/illustrations/voyage.d.ts +4 -0
- package/dist/illustrations/voyage.d.ts.map +1 -0
- package/dist/illustrations/voyage.js +6 -0
- package/dist/illustrations/voyage.js.map +1 -0
- package/dist/index.d.ts +7 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -3
- package/dist/index.js.map +1 -1
- package/dist/scene/geometry.d.ts +17 -0
- package/dist/scene/geometry.d.ts.map +1 -0
- package/dist/scene/geometry.js +37 -0
- package/dist/scene/geometry.js.map +1 -0
- package/dist/scene/scene.css +123 -0
- package/dist/scene/scene.css.d.ts +2 -0
- package/dist/scene/vessels.d.ts +14 -0
- package/dist/scene/vessels.d.ts.map +1 -0
- package/dist/scene/vessels.js +19 -0
- package/dist/scene/vessels.js.map +1 -0
- package/dist/voyage-scene/index.d.ts +3 -0
- package/dist/voyage-scene/index.d.ts.map +1 -0
- package/dist/voyage-scene/index.js +2 -0
- package/dist/voyage-scene/index.js.map +1 -0
- package/dist/voyage-scene/voyage-scene.css +11 -0
- package/dist/voyage-scene/voyage-scene.css.d.ts +2 -0
- package/dist/voyage-scene/voyage-scene.d.ts +57 -0
- package/dist/voyage-scene/voyage-scene.d.ts.map +1 -0
- package/dist/voyage-scene/voyage-scene.js +54 -0
- package/dist/voyage-scene/voyage-scene.js.map +1 -0
- package/package.json +34 -8
package/README.md
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
# `@manakind/shiptight-ui`
|
|
2
2
|
|
|
3
3
|
The ShipTight-flavored surface of the [Manakind](https://github.com/Humanity-Plus/Manakind)
|
|
4
|
-
design system.
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
design system. It re-exports the shared base components from `@manakind/ui-core`
|
|
5
|
+
and adds ShipTight's own: the Seaworthy vocabulary artwork and the scenes drawn
|
|
6
|
+
from it (`sti-` prefixed).
|
|
7
7
|
|
|
8
8
|
Pair it with `@manakind/shiptight-tokens`, whose `theme.css` resolves the
|
|
9
9
|
`--ds-*` contract into ShipTight's Chart paper and Night watch themes.
|
|
@@ -38,6 +38,44 @@ export function SetSail() {
|
|
|
38
38
|
}
|
|
39
39
|
```
|
|
40
40
|
|
|
41
|
+
## Exports
|
|
42
|
+
|
|
43
|
+
Everything is exported from the package root, `@manakind/shiptight-ui`.
|
|
44
|
+
|
|
45
|
+
| Export | What it is |
|
|
46
|
+
|---|---|
|
|
47
|
+
| Everything in `@manakind/ui-core` | The shared base components, including `Illustration` and `illustrationPaint` |
|
|
48
|
+
| `artwork`, `ArtworkTerm` | Every Seaworthy vocabulary drawing, keyed by term (`lodestar`, `landfall`, `passage`, `course`, `sounding`, `halfhull`, `keel`, `fittingout`, `plan`, `chart`, `voyage`, `daysail`, `log`, `anchor`, `scuttled`) |
|
|
49
|
+
| `LodestarArtwork`, `LandfallArtwork`, … `ScuttledArtwork` | The same drawings one by one, each an `IllustrationSource` |
|
|
50
|
+
| `ChartScene` | The Chart: Lodestar, Landfalls as islands, and each Passage as a route with its vessel and gates |
|
|
51
|
+
| `VoyageScene` | One voyage as a route from home port to its Landfall, stage by stage and gate by gate |
|
|
52
|
+
| `SceneVessel` | The vessel a scene draws: `voyage`, `daysail`, `anchor` or `wreck` |
|
|
53
|
+
|
|
54
|
+
Render a drawing through `Illustration`, never on its own:
|
|
55
|
+
|
|
56
|
+
```tsx
|
|
57
|
+
import { artwork, Illustration } from '@manakind/shiptight-ui';
|
|
58
|
+
|
|
59
|
+
<Illustration source={artwork.landfall} decorative />
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
The scenes take plain props (titles, positions from 0 to 1, counts), never
|
|
63
|
+
records from the app's data layer: map your records into props. A scene is
|
|
64
|
+
never the only representation of what it shows. Render the same passages,
|
|
65
|
+
stages and gates as text beside it, and give it a `title` that summarises the
|
|
66
|
+
state. `ChartScene` draws each vessel as a link through your router:
|
|
67
|
+
|
|
68
|
+
```tsx
|
|
69
|
+
<ChartScene
|
|
70
|
+
title="The Chart: 6 Passages toward 3 Landfalls"
|
|
71
|
+
landfalls={landfalls}
|
|
72
|
+
passages={passages}
|
|
73
|
+
renderLink={(passageId, link) => (
|
|
74
|
+
<Link to="/passages/$passageId" params={{ passageId }} {...link} />
|
|
75
|
+
)}
|
|
76
|
+
/>
|
|
77
|
+
```
|
|
78
|
+
|
|
41
79
|
## License
|
|
42
80
|
|
|
43
81
|
MIT — see [LICENSE](./LICENSE).
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
@layer components {
|
|
2
|
+
.sti-chart-scene__star {
|
|
3
|
+
fill: var(--component-scene-star-bg);
|
|
4
|
+
stroke: var(--component-scene-text);
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.sti-chart-scene__lighthouse {
|
|
8
|
+
fill: var(--semantic-color-surface-raised);
|
|
9
|
+
stroke: var(--component-scene-text);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.sti-chart-scene__beam {
|
|
13
|
+
fill: none;
|
|
14
|
+
stroke: var(--component-scene-star-bg);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.sti-chart-scene__compass {
|
|
18
|
+
fill: none;
|
|
19
|
+
stroke: var(--component-scene-line-color);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.sti-chart-scene__compass-north {
|
|
23
|
+
fill: var(--semantic-color-line-accent);
|
|
24
|
+
stroke: none;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/* A patch of clear sea under each vessel, and its focus and hover ring. */
|
|
28
|
+
.sti-chart-scene__halo {
|
|
29
|
+
fill: var(--component-scene-bg);
|
|
30
|
+
stroke: none;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.sti-chart-scene__vessel {
|
|
34
|
+
cursor: pointer;
|
|
35
|
+
|
|
36
|
+
& :focus-visible {
|
|
37
|
+
outline: none;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
& :focus-visible .sti-chart-scene__halo,
|
|
41
|
+
& :hover .sti-chart-scene__halo {
|
|
42
|
+
fill: var(--semantic-color-fill-accent);
|
|
43
|
+
stroke: var(--semantic-color-focus-ring);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
import '../scene/scene.css';
|
|
3
|
+
import { type SceneVessel } from '../scene/vessels';
|
|
4
|
+
import './chart-scene.css';
|
|
5
|
+
export interface ChartSceneGate {
|
|
6
|
+
/** Where the gate sits along the route, 0 (home port) to 1 (the Landfall). */
|
|
7
|
+
at: number;
|
|
8
|
+
/** Opened gates are drawn filled, closed ones hollow. */
|
|
9
|
+
opened: boolean;
|
|
10
|
+
}
|
|
11
|
+
export interface ChartSceneLandfall {
|
|
12
|
+
id: string;
|
|
13
|
+
/** Shown above the island; wrapped to two lines, the rest elided. */
|
|
14
|
+
title: string;
|
|
15
|
+
}
|
|
16
|
+
export interface ChartScenePassage {
|
|
17
|
+
id: string;
|
|
18
|
+
/** Short label drawn beside the vessel, e.g. the passage's identifier. */
|
|
19
|
+
label: string;
|
|
20
|
+
/** Full name, used for the vessel link's accessible name. */
|
|
21
|
+
name: string;
|
|
22
|
+
/** The Landfall this passage sails for. A passage whose Landfall is absent is not drawn. */
|
|
23
|
+
landfallId: string;
|
|
24
|
+
/** Where the vessel is along its route, 0 (home port) to 1 (arrived). */
|
|
25
|
+
progress: number;
|
|
26
|
+
/** The gates along the route. */
|
|
27
|
+
gates: readonly ChartSceneGate[];
|
|
28
|
+
/** The vessel drawn at `progress`. A wreck's route has no leg ahead. */
|
|
29
|
+
vessel: SceneVessel;
|
|
30
|
+
/** Draws the route receded, for a passage that is paused or given up. */
|
|
31
|
+
faded?: boolean;
|
|
32
|
+
}
|
|
33
|
+
/** What `renderLink` must spread onto the link it returns. */
|
|
34
|
+
export interface ChartSceneLinkProps {
|
|
35
|
+
'aria-label': string;
|
|
36
|
+
children: ReactNode;
|
|
37
|
+
}
|
|
38
|
+
export interface ChartSceneProps {
|
|
39
|
+
/** The scene's accessible name, summarising what it shows. */
|
|
40
|
+
title: string;
|
|
41
|
+
/** An optional longer summary, exposed as the scene's accessible description. */
|
|
42
|
+
description?: string;
|
|
43
|
+
/** The star the whole chart steers by, drawn above the horizon. */
|
|
44
|
+
lodestar?: {
|
|
45
|
+
title: string;
|
|
46
|
+
kicker: string;
|
|
47
|
+
};
|
|
48
|
+
/** One island per Landfall, left to right. Up to five fit. */
|
|
49
|
+
landfalls: readonly ChartSceneLandfall[];
|
|
50
|
+
/** One route and vessel per passage. Up to four per Landfall fit side by side. */
|
|
51
|
+
passages: readonly ChartScenePassage[];
|
|
52
|
+
/**
|
|
53
|
+
* Renders the link each vessel opens, so the host supplies its own router
|
|
54
|
+
* link. Spread `link` onto it: `(id, link) => <Link to={…} {...link} />`.
|
|
55
|
+
* Inside an SVG the host's `<a>` renders as an SVG link.
|
|
56
|
+
*/
|
|
57
|
+
renderLink: (passageId: string, link: ChartSceneLinkProps) => ReactNode;
|
|
58
|
+
/** Extra class names on the root `<svg>`. */
|
|
59
|
+
className?: string;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* The Chart: a product's strategy drawn as a sea chart. The Lodestar sits
|
|
63
|
+
* above the horizon, each Landfall is an island, and each Passage is a route
|
|
64
|
+
* from the home coast with its vessel at the current position and its gates
|
|
65
|
+
* along the way.
|
|
66
|
+
*
|
|
67
|
+
* The scene is never the only representation of what it shows. The host must
|
|
68
|
+
* render the same passages as text (a list or table) beside it, and pass a
|
|
69
|
+
* `title` that summarises the state. Each vessel is a real link, supplied by
|
|
70
|
+
* `renderLink`, reachable by keyboard and ringed by a halo when focused; the
|
|
71
|
+
* rest of the drawing is hidden from assistive technology. Vessels under way
|
|
72
|
+
* bob gently, and stop under `prefers-reduced-motion`.
|
|
73
|
+
*/
|
|
74
|
+
export declare function ChartScene({ title, description, lodestar, landfalls, passages, renderLink, className, }: ChartSceneProps): import("react/jsx-runtime").JSX.Element;
|
|
75
|
+
//# sourceMappingURL=chart-scene.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chart-scene.d.ts","sourceRoot":"","sources":["../../src/chart-scene/chart-scene.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,SAAS,EAAS,MAAM,OAAO,CAAC;AAE9C,OAAO,oBAAoB,CAAC;AAC5B,OAAO,EAA0B,KAAK,WAAW,EAAkB,MAAM,kBAAkB,CAAC;AAC5F,OAAO,mBAAmB,CAAC;AAY3B,MAAM,WAAW,cAAc;IAC7B,8EAA8E;IAC9E,EAAE,EAAE,MAAM,CAAC;IACX,yDAAyD;IACzD,MAAM,EAAE,OAAO,CAAC;CACjB;AAED,MAAM,WAAW,kBAAkB;IACjC,EAAE,EAAE,MAAM,CAAC;IACX,qEAAqE;IACrE,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,iBAAiB;IAChC,EAAE,EAAE,MAAM,CAAC;IACX,0EAA0E;IAC1E,KAAK,EAAE,MAAM,CAAC;IACd,6DAA6D;IAC7D,IAAI,EAAE,MAAM,CAAC;IACb,4FAA4F;IAC5F,UAAU,EAAE,MAAM,CAAC;IACnB,yEAAyE;IACzE,QAAQ,EAAE,MAAM,CAAC;IACjB,iCAAiC;IACjC,KAAK,EAAE,SAAS,cAAc,EAAE,CAAC;IACjC,wEAAwE;IACxE,MAAM,EAAE,WAAW,CAAC;IACpB,yEAAyE;IACzE,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED,8DAA8D;AAC9D,MAAM,WAAW,mBAAmB;IAClC,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED,MAAM,WAAW,eAAe;IAC9B,8DAA8D;IAC9D,KAAK,EAAE,MAAM,CAAC;IACd,iFAAiF;IACjF,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,mEAAmE;IACnE,QAAQ,CAAC,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;IAC7C,8DAA8D;IAC9D,SAAS,EAAE,SAAS,kBAAkB,EAAE,CAAC;IACzC,kFAAkF;IAClF,QAAQ,EAAE,SAAS,iBAAiB,EAAE,CAAC;IACvC;;;;OAIG;IACH,UAAU,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,mBAAmB,KAAK,SAAS,CAAC;IACxE,6CAA6C;IAC7C,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAeD;;;;;;;;;;;;GAYG;AACH,wBAAgB,UAAU,CAAC,EACzB,KAAK,EACL,WAAW,EACX,QAAQ,EACR,SAAS,EACT,QAAQ,EACR,UAAU,EACV,SAAS,GACV,EAAE,eAAe,2CA0CjB"}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { cx, Illustration } from '@manakind/ui-core';
|
|
3
|
+
import { useId } from 'react';
|
|
4
|
+
import { pathOf, pointAt, split } from '../scene/geometry';
|
|
5
|
+
import '../scene/scene.css';
|
|
6
|
+
import { gatesDrawn, isUnderWay, VESSEL_ARTWORK } from '../scene/vessels';
|
|
7
|
+
import './chart-scene.css';
|
|
8
|
+
import { CHART, ISLAND_OUTLINE, ISLAND_PEAK, ISLAND_TREES, layoutIslands, plotRoutes, } from './layout';
|
|
9
|
+
const VESSEL_SIZE = 38;
|
|
10
|
+
const DAYSAIL_SIZE = 30;
|
|
11
|
+
const ROUTE_WEIGHT = 2.25;
|
|
12
|
+
const DAYSAIL_WEIGHT = 1.5;
|
|
13
|
+
const FLAG_POLE = 30;
|
|
14
|
+
const LANDFALL_KICKER = 'Landfall · Outcome';
|
|
15
|
+
const HOME_PORT = 'Home port · where every Passage starts';
|
|
16
|
+
const NO_LANDFALLS = 'No Landfalls charted yet';
|
|
17
|
+
const NO_PASSAGES = 'No Passages plotted yet';
|
|
18
|
+
// Text sizes and stroke weights are in the chart's user units: they scale
|
|
19
|
+
// with the scene, so they are part of the drawing, not type or space tokens.
|
|
20
|
+
/**
|
|
21
|
+
* The Chart: a product's strategy drawn as a sea chart. The Lodestar sits
|
|
22
|
+
* above the horizon, each Landfall is an island, and each Passage is a route
|
|
23
|
+
* from the home coast with its vessel at the current position and its gates
|
|
24
|
+
* along the way.
|
|
25
|
+
*
|
|
26
|
+
* The scene is never the only representation of what it shows. The host must
|
|
27
|
+
* render the same passages as text (a list or table) beside it, and pass a
|
|
28
|
+
* `title` that summarises the state. Each vessel is a real link, supplied by
|
|
29
|
+
* `renderLink`, reachable by keyboard and ringed by a halo when focused; the
|
|
30
|
+
* rest of the drawing is hidden from assistive technology. Vessels under way
|
|
31
|
+
* bob gently, and stop under `prefers-reduced-motion`.
|
|
32
|
+
*/
|
|
33
|
+
export function ChartScene({ title, description, lodestar, landfalls, passages, renderLink, className, }) {
|
|
34
|
+
const titleId = useId();
|
|
35
|
+
const descriptionId = useId();
|
|
36
|
+
const islands = layoutIslands(landfalls);
|
|
37
|
+
const routes = plotRoutes(passages, islands);
|
|
38
|
+
const emptyCaption = islands.length === 0 ? NO_LANDFALLS : routes.length === 0 ? NO_PASSAGES : null;
|
|
39
|
+
// The hidden layer is a nested <svg> rather than a <g>: it shares the root's
|
|
40
|
+
// coordinates, and Biome's a11y rules treat every other SVG element as
|
|
41
|
+
// focusable, so they reject aria-hidden on a <g>.
|
|
42
|
+
return (_jsxs("svg", { viewBox: `0 0 ${CHART.width} ${CHART.height}`, className: cx('sti-scene', 'sti-chart-scene', className), "aria-labelledby": titleId, "aria-describedby": description ? descriptionId : undefined, children: [_jsx("title", { id: titleId, children: title }), description && _jsx("desc", { id: descriptionId, children: description }), _jsxs("svg", { "aria-hidden": "true", children: [_jsx(Grid, {}), _jsx(Contours, {}), _jsx(Horizon, { lodestar: lodestar }), islands.map((island) => (_jsx(Island, { island: island }, island.id))), _jsx(HomeCoast, {}), _jsx(Compass, {}), emptyCaption && _jsx(EmptyCaption, { text: emptyCaption }), routes.map((route) => (_jsx(RouteLine, { route: route }, route.passage.id))), routes.map((route) => (_jsx(Gates, { route: route }, route.passage.id)))] }), routes.map((route) => (_jsx(Vessel, { route: route, renderLink: renderLink }, route.passage.id)))] }));
|
|
43
|
+
}
|
|
44
|
+
function Grid() {
|
|
45
|
+
const columns = Array.from({ length: CHART.width / 100 - 1 }, (_, i) => (i + 1) * 100);
|
|
46
|
+
const rows = Array.from({ length: Math.floor(CHART.height / 100) }, (_, i) => (i + 1) * 100);
|
|
47
|
+
return (_jsxs("g", { className: "sti-scene__grid", strokeWidth: 1, children: [columns.map((x) => (_jsx("path", { d: `M${x} 0 V${CHART.height}` }, `x${x}`))), rows.map((y) => (_jsx("path", { d: `M0 ${y} H${CHART.width}` }, `y${y}`)))] }));
|
|
48
|
+
}
|
|
49
|
+
function Contours() {
|
|
50
|
+
return (_jsxs("g", { className: "sti-scene__contour", strokeWidth: 1, children: [_jsx("path", { d: "M0 340 C200 320 320 360 520 336 S880 300 1200 330" }), _jsx("path", { d: "M0 470 C180 450 360 500 600 470 S960 430 1200 462", strokeDasharray: "2 6" }), _jsx("path", { d: "M0 600 C240 590 420 620 640 604 S1000 580 1200 598" })] }));
|
|
51
|
+
}
|
|
52
|
+
function Horizon({ lodestar }) {
|
|
53
|
+
return (_jsxs("g", { children: [_jsx("path", { className: "sti-scene__line", d: `M0 ${CHART.horizon} H${CHART.width}` }), lodestar && (_jsxs(_Fragment, { children: [_jsx("path", { className: "sti-chart-scene__star", strokeWidth: 1, transform: "translate(400 50)", d: "M0 -26 L6 -6 L26 0 L6 6 L0 26 L-6 6 L-26 0 L-6 -6 Z" }), _jsx("text", { x: 444, y: 40, fontSize: 11, className: "sti-scene__label sti-scene__label--muted", children: lodestar.kicker }), _jsx("text", { x: 444, y: 66, fontSize: 18, className: "sti-scene__name", children: lodestar.title })] }))] }));
|
|
54
|
+
}
|
|
55
|
+
function Island({ island }) {
|
|
56
|
+
const { cx: x, sx, sy } = island;
|
|
57
|
+
const place = `translate(${x} ${CHART.shore}) scale(${sx} ${sy})`;
|
|
58
|
+
const flag = { x: x + ISLAND_PEAK.x * sx, y: CHART.shore + ISLAND_PEAK.y * sy };
|
|
59
|
+
const trees = ISLAND_TREES.map((t) => `M${t.x} ${t.y - 12} L${t.x + 5} ${t.y} L${t.x - 5} ${t.y} Z M${t.x} ${t.y} V${t.y + 3}`).join(' ');
|
|
60
|
+
return (_jsxs("g", { children: [_jsx("path", { className: "sti-scene__contour", transform: `translate(${x} ${CHART.shore + 8}) scale(${sx * 1.1} ${sy * 0.35})`, strokeDasharray: "3 5", vectorEffect: "non-scaling-stroke", d: ISLAND_OUTLINE }), _jsx("path", { className: "sti-scene__land", transform: place, strokeWidth: 1.5, vectorEffect: "non-scaling-stroke", d: ISLAND_OUTLINE }), _jsx("path", { className: "sti-scene__coastline", transform: place, vectorEffect: "non-scaling-stroke", d: trees }), _jsx("path", { className: "sti-scene__ink", d: `M${flag.x} ${flag.y} V${flag.y - FLAG_POLE}` }), _jsx("path", { className: "sti-scene__flag", d: `M${flag.x} ${flag.y - FLAG_POLE} L${flag.x + 20} ${flag.y - FLAG_POLE + 7} L${flag.x} ${flag.y - FLAG_POLE + 14} Z` }), _jsx("text", { x: x, y: 122, fontSize: 11, textAnchor: "middle", className: "sti-scene__label sti-scene__label--muted", children: LANDFALL_KICKER }), island.titleLines.map((line, i) => (_jsx("text", { x: x, y: 146 + i * (island.titleSize + 2), fontSize: island.titleSize, textAnchor: "middle", className: "sti-scene__name", children: line }, line)))] }));
|
|
61
|
+
}
|
|
62
|
+
function HomeCoast() {
|
|
63
|
+
const y = CHART.coast;
|
|
64
|
+
return (_jsxs("g", { children: [_jsx("path", { className: "sti-scene__land", strokeWidth: 1.5, d: `M0 ${y + 6} C200 ${y - 8} 400 ${y + 10} 600 ${y + 2} S1000 ${y - 6} ${CHART.width} ${y + 8} V${CHART.height} H0 Z` }), _jsxs("g", { transform: `translate(1110 ${y + 8})`, children: [_jsx("path", { className: "sti-chart-scene__lighthouse", d: "M-7 0 L-4 -30 H4 L7 0 Z" }), _jsx("path", { className: "sti-chart-scene__star", d: "M-6 -36 H6 V-30 H-6 Z" }), _jsx("path", { className: "sti-chart-scene__beam", d: "M-14 -34 H-22 M14 -34 H22" })] }), _jsx("text", { x: CHART.width / 2, y: y + 44, fontSize: 11, textAnchor: "middle", className: "sti-scene__label", children: HOME_PORT })] }));
|
|
65
|
+
}
|
|
66
|
+
function Compass() {
|
|
67
|
+
return (_jsxs("g", { transform: "translate(96 560)", className: "sti-chart-scene__compass", children: [_jsx("circle", { r: 46 }), _jsx("circle", { r: 36, strokeDasharray: "1 4" }), _jsx("path", { className: "sti-chart-scene__compass-north", d: "M0 -52 L7 -7 L0 0 L-7 -7 Z" }), _jsx("path", { d: "M0 52 L7 7 L0 0 L-7 7 Z" }), _jsx("path", { d: "M-52 0 L-7 -7 L0 0 L-7 7 Z" }), _jsx("path", { d: "M52 0 L7 -7 L0 0 L7 7 Z" }), _jsx("text", { y: -58, fontSize: 11, textAnchor: "middle", className: "sti-scene__label", children: "N" })] }));
|
|
68
|
+
}
|
|
69
|
+
function EmptyCaption({ text }) {
|
|
70
|
+
return (_jsx("text", { x: CHART.width / 2, y: 420, fontSize: 20, textAnchor: "middle", className: "sti-scene__name sti-scene__name--muted", children: text }));
|
|
71
|
+
}
|
|
72
|
+
function RouteLine({ route }) {
|
|
73
|
+
const { passage, curve } = route;
|
|
74
|
+
const [sailed, ahead] = split(curve, passage.progress);
|
|
75
|
+
const weight = passage.vessel === 'daysail' ? DAYSAIL_WEIGHT : ROUTE_WEIGHT;
|
|
76
|
+
return (_jsxs("g", { className: cx(passage.faded && 'sti-scene__faded'), children: [passage.progress > 0 && (_jsx("path", { className: "sti-scene__sailed", d: pathOf(sailed), strokeWidth: weight })), passage.progress < 1 && passage.vessel !== 'wreck' && (_jsx("path", { className: "sti-scene__ahead", d: pathOf(ahead), strokeWidth: weight * 0.8, strokeDasharray: "5 6" }))] }));
|
|
77
|
+
}
|
|
78
|
+
function Gates({ route }) {
|
|
79
|
+
return (_jsx("g", { className: cx(route.passage.faded && 'sti-scene__faded'), children: gatesDrawn(route.passage.vessel, route.passage.gates).map((gate) => {
|
|
80
|
+
const at = pointAt(route.curve, gate.at);
|
|
81
|
+
return (_jsx("circle", { className: cx('sti-scene__gate', gate.opened && 'sti-scene__gate--opened'), cx: at.x, cy: at.y, r: 4, strokeWidth: 1.2 }, gate.at));
|
|
82
|
+
}) }));
|
|
83
|
+
}
|
|
84
|
+
function Vessel({ route, renderLink, }) {
|
|
85
|
+
const { passage, curve, vesselScale } = route;
|
|
86
|
+
const at = pointAt(curve, passage.progress);
|
|
87
|
+
const size = (passage.vessel === 'daysail' ? DAYSAIL_SIZE : VESSEL_SIZE) * vesselScale;
|
|
88
|
+
return (_jsx("g", { className: "sti-chart-scene__vessel", "data-vessel": passage.vessel, children: renderLink(passage.id, {
|
|
89
|
+
'aria-label': `${passage.label}: ${passage.name}`,
|
|
90
|
+
children: (_jsxs(_Fragment, { children: [_jsx("circle", { className: "sti-chart-scene__halo", cx: at.x, cy: at.y, r: size / 2 + 6, strokeWidth: 2 }), _jsx("g", { className: cx(isUnderWay(passage.vessel, passage.progress) && 'sti-scene__bob'), children: _jsx(Illustration, { source: VESSEL_ARTWORK[passage.vessel], at: { x: at.x - size / 2, y: at.y - size / 2, size }, decorative: true }) }), _jsx("text", { x: at.x, y: at.y + size / 2 + 14, fontSize: 10, textAnchor: "middle", paintOrder: "stroke", strokeWidth: 3, className: "sti-scene__label sti-scene__label--haloed", children: passage.label })] })),
|
|
91
|
+
}) }));
|
|
92
|
+
}
|
|
93
|
+
//# sourceMappingURL=chart-scene.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chart-scene.js","sourceRoot":"","sources":["../../src/chart-scene/chart-scene.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,EA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+1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/chart-scene/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,cAAc,EACd,kBAAkB,EAClB,mBAAmB,EACnB,iBAAiB,EACjB,eAAe,GAChB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/chart-scene/index.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import type { Cubic } from '../scene/geometry';
|
|
2
|
+
/** The Chart's frame, in user units. Everything below is placed on it. */
|
|
3
|
+
export declare const CHART: {
|
|
4
|
+
readonly width: 1200;
|
|
5
|
+
readonly height: 760;
|
|
6
|
+
readonly horizon: 96;
|
|
7
|
+
/** The shoreline every island stands on. */
|
|
8
|
+
readonly shore: 270;
|
|
9
|
+
/** The home coast every route leaves from. */
|
|
10
|
+
readonly coast: 690;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* One hand-drawn coastline, a low shelf rising to a single hill, varied per
|
|
14
|
+
* island by mirroring and stretching so neighbours don't read as copies.
|
|
15
|
+
*/
|
|
16
|
+
export declare const ISLAND_OUTLINE = "M-130 0 C-118 -6 -100 -10 -80 -12 C-60 -14 -44 -24 -26 -42 C-12 -56 10 -58 22 -46 C34 -34 46 -20 70 -14 C94 -9 116 -6 130 0 Z";
|
|
17
|
+
export declare const ISLAND_PEAK: {
|
|
18
|
+
x: number;
|
|
19
|
+
y: number;
|
|
20
|
+
};
|
|
21
|
+
export declare const ISLAND_TREES: readonly [{
|
|
22
|
+
readonly x: -58;
|
|
23
|
+
readonly y: -18;
|
|
24
|
+
}, {
|
|
25
|
+
readonly x: -44;
|
|
26
|
+
readonly y: -26;
|
|
27
|
+
}, {
|
|
28
|
+
readonly x: 44;
|
|
29
|
+
readonly y: -22;
|
|
30
|
+
}];
|
|
31
|
+
export interface IslandLayout {
|
|
32
|
+
id: string;
|
|
33
|
+
/** Centre of the island on the shoreline. */
|
|
34
|
+
cx: number;
|
|
35
|
+
/** Horizontal and vertical scale, including the variant's mirroring. */
|
|
36
|
+
sx: number;
|
|
37
|
+
sy: number;
|
|
38
|
+
/** The title, wrapped to at most two lines. */
|
|
39
|
+
titleLines: string[];
|
|
40
|
+
titleSize: number;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Islands spread evenly across the chart. Three sit where the prototype put
|
|
44
|
+
* them; more close up and shrink, so five still clear each other.
|
|
45
|
+
*/
|
|
46
|
+
export declare function layoutIslands(landfalls: readonly {
|
|
47
|
+
id: string;
|
|
48
|
+
title: string;
|
|
49
|
+
}[]): IslandLayout[];
|
|
50
|
+
/**
|
|
51
|
+
* Greedy word wrap to `maxLines`, ending in an ellipsis when the title is
|
|
52
|
+
* longer. The full title is always in the scene's text equivalent.
|
|
53
|
+
*/
|
|
54
|
+
export declare function wrapTitle(title: string, maxChars: number, maxLines?: number): string[];
|
|
55
|
+
export interface Route<P> {
|
|
56
|
+
passage: P;
|
|
57
|
+
curve: Cubic;
|
|
58
|
+
/** How much of a vessel's full size it is drawn at. */
|
|
59
|
+
vesselScale: number;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Routes run from the home coast to their Landfall's shore in a gentle S.
|
|
63
|
+
*
|
|
64
|
+
* Each Landfall's passages land side by side on its shore, and departures
|
|
65
|
+
* spread along the home coast in the order of those landings, so no two
|
|
66
|
+
* routes leave from the same point and no two cross near the coast. A
|
|
67
|
+
* passage whose Landfall is not on the chart is not drawn.
|
|
68
|
+
*/
|
|
69
|
+
export declare function plotRoutes<P extends {
|
|
70
|
+
landfallId: string;
|
|
71
|
+
}>(passages: readonly P[], islands: readonly IslandLayout[]): Route<P>[];
|
|
72
|
+
//# sourceMappingURL=layout.d.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S,YAAY,EAAE,GAC/B,KAAK,CAAC,CAAC,CAAC,EAAE,CA4BZ"}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
/** The Chart's frame, in user units. Everything below is placed on it. */
|
|
2
|
+
export const CHART = {
|
|
3
|
+
width: 1200,
|
|
4
|
+
height: 760,
|
|
5
|
+
horizon: 96,
|
|
6
|
+
/** The shoreline every island stands on. */
|
|
7
|
+
shore: 270,
|
|
8
|
+
/** The home coast every route leaves from. */
|
|
9
|
+
coast: 690,
|
|
10
|
+
};
|
|
11
|
+
const ISLAND_SPAN = 1110;
|
|
12
|
+
const MAX_ISLAND_SPACING = 370;
|
|
13
|
+
/** An island's widest outline (its mirrored, widened variant), at scale 1. */
|
|
14
|
+
const ISLAND_WIDTH = 300;
|
|
15
|
+
const MAX_END_STEP = 64;
|
|
16
|
+
const ROUTE_SWAY = 70;
|
|
17
|
+
const DEPARTURES = { left: 170, right: 1030 };
|
|
18
|
+
/** Below this gap between departures, vessels shrink so neighbours don't touch. */
|
|
19
|
+
const COMFORTABLE_GAP = 60;
|
|
20
|
+
const MIN_VESSEL_SCALE = 0.7;
|
|
21
|
+
/**
|
|
22
|
+
* One hand-drawn coastline, a low shelf rising to a single hill, varied per
|
|
23
|
+
* island by mirroring and stretching so neighbours don't read as copies.
|
|
24
|
+
*/
|
|
25
|
+
export const ISLAND_OUTLINE = 'M-130 0 C-118 -6 -100 -10 -80 -12 C-60 -14 -44 -24 -26 -42 C-12 -56 10 -58 22 -46 C34 -34 46 -20 70 -14 C94 -9 116 -6 130 0 Z';
|
|
26
|
+
export const ISLAND_PEAK = { x: 0, y: -56 };
|
|
27
|
+
export const ISLAND_TREES = [
|
|
28
|
+
{ x: -58, y: -18 },
|
|
29
|
+
{ x: -44, y: -26 },
|
|
30
|
+
{ x: 44, y: -22 },
|
|
31
|
+
];
|
|
32
|
+
const ISLAND_VARIANTS = [
|
|
33
|
+
{ sx: 1, sy: 1 },
|
|
34
|
+
{ sx: -1.08, sy: 0.9 },
|
|
35
|
+
{ sx: 0.92, sy: 1.1 },
|
|
36
|
+
];
|
|
37
|
+
/**
|
|
38
|
+
* Islands spread evenly across the chart. Three sit where the prototype put
|
|
39
|
+
* them; more close up and shrink, so five still clear each other.
|
|
40
|
+
*/
|
|
41
|
+
export function layoutIslands(landfalls) {
|
|
42
|
+
const count = landfalls.length;
|
|
43
|
+
const spacing = Math.min(MAX_ISLAND_SPACING, ISLAND_SPAN / Math.max(count, 1));
|
|
44
|
+
const scale = Math.min(1, spacing / ISLAND_WIDTH);
|
|
45
|
+
const titleSize = spacing >= ISLAND_WIDTH ? 19 : 16;
|
|
46
|
+
// Italic serif runs about half an em per character.
|
|
47
|
+
const maxChars = Math.floor((spacing * 0.9) / (titleSize * 0.5));
|
|
48
|
+
return landfalls.map((landfall, i) => {
|
|
49
|
+
const variant = ISLAND_VARIANTS[i % ISLAND_VARIANTS.length];
|
|
50
|
+
return {
|
|
51
|
+
id: landfall.id,
|
|
52
|
+
cx: CHART.width / 2 + (i - (count - 1) / 2) * spacing,
|
|
53
|
+
sx: variant.sx * scale,
|
|
54
|
+
sy: variant.sy * scale,
|
|
55
|
+
titleLines: wrapTitle(landfall.title, maxChars),
|
|
56
|
+
titleSize,
|
|
57
|
+
};
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Greedy word wrap to `maxLines`, ending in an ellipsis when the title is
|
|
62
|
+
* longer. The full title is always in the scene's text equivalent.
|
|
63
|
+
*/
|
|
64
|
+
export function wrapTitle(title, maxChars, maxLines = 2) {
|
|
65
|
+
const fit = (line) => (line.length > maxChars ? `${line.slice(0, maxChars - 1)}…` : line);
|
|
66
|
+
const lines = [];
|
|
67
|
+
let current = '';
|
|
68
|
+
for (const word of title.trim().split(/\s+/)) {
|
|
69
|
+
const next = current ? `${current} ${word}` : word;
|
|
70
|
+
if (next.length <= maxChars || !current) {
|
|
71
|
+
current = next;
|
|
72
|
+
continue;
|
|
73
|
+
}
|
|
74
|
+
lines.push(current);
|
|
75
|
+
current = word;
|
|
76
|
+
}
|
|
77
|
+
if (current)
|
|
78
|
+
lines.push(current);
|
|
79
|
+
if (lines.length <= maxLines)
|
|
80
|
+
return lines.map(fit);
|
|
81
|
+
const kept = lines.slice(0, maxLines);
|
|
82
|
+
kept[maxLines - 1] = `${kept[maxLines - 1].slice(0, maxChars - 1)}…`;
|
|
83
|
+
return kept.map(fit);
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Routes run from the home coast to their Landfall's shore in a gentle S.
|
|
87
|
+
*
|
|
88
|
+
* Each Landfall's passages land side by side on its shore, and departures
|
|
89
|
+
* spread along the home coast in the order of those landings, so no two
|
|
90
|
+
* routes leave from the same point and no two cross near the coast. A
|
|
91
|
+
* passage whose Landfall is not on the chart is not drawn.
|
|
92
|
+
*/
|
|
93
|
+
export function plotRoutes(passages, islands) {
|
|
94
|
+
const spacing = islands.length > 1 ? islands[1].cx - islands[0].cx : MAX_ISLAND_SPACING;
|
|
95
|
+
const landings = islands.flatMap((island) => {
|
|
96
|
+
const mine = passages.filter((p) => p.landfallId === island.id);
|
|
97
|
+
const step = Math.min(MAX_END_STEP, (spacing * 0.8) / Math.max(mine.length, 1));
|
|
98
|
+
return mine.map((passage, i) => ({
|
|
99
|
+
passage,
|
|
100
|
+
end: { x: island.cx + (i - (mine.length - 1) / 2) * step, y: CHART.shore + 4 },
|
|
101
|
+
}));
|
|
102
|
+
});
|
|
103
|
+
const ordered = [...landings].sort((a, b) => a.end.x - b.end.x);
|
|
104
|
+
const gap = ordered.length > 1
|
|
105
|
+
? (DEPARTURES.right - DEPARTURES.left) / (ordered.length - 1)
|
|
106
|
+
: Number.POSITIVE_INFINITY;
|
|
107
|
+
const vesselScale = Math.min(1, Math.max(MIN_VESSEL_SCALE, gap / COMFORTABLE_GAP));
|
|
108
|
+
return ordered.map(({ passage, end }, i) => {
|
|
109
|
+
const start = {
|
|
110
|
+
x: ordered.length > 1 ? DEPARTURES.left + i * gap : CHART.width / 2,
|
|
111
|
+
y: CHART.coast,
|
|
112
|
+
};
|
|
113
|
+
// Neighbours sway opposite ways; closer departures sway less, or they cross.
|
|
114
|
+
const reach = Math.min(ROUTE_SWAY, gap / 2);
|
|
115
|
+
const sway = i % 2 === 0 ? reach : -reach;
|
|
116
|
+
const curve = [start, { x: start.x + sway, y: 540 }, { x: end.x - sway, y: 440 }, end];
|
|
117
|
+
return { passage, curve, vesselScale };
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
//# sourceMappingURL=layout.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"layout.js","sourceRoot":"","sources":["../../src/chart-scene/layout.ts"],"names":[],"mappings":"AAEA,0EAA0E;AAC1E,MAAM,CAAC,MAAM,KAAK,GAAG;IACnB,KAAK,EAAE,IAAI;IACX,MAAM,EAAE,GAAG;IACX,OAAO,EAAE,EAAE;IACX,4CAA4C;IAC5C,KAAK,EAAE,GAAG;IACV,8CAA8C;IAC9C,KAAK,EAAE,GAAG;CACF,CAAC;AAEX,MAAM,WAAW,GAAG,IAAI,CAAC;AACzB,MAAM,kBAAkB,GAAG,GAAG,CAAC;AAC/B,8EAA8E;AAC9E,MAAM,YAAY,GAAG,GAAG,CAAC;AACzB,MAAM,YAAY,GAAG,EAAE,CAAC;AACxB,MAAM,UAAU,GAAG,EAAE,CAAC;AACtB,MAAM,UAAU,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,IAAI,EAAW,CAAC;AACvD,mFAAmF;AACnF,MAAM,eAAe,GAAG,EAAE,CAAC;AAC3B,MAAM,gBAAgB,GAAG,GAAG,CAAC;AAE7B;;;GAGG;AACH,MAAM,CAAC,MAAM,cAAc,GACzB,+HAA+H,CAAC;AAClI,MAAM,CAAC,MAAM,WAAW,GAAG,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;AAC5C,MAAM,CAAC,MAAM,YAAY,GAAG;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AAK,EAAE,EAAE,CAAC,EAAE,KAAK,CAAC,CAAC,GAAG,IAAI,EAAE,CAAC,EAAE,GAAG,EAAE,EAAE,EAAE,CAAC,EAAE,GAAG,CAAC,CAAC,GAAG,IAAI,EAAE,CAAC,EAAE,GAAG,EAAE,EAAE,GAAG,CAAC,CAAC;QAC9F,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,CAAC;IACzC,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"anchor.d.ts","sourceRoot":"","sources":["../../src/illustrations/anchor.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAI5D,4BAA4B;AAC5B,eAAO,MAAM,aAAa,EAAE,kBAQ3B,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Frame } from './frame';
|
|
3
|
+
import { accent } from './paint';
|
|
4
|
+
/** At anchor: an anchor. */
|
|
5
|
+
export const AnchorArtwork = (props) => (_jsxs(Frame, { ...props, children: [_jsx("circle", { cx: "32", cy: "11", r: "4" }), _jsx("path", { d: "M32 15 V54" }), _jsx("path", { d: "M22 24 H42" }), _jsx("path", { ...accent, d: "M12 40 C14 50 23 54 32 54 C41 54 50 50 52 40" }), _jsx("path", { ...accent, d: "M8 44 L12 40 L16 44 M48 44 L52 40 L56 44" })] }));
|
|
6
|
+
//# sourceMappingURL=anchor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"anchor.js","sourceRoot":"","sources":["../../src/illustrations/anchor.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAEjC,4BAA4B;AAC5B,MAAM,CAAC,MAAM,aAAa,GAAuB,CAAC,KAAK,EAAE,EAAE,CAAC,CAC1D,MAAC,KAAK,OAAK,KAAK,aACd,iBAAQ,EAAE,EAAC,IAAI,EAAC,EAAE,EAAC,IAAI,EAAC,CAAC,EAAC,GAAG,GAAG,EAChC,eAAM,CAAC,EAAC,YAAY,GAAG,EACvB,eAAM,CAAC,EAAC,YAAY,GAAG,EACvB,kBAAU,MAAM,EAAE,CAAC,EAAC,8CAA8C,GAAG,EACrE,kBAAU,MAAM,EAAE,CAAC,EAAC,0CAA0C,GAAG,IAC3D,CACT,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chart.d.ts","sourceRoot":"","sources":["../../src/illustrations/chart.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAI5D,4DAA4D;AAC5D,eAAO,MAAM,YAAY,EAAE,kBAO1B,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Frame } from './frame';
|
|
3
|
+
import { accent, accentWash, muted } from './paint';
|
|
4
|
+
/** The Chart: a folded sea chart with a route to a star. */
|
|
5
|
+
export const ChartArtwork = (props) => (_jsxs(Frame, { ...props, children: [_jsx("path", { d: "M6 14 L22 10 L42 16 L58 12 V50 L42 54 L22 48 L6 52 Z" }), _jsx("path", { ...muted, d: "M22 10 V48 M42 16 V54" }), _jsx("path", { ...accent, d: "M26 42 L34 20 L42 42" }), _jsx("circle", { ...accentWash, cx: "34", cy: "20", r: "2.5" })] }));
|
|
6
|
+
//# sourceMappingURL=chart.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chart.js","sourceRoot":"","sources":["../../src/illustrations/chart.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAEpD,4DAA4D;AAC5D,MAAM,CAAC,MAAM,YAAY,GAAuB,CAAC,KAAK,EAAE,EAAE,CAAC,CACzD,MAAC,KAAK,OAAK,KAAK,aACd,eAAM,CAAC,EAAC,sDAAsD,GAAG,EACjE,kBAAU,KAAK,EAAE,CAAC,EAAC,uBAAuB,GAAG,EAC7C,kBAAU,MAAM,EAAE,CAAC,EAAC,sBAAsB,GAAG,EAC7C,oBAAY,UAAU,EAAE,EAAE,EAAC,IAAI,EAAC,EAAE,EAAC,IAAI,EAAC,CAAC,EAAC,KAAK,GAAG,IAC5C,CACT,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"course.d.ts","sourceRoot":"","sources":["../../src/illustrations/course.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAI5D,iEAAiE;AACjE,eAAO,MAAM,aAAa,EAAE,kBAU3B,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Frame } from './frame';
|
|
3
|
+
import { accent, accentWash, dashed, muted } from './paint';
|
|
4
|
+
/** A Course: three routes from one point, one of them chosen. */
|
|
5
|
+
export const CourseArtwork = (props) => (_jsxs(Frame, { ...props, children: [_jsx("path", { ...muted, ...dashed, d: "M32 56 C26 40 16 26 10 10" }), _jsx("path", { ...muted, ...dashed, d: "M32 56 C40 42 48 28 54 12" }), _jsx("path", { ...accent, d: "M32 56 C32 42 32 24 32 8" }), _jsx("circle", { cx: "32", cy: "56", r: "3" }), _jsx("circle", { ...accentWash, cx: "32", cy: "8", r: "3" }), _jsx("circle", { ...muted, cx: "10", cy: "10", r: "2" }), _jsx("circle", { ...muted, cx: "54", cy: "12", r: "2" })] }));
|
|
6
|
+
//# sourceMappingURL=course.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"course.js","sourceRoot":"","sources":["../../src/illustrations/course.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAE5D,iEAAiE;AACjE,MAAM,CAAC,MAAM,aAAa,GAAuB,CAAC,KAAK,EAAE,EAAE,CAAC,CAC1D,MAAC,KAAK,OAAK,KAAK,aACd,kBAAU,KAAK,KAAM,MAAM,EAAE,CAAC,EAAC,2BAA2B,GAAG,EAC7D,kBAAU,KAAK,KAAM,MAAM,EAAE,CAAC,EAAC,2BAA2B,GAAG,EAC7D,kBAAU,MAAM,EAAE,CAAC,EAAC,0BAA0B,GAAG,EACjD,iBAAQ,EAAE,EAAC,IAAI,EAAC,EAAE,EAAC,IAAI,EAAC,CAAC,EAAC,GAAG,GAAG,EAChC,oBAAY,UAAU,EAAE,EAAE,EAAC,IAAI,EAAC,EAAE,EAAC,GAAG,EAAC,CAAC,EAAC,GAAG,GAAG,EAC/C,oBAAY,KAAK,EAAE,EAAE,EAAC,IAAI,EAAC,EAAE,EAAC,IAAI,EAAC,CAAC,EAAC,GAAG,GAAG,EAC3C,oBAAY,KAAK,EAAE,EAAE,EAAC,IAAI,EAAC,EAAE,EAAC,IAAI,EAAC,CAAC,EAAC,GAAG,GAAG,IACrC,CACT,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"day-sail.d.ts","sourceRoot":"","sources":["../../src/illustrations/day-sail.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAI5D,2DAA2D;AAC3D,eAAO,MAAM,cAAc,EAAE,kBAQ5B,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Frame, Waves } from './frame';
|
|
3
|
+
import { accentWash, muted } from './paint';
|
|
4
|
+
/** A Day sail: a small boat under one sail, in the sun. */
|
|
5
|
+
export const DaySailArtwork = (props) => (_jsxs(Frame, { ...props, children: [_jsx("circle", { ...muted, cx: "50", cy: "14", r: "5" }), _jsx("path", { d: "M18 44 H46 L42 50 H22 Z" }), _jsx("path", { d: "M32 44 V16" }), _jsx("path", { ...accentWash, d: "M33 17 L44 41 H33 Z" }), _jsx(Waves, { y: 56 })] }));
|
|
6
|
+
//# sourceMappingURL=day-sail.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"day-sail.js","sourceRoot":"","sources":["../../src/illustrations/day-sail.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAE5C,2DAA2D;AAC3D,MAAM,CAAC,MAAM,cAAc,GAAuB,CAAC,KAAK,EAAE,EAAE,CAAC,CAC3D,MAAC,KAAK,OAAK,KAAK,aACd,oBAAY,KAAK,EAAE,EAAE,EAAC,IAAI,EAAC,EAAE,EAAC,IAAI,EAAC,CAAC,EAAC,GAAG,GAAG,EAC3C,eAAM,CAAC,EAAC,yBAAyB,GAAG,EACpC,eAAM,CAAC,EAAC,YAAY,GAAG,EACvB,kBAAU,UAAU,EAAE,CAAC,EAAC,qBAAqB,GAAG,EAChD,KAAC,KAAK,IAAC,CAAC,EAAE,EAAE,GAAI,IACV,CACT,CAAC"}
|