@burdenoff/microfe-cosmicintersection 2026.1101.1 → 2026.1101.3
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/dist/cosmicintersection/api/tagsApi.d.ts +100 -0
- package/dist/cosmicintersection/api/tagsApi.d.ts.map +1 -0
- package/dist/cosmicintersection/api/tagsApi.js +110 -0
- package/dist/cosmicintersection/api/tagsApi.js.map +1 -0
- package/dist/cosmicintersection/components/EntityTagsField.d.ts +5 -5
- package/dist/cosmicintersection/components/EntityTagsField.js.map +1 -1
- package/dist/cosmicintersection/components/ScienceCanvas.d.ts +17 -0
- package/dist/cosmicintersection/components/ScienceCanvas.d.ts.map +1 -0
- package/dist/cosmicintersection/components/ScienceCanvas.js +791 -0
- package/dist/cosmicintersection/components/ScienceCanvas.js.map +1 -0
- package/dist/cosmicintersection/components/WorkspaceTagsPicker.d.ts +27 -0
- package/dist/cosmicintersection/components/WorkspaceTagsPicker.d.ts.map +1 -0
- package/dist/cosmicintersection/components/WorkspaceTagsPicker.js +141 -0
- package/dist/cosmicintersection/components/WorkspaceTagsPicker.js.map +1 -0
- package/dist/cosmicintersection/components/index.d.ts +3 -0
- package/dist/cosmicintersection/components/index.d.ts.map +1 -1
- package/dist/cosmicintersection/components/index.js +8 -5
- package/dist/cosmicintersection/hooks/useEntityTagSync.d.ts +49 -0
- package/dist/cosmicintersection/hooks/useEntityTagSync.d.ts.map +1 -0
- package/dist/cosmicintersection/hooks/useEntityTagSync.js +86 -0
- package/dist/cosmicintersection/hooks/useEntityTagSync.js.map +1 -0
- package/dist/cosmicintersection/lib/visualization.d.ts +189 -0
- package/dist/cosmicintersection/lib/visualization.d.ts.map +1 -0
- package/dist/cosmicintersection/lib/visualization.js +298 -0
- package/dist/cosmicintersection/lib/visualization.js.map +1 -0
- package/dist/cosmicintersection/lib/visualizationSamples.d.ts +80 -0
- package/dist/cosmicintersection/lib/visualizationSamples.d.ts.map +1 -0
- package/dist/cosmicintersection/pages/analyses/AnalysesPage.d.ts.map +1 -1
- package/dist/cosmicintersection/pages/analyses/AnalysesPage.js +11 -11
- package/dist/cosmicintersection/pages/analyses/AnalysesPage.js.map +1 -1
- package/dist/cosmicintersection/pages/collections/CollectionFormPage.d.ts.map +1 -1
- package/dist/cosmicintersection/pages/collections/CollectionFormPage.js +75 -74
- package/dist/cosmicintersection/pages/collections/CollectionFormPage.js.map +1 -1
- package/dist/cosmicintersection/pages/datasets/DatasetDetailPage.d.ts.map +1 -1
- package/dist/cosmicintersection/pages/datasets/DatasetDetailPage.js +115 -106
- package/dist/cosmicintersection/pages/datasets/DatasetDetailPage.js.map +1 -1
- package/dist/cosmicintersection/pages/datasets/DatasetFormPage.d.ts.map +1 -1
- package/dist/cosmicintersection/pages/datasets/DatasetFormPage.js +103 -101
- package/dist/cosmicintersection/pages/datasets/DatasetFormPage.js.map +1 -1
- package/dist/cosmicintersection/pages/notebooks/NotebookFormPage.d.ts.map +1 -1
- package/dist/cosmicintersection/pages/notebooks/NotebookFormPage.js +141 -139
- package/dist/cosmicintersection/pages/notebooks/NotebookFormPage.js.map +1 -1
- package/dist/cosmicintersection/pages/pipelines/PipelineFormPage.d.ts.map +1 -1
- package/dist/cosmicintersection/pages/pipelines/PipelineFormPage.js +213 -211
- package/dist/cosmicintersection/pages/pipelines/PipelineFormPage.js.map +1 -1
- package/dist/cosmicintersection/pages/sources/SourceFormPage.d.ts.map +1 -1
- package/dist/cosmicintersection/pages/sources/SourceFormPage.js +110 -107
- package/dist/cosmicintersection/pages/sources/SourceFormPage.js.map +1 -1
- package/dist/stories/ScienceCanvas.stories.d.ts +21 -0
- package/dist/stories/ScienceCanvas.stories.d.ts.map +1 -0
- package/dist/stories/WorkspaceTagsPicker.stories.d.ts +12 -0
- package/dist/stories/WorkspaceTagsPicker.stories.d.ts.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Canonical scientific-visualization payloads for analysis results (BOFF-3984).
|
|
3
|
+
*
|
|
4
|
+
* `cosCompleteAnalysis` persists free-form `results` JSON. A producer opts in to
|
|
5
|
+
* a domain view by adding `results.visualization` (one view) or
|
|
6
|
+
* `results.visualizations` (a list of up to 8). The backend validates these
|
|
7
|
+
* shapes at write time (wspace-cosmicintersection-svc `visualization.ts`); this
|
|
8
|
+
* module normalises them for rendering and is deliberately lenient, so a row
|
|
9
|
+
* written before validation existed degrades to "fewer elements", never a crash.
|
|
10
|
+
*
|
|
11
|
+
* skymap { sources: [{ ra, dec, label?, value? }], projection?, frame?, valueLabel? }
|
|
12
|
+
* spectrum { series: [{ name?, style?, points }], lines?: [{ x, label? }], x/y labels+units }
|
|
13
|
+
* lightcurve { series: [...], magnitude?: boolean, x/y labels+units }
|
|
14
|
+
* scene3d { points?: [{ x, y, z, label?, value? }], paths?: [{ name?, points }], axes? }
|
|
15
|
+
*
|
|
16
|
+
* 2-D points are `[x, y]`, `[x, y, err]` or `{ x, y, err? }`; 3-D points are
|
|
17
|
+
* `[x, y, z]` or `{ x, y, z }`. Angles are degrees.
|
|
18
|
+
*/
|
|
19
|
+
export type SkyProjection = 'mollweide' | 'aitoff' | 'equirectangular';
|
|
20
|
+
export type SkyFrame = 'icrs' | 'galactic' | 'ecliptic';
|
|
21
|
+
export type SeriesStyle = 'line' | 'scatter' | 'step';
|
|
22
|
+
export declare const SKY_PROJECTIONS: readonly SkyProjection[];
|
|
23
|
+
export interface SkySource {
|
|
24
|
+
ra: number;
|
|
25
|
+
dec: number;
|
|
26
|
+
label?: string;
|
|
27
|
+
value?: number;
|
|
28
|
+
}
|
|
29
|
+
export interface Point2D {
|
|
30
|
+
x: number;
|
|
31
|
+
y: number;
|
|
32
|
+
err?: number;
|
|
33
|
+
}
|
|
34
|
+
export interface Series2D {
|
|
35
|
+
name: string;
|
|
36
|
+
style: SeriesStyle;
|
|
37
|
+
points: Point2D[];
|
|
38
|
+
}
|
|
39
|
+
export interface MarkerLine {
|
|
40
|
+
x: number;
|
|
41
|
+
label?: string;
|
|
42
|
+
}
|
|
43
|
+
export interface Point3D {
|
|
44
|
+
x: number;
|
|
45
|
+
y: number;
|
|
46
|
+
z: number;
|
|
47
|
+
label?: string;
|
|
48
|
+
value?: number;
|
|
49
|
+
}
|
|
50
|
+
export interface Path3D {
|
|
51
|
+
name: string;
|
|
52
|
+
points: Point3D[];
|
|
53
|
+
}
|
|
54
|
+
interface ViewBase {
|
|
55
|
+
title?: string;
|
|
56
|
+
description?: string;
|
|
57
|
+
}
|
|
58
|
+
export interface SkyMapView extends ViewBase {
|
|
59
|
+
kind: 'skymap';
|
|
60
|
+
projection: SkyProjection;
|
|
61
|
+
frame: SkyFrame;
|
|
62
|
+
valueLabel?: string;
|
|
63
|
+
sources: SkySource[];
|
|
64
|
+
}
|
|
65
|
+
export interface PlotView extends ViewBase {
|
|
66
|
+
kind: 'spectrum' | 'lightcurve';
|
|
67
|
+
xLabel: string;
|
|
68
|
+
yLabel: string;
|
|
69
|
+
/** Light curves in magnitudes plot brighter (smaller) values higher. */
|
|
70
|
+
invertY: boolean;
|
|
71
|
+
series: Series2D[];
|
|
72
|
+
lines: MarkerLine[];
|
|
73
|
+
}
|
|
74
|
+
export interface Scene3DView extends ViewBase {
|
|
75
|
+
kind: 'scene3d';
|
|
76
|
+
axes: {
|
|
77
|
+
x: string;
|
|
78
|
+
y: string;
|
|
79
|
+
z: string;
|
|
80
|
+
};
|
|
81
|
+
points: Point3D[];
|
|
82
|
+
paths: Path3D[];
|
|
83
|
+
}
|
|
84
|
+
export type VisualizationView = SkyMapView | PlotView | Scene3DView;
|
|
85
|
+
export declare const MAX_VISUALIZATIONS = 8;
|
|
86
|
+
/** Matches the backend cap; extra elements are dropped rather than rendered. */
|
|
87
|
+
export declare const MAX_ELEMENTS_PER_VIEW = 20000;
|
|
88
|
+
/** "Wavelength" + "nm" -> "Wavelength (nm)". */
|
|
89
|
+
export declare function axisTitle(label: string | undefined, unit: string | undefined, fallback: string): string;
|
|
90
|
+
/** Every renderable canonical view in an analysis `results` payload (may be empty). */
|
|
91
|
+
export declare function extractVisualizations(results: unknown): VisualizationView[];
|
|
92
|
+
/** The view kind's display name, used for tabs and fallback titles. */
|
|
93
|
+
export declare function viewKindLabel(kind: VisualizationView['kind']): string;
|
|
94
|
+
/**
|
|
95
|
+
* Project equatorial (or galactic) coordinates to normalised plane coordinates
|
|
96
|
+
* in [-1, 1] x [-0.5, 0.5] (a 2:1 frame). Astronomical convention: longitude
|
|
97
|
+
* increases to the LEFT (east is left when looking at the sky), centred on 180°.
|
|
98
|
+
*/
|
|
99
|
+
export declare function projectSky(lonDeg: number, latDeg: number, projection: SkyProjection): {
|
|
100
|
+
x: number;
|
|
101
|
+
y: number;
|
|
102
|
+
};
|
|
103
|
+
export interface Camera {
|
|
104
|
+
/** Rotation about the vertical axis, degrees. */
|
|
105
|
+
yaw: number;
|
|
106
|
+
/** Rotation about the horizontal axis, degrees (clamped to ±89). */
|
|
107
|
+
pitch: number;
|
|
108
|
+
}
|
|
109
|
+
export declare const DEFAULT_CAMERA: Camera;
|
|
110
|
+
export declare function clampPitch(pitch: number): number;
|
|
111
|
+
/**
|
|
112
|
+
* Orthographic projection of a point (already centred and scaled to roughly
|
|
113
|
+
* unit size) for the given camera. Returns screen-plane x/y (y up) and a depth
|
|
114
|
+
* where larger means nearer the viewer.
|
|
115
|
+
*/
|
|
116
|
+
export declare function projectPoint(p: {
|
|
117
|
+
x: number;
|
|
118
|
+
y: number;
|
|
119
|
+
z: number;
|
|
120
|
+
}, camera: Camera): {
|
|
121
|
+
x: number;
|
|
122
|
+
y: number;
|
|
123
|
+
depth: number;
|
|
124
|
+
};
|
|
125
|
+
/**
|
|
126
|
+
* Centre + uniform scale that fits every point inside a unit sphere.
|
|
127
|
+
*
|
|
128
|
+
* The scale is the bounding radius (the farthest point from the box centre),
|
|
129
|
+
* not the largest half-extent: a unit cube's corners sit at sqrt(3), so a
|
|
130
|
+
* half-extent scale would let rotation carry valid points outside the canvas.
|
|
131
|
+
*/
|
|
132
|
+
export declare function sceneNormalizer(points: Point3D[]): (p: Point3D) => Point3D;
|
|
133
|
+
/**
|
|
134
|
+
* Rounded, human-friendly tick values across [min, max].
|
|
135
|
+
*
|
|
136
|
+
* Each tick is computed from its index (never by repeated addition) and the
|
|
137
|
+
* loop is bounded, so a step below the floating-point spacing of the range
|
|
138
|
+
* cannot spin forever; rounding uses the step's own precision so very small
|
|
139
|
+
* scientific values (e.g. fluxes of 1e-15) keep distinct ticks. Ticks that
|
|
140
|
+
* collapse to the same representable value are emitted once.
|
|
141
|
+
*/
|
|
142
|
+
export declare function niceTicks(min: number, max: number, count: number): number[];
|
|
143
|
+
/** Spacing between adjacent ticks, or undefined when there is only one. */
|
|
144
|
+
export declare function tickStep(ticks: number[]): number | undefined;
|
|
145
|
+
/**
|
|
146
|
+
* Compact tick label. When the tick spacing is known, the label keeps enough
|
|
147
|
+
* precision to tell adjacent ticks apart (MJD 60200 vs 60201, or 1.0e-15 vs
|
|
148
|
+
* 1.5e-15) instead of a fixed number of significant digits.
|
|
149
|
+
*/
|
|
150
|
+
export declare function formatTick(value: number, step?: number): string;
|
|
151
|
+
/**
|
|
152
|
+
* Evenly downsample a long series so the SVG stays light on huge payloads.
|
|
153
|
+
* The first and last items are always kept, so a thinned path still ends
|
|
154
|
+
* where the data ends.
|
|
155
|
+
*/
|
|
156
|
+
export declare function downsample<T>(items: T[], max: number): T[];
|
|
157
|
+
/**
|
|
158
|
+
* Thin an x-sorted 2-D series to at most `max` points without losing the
|
|
159
|
+
* features a scientist looks for. The series is split into `max / 2` buckets
|
|
160
|
+
* and each bucket keeps its lowest and highest point (by y − err and y + err,
|
|
161
|
+
* so the largest error bars survive too), in x order. Absorption and emission
|
|
162
|
+
* peaks, flare maxima and eclipse minima therefore always remain visible,
|
|
163
|
+
* which an even stride cannot guarantee. A thinned `step` series is redrawn
|
|
164
|
+
* from these extremes, so its steps show each bucket's range rather than every
|
|
165
|
+
* original bin; the view's thinning note says so.
|
|
166
|
+
*/
|
|
167
|
+
export declare function decimateSeries(points: Point2D[], max: number): Point2D[];
|
|
168
|
+
/**
|
|
169
|
+
* Number repeated tab labels ("Spectrum 1", "Spectrum 2") so untitled views of
|
|
170
|
+
* the same kind stay distinguishable; unique labels are left as they are.
|
|
171
|
+
*/
|
|
172
|
+
export declare function tabLabels(labels: string[], numbered: (label: string, n: number) => string): string[];
|
|
173
|
+
/**
|
|
174
|
+
* Index of the point nearest to (`x`, `y`) in screen space, or -1 when no
|
|
175
|
+
* point lies within `maxDistance`. Plots use it to turn a tap anywhere near a
|
|
176
|
+
* line, step or scatter series into a readout of the closest measurement.
|
|
177
|
+
*/
|
|
178
|
+
export declare function nearestPoint(points: Array<{
|
|
179
|
+
x: number;
|
|
180
|
+
y: number;
|
|
181
|
+
}>, x: number, y: number, maxDistance: number): number;
|
|
182
|
+
/**
|
|
183
|
+
* A measured value at full precision, for readouts and data tables: unlike
|
|
184
|
+
* {@link formatTick} it never rounds, so 1.23456e-15 or MJD 60200.123456
|
|
185
|
+
* read back exactly as recorded.
|
|
186
|
+
*/
|
|
187
|
+
export declare function formatValue(value: number): string;
|
|
188
|
+
export {};
|
|
189
|
+
//# sourceMappingURL=visualization.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"visualization.d.ts","sourceRoot":"","sources":["../../../src/cosmicintersection/lib/visualization.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,MAAM,MAAM,aAAa,GAAG,WAAW,GAAG,QAAQ,GAAG,iBAAiB,CAAC;AACvE,MAAM,MAAM,QAAQ,GAAG,MAAM,GAAG,UAAU,GAAG,UAAU,CAAC;AACxD,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,SAAS,GAAG,MAAM,CAAC;AAEtD,eAAO,MAAM,eAAe,EAAE,SAAS,aAAa,EAA+C,CAAC;AAEpG,MAAM,WAAW,SAAS;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,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,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,EACvC,CAAC,EAAE,MAAM,EACT,CAAC,EAAE,MAAM,EACT,WAAW,EAAE,MAAM,GAClB,MAAM,CAWR;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAEjD"}
|
|
@@ -0,0 +1,298 @@
|
|
|
1
|
+
//#region src/cosmicintersection/lib/visualization.ts
|
|
2
|
+
var e = [
|
|
3
|
+
"mollweide",
|
|
4
|
+
"aitoff",
|
|
5
|
+
"equirectangular"
|
|
6
|
+
], t = 2e4;
|
|
7
|
+
function n(e) {
|
|
8
|
+
return typeof e == "object" && !!e && !Array.isArray(e);
|
|
9
|
+
}
|
|
10
|
+
function r(e) {
|
|
11
|
+
return typeof e == "number" && Number.isFinite(e);
|
|
12
|
+
}
|
|
13
|
+
function i(e) {
|
|
14
|
+
return typeof e == "string" && e.trim() ? e.trim() : void 0;
|
|
15
|
+
}
|
|
16
|
+
function a(e, t, n) {
|
|
17
|
+
return typeof e == "string" && t.includes(e) ? e : n;
|
|
18
|
+
}
|
|
19
|
+
function o(e, t, n) {
|
|
20
|
+
let r = e ?? n;
|
|
21
|
+
return t ? `${r} (${t})` : r;
|
|
22
|
+
}
|
|
23
|
+
function s(e) {
|
|
24
|
+
if (Array.isArray(e)) {
|
|
25
|
+
let [t, n, i] = e;
|
|
26
|
+
return !r(t) || !r(n) ? null : r(i) ? {
|
|
27
|
+
x: t,
|
|
28
|
+
y: n,
|
|
29
|
+
err: Math.abs(i)
|
|
30
|
+
} : {
|
|
31
|
+
x: t,
|
|
32
|
+
y: n
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
return n(e) && r(e.x) && r(e.y) ? r(e.err) ? {
|
|
36
|
+
x: e.x,
|
|
37
|
+
y: e.y,
|
|
38
|
+
err: Math.abs(e.err)
|
|
39
|
+
} : {
|
|
40
|
+
x: e.x,
|
|
41
|
+
y: e.y
|
|
42
|
+
} : null;
|
|
43
|
+
}
|
|
44
|
+
function c(e) {
|
|
45
|
+
if (Array.isArray(e)) {
|
|
46
|
+
let [t, n, i] = e;
|
|
47
|
+
return r(t) && r(n) && r(i) ? {
|
|
48
|
+
x: t,
|
|
49
|
+
y: n,
|
|
50
|
+
z: i
|
|
51
|
+
} : null;
|
|
52
|
+
}
|
|
53
|
+
if (n(e) && r(e.x) && r(e.y) && r(e.z)) {
|
|
54
|
+
let t = {
|
|
55
|
+
x: e.x,
|
|
56
|
+
y: e.y,
|
|
57
|
+
z: e.z
|
|
58
|
+
}, n = i(e.label);
|
|
59
|
+
return n && (t.label = n), r(e.value) && (t.value = e.value), t;
|
|
60
|
+
}
|
|
61
|
+
return null;
|
|
62
|
+
}
|
|
63
|
+
function l(e) {
|
|
64
|
+
return Array.isArray(e) ? e.slice(0, t) : [];
|
|
65
|
+
}
|
|
66
|
+
function u(t) {
|
|
67
|
+
let o = [];
|
|
68
|
+
for (let e of l(t.sources)) {
|
|
69
|
+
if (!n(e) || !r(e.ra) || !r(e.dec) || e.ra < 0 || e.ra > 360 || e.dec < -90 || e.dec > 90) continue;
|
|
70
|
+
let t = {
|
|
71
|
+
ra: e.ra,
|
|
72
|
+
dec: e.dec
|
|
73
|
+
}, a = i(e.label);
|
|
74
|
+
a && (t.label = a), r(e.value) && (t.value = e.value), o.push(t);
|
|
75
|
+
}
|
|
76
|
+
return o.length === 0 ? null : {
|
|
77
|
+
kind: "skymap",
|
|
78
|
+
title: i(t.title),
|
|
79
|
+
description: i(t.description),
|
|
80
|
+
projection: a(t.projection, e, "mollweide"),
|
|
81
|
+
frame: a(t.frame, [
|
|
82
|
+
"icrs",
|
|
83
|
+
"galactic",
|
|
84
|
+
"ecliptic"
|
|
85
|
+
], "icrs"),
|
|
86
|
+
valueLabel: i(t.valueLabel),
|
|
87
|
+
sources: o
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
function d(e, t) {
|
|
91
|
+
let c = [];
|
|
92
|
+
if (l(e.series).forEach((e, t) => {
|
|
93
|
+
if (!n(e)) return;
|
|
94
|
+
let r = l(e.points).map(s).filter((e) => e !== null);
|
|
95
|
+
r.length < 2 || c.push({
|
|
96
|
+
name: i(e.name) ?? `Series ${t + 1}`,
|
|
97
|
+
style: a(e.style, [
|
|
98
|
+
"line",
|
|
99
|
+
"scatter",
|
|
100
|
+
"step"
|
|
101
|
+
], "line"),
|
|
102
|
+
points: r
|
|
103
|
+
});
|
|
104
|
+
}), c.length === 0) return null;
|
|
105
|
+
let u = [];
|
|
106
|
+
for (let t of l(e.lines)) !n(t) || !r(t.x) || u.push({
|
|
107
|
+
x: t.x,
|
|
108
|
+
label: i(t.label)
|
|
109
|
+
});
|
|
110
|
+
let d = t === "lightcurve" && e.magnitude === !0, f = t === "spectrum";
|
|
111
|
+
return {
|
|
112
|
+
kind: t,
|
|
113
|
+
title: i(e.title),
|
|
114
|
+
description: i(e.description),
|
|
115
|
+
xLabel: o(i(e.xLabel), i(e.xUnit), f ? "Wavelength" : "Time"),
|
|
116
|
+
yLabel: o(i(e.yLabel), i(e.yUnit), f ? "Flux" : d ? "Magnitude" : "Flux"),
|
|
117
|
+
invertY: d,
|
|
118
|
+
series: c,
|
|
119
|
+
lines: u
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
function f(e) {
|
|
123
|
+
let t = l(e.points).map(c).filter((e) => e !== null), r = [];
|
|
124
|
+
if (l(e.paths).forEach((e, t) => {
|
|
125
|
+
if (!n(e)) return;
|
|
126
|
+
let a = l(e.points).map(c).filter((e) => e !== null);
|
|
127
|
+
a.length >= 2 && r.push({
|
|
128
|
+
name: i(e.name) ?? `Path ${t + 1}`,
|
|
129
|
+
points: a
|
|
130
|
+
});
|
|
131
|
+
}), t.length === 0 && r.length === 0) return null;
|
|
132
|
+
let a = n(e.axes) ? e.axes : {};
|
|
133
|
+
return {
|
|
134
|
+
kind: "scene3d",
|
|
135
|
+
title: i(e.title),
|
|
136
|
+
description: i(e.description),
|
|
137
|
+
axes: {
|
|
138
|
+
x: i(a.x) ?? "x",
|
|
139
|
+
y: i(a.y) ?? "y",
|
|
140
|
+
z: i(a.z) ?? "z"
|
|
141
|
+
},
|
|
142
|
+
points: t,
|
|
143
|
+
paths: r
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
function p(e) {
|
|
147
|
+
if (!n(e)) return null;
|
|
148
|
+
switch (e.kind) {
|
|
149
|
+
case "skymap": return u(e);
|
|
150
|
+
case "spectrum": return d(e, "spectrum");
|
|
151
|
+
case "lightcurve": return d(e, "lightcurve");
|
|
152
|
+
case "scene3d": return f(e);
|
|
153
|
+
default: return null;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
function m(e) {
|
|
157
|
+
if (!n(e)) return [];
|
|
158
|
+
let t = [];
|
|
159
|
+
return e.visualization !== void 0 && t.push(e.visualization), Array.isArray(e.visualizations) && t.push(...e.visualizations), t.slice(0, 8).map(p).filter((e) => e !== null);
|
|
160
|
+
}
|
|
161
|
+
function h(e) {
|
|
162
|
+
switch (e) {
|
|
163
|
+
case "skymap": return "Sky map";
|
|
164
|
+
case "spectrum": return "Spectrum";
|
|
165
|
+
case "lightcurve": return "Light curve";
|
|
166
|
+
case "scene3d": return "3-D scene";
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
var g = Math.PI / 180;
|
|
170
|
+
function _(e, t, n) {
|
|
171
|
+
let r = ((e - 180) % 360 + 540) % 360 - 180;
|
|
172
|
+
r = -r;
|
|
173
|
+
let i = r * g, a = t * g;
|
|
174
|
+
if (n === "equirectangular") return {
|
|
175
|
+
x: r / 180,
|
|
176
|
+
y: t / 180
|
|
177
|
+
};
|
|
178
|
+
if (n === "aitoff") {
|
|
179
|
+
let e = Math.acos(Math.min(1, Math.cos(a) * Math.cos(i / 2))), t = e === 0 ? 1 : Math.sin(e) / e, n = 2 * Math.cos(a) * Math.sin(i / 2) / t, r = Math.sin(a) / t;
|
|
180
|
+
return {
|
|
181
|
+
x: n / Math.PI,
|
|
182
|
+
y: r / Math.PI
|
|
183
|
+
};
|
|
184
|
+
}
|
|
185
|
+
let o = a;
|
|
186
|
+
if (Math.abs(Math.abs(a) - Math.PI / 2) < 1e-9) o = a;
|
|
187
|
+
else for (let e = 0; e < 50; e += 1) {
|
|
188
|
+
let e = -(2 * o + Math.sin(2 * o) - Math.PI * Math.sin(a)) / (2 + 2 * Math.cos(2 * o));
|
|
189
|
+
if (o += e, Math.abs(e) < 1e-10) break;
|
|
190
|
+
}
|
|
191
|
+
let s = 2 * Math.SQRT2 / Math.PI * i * Math.cos(o), c = Math.SQRT2 * Math.sin(o);
|
|
192
|
+
return {
|
|
193
|
+
x: s / (2 * Math.SQRT2),
|
|
194
|
+
y: c / (2 * Math.SQRT2)
|
|
195
|
+
};
|
|
196
|
+
}
|
|
197
|
+
var v = {
|
|
198
|
+
yaw: 35,
|
|
199
|
+
pitch: 25
|
|
200
|
+
};
|
|
201
|
+
function y(e) {
|
|
202
|
+
return Math.max(-89, Math.min(89, e));
|
|
203
|
+
}
|
|
204
|
+
function b(e, t) {
|
|
205
|
+
let n = t.yaw * g, r = t.pitch * g, i = e.x * Math.cos(n) - e.y * Math.sin(n), a = e.x * Math.sin(n) + e.y * Math.cos(n), o = e.z;
|
|
206
|
+
return {
|
|
207
|
+
x: i,
|
|
208
|
+
y: o * Math.cos(r) - a * Math.sin(r),
|
|
209
|
+
depth: -(o * Math.sin(r) + a * Math.cos(r))
|
|
210
|
+
};
|
|
211
|
+
}
|
|
212
|
+
function x(e) {
|
|
213
|
+
if (e.length === 0) return (e) => e;
|
|
214
|
+
let t = Infinity, n = Infinity, r = Infinity, i = -Infinity, a = -Infinity, o = -Infinity;
|
|
215
|
+
for (let s of e) t = Math.min(t, s.x), n = Math.min(n, s.y), r = Math.min(r, s.z), i = Math.max(i, s.x), a = Math.max(a, s.y), o = Math.max(o, s.z);
|
|
216
|
+
let s = (t + i) / 2, c = (n + a) / 2, l = (r + o) / 2, u = 0;
|
|
217
|
+
for (let t of e) u = Math.max(u, Math.hypot(t.x - s, t.y - c, t.z - l));
|
|
218
|
+
let d = u || 1;
|
|
219
|
+
return (e) => ({
|
|
220
|
+
...e,
|
|
221
|
+
x: (e.x - s) / d,
|
|
222
|
+
y: (e.y - c) / d,
|
|
223
|
+
z: (e.z - l) / d
|
|
224
|
+
});
|
|
225
|
+
}
|
|
226
|
+
var S = 50;
|
|
227
|
+
function C(e) {
|
|
228
|
+
return !Number.isFinite(e) || e <= 0 ? 0 : Math.min(100, Math.max(0, Math.ceil(-Math.log10(e) - 1e-9)));
|
|
229
|
+
}
|
|
230
|
+
function w(e, t, n) {
|
|
231
|
+
if (!Number.isFinite(e) || !Number.isFinite(t) || e === t) return [e];
|
|
232
|
+
let r = (t - e) / Math.max(1, n), i = 10 ** Math.floor(Math.log10(r)), a = r / i, o = (a < 1.5 ? 1 : a < 3 ? 2 : a < 7 ? 5 : 10) * i, s = Math.min(100, C(o) + 1), c = Math.ceil(e / o) * o, l = [];
|
|
233
|
+
for (let e = 0; e < S; e += 1) {
|
|
234
|
+
let n = c + e * o;
|
|
235
|
+
if (n > t + o * 1e-6) break;
|
|
236
|
+
let r = Number(n.toFixed(s));
|
|
237
|
+
(l.length === 0 || l[l.length - 1] !== r) && l.push(r);
|
|
238
|
+
}
|
|
239
|
+
return l.length > 0 ? l : [e];
|
|
240
|
+
}
|
|
241
|
+
function T(e) {
|
|
242
|
+
return e.length > 1 ? Math.abs(e[1] - e[0]) : void 0;
|
|
243
|
+
}
|
|
244
|
+
function E(e, t) {
|
|
245
|
+
if (e === 0) return "0";
|
|
246
|
+
let n = Math.abs(e), r = t !== void 0 && Number.isFinite(t) && t > 0;
|
|
247
|
+
if (n < .001 || n >= 1e6) {
|
|
248
|
+
if (!r) return e.toExponential(1);
|
|
249
|
+
let i = Math.floor(Math.log10(n)) - Math.floor(Math.log10(t)) + 1;
|
|
250
|
+
return e.toExponential(Math.min(15, Math.max(1, i - 1)));
|
|
251
|
+
}
|
|
252
|
+
return r ? e.toLocaleString(void 0, { maximumFractionDigits: Math.min(20, C(t)) }) : Number(e.toPrecision(4)).toLocaleString(void 0, { maximumFractionDigits: 4 });
|
|
253
|
+
}
|
|
254
|
+
function D(e, t) {
|
|
255
|
+
if (e.length <= t) return e;
|
|
256
|
+
if (t <= 1) return e.slice(0, Math.max(0, t));
|
|
257
|
+
let n = (e.length - 1) / (t - 1), r = [];
|
|
258
|
+
for (let i = 0; i < t; i += 1) r.push(e[Math.floor(i * n)]);
|
|
259
|
+
return r;
|
|
260
|
+
}
|
|
261
|
+
function O(e, t) {
|
|
262
|
+
if (e.length <= t) return e;
|
|
263
|
+
let n = Math.max(1, Math.floor(t / 2)), r = e.length / n, i = [];
|
|
264
|
+
for (let t = 0; t < n; t += 1) {
|
|
265
|
+
let n = Math.floor(t * r), a = Math.min(e.length, Math.floor((t + 1) * r)), o = n, s = n;
|
|
266
|
+
for (let t = n; t < a; t += 1) {
|
|
267
|
+
let n = e[t], r = n.err ?? 0;
|
|
268
|
+
n.y - r < e[o].y - (e[o].err ?? 0) && (o = t), n.y + r > e[s].y + (e[s].err ?? 0) && (s = t);
|
|
269
|
+
}
|
|
270
|
+
o === s ? i.push(e[o]) : o < s ? i.push(e[o], e[s]) : i.push(e[s], e[o]);
|
|
271
|
+
}
|
|
272
|
+
return i;
|
|
273
|
+
}
|
|
274
|
+
function k(e, t) {
|
|
275
|
+
let n = /* @__PURE__ */ new Map();
|
|
276
|
+
for (let t of e) n.set(t, (n.get(t) ?? 0) + 1);
|
|
277
|
+
let r = /* @__PURE__ */ new Map();
|
|
278
|
+
return e.map((e) => {
|
|
279
|
+
if ((n.get(e) ?? 0) < 2) return e;
|
|
280
|
+
let i = (r.get(e) ?? 0) + 1;
|
|
281
|
+
return r.set(e, i), t(e, i);
|
|
282
|
+
});
|
|
283
|
+
}
|
|
284
|
+
function A(e, t, n, r) {
|
|
285
|
+
let i = -1, a = r;
|
|
286
|
+
for (let r = 0; r < e.length; r += 1) {
|
|
287
|
+
let o = Math.hypot(e[r].x - t, e[r].y - n);
|
|
288
|
+
o <= a && (i = r, a = o);
|
|
289
|
+
}
|
|
290
|
+
return i;
|
|
291
|
+
}
|
|
292
|
+
function j(e) {
|
|
293
|
+
return Object.is(e, -0) ? "0" : String(e);
|
|
294
|
+
}
|
|
295
|
+
//#endregion
|
|
296
|
+
export { v as DEFAULT_CAMERA, t as MAX_ELEMENTS_PER_VIEW, e as SKY_PROJECTIONS, o as axisTitle, y as clampPitch, O as decimateSeries, D as downsample, m as extractVisualizations, E as formatTick, j as formatValue, A as nearestPoint, w as niceTicks, b as projectPoint, _ as projectSky, x as sceneNormalizer, k as tabLabels, T as tickStep, h as viewKindLabel };
|
|
297
|
+
|
|
298
|
+
//# sourceMappingURL=visualization.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"visualization.js","names":[],"sources":["../../../src/cosmicintersection/lib/visualization.ts"],"sourcesContent":["/**\n * Canonical scientific-visualization payloads for analysis results (BOFF-3984).\n *\n * `cosCompleteAnalysis` persists free-form `results` JSON. A producer opts in to\n * a domain view by adding `results.visualization` (one view) or\n * `results.visualizations` (a list of up to 8). The backend validates these\n * shapes at write time (wspace-cosmicintersection-svc `visualization.ts`); this\n * module normalises them for rendering and is deliberately lenient, so a row\n * written before validation existed degrades to \"fewer elements\", never a crash.\n *\n * skymap { sources: [{ ra, dec, label?, value? }], projection?, frame?, valueLabel? }\n * spectrum { series: [{ name?, style?, points }], lines?: [{ x, label? }], x/y labels+units }\n * lightcurve { series: [...], magnitude?: boolean, x/y labels+units }\n * scene3d { points?: [{ x, y, z, label?, value? }], paths?: [{ name?, points }], axes? }\n *\n * 2-D points are `[x, y]`, `[x, y, err]` or `{ x, y, err? }`; 3-D points are\n * `[x, y, z]` or `{ x, y, z }`. Angles are degrees.\n */\n\nexport type SkyProjection = 'mollweide' | 'aitoff' | 'equirectangular';\nexport type SkyFrame = 'icrs' | 'galactic' | 'ecliptic';\nexport type SeriesStyle = 'line' | 'scatter' | 'step';\n\nexport const SKY_PROJECTIONS: readonly SkyProjection[] = ['mollweide', 'aitoff', 'equirectangular'];\n\nexport interface SkySource {\n ra: number;\n dec: number;\n label?: string;\n value?: number;\n}\n\nexport interface Point2D {\n x: number;\n y: number;\n err?: number;\n}\n\nexport interface Series2D {\n name: string;\n style: SeriesStyle;\n points: Point2D[];\n}\n\nexport interface MarkerLine {\n x: number;\n label?: string;\n}\n\nexport interface Point3D {\n x: number;\n y: number;\n z: number;\n label?: string;\n value?: number;\n}\n\nexport interface Path3D {\n name: string;\n points: Point3D[];\n}\n\ninterface ViewBase {\n title?: string;\n description?: string;\n}\n\nexport interface SkyMapView extends ViewBase {\n kind: 'skymap';\n projection: SkyProjection;\n frame: SkyFrame;\n valueLabel?: string;\n sources: SkySource[];\n}\n\nexport interface PlotView extends ViewBase {\n kind: 'spectrum' | 'lightcurve';\n xLabel: string;\n yLabel: string;\n /** Light curves in magnitudes plot brighter (smaller) values higher. */\n invertY: boolean;\n series: Series2D[];\n lines: MarkerLine[];\n}\n\nexport interface Scene3DView extends ViewBase {\n kind: 'scene3d';\n axes: { x: string; y: string; z: string };\n points: Point3D[];\n paths: Path3D[];\n}\n\nexport type VisualizationView = SkyMapView | PlotView | Scene3DView;\n\nexport const MAX_VISUALIZATIONS = 8;\n/** Matches the backend cap; extra elements are dropped rather than rendered. */\nexport const MAX_ELEMENTS_PER_VIEW = 20_000;\n\ntype Obj = Record<string, unknown>;\n\nfunction isObject(value: unknown): value is Obj {\n return typeof value === 'object' && value !== null && !Array.isArray(value);\n}\n\nfunction isFiniteNumber(value: unknown): value is number {\n return typeof value === 'number' && Number.isFinite(value);\n}\n\nfunction text(value: unknown): string | undefined {\n return typeof value === 'string' && value.trim() ? value.trim() : undefined;\n}\n\nfunction oneOf<T extends string>(value: unknown, allowed: readonly T[], fallback: T): T {\n return typeof value === 'string' && (allowed as readonly string[]).includes(value)\n ? (value as T)\n : fallback;\n}\n\n/** \"Wavelength\" + \"nm\" -> \"Wavelength (nm)\". */\nexport function axisTitle(label: string | undefined, unit: string | undefined, fallback: string) {\n const base = label ?? fallback;\n return unit ? `${base} (${unit})` : base;\n}\n\nfunction toPoint2D(raw: unknown): Point2D | null {\n if (Array.isArray(raw)) {\n const [x, y, err] = raw;\n if (!isFiniteNumber(x) || !isFiniteNumber(y)) return null;\n return isFiniteNumber(err) ? { x, y, err: Math.abs(err) } : { x, y };\n }\n if (isObject(raw) && isFiniteNumber(raw.x) && isFiniteNumber(raw.y)) {\n return isFiniteNumber(raw.err)\n ? { x: raw.x, y: raw.y, err: Math.abs(raw.err) }\n : { x: raw.x, y: raw.y };\n }\n return null;\n}\n\nfunction toPoint3D(raw: unknown): Point3D | null {\n if (Array.isArray(raw)) {\n const [x, y, z] = raw;\n return isFiniteNumber(x) && isFiniteNumber(y) && isFiniteNumber(z) ? { x, y, z } : null;\n }\n if (isObject(raw) && isFiniteNumber(raw.x) && isFiniteNumber(raw.y) && isFiniteNumber(raw.z)) {\n const point: Point3D = { x: raw.x, y: raw.y, z: raw.z };\n const label = text(raw.label);\n if (label) point.label = label;\n if (isFiniteNumber(raw.value)) point.value = raw.value;\n return point;\n }\n return null;\n}\n\nfunction arrayOf(value: unknown): unknown[] {\n return Array.isArray(value) ? value.slice(0, MAX_ELEMENTS_PER_VIEW) : [];\n}\n\nfunction parseSkyMap(view: Obj): SkyMapView | null {\n const sources: SkySource[] = [];\n for (const raw of arrayOf(view.sources)) {\n if (!isObject(raw) || !isFiniteNumber(raw.ra) || !isFiniteNumber(raw.dec)) continue;\n if (raw.ra < 0 || raw.ra > 360 || raw.dec < -90 || raw.dec > 90) continue;\n const source: SkySource = { ra: raw.ra, dec: raw.dec };\n const label = text(raw.label);\n if (label) source.label = label;\n if (isFiniteNumber(raw.value)) source.value = raw.value;\n sources.push(source);\n }\n if (sources.length === 0) return null;\n return {\n kind: 'skymap',\n title: text(view.title),\n description: text(view.description),\n projection: oneOf(view.projection, SKY_PROJECTIONS, 'mollweide'),\n frame: oneOf(view.frame, ['icrs', 'galactic', 'ecliptic'] as const, 'icrs'),\n valueLabel: text(view.valueLabel),\n sources,\n };\n}\n\nfunction parsePlot(view: Obj, kind: 'spectrum' | 'lightcurve'): PlotView | null {\n const series: Series2D[] = [];\n arrayOf(view.series).forEach((raw, i) => {\n if (!isObject(raw)) return;\n const points = arrayOf(raw.points)\n .map(toPoint2D)\n .filter((p): p is Point2D => p !== null);\n if (points.length < 2) return;\n series.push({\n name: text(raw.name) ?? `Series ${i + 1}`,\n style: oneOf(raw.style, ['line', 'scatter', 'step'] as const, 'line'),\n points,\n });\n });\n if (series.length === 0) return null;\n const lines: MarkerLine[] = [];\n for (const raw of arrayOf(view.lines)) {\n if (!isObject(raw) || !isFiniteNumber(raw.x)) continue;\n lines.push({ x: raw.x, label: text(raw.label) });\n }\n const magnitude = kind === 'lightcurve' && view.magnitude === true;\n const isSpectrum = kind === 'spectrum';\n return {\n kind,\n title: text(view.title),\n description: text(view.description),\n xLabel: axisTitle(text(view.xLabel), text(view.xUnit), isSpectrum ? 'Wavelength' : 'Time'),\n yLabel: axisTitle(\n text(view.yLabel),\n text(view.yUnit),\n isSpectrum ? 'Flux' : magnitude ? 'Magnitude' : 'Flux'\n ),\n invertY: magnitude,\n series,\n lines,\n };\n}\n\nfunction parseScene(view: Obj): Scene3DView | null {\n const points = arrayOf(view.points)\n .map(toPoint3D)\n .filter((p): p is Point3D => p !== null);\n const paths: Path3D[] = [];\n arrayOf(view.paths).forEach((raw, i) => {\n if (!isObject(raw)) return;\n const vertices = arrayOf(raw.points)\n .map(toPoint3D)\n .filter((p): p is Point3D => p !== null);\n if (vertices.length >= 2)\n paths.push({ name: text(raw.name) ?? `Path ${i + 1}`, points: vertices });\n });\n if (points.length === 0 && paths.length === 0) return null;\n const axes = isObject(view.axes) ? view.axes : {};\n return {\n kind: 'scene3d',\n title: text(view.title),\n description: text(view.description),\n axes: { x: text(axes.x) ?? 'x', y: text(axes.y) ?? 'y', z: text(axes.z) ?? 'z' },\n points,\n paths,\n };\n}\n\nfunction parseView(raw: unknown): VisualizationView | null {\n if (!isObject(raw)) return null;\n switch (raw.kind) {\n case 'skymap':\n return parseSkyMap(raw);\n case 'spectrum':\n return parsePlot(raw, 'spectrum');\n case 'lightcurve':\n return parsePlot(raw, 'lightcurve');\n case 'scene3d':\n return parseScene(raw);\n default:\n return null;\n }\n}\n\n/** Every renderable canonical view in an analysis `results` payload (may be empty). */\nexport function extractVisualizations(results: unknown): VisualizationView[] {\n if (!isObject(results)) return [];\n const raw: unknown[] = [];\n if (results.visualization !== undefined) raw.push(results.visualization);\n if (Array.isArray(results.visualizations)) raw.push(...results.visualizations);\n return raw\n .slice(0, MAX_VISUALIZATIONS)\n .map(parseView)\n .filter((v): v is VisualizationView => v !== null);\n}\n\n/** The view kind's display name, used for tabs and fallback titles. */\nexport function viewKindLabel(kind: VisualizationView['kind']): string {\n switch (kind) {\n case 'skymap':\n return 'Sky map';\n case 'spectrum':\n return 'Spectrum';\n case 'lightcurve':\n return 'Light curve';\n case 'scene3d':\n return '3-D scene';\n }\n}\n\n// ---------------------------------------------------------------------------\n// Sky projections\n// ---------------------------------------------------------------------------\n\nconst DEG = Math.PI / 180;\n\n/**\n * Project equatorial (or galactic) coordinates to normalised plane coordinates\n * in [-1, 1] x [-0.5, 0.5] (a 2:1 frame). Astronomical convention: longitude\n * increases to the LEFT (east is left when looking at the sky), centred on 180°.\n */\nexport function projectSky(\n lonDeg: number,\n latDeg: number,\n projection: SkyProjection\n): { x: number; y: number } {\n // Longitude relative to the centre, wrapped to [-180, 180], flipped east-left.\n let l = ((((lonDeg - 180) % 360) + 540) % 360) - 180;\n l = -l;\n const lambda = l * DEG;\n const phi = latDeg * DEG;\n\n if (projection === 'equirectangular') {\n return { x: l / 180, y: latDeg / 180 };\n }\n\n if (projection === 'aitoff') {\n // Clamp: rounding can push the product a hair above 1, and acos would return NaN.\n const alpha = Math.acos(Math.min(1, Math.cos(phi) * Math.cos(lambda / 2)));\n const sinc = alpha === 0 ? 1 : Math.sin(alpha) / alpha;\n const x = (2 * Math.cos(phi) * Math.sin(lambda / 2)) / sinc;\n const y = Math.sin(phi) / sinc;\n // Aitoff spans x in [-pi, pi], y in [-pi/2, pi/2].\n return { x: x / Math.PI, y: y / Math.PI };\n }\n\n // Mollweide: solve 2θ + sin 2θ = π sin φ by Newton iteration.\n let theta = phi;\n if (Math.abs(Math.abs(phi) - Math.PI / 2) < 1e-9) {\n theta = phi;\n } else {\n for (let i = 0; i < 50; i += 1) {\n const delta =\n -(2 * theta + Math.sin(2 * theta) - Math.PI * Math.sin(phi)) /\n (2 + 2 * Math.cos(2 * theta));\n theta += delta;\n if (Math.abs(delta) < 1e-10) break;\n }\n }\n const x = ((2 * Math.SQRT2) / Math.PI) * lambda * Math.cos(theta);\n const y = Math.SQRT2 * Math.sin(theta);\n // Mollweide spans x in [-2√2, 2√2], y in [-√2, √2].\n return { x: x / (2 * Math.SQRT2), y: y / (2 * Math.SQRT2) };\n}\n\n// ---------------------------------------------------------------------------\n// 3-D projection\n// ---------------------------------------------------------------------------\n\nexport interface Camera {\n /** Rotation about the vertical axis, degrees. */\n yaw: number;\n /** Rotation about the horizontal axis, degrees (clamped to ±89). */\n pitch: number;\n}\n\nexport const DEFAULT_CAMERA: Camera = { yaw: 35, pitch: 25 };\n\nexport function clampPitch(pitch: number): number {\n return Math.max(-89, Math.min(89, pitch));\n}\n\n/**\n * Orthographic projection of a point (already centred and scaled to roughly\n * unit size) for the given camera. Returns screen-plane x/y (y up) and a depth\n * where larger means nearer the viewer.\n */\nexport function projectPoint(\n p: { x: number; y: number; z: number },\n camera: Camera\n): { x: number; y: number; depth: number } {\n const yaw = camera.yaw * DEG;\n const pitch = camera.pitch * DEG;\n // Data convention: z is \"up\". Rotate about z (yaw), then tilt about x (pitch).\n const x1 = p.x * Math.cos(yaw) - p.y * Math.sin(yaw);\n const y1 = p.x * Math.sin(yaw) + p.y * Math.cos(yaw);\n const z1 = p.z;\n const screenY = z1 * Math.cos(pitch) - y1 * Math.sin(pitch);\n const depth = -(z1 * Math.sin(pitch) + y1 * Math.cos(pitch));\n return { x: x1, y: screenY, depth };\n}\n\n/**\n * Centre + uniform scale that fits every point inside a unit sphere.\n *\n * The scale is the bounding radius (the farthest point from the box centre),\n * not the largest half-extent: a unit cube's corners sit at sqrt(3), so a\n * half-extent scale would let rotation carry valid points outside the canvas.\n */\nexport function sceneNormalizer(points: Point3D[]): (p: Point3D) => Point3D {\n if (points.length === 0) return (p) => p;\n let minX = Infinity;\n let minY = Infinity;\n let minZ = Infinity;\n let maxX = -Infinity;\n let maxY = -Infinity;\n let maxZ = -Infinity;\n for (const p of points) {\n minX = Math.min(minX, p.x);\n minY = Math.min(minY, p.y);\n minZ = Math.min(minZ, p.z);\n maxX = Math.max(maxX, p.x);\n maxY = Math.max(maxY, p.y);\n maxZ = Math.max(maxZ, p.z);\n }\n const cx = (minX + maxX) / 2;\n const cy = (minY + maxY) / 2;\n const cz = (minZ + maxZ) / 2;\n let radius = 0;\n for (const p of points) {\n radius = Math.max(radius, Math.hypot(p.x - cx, p.y - cy, p.z - cz));\n }\n const scale = radius || 1;\n return (p) => ({ ...p, x: (p.x - cx) / scale, y: (p.y - cy) / scale, z: (p.z - cz) / scale });\n}\n\n// ---------------------------------------------------------------------------\n// Axis helpers shared by the 2-D plots\n// ---------------------------------------------------------------------------\n\n/** Upper bound on generated ticks, whatever the requested count. */\nconst MAX_TICKS = 50;\n\n/** Decimal places needed to tell ticks `step` apart (0 for whole steps). */\nfunction stepDecimals(step: number): number {\n if (!Number.isFinite(step) || step <= 0) return 0;\n return Math.min(100, Math.max(0, Math.ceil(-Math.log10(step) - 1e-9)));\n}\n\n/**\n * Rounded, human-friendly tick values across [min, max].\n *\n * Each tick is computed from its index (never by repeated addition) and the\n * loop is bounded, so a step below the floating-point spacing of the range\n * cannot spin forever; rounding uses the step's own precision so very small\n * scientific values (e.g. fluxes of 1e-15) keep distinct ticks. Ticks that\n * collapse to the same representable value are emitted once.\n */\nexport function niceTicks(min: number, max: number, count: number): number[] {\n if (!Number.isFinite(min) || !Number.isFinite(max) || min === max) return [min];\n const rawStep = (max - min) / Math.max(1, count);\n const mag = Math.pow(10, Math.floor(Math.log10(rawStep)));\n const norm = rawStep / mag;\n const step = (norm < 1.5 ? 1 : norm < 3 ? 2 : norm < 7 ? 5 : 10) * mag;\n // Number#toFixed accepts at most 100 digits.\n const decimals = Math.min(100, stepDecimals(step) + 1);\n const start = Math.ceil(min / step) * step;\n const ticks: number[] = [];\n for (let i = 0; i < MAX_TICKS; i += 1) {\n const raw = start + i * step;\n if (raw > max + step * 1e-6) break;\n const value = Number(raw.toFixed(decimals));\n if (ticks.length === 0 || ticks[ticks.length - 1] !== value) ticks.push(value);\n }\n return ticks.length > 0 ? ticks : [min];\n}\n\n/** Spacing between adjacent ticks, or undefined when there is only one. */\nexport function tickStep(ticks: number[]): number | undefined {\n return ticks.length > 1 ? Math.abs(ticks[1] - ticks[0]) : undefined;\n}\n\n/**\n * Compact tick label. When the tick spacing is known, the label keeps enough\n * precision to tell adjacent ticks apart (MJD 60200 vs 60201, or 1.0e-15 vs\n * 1.5e-15) instead of a fixed number of significant digits.\n */\nexport function formatTick(value: number, step?: number): string {\n if (value === 0) return '0';\n const abs = Math.abs(value);\n const hasStep = step !== undefined && Number.isFinite(step) && step > 0;\n if (abs < 1e-3 || abs >= 1e6) {\n if (!hasStep) return value.toExponential(1);\n const digits = Math.floor(Math.log10(abs)) - Math.floor(Math.log10(step)) + 1;\n return value.toExponential(Math.min(15, Math.max(1, digits - 1)));\n }\n if (!hasStep) {\n return Number(value.toPrecision(4)).toLocaleString(undefined, { maximumFractionDigits: 4 });\n }\n return value.toLocaleString(undefined, {\n maximumFractionDigits: Math.min(20, stepDecimals(step)),\n });\n}\n\n/**\n * Evenly downsample a long series so the SVG stays light on huge payloads.\n * The first and last items are always kept, so a thinned path still ends\n * where the data ends.\n */\nexport function downsample<T>(items: T[], max: number): T[] {\n if (items.length <= max) return items;\n if (max <= 1) return items.slice(0, Math.max(0, max));\n const stride = (items.length - 1) / (max - 1);\n const out: T[] = [];\n for (let i = 0; i < max; i += 1) out.push(items[Math.floor(i * stride)]);\n return out;\n}\n\n/**\n * Thin an x-sorted 2-D series to at most `max` points without losing the\n * features a scientist looks for. The series is split into `max / 2` buckets\n * and each bucket keeps its lowest and highest point (by y − err and y + err,\n * so the largest error bars survive too), in x order. Absorption and emission\n * peaks, flare maxima and eclipse minima therefore always remain visible,\n * which an even stride cannot guarantee. A thinned `step` series is redrawn\n * from these extremes, so its steps show each bucket's range rather than every\n * original bin; the view's thinning note says so.\n */\nexport function decimateSeries(points: Point2D[], max: number): Point2D[] {\n if (points.length <= max) return points;\n const buckets = Math.max(1, Math.floor(max / 2));\n const size = points.length / buckets;\n const out: Point2D[] = [];\n for (let b = 0; b < buckets; b += 1) {\n const start = Math.floor(b * size);\n const end = Math.min(points.length, Math.floor((b + 1) * size));\n let lo = start;\n let hi = start;\n for (let i = start; i < end; i += 1) {\n const p = points[i];\n const err = p.err ?? 0;\n if (p.y - err < points[lo].y - (points[lo].err ?? 0)) lo = i;\n if (p.y + err > points[hi].y + (points[hi].err ?? 0)) hi = i;\n }\n if (lo === hi) out.push(points[lo]);\n else if (lo < hi) out.push(points[lo], points[hi]);\n else out.push(points[hi], points[lo]);\n }\n return out;\n}\n\n/**\n * Number repeated tab labels (\"Spectrum 1\", \"Spectrum 2\") so untitled views of\n * the same kind stay distinguishable; unique labels are left as they are.\n */\nexport function tabLabels(\n labels: string[],\n numbered: (label: string, n: number) => string\n): string[] {\n const totals = new Map<string, number>();\n for (const label of labels) totals.set(label, (totals.get(label) ?? 0) + 1);\n const seen = new Map<string, number>();\n return labels.map((label) => {\n if ((totals.get(label) ?? 0) < 2) return label;\n const n = (seen.get(label) ?? 0) + 1;\n seen.set(label, n);\n return numbered(label, n);\n });\n}\n\n/**\n * Index of the point nearest to (`x`, `y`) in screen space, or -1 when no\n * point lies within `maxDistance`. Plots use it to turn a tap anywhere near a\n * line, step or scatter series into a readout of the closest measurement.\n */\nexport function nearestPoint(\n points: Array<{ x: number; y: number }>,\n x: number,\n y: number,\n maxDistance: number\n): number {\n let best = -1;\n let bestDistance = maxDistance;\n for (let i = 0; i < points.length; i += 1) {\n const d = Math.hypot(points[i].x - x, points[i].y - y);\n if (d <= bestDistance) {\n best = i;\n bestDistance = d;\n }\n }\n return best;\n}\n\n/**\n * A measured value at full precision, for readouts and data tables: unlike\n * {@link formatTick} it never rounds, so 1.23456e-15 or MJD 60200.123456\n * read back exactly as recorded.\n */\nexport function formatValue(value: number): string {\n return Object.is(value, -0) ? '0' : String(value);\n}\n"],"mappings":";AAuBA,IAAa,IAA4C;CAAC;CAAa;CAAU;AAAiB,GAyErF,IAAwB;AAIrC,SAAS,EAAS,GAA8B;CAC9C,OAAO,OAAO,KAAU,cAAY,KAAkB,CAAC,MAAM,QAAQ,CAAK;AAC5E;AAEA,SAAS,EAAe,GAAiC;CACvD,OAAO,OAAO,KAAU,YAAY,OAAO,SAAS,CAAK;AAC3D;AAEA,SAAS,EAAK,GAAoC;CAChD,OAAO,OAAO,KAAU,YAAY,EAAM,KAAK,IAAI,EAAM,KAAK,IAAI,KAAA;AACpE;AAEA,SAAS,EAAwB,GAAgB,GAAuB,GAAgB;CACtF,OAAO,OAAO,KAAU,YAAa,EAA8B,SAAS,CAAK,IAC5E,IACD;AACN;AAGA,SAAgB,EAAU,GAA2B,GAA0B,GAAkB;CAC/F,IAAM,IAAO,KAAS;CACtB,OAAO,IAAO,GAAG,EAAK,IAAI,EAAK,KAAK;AACtC;AAEA,SAAS,EAAU,GAA8B;CAC/C,IAAI,MAAM,QAAQ,CAAG,GAAG;EACtB,IAAM,CAAC,GAAG,GAAG,KAAO;EAEpB,OADI,CAAC,EAAe,CAAC,KAAK,CAAC,EAAe,CAAC,IAAU,OAC9C,EAAe,CAAG,IAAI;GAAE;GAAG;GAAG,KAAK,KAAK,IAAI,CAAG;EAAE,IAAI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I,IAAoB;CACrC,OAAO,EAAO,KAAK,MAAU;EAC3B,KAAK,EAAO,IAAI,CAAK,KAAK,KAAK,GAAG,OAAO;EACzC,IAAM,KAAK,EAAK,IAAI,CAAK,KAAK,KAAK;EAEnC,OADA,EAAK,IAAI,GAAO,CAAC,GACV,EAAS,GAAO,CAAC;CAC1B,CAAC;AACH;AAOA,SAAgB,EACd,GACA,GACA,GACA,GACQ;CACR,IAAI,IAAO,IACP,IAAe;CACnB,KAAK,IAAI,IAAI,GAAG,IAAI,EAAO,QAAQ,KAAK,GAAG;EACzC,IAAM,IAAI,KAAK,MAAM,EAAO,EAAE,CAAC,IAAI,GAAG,EAAO,EAAE,CAAC,IAAI,CAAC;EACrD,AAAI,KAAK,MACP,IAAO,GACP,IAAe;CAEnB;CACA,OAAO;AACT;AAOA,SAAgB,EAAY,GAAuB;CACjD,OAAO,OAAO,GAAG,GAAO,EAAE,IAAI,MAAM,OAAO,CAAK;AAClD"}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Representative canonical visualization payloads (BOFF-3984).
|
|
3
|
+
*
|
|
4
|
+
* Deterministic, physically plausible example data used by the Storybook
|
|
5
|
+
* stories and unit tests of the ScienceCanvas. They document the payload shapes
|
|
6
|
+
* that producers (notebooks, the SDKs, MCP agents) send to `cosCompleteAnalysis`;
|
|
7
|
+
* they are never rendered as if they were a real analysis' results.
|
|
8
|
+
*/
|
|
9
|
+
/** Bright stars (J2000 RA/Dec in degrees, V magnitude as the value). */
|
|
10
|
+
export declare const SAMPLE_SKYMAP: {
|
|
11
|
+
kind: string;
|
|
12
|
+
title: string;
|
|
13
|
+
projection: string;
|
|
14
|
+
frame: string;
|
|
15
|
+
valueLabel: string;
|
|
16
|
+
sources: {
|
|
17
|
+
ra: number;
|
|
18
|
+
dec: number;
|
|
19
|
+
label: string;
|
|
20
|
+
value: number;
|
|
21
|
+
}[];
|
|
22
|
+
};
|
|
23
|
+
/** Optical spectrum with H-alpha / H-beta emission and a fitted continuum model. */
|
|
24
|
+
export declare const SAMPLE_SPECTRUM: {
|
|
25
|
+
kind: string;
|
|
26
|
+
title: string;
|
|
27
|
+
xLabel: string;
|
|
28
|
+
xUnit: string;
|
|
29
|
+
yLabel: string;
|
|
30
|
+
yUnit: string;
|
|
31
|
+
series: {
|
|
32
|
+
name: string;
|
|
33
|
+
style: string;
|
|
34
|
+
points: number[][];
|
|
35
|
+
}[];
|
|
36
|
+
lines: {
|
|
37
|
+
x: number;
|
|
38
|
+
label: string;
|
|
39
|
+
}[];
|
|
40
|
+
};
|
|
41
|
+
/** Phase-sampled light curve of an eclipsing binary, in magnitudes. */
|
|
42
|
+
export declare const SAMPLE_LIGHTCURVE: {
|
|
43
|
+
kind: string;
|
|
44
|
+
title: string;
|
|
45
|
+
xLabel: string;
|
|
46
|
+
xUnit: string;
|
|
47
|
+
yLabel: string;
|
|
48
|
+
yUnit: string;
|
|
49
|
+
magnitude: boolean;
|
|
50
|
+
series: {
|
|
51
|
+
name: string;
|
|
52
|
+
style: string;
|
|
53
|
+
points: {
|
|
54
|
+
x: number;
|
|
55
|
+
y: number;
|
|
56
|
+
err: number;
|
|
57
|
+
}[];
|
|
58
|
+
}[];
|
|
59
|
+
};
|
|
60
|
+
/** Inner solar system: planets at a single epoch plus their orbits (AU). */
|
|
61
|
+
export declare const SAMPLE_SCENE3D: {
|
|
62
|
+
kind: string;
|
|
63
|
+
title: string;
|
|
64
|
+
axes: {
|
|
65
|
+
x: string;
|
|
66
|
+
y: string;
|
|
67
|
+
z: string;
|
|
68
|
+
};
|
|
69
|
+
points: {
|
|
70
|
+
x: number;
|
|
71
|
+
y: number;
|
|
72
|
+
z: number;
|
|
73
|
+
label: string;
|
|
74
|
+
}[];
|
|
75
|
+
paths: {
|
|
76
|
+
name: string;
|
|
77
|
+
points: number[][];
|
|
78
|
+
}[];
|
|
79
|
+
};
|
|
80
|
+
//# sourceMappingURL=visualizationSamples.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"visualizationSamples.d.ts","sourceRoot":"","sources":["../../../src/cosmicintersection/lib/visualizationSamples.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,wEAAwE;AACxE,eAAO,MAAM,aAAa;;;;;;;;;;;;CAwBzB,CAAC;AAaF,oFAAoF;AACpF,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;CA6B3B,CAAC;AAEF,uEAAuE;AACvE,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;CAwB7B,CAAC;AAEF,4EAA4E;AAC5E,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;CA2B1B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AnalysesPage.d.ts","sourceRoot":"","sources":["../../../../src/cosmicintersection/pages/analyses/AnalysesPage.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AnalysesPage.d.ts","sourceRoot":"","sources":["../../../../src/cosmicintersection/pages/analyses/AnalysesPage.tsx"],"names":[],"mappings":"AA6lBA,MAAM,CAAC,OAAO,UAAU,YAAY,gCAoXnC"}
|