@rubin-epo/epo-widget-lib 2.1.0 → 2.2.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.
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("react/jsx-runtime"),c=require("@rubin-epo/epo-react-lib/styles");require("../Base/index.cjs");require("../XAxis/index.cjs");require("../YAxis/index.cjs");require("../Guidelines/index.cjs");require("../Tooltip/index.cjs");require("../Bars/index.cjs");const d=require("../Viewport/index.cjs"),y=require("../ForeignObject/index.cjs");require("../ScatterPlot/index.cjs");const o=require("./styles.cjs"),j=(r="")=>{const i=["top","right"],a=["center","center"],n=r?[...r.split(" "),...a].slice(0,2):i,e={justifyContent:null,alignItems:null};return n.forEach(s=>{switch(s){case"center":e.alignItems=e.alignItems??"center",e.justifyContent=e.justifyContent??"center";break;case"top":e.alignItems="start";break;case"right":e.justifyContent="end";break;case"bottom":e.alignItems="end";break;case"left":e.justifyContent="start";break}}),e},u=({className:r,children:i,position:a,viewport:n,forIds:e,forScreenreaders:s})=>{const l=t.jsx(y.default,{children:t.jsx(o.DisplayContainer,{style:j(a),children:t.jsxs(o.Display,{form:Array.isArray(e)?e.join(" "):e,className:r,children:[t.jsx("span",{"aria-hidden":!!s,children:i}),t.jsx(c.ScreenreaderText,{children:s})]})})});return n?t.jsx(d.default,{...n,children:l}):l};u.displayName="Charts.Readout";exports.default=u;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("react/jsx-runtime"),u=require("@rubin-epo/epo-react-lib/styles"),o=require("./styles.cjs"),d=require("../ForeignObject/index.cjs"),y=require("../Viewport/index.cjs"),j=(n="")=>{const r=["top","right"],a=["center","center"],s=n?[...n.split(" "),...a].slice(0,2):r,e={justifyContent:null,alignItems:null};return s.forEach(i=>{switch(i){case"center":e.alignItems=e.alignItems??"center",e.justifyContent=e.justifyContent??"center";break;case"top":e.alignItems="start";break;case"right":e.justifyContent="end";break;case"bottom":e.alignItems="end";break;case"left":e.justifyContent="start";break}}),e},c=({className:n,children:r,position:a,viewport:s,forIds:e,forScreenreaders:i})=>{const l=t.jsx(d.default,{children:t.jsx(o.DisplayContainer,{style:j(a),children:t.jsxs(o.Display,{form:Array.isArray(e)?e.join(" "):e,className:n,children:[t.jsx("span",{"aria-hidden":!!i,children:r}),t.jsx(u.ScreenreaderText,{children:i})]})})});return s?t.jsx(y.default,{...s,children:l}):l};c.displayName="Charts.Readout";exports.default=c;
@@ -1,22 +1,15 @@
1
1
  import { jsx as e, jsxs as l } from "react/jsx-runtime";
2
2
  import { ScreenreaderText as c } from "@rubin-epo/epo-react-lib/styles";
3
- import "../Base/index.js";
4
- import "../XAxis/index.js";
5
- import "../YAxis/index.js";
6
- import "../Guidelines/index.js";
7
- import "../Tooltip/index.js";
8
- import "../Bars/index.js";
9
- import m from "../Viewport/index.js";
10
- import p from "../ForeignObject/index.js";
11
- import "../ScatterPlot/index.js";
12
- import { DisplayContainer as f, Display as u } from "./styles.js";
13
- const d = (i = "") => {
14
- const o = ["top", "right"], s = ["center", "center"], r = i ? [...i.split(" "), ...s].slice(0, 2) : o, t = {
3
+ import { DisplayContainer as m, Display as f } from "./styles.js";
4
+ import u from "../ForeignObject/index.js";
5
+ import d from "../Viewport/index.js";
6
+ const p = (n = "") => {
7
+ const s = ["top", "right"], o = ["center", "center"], i = n ? [...n.split(" "), ...o].slice(0, 2) : s, t = {
15
8
  justifyContent: null,
16
9
  alignItems: null
17
10
  };
18
- return r.forEach((n) => {
19
- switch (n) {
11
+ return i.forEach((r) => {
12
+ switch (r) {
20
13
  case "center":
21
14
  t.alignItems = t.alignItems ?? "center", t.justifyContent = t.justifyContent ?? "center";
22
15
  break;
@@ -35,25 +28,25 @@ const d = (i = "") => {
35
28
  }
36
29
  }), t;
37
30
  }, y = ({
38
- className: i,
39
- children: o,
40
- position: s,
41
- viewport: r,
31
+ className: n,
32
+ children: s,
33
+ position: o,
34
+ viewport: i,
42
35
  forIds: t,
43
- forScreenreaders: n
36
+ forScreenreaders: r
44
37
  }) => {
45
- const a = /* @__PURE__ */ e(p, { children: /* @__PURE__ */ e(f, { style: d(s), children: /* @__PURE__ */ l(
46
- u,
38
+ const a = /* @__PURE__ */ e(u, { children: /* @__PURE__ */ e(m, { style: p(o), children: /* @__PURE__ */ l(
39
+ f,
47
40
  {
48
41
  form: Array.isArray(t) ? t.join(" ") : t,
49
- className: i,
42
+ className: n,
50
43
  children: [
51
- /* @__PURE__ */ e("span", { "aria-hidden": !!n, children: o }),
52
- /* @__PURE__ */ e(c, { children: n })
44
+ /* @__PURE__ */ e("span", { "aria-hidden": !!r, children: s }),
45
+ /* @__PURE__ */ e(c, { children: r })
53
46
  ]
54
47
  }
55
48
  ) }) });
56
- return r ? /* @__PURE__ */ e(m, { ...r, children: a }) : a;
49
+ return i ? /* @__PURE__ */ e(d, { ...i, children: a }) : a;
57
50
  };
58
51
  y.displayName = "Charts.Readout";
59
52
  export {
@@ -1 +1 @@
1
- "use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const n=require("react/jsx-runtime"),J=require("react");require("../Base/index.cjs");const K=require("../XAxis/index.cjs"),Q=require("../YAxis/index.cjs"),$=require("../Guidelines/index.cjs"),U=require("../Points/index.cjs"),V=require("../Tooltip/index.cjs"),X=require("../ClippingContainer/index.cjs");require("../Bars/index.cjs");require("../Viewport/index.cjs");const R=require("../hooks/useAxis.cjs"),Y=require("./styles.cjs"),H=require("../defaults.cjs"),Z=require("../canvas/Points/index.cjs"),w={svg:U.default,canvas:Z.default},M=({data:C,className:D,xAxis:l,yAxis:c,width:d,height:u,title:T,activePointId:p,margins:z,tooltip:a,onLoadedCallback:B,renderer:E="svg",plotChildren:y})=>{const[q,h]=J.useState(),{label:O,points:x}=C,o={...H.default.margins,...z},e=typeof q<"u"?x[q]:x.find(({id:v})=>v===p),f=[0+o.left,d-o.right],b=[u-o.bottom,0+o.top],[r,j,t]=R.default({...l,range:f}),[i,m,s]=R.default({...c,range:b}),S=s(i[0]),g=t(r[0]),I=s(i[1]),_=t(r[1]),k="x-axis-label",L="y-axis-label",N=Math.abs(f[1]-f[0]),W=Math.abs(b[1]-b[0]),F=w[E],P=n.jsx(F,{data:x,onHoverCallback:a?v=>h(v):void 0,onHoverOutCallback:a?()=>h(void 0):void 0,width:d,height:u,xScale:t,yScale:s,label:O,onLoadedCallback:B}),G={Data:P,xScale:t,yScale:s,yStart:S,yEnd:I,xStart:g,xEnd:_,yDomain:i,xDomain:r};return n.jsxs(Y.Chart,{verticalLabel:c.label,verticalLabelId:L,horizontalLabel:l.label,horizontalLabelId:k,className:D,width:d,height:u,title:T,children:[n.jsx(Q.default,{ticks:m,x:g,labelledById:L,yDomain:i,yScale:s}),n.jsxs(X.default,{x:g,y:I,width:N,height:W,children:[l.guidelines&&n.jsx($.default,{guides:j.length,direction:"vertical",xDomain:r,yDomain:i,xScale:t,yScale:s}),c.guidelines&&n.jsx($.default,{guides:m.length,xDomain:r,yDomain:i,xScale:t,yScale:s}),y?y(G):P]}),n.jsx(K.default,{ticks:j,y:S,labelledById:k,xDomain:r,xScale:t}),a&&n.jsxs(V.default,{x:e?t(e.x):void 0,y:e?s(e.y):void 0,visible:!!e,offset:H.default.pointRadius,children:[e&&typeof a=="function"&&a(e),e&&typeof a=="string"&&a]})]})};M.displayName="Charts.ScatterPlot";exports.default=M;
1
+ "use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const n=require("react/jsx-runtime"),J=require("react"),$=require("../hooks/useAxis.cjs"),K=require("./styles.cjs"),R=require("../defaults.cjs"),Q=require("../canvas/Points/index.cjs"),U=require("../YAxis/index.cjs"),V=require("../ClippingContainer/index.cjs"),H=require("../Guidelines/index.cjs"),X=require("../XAxis/index.cjs"),Y=require("../Tooltip/index.cjs"),Z=require("../Points/index.cjs"),w={svg:Z.default,canvas:Q.default},M=({data:C,className:D,xAxis:l,yAxis:c,width:d,height:u,title:T,activePointId:p,margins:z,tooltip:a,onLoadedCallback:B,renderer:E="svg",plotChildren:y})=>{const[q,h]=J.useState(),{label:O,points:x}=C,o={...R.default.margins,...z},e=typeof q<"u"?x[q]:x.find(({id:v})=>v===p),f=[0+o.left,d-o.right],b=[u-o.bottom,0+o.top],[r,j,t]=$.default({...l,range:f}),[i,m,s]=$.default({...c,range:b}),S=s(i[0]),g=t(r[0]),I=s(i[1]),_=t(r[1]),k="x-axis-label",L="y-axis-label",N=Math.abs(f[1]-f[0]),W=Math.abs(b[1]-b[0]),F=w[E],P=n.jsx(F,{data:x,onHoverCallback:a?v=>h(v):void 0,onHoverOutCallback:a?()=>h(void 0):void 0,width:d,height:u,xScale:t,yScale:s,label:O,onLoadedCallback:B}),G={Data:P,xScale:t,yScale:s,yStart:S,yEnd:I,xStart:g,xEnd:_,yDomain:i,xDomain:r};return n.jsxs(K.Chart,{verticalLabel:c.label,verticalLabelId:L,horizontalLabel:l.label,horizontalLabelId:k,className:D,width:d,height:u,title:T,children:[n.jsx(U.default,{ticks:m,x:g,labelledById:L,yDomain:i,yScale:s}),n.jsxs(V.default,{x:g,y:I,width:N,height:W,children:[l.guidelines&&n.jsx(H.default,{guides:j.length,direction:"vertical",xDomain:r,yDomain:i,xScale:t,yScale:s}),c.guidelines&&n.jsx(H.default,{guides:m.length,xDomain:r,yDomain:i,xScale:t,yScale:s}),y?y(G):P]}),n.jsx(X.default,{ticks:j,y:S,labelledById:k,xDomain:r,xScale:t}),a&&n.jsxs(Y.default,{x:e?t(e.x):void 0,y:e?s(e.y):void 0,visible:!!e,offset:R.default.pointRadius,children:[e&&typeof a=="function"&&a(e),e&&typeof a=="string"&&a]})]})};M.displayName="Charts.ScatterPlot";exports.default=M;
@@ -1,22 +1,19 @@
1
1
  "use client";
2
- import { jsxs as u, jsx as s } from "react/jsx-runtime";
2
+ import { jsxs as u, jsx as i } from "react/jsx-runtime";
3
3
  import { useState as F } from "react";
4
- import "../Base/index.js";
5
- import J from "../XAxis/index.js";
6
- import K from "../YAxis/index.js";
7
- import R from "../Guidelines/index.js";
8
- import Q from "../Points/index.js";
9
- import U from "../Tooltip/index.js";
10
- import V from "../ClippingContainer/index.js";
11
- import "../Bars/index.js";
12
- import "../Viewport/index.js";
13
- import D from "../hooks/useAxis.js";
14
- import { Chart as Z } from "./styles.js";
15
- import T from "../defaults.js";
16
- import _ from "../canvas/Points/index.js";
4
+ import R from "../hooks/useAxis.js";
5
+ import { Chart as J } from "./styles.js";
6
+ import D from "../defaults.js";
7
+ import K from "../canvas/Points/index.js";
8
+ import Q from "../YAxis/index.js";
9
+ import U from "../ClippingContainer/index.js";
10
+ import T from "../Guidelines/index.js";
11
+ import V from "../XAxis/index.js";
12
+ import Z from "../Tooltip/index.js";
13
+ import _ from "../Points/index.js";
17
14
  const $ = {
18
- svg: Q,
19
- canvas: _
15
+ svg: _,
16
+ canvas: K
20
17
  }, w = ({
21
18
  data: j,
22
19
  className: z,
@@ -32,32 +29,32 @@ const $ = {
32
29
  renderer: G = "svg",
33
30
  plotChildren: x
34
31
  }) => {
35
- const [y, h] = F(), { label: N, points: f } = j, a = { ...T.margins, ...M }, t = typeof y < "u" ? f[y] : f.find(({ id: v }) => v === E), p = [0 + a.left, d - a.right], b = [m - a.bottom, 0 + a.top], [i, I, o] = D({ ...l, range: p }), [r, P, e] = D({ ...c, range: b }), S = e(r[0]), g = o(i[0]), k = e(r[1]), O = o(i[1]), C = "x-axis-label", L = "y-axis-label", W = Math.abs(p[1] - p[0]), X = Math.abs(b[1] - b[0]), Y = $[G], H = /* @__PURE__ */ s(
32
+ const [y, h] = F(), { label: N, points: f } = j, r = { ...D.margins, ...M }, t = typeof y < "u" ? f[y] : f.find(({ id: p }) => p === E), b = [0 + r.left, d - r.right], g = [m - r.bottom, 0 + r.top], [s, I, e] = R({ ...l, range: b }), [a, P, o] = R({ ...c, range: g }), S = o(a[0]), v = e(s[0]), k = o(a[1]), O = e(s[1]), C = "x-axis-label", L = "y-axis-label", W = Math.abs(b[1] - b[0]), X = Math.abs(g[1] - g[0]), Y = $[G], H = /* @__PURE__ */ i(
36
33
  Y,
37
34
  {
38
35
  data: f,
39
- onHoverCallback: n ? (v) => h(v) : void 0,
36
+ onHoverCallback: n ? (p) => h(p) : void 0,
40
37
  onHoverOutCallback: n ? () => h(void 0) : void 0,
41
38
  width: d,
42
39
  height: m,
43
- xScale: o,
44
- yScale: e,
40
+ xScale: e,
41
+ yScale: o,
45
42
  label: N,
46
43
  onLoadedCallback: A
47
44
  }
48
45
  ), q = {
49
46
  Data: H,
50
- xScale: o,
51
- yScale: e,
47
+ xScale: e,
48
+ yScale: o,
52
49
  yStart: S,
53
50
  yEnd: k,
54
- xStart: g,
51
+ xStart: v,
55
52
  xEnd: O,
56
- yDomain: r,
57
- xDomain: i
53
+ yDomain: a,
54
+ xDomain: s
58
55
  };
59
56
  return /* @__PURE__ */ u(
60
- Z,
57
+ J,
61
58
  {
62
59
  verticalLabel: c.label,
63
60
  verticalLabelId: L,
@@ -68,66 +65,66 @@ const $ = {
68
65
  height: m,
69
66
  title: B,
70
67
  children: [
71
- /* @__PURE__ */ s(
72
- K,
68
+ /* @__PURE__ */ i(
69
+ Q,
73
70
  {
74
71
  ticks: P,
75
- x: g,
72
+ x: v,
76
73
  labelledById: L,
77
- yDomain: r,
78
- yScale: e
74
+ yDomain: a,
75
+ yScale: o
79
76
  }
80
77
  ),
81
78
  /* @__PURE__ */ u(
82
- V,
79
+ U,
83
80
  {
84
- x: g,
81
+ x: v,
85
82
  y: k,
86
83
  width: W,
87
84
  height: X,
88
85
  children: [
89
- l.guidelines && /* @__PURE__ */ s(
90
- R,
86
+ l.guidelines && /* @__PURE__ */ i(
87
+ T,
91
88
  {
92
89
  guides: I.length,
93
90
  direction: "vertical",
94
- xDomain: i,
95
- yDomain: r,
96
- xScale: o,
97
- yScale: e
91
+ xDomain: s,
92
+ yDomain: a,
93
+ xScale: e,
94
+ yScale: o
98
95
  }
99
96
  ),
100
- c.guidelines && /* @__PURE__ */ s(
101
- R,
97
+ c.guidelines && /* @__PURE__ */ i(
98
+ T,
102
99
  {
103
100
  guides: P.length,
104
- xDomain: i,
105
- yDomain: r,
106
- xScale: o,
107
- yScale: e
101
+ xDomain: s,
102
+ yDomain: a,
103
+ xScale: e,
104
+ yScale: o
108
105
  }
109
106
  ),
110
107
  x ? x(q) : H
111
108
  ]
112
109
  }
113
110
  ),
114
- /* @__PURE__ */ s(
115
- J,
111
+ /* @__PURE__ */ i(
112
+ V,
116
113
  {
117
114
  ticks: I,
118
115
  y: S,
119
116
  labelledById: C,
120
- xDomain: i,
121
- xScale: o
117
+ xDomain: s,
118
+ xScale: e
122
119
  }
123
120
  ),
124
121
  n && /* @__PURE__ */ u(
125
- U,
122
+ Z,
126
123
  {
127
- x: t ? o(t.x) : void 0,
128
- y: t ? e(t.y) : void 0,
124
+ x: t ? e(t.x) : void 0,
125
+ y: t ? o(t.y) : void 0,
129
126
  visible: !!t,
130
- offset: T.pointRadius,
127
+ offset: D.pointRadius,
131
128
  children: [
132
129
  t && typeof n == "function" && n(t),
133
130
  t && typeof n == "string" && n
@@ -12,7 +12,6 @@ export declare const SwappableOrbitsData: {
12
12
  objectColor: string;
13
13
  objectRadius: number;
14
14
  }[];
15
- defaultZoom: number;
16
15
  };
17
16
  swappableOrbits: boolean;
18
17
  };
@@ -59,7 +58,6 @@ export declare const PrimaryData: {
59
58
  selectionCallback: () => void;
60
59
  paused: boolean;
61
60
  pov: string;
62
- defaultZoom: number;
63
61
  potentialOrbits: null;
64
62
  observations: null;
65
63
  noDetails: boolean;
@@ -98,7 +96,6 @@ export declare const PotentialOrbitsData: {
98
96
  selectionCallback: () => void;
99
97
  paused: null;
100
98
  pov: null;
101
- defaultZoom: number;
102
99
  potentialOrbits: boolean;
103
100
  observations: ({
104
101
  id: string;
@@ -163,7 +160,6 @@ export declare const ObjectDetailsData: {
163
160
  selectionCallback: () => void;
164
161
  paused: null;
165
162
  pov: null;
166
- defaultZoom: number;
167
163
  potentialOrbits: null;
168
164
  observations: null;
169
165
  detailsSet: string;
@@ -3,23 +3,25 @@ import { ReactNode } from 'react';
3
3
  export interface OrbitalSimProviderProps {
4
4
  children: ReactNode;
5
5
  orbitData: Orbits;
6
+ defaultZoom: number;
6
7
  showDetailsTable?: boolean;
7
8
  allowOrbitRotation?: boolean;
8
9
  showTimeControls?: boolean;
9
- selectedAnswer: string | null;
10
- updateSelectedAnswer: (newSelectedAnswer: string | null) => void;
10
+ selectedAnswer?: string | null;
11
+ updateSelectedAnswer?: (newSelectedAnswer: string | null) => void;
11
12
  swappableOrbits?: boolean;
12
13
  selectedNeoIndex?: number;
13
14
  }
14
15
  export type OrbitalSimContextValues = {
15
16
  orbits: Orbits;
17
+ defaultZoom: number;
16
18
  showDetailsTable?: boolean;
17
19
  allowOrbitRotation?: boolean;
18
20
  showTimeControls?: boolean;
19
21
  setOrbits: React.Dispatch<React.SetStateAction<Orbits>>;
20
22
  observations: Observation[];
21
23
  updateActiveObservation: (activeId: string) => void;
22
- selectedAnswer: string | null;
24
+ selectedAnswer?: string | null;
23
25
  swappableOrbits: boolean;
24
26
  selectedNeoIndex?: number;
25
27
  };
@@ -51,7 +53,6 @@ export type Orbits = {
51
53
  observations: Observation[];
52
54
  paused: boolean;
53
55
  pov: string | null;
54
- defaultZoom: number | null;
55
56
  potentialOrbits: boolean;
56
57
  noDetails: boolean;
57
58
  refObjs: string[] | null;
@@ -1 +1 @@
1
- "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("react/jsx-runtime"),e=require("react"),c=e.createContext(null);function j(){const s=e.useContext(c);if(!s)throw new Error("OrbitalSim components cannot be rendered outside the OrbitalSimContext.Provider component.");return s}function h({children:s,orbitData:r,showDetailsTable:f=!1,allowOrbitRotation:b=!1,showTimeControls:v=!1,selectedAnswer:i,updateSelectedAnswer:p,swappableOrbits:m=!1,selectedNeoIndex:S}){const[l,u]=e.useState({neos:null,activeNeo:null,observations:[],paused:!1,pov:null,defaultZoom:null,potentialOrbits:!1,noDetails:!1,refObjs:null,noControls:!1}),[t,O]=e.useState(()=>l.observations??[]);e.useEffect(()=>{u(r),O(r.observations)},[r]);const d=e.useMemo(()=>t&&t.length>0?t.map(n=>({...n,isActive:n.label===i})):[],[i,t]),x=n=>{if(t&&t.length>0){let P=t.map(o=>o.id==n?{...o,isActive:!0}:{...o,isActive:!1});O(P);const a=t.find(o=>o.id===n);p((a==null?void 0:a.label)||null)}},C=e.useMemo(()=>({orbits:l,showDetailsTable:f,allowOrbitRotation:b,showTimeControls:v,setOrbits:u,observations:d,updateActiveObservation:x,selectedAnswer:i,swappableOrbits:m,selectedNeoIndex:S}),[l,f,b,v,u,d,x,i,m,S]);return g.jsx(c.Provider,{value:C,children:s})}exports.OrbitalSimContext=c;exports.OrbitalSimProvider=h;exports.useOrbitalSimContext=j;
1
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const j=require("react/jsx-runtime"),n=require("react"),a=n.createContext(null);function h(){const s=n.useContext(a);if(!s)throw new Error("OrbitalSim components cannot be rendered outside the OrbitalSimContext.Provider component.");return s}function M({children:s,orbitData:r,defaultZoom:c,showDetailsTable:b=!1,allowOrbitRotation:f=!1,showTimeControls:v=!1,selectedAnswer:o,updateSelectedAnswer:m,swappableOrbits:O=!1,selectedNeoIndex:S}){const[l,u]=n.useState({neos:null,activeNeo:null,observations:[],paused:!1,pov:null,potentialOrbits:!1,noDetails:!1,refObjs:null,noControls:!1}),[t,x]=n.useState(()=>l.observations??[]);n.useEffect(()=>{u(r),x(r.observations)},[r]);const C=n.useMemo(()=>t&&t.length>0?t.map(i=>({...i,isActive:i.label===o})):[],[o,t]),p=i=>{if(t&&t.length>0){let P=t.map(e=>e.id==i?{...e,isActive:!0}:{...e,isActive:!1});if(x(P),m){const e=t.find(g=>g.id===i);m((e==null?void 0:e.label)||null)}}},d=n.useMemo(()=>({orbits:l,defaultZoom:c,showDetailsTable:b,allowOrbitRotation:f,showTimeControls:v,setOrbits:u,observations:C,updateActiveObservation:p,selectedAnswer:o,swappableOrbits:O,selectedNeoIndex:S}),[l,c,b,f,v,u,C,p,o,O,S]);return j.jsx(a.Provider,{value:d,children:s})}exports.OrbitalSimContext=a;exports.OrbitalSimProvider=M;exports.useOrbitalSimContext=h;
@@ -27,4 +27,4 @@ export declare function useOrbitalSimContext(): OrbitalSimContextValues;
27
27
  *
28
28
  * @returns
29
29
  */
30
- export declare function OrbitalSimProvider({ children, orbitData, showDetailsTable, allowOrbitRotation, showTimeControls, selectedAnswer, updateSelectedAnswer, swappableOrbits, selectedNeoIndex }: OrbitalSimProviderProps): import("react/jsx-runtime").JSX.Element;
30
+ export declare function OrbitalSimProvider({ children, orbitData, defaultZoom, showDetailsTable, allowOrbitRotation, showTimeControls, selectedAnswer, updateSelectedAnswer, swappableOrbits, selectedNeoIndex }: OrbitalSimProviderProps): import("react/jsx-runtime").JSX.Element;
@@ -1,80 +1,83 @@
1
1
  "use client";
2
- import { jsx as g } from "react/jsx-runtime";
3
- import { createContext as j, useState as x, useEffect as A, useMemo as S, useContext as E } from "react";
4
- const d = j(null);
5
- function Z() {
6
- const o = E(d);
2
+ import { jsx as j } from "react/jsx-runtime";
3
+ import { createContext as E, useState as S, useEffect as A, useMemo as C, useContext as M } from "react";
4
+ const h = E(null);
5
+ function q() {
6
+ const o = M(h);
7
7
  if (!o)
8
8
  throw new Error(
9
9
  "OrbitalSim components cannot be rendered outside the OrbitalSimContext.Provider component."
10
10
  );
11
11
  return o;
12
12
  }
13
- function k({
13
+ function y({
14
14
  children: o,
15
15
  orbitData: i,
16
+ defaultZoom: u,
16
17
  showDetailsTable: a = !1,
17
18
  allowOrbitRotation: f = !1,
18
19
  showTimeControls: c = !1,
19
20
  selectedAnswer: s,
20
- updateSelectedAnswer: C,
21
- swappableOrbits: v = !1,
22
- selectedNeoIndex: b
21
+ updateSelectedAnswer: v,
22
+ swappableOrbits: b = !1,
23
+ selectedNeoIndex: m
23
24
  }) {
24
- const [r, l] = x({
25
+ const [r, l] = S({
25
26
  neos: null,
26
27
  activeNeo: null,
27
28
  observations: [],
28
29
  paused: !1,
29
30
  pov: null,
30
- defaultZoom: null,
31
31
  potentialOrbits: !1,
32
32
  noDetails: !1,
33
33
  refObjs: null,
34
34
  noControls: !1
35
- }), [t, m] = x(
35
+ }), [t, p] = S(
36
36
  () => r.observations ?? []
37
37
  );
38
38
  A(() => {
39
- l(i), m(i.observations);
39
+ l(i), p(i.observations);
40
40
  }, [i]);
41
- const p = S(
42
- () => t && t.length > 0 ? t.map((e) => ({ ...e, isActive: e.label === s })) : [],
41
+ const O = C(
42
+ () => t && t.length > 0 ? t.map((n) => ({ ...n, isActive: n.label === s })) : [],
43
43
  [s, t]
44
- ), O = (e) => {
44
+ ), x = (n) => {
45
45
  if (t && t.length > 0) {
46
- let P = t.map((n) => n.id == e ? { ...n, isActive: !0 } : { ...n, isActive: !1 });
47
- m(P);
48
- const u = t.find((n) => n.id === e);
49
- C((u == null ? void 0 : u.label) || null);
46
+ let d = t.map((e) => e.id == n ? { ...e, isActive: !0 } : { ...e, isActive: !1 });
47
+ if (p(d), v) {
48
+ const e = t.find((g) => g.id === n);
49
+ v((e == null ? void 0 : e.label) || null);
50
+ }
50
51
  }
51
- }, h = S(() => ({
52
+ }, P = C(() => ({
52
53
  orbits: r,
54
+ defaultZoom: u,
53
55
  showDetailsTable: a,
54
56
  allowOrbitRotation: f,
55
57
  showTimeControls: c,
56
58
  setOrbits: l,
57
- observations: p,
58
- updateActiveObservation: O,
59
+ observations: O,
60
+ updateActiveObservation: x,
59
61
  selectedAnswer: s,
60
- swappableOrbits: v,
61
- selectedNeoIndex: b
62
+ swappableOrbits: b,
63
+ selectedNeoIndex: m
62
64
  }), [
63
65
  r,
66
+ u,
64
67
  a,
65
68
  f,
66
69
  c,
67
70
  l,
68
- p,
69
71
  O,
72
+ x,
70
73
  s,
71
- v,
72
- b
74
+ b,
75
+ m
73
76
  ]);
74
- return /* @__PURE__ */ g(d.Provider, { value: h, children: o });
77
+ return /* @__PURE__ */ j(h.Provider, { value: P, children: o });
75
78
  }
76
79
  export {
77
- d as OrbitalSimContext,
78
- k as OrbitalSimProvider,
79
- Z as useOrbitalSimContext
80
+ h as OrbitalSimContext,
81
+ y as OrbitalSimProvider,
82
+ q as useOrbitalSimContext
80
83
  };
@@ -1 +1 @@
1
- "use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("react/jsx-runtime"),s=require("react"),M=require("./Orbitals/OrbitalDetails.cjs"),N=require("./Camera/CameraController.cjs"),V=require("./Camera/Camera.cjs"),W=require("./Orbitals/Orbitals.cjs"),B=require("./Sun.cjs"),G=require("./Controls/PlaybackSpeed.cjs"),I=require("./Controls/PlaybackControls.cjs"),n=require("./styles.cjs"),A=require("./Context/index.cjs");function H(){const{orbits:i,showDetailsTable:q,allowOrbitRotation:v,showTimeControls:m,swappableOrbits:x,selectedNeoIndex:y}=A.useOrbitalSimContext(),{paused:h,pov:P,defaultZoom:c,potentialOrbits:w}=i,u={min:1157e-8,max:365.25,initial:11.574,step:1},[l,a]=s.useState(!h),[D,o]=s.useState(1),[k,j]=s.useState(0),[O,d]=s.useState(h?0:u.initial),[g,p]=s.useState(0),[r,b]=s.useState(0),[C,R]=s.useState(1),[f,T]=s.useState({neos:[{Principal_desig:""}]});s.useEffect(()=>{m||(a(!1),d(0)),r>0?(d(u.initial),o(1),p(0),b(-1)):r<0&&(p(0),a(!0),b(0))},[r]);const Z=t=>{d(+t)},_=()=>{l||o(1),a(!l)},F=()=>{a(t=>!1),b(t=>t+1)},z=t=>{a(!1),o(1),j(S=>S+1)},L=t=>{a(!1),o(-1),j(S=>S+1)},E=t=>{T({neos:[t]})};return e.jsxs(e.Fragment,{children:[e.jsx(n.GlobalStyles,{}),e.jsxs(n.OrbitalSimWrapper,{children:[x?e.jsx(n.SwappableOrbitsContainer,{children:i&&i.neos&&i.neos.map(t=>e.jsx(n.SwappableOrbitButton,{onClick:()=>E(t),"data-active":Object.keys(f).length?t.Principal_desig===f.neos[0].Principal_desig:!1,children:t.Ref}))}):e.jsxs(e.Fragment,{children:[q&&e.jsx(M.default,{}),m&&e.jsxs(e.Fragment,{children:[e.jsx(G.default,{elapsedTime:g,dayPerVizSec:O,speeds:u,sliderOnChangeCallback:Z}),e.jsx(I.default,{playing:l,handleStartStop:_,handleNext:z,handlePrevious:L,isDisabled:!1,handleReset:F})]})]}),e.jsxs(n.CanvasWrapper,{orthographic:!0,children:[e.jsx(N.default,{pov:v?null:P??"top",reset:r}),e.jsx(V.default,{near:-1e3,far:1e3,position:[0,0,10],defaultZoom:c||3}),e.jsx("ambientLight",{intensity:.9}),e.jsx(W.default,{defaultZoom:c||1,playing:l,stepDirection:D,dayPerVizSec:O,frameOverride:k,potentialOrbits:w,elapsedTime:g,setElapsedTime:p,reset:r,zoomLevel:C,setZoomLevel:R,selectedNeoIndex:y,orbits:x?f:i}),e.jsx(B.default,{zoomLevel:C,defaultZoom:c||1})]})]})]})}exports.default=H;
1
+ "use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("react/jsx-runtime"),s=require("react"),M=require("./Orbitals/OrbitalDetails.cjs"),N=require("./Camera/CameraController.cjs"),V=require("./Camera/Camera.cjs"),W=require("./Orbitals/Orbitals.cjs"),B=require("./Sun.cjs"),G=require("./Controls/PlaybackSpeed.cjs"),I=require("./Controls/PlaybackControls.cjs"),n=require("./styles.cjs"),A=require("./Context/index.cjs");function H(){const{orbits:i,defaultZoom:l,showDetailsTable:q,allowOrbitRotation:v,showTimeControls:m,swappableOrbits:x,selectedNeoIndex:y}=A.useOrbitalSimContext(),{paused:h,pov:P,potentialOrbits:w}=i,u={min:1157e-8,max:365.25,initial:11.574,step:1},[o,a]=s.useState(!h),[D,c]=s.useState(1),[k,j]=s.useState(0),[O,d]=s.useState(h?0:u.initial),[g,p]=s.useState(0),[r,b]=s.useState(0),[C,R]=s.useState(l),[f,T]=s.useState({neos:[{Principal_desig:""}]});s.useEffect(()=>{m||(a(!1),d(0)),r>0?(d(u.initial),c(1),p(0),b(-1)):r<0&&(p(0),a(!0),b(0))},[r]);const Z=t=>{d(+t)},_=()=>{o||c(1),a(!o)},F=()=>{a(t=>!1),b(t=>t+1)},z=t=>{a(!1),c(1),j(S=>S+1)},L=t=>{a(!1),c(-1),j(S=>S+1)},E=t=>{T({neos:[t]})};return e.jsxs(e.Fragment,{children:[e.jsx(n.GlobalStyles,{}),e.jsxs(n.OrbitalSimWrapper,{children:[x?e.jsx(n.SwappableOrbitsContainer,{children:i&&i.neos&&i.neos.map(t=>e.jsx(n.SwappableOrbitButton,{onClick:()=>E(t),"data-active":Object.keys(f).length?t.Principal_desig===f.neos[0].Principal_desig:!1,children:t.Ref}))}):e.jsxs(e.Fragment,{children:[q&&e.jsx(M.default,{}),m&&e.jsxs(e.Fragment,{children:[e.jsx(G.default,{elapsedTime:g,dayPerVizSec:O,speeds:u,sliderOnChangeCallback:Z}),e.jsx(I.default,{playing:o,handleStartStop:_,handleNext:z,handlePrevious:L,isDisabled:!1,handleReset:F})]})]}),e.jsxs(n.CanvasWrapper,{orthographic:!0,children:[e.jsx(N.default,{pov:v?null:P??"top",reset:r}),e.jsx(V.default,{near:-1e3,far:1e3,position:[0,0,10],defaultZoom:l||3}),e.jsx("ambientLight",{intensity:.9}),e.jsx(W.default,{defaultZoom:l||1,playing:o,stepDirection:D,dayPerVizSec:O,frameOverride:k,potentialOrbits:w,elapsedTime:g,setElapsedTime:p,reset:r,zoomLevel:C,setZoomLevel:R,selectedNeoIndex:y,orbits:x?f:i}),e.jsx(B.default,{zoomLevel:C,defaultZoom:l||1})]})]})]})}exports.default=H;
@@ -11,25 +11,24 @@ import J from "./Controls/PlaybackControls.js";
11
11
  import { GlobalStyles as K, OrbitalSimWrapper as M, SwappableOrbitsContainer as Q, SwappableOrbitButton as U, CanvasWrapper as X } from "./styles.js";
12
12
  import { useOrbitalSimContext as Y } from "./Context/index.js";
13
13
  function me() {
14
- const { orbits: o, showDetailsTable: P, allowOrbitRotation: x, showTimeControls: S, swappableOrbits: O, selectedNeoIndex: D } = Y(), {
14
+ const { orbits: o, defaultZoom: l, showDetailsTable: P, allowOrbitRotation: x, showTimeControls: S, swappableOrbits: O, selectedNeoIndex: D } = Y(), {
15
15
  paused: C,
16
16
  pov: k,
17
- defaultZoom: p,
18
17
  potentialOrbits: Z
19
- } = o, c = { min: 1157e-8, max: 365.25, initial: 11.574, step: 1 }, [l, a] = i(!C), [R, n] = i(1), [T, g] = i(0), [v, m] = i(C ? 0 : c.initial), [w, d] = i(0), [r, f] = i(0), [y, j] = i(1), [b, z] = i({ neos: [{ Principal_desig: "" }] });
18
+ } = o, c = { min: 1157e-8, max: 365.25, initial: 11.574, step: 1 }, [n, a] = i(!C), [R, p] = i(1), [T, g] = i(0), [v, m] = i(C ? 0 : c.initial), [w, d] = i(0), [r, f] = i(0), [y, j] = i(l), [b, z] = i({ neos: [{ Principal_desig: "" }] });
20
19
  W(() => {
21
- S || (a(!1), m(0)), r > 0 ? (m(c.initial), n(1), d(0), f(-1)) : r < 0 && (d(0), a(!0), f(0));
20
+ S || (a(!1), m(0)), r > 0 ? (m(c.initial), p(1), d(0), f(-1)) : r < 0 && (d(0), a(!0), f(0));
22
21
  }, [r]);
23
22
  const L = (e) => {
24
23
  m(+e);
25
24
  }, _ = () => {
26
- l || n(1), a(!l);
25
+ n || p(1), a(!n);
27
26
  }, E = () => {
28
27
  a((e) => !1), f((e) => e + 1);
29
28
  }, F = (e) => {
30
- a(!1), n(1), g((u) => u + 1);
29
+ a(!1), p(1), g((u) => u + 1);
31
30
  }, N = (e) => {
32
- a(!1), n(-1), g((u) => u + 1);
31
+ a(!1), p(-1), g((u) => u + 1);
33
32
  }, V = (e) => {
34
33
  z({
35
34
  neos: [e]
@@ -60,7 +59,7 @@ function me() {
60
59
  /* @__PURE__ */ t(
61
60
  J,
62
61
  {
63
- playing: l,
62
+ playing: n,
64
63
  handleStartStop: _,
65
64
  handleNext: F,
66
65
  handlePrevious: N,
@@ -78,15 +77,15 @@ function me() {
78
77
  near: -1e3,
79
78
  far: 1e3,
80
79
  position: [0, 0, 10],
81
- defaultZoom: p || 3
80
+ defaultZoom: l || 3
82
81
  }
83
82
  ),
84
83
  /* @__PURE__ */ t("ambientLight", { intensity: 0.9 }),
85
84
  /* @__PURE__ */ t(
86
85
  q,
87
86
  {
88
- defaultZoom: p || 1,
89
- playing: l,
87
+ defaultZoom: l || 1,
88
+ playing: n,
90
89
  stepDirection: R,
91
90
  dayPerVizSec: v,
92
91
  frameOverride: T,
@@ -104,7 +103,7 @@ function me() {
104
103
  A,
105
104
  {
106
105
  zoomLevel: y,
107
- defaultZoom: p || 1
106
+ defaultZoom: l || 1
108
107
  }
109
108
  )
110
109
  ] })
@@ -1 +1 @@
1
- "use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("react/jsx-runtime"),b=require("react"),_=require("d3-geo-projection"),S=require("d3-geo"),M=require("d3-array"),E=require("../../../charts/Base/index.cjs");require("../../../charts/XAxis/index.cjs");require("../../../charts/YAxis/index.cjs");require("../../../charts/Guidelines/index.cjs");const N=require("../../../charts/Tooltip/index.cjs");require("../../../charts/Bars/index.cjs");require("../../../charts/Viewport/index.cjs");require("../../../charts/ScatterPlot/index.cjs");const U=require("../../../atomic/ImageStack/index.cjs"),r=require("./styles.cjs"),y=({className:L,objects:p=[],images:v=[],visibleImages:w=[],describedById:G})=>{const[O,P]=b.useState(!1),[x,f]=b.useState(),l=600,c=300,n={top:20,right:0,bottom:20,left:20},W=l+n.right+n.left,$=c+n.top+n.bottom,d=15,u=30,j=-90,m=90,g=-180,q=180,h=2,i=_.geoAitoff(),s=S.geoGraticule();s.step([u,d]),s.extent([[g,j],[q,m]]),i.fitExtent([[n.left,n.top],[n.left+l-h,n.top+c]],s.outline());const B=M.range(j+d,m,d),A=M.range(g+u,q,u),C=S.geoPath(i).pointRadius(6),a=t=>C(t)||void 0,o=typeof x<"u"?p[x]:void 0,k=(o?i([o==null?void 0:o.long,o==null?void 0:o.lat]):[0,0])||[0,0];return e.jsxs(E.default,{width:W,height:$,className:L,children:[e.jsx("mask",{id:"imageMask",children:e.jsx("path",{d:a(s.outline()),fill:"white"})}),e.jsx(r.Background,{d:a(s.outline())}),e.jsx(r.Graticule,{d:a(s())}),e.jsx(r.ImageStackerWrapper,{style:{"--image-stack-opacity":O&&1},x:n.left,y:n.top,width:l-h,height:c,mask:"url(#imageMask)",children:e.jsx(U.default,{images:v,describedById:G,visible:w,loadCallback:()=>P(!0),showBackdrop:!1,showLoader:!1})}),e.jsx("g",{children:p.map(({id:t,lat:H,long:R},T)=>e.jsx(r.UserObject,{d:a({type:"Point",coordinates:[R,H]}),onMouseOver:()=>f(T),onMouseOut:()=>f(void 0)},t))}),e.jsx("g",{"aria-hidden":"true",children:B.map(t=>t===0?null:e.jsxs(r.LatLabel,{style:{dominantBaseline:t>0?"text-after-edge":"text-before-edge"},transform:`translate(${i([g,t])})`,children:[t,"°"]},t))}),e.jsx("g",{"aria-hidden":"true",children:A.map(t=>e.jsxs(r.LongLabel,{transform:`translate(${i([t,0])})`,children:[t,"°"]},t))}),e.jsx(r.Outline,{strokeWidth:h,d:a(s.outline())}),e.jsx(N.default,{visible:!!o,x:k[0],y:k[1],children:o==null?void 0:o.id})]})};y.displayName="Widgets.SupernovaThreeVector.Skymap";exports.default=y;
1
+ "use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("react/jsx-runtime"),S=require("react"),_=require("d3-geo-projection"),M=require("d3-geo"),q=require("d3-array"),E=require("../../../atomic/ImageStack/index.cjs"),a=require("./styles.cjs"),N=require("../../../charts/Base/index.cjs"),U=require("../../../charts/Tooltip/index.cjs"),y=({className:L,objects:p=[],images:v=[],visibleImages:w=[],describedById:G})=>{const[O,P]=S.useState(!1),[x,f]=S.useState(),l=600,c=300,n={top:20,right:0,bottom:20,left:20},W=l+n.right+n.left,$=c+n.top+n.bottom,d=15,u=30,j=-90,m=90,g=-180,k=180,h=2,i=_.geoAitoff(),s=M.geoGraticule();s.step([u,d]),s.extent([[g,j],[k,m]]),i.fitExtent([[n.left,n.top],[n.left+l-h,n.top+c]],s.outline());const B=q.range(j+d,m,d),A=q.range(g+u,k,u),C=M.geoPath(i).pointRadius(6),r=t=>C(t)||void 0,o=typeof x<"u"?p[x]:void 0,b=(o?i([o==null?void 0:o.long,o==null?void 0:o.lat]):[0,0])||[0,0];return e.jsxs(N.default,{width:W,height:$,className:L,children:[e.jsx("mask",{id:"imageMask",children:e.jsx("path",{d:r(s.outline()),fill:"white"})}),e.jsx(a.Background,{d:r(s.outline())}),e.jsx(a.Graticule,{d:r(s())}),e.jsx(a.ImageStackerWrapper,{style:{"--image-stack-opacity":O&&1},x:n.left,y:n.top,width:l-h,height:c,mask:"url(#imageMask)",children:e.jsx(E.default,{images:v,describedById:G,visible:w,loadCallback:()=>P(!0),showBackdrop:!1,showLoader:!1})}),e.jsx("g",{children:p.map(({id:t,lat:H,long:R},T)=>e.jsx(a.UserObject,{d:r({type:"Point",coordinates:[R,H]}),onMouseOver:()=>f(T),onMouseOut:()=>f(void 0)},t))}),e.jsx("g",{"aria-hidden":"true",children:B.map(t=>t===0?null:e.jsxs(a.LatLabel,{style:{dominantBaseline:t>0?"text-after-edge":"text-before-edge"},transform:`translate(${i([g,t])})`,children:[t,"°"]},t))}),e.jsx("g",{"aria-hidden":"true",children:A.map(t=>e.jsxs(a.LongLabel,{transform:`translate(${i([t,0])})`,children:[t,"°"]},t))}),e.jsx(a.Outline,{strokeWidth:h,d:r(s.outline())}),e.jsx(U.default,{visible:!!o,x:b[0],y:b[1],children:o==null?void 0:o.id})]})};y.displayName="Widgets.SupernovaThreeVector.Skymap";exports.default=y;
@@ -1,19 +1,13 @@
1
1
  "use client";
2
- import { jsxs as h, jsx as o } from "react/jsx-runtime";
2
+ import { jsxs as h, jsx as e } from "react/jsx-runtime";
3
3
  import { useState as L } from "react";
4
4
  import { geoAitoff as E } from "d3-geo-projection";
5
5
  import { geoGraticule as N, geoPath as R } from "d3-geo";
6
6
  import { range as M } from "d3-array";
7
- import U from "../../../charts/Base/index.js";
8
- import "../../../charts/XAxis/index.js";
9
- import "../../../charts/YAxis/index.js";
10
- import "../../../charts/Guidelines/index.js";
11
- import V from "../../../charts/Tooltip/index.js";
12
- import "../../../charts/Bars/index.js";
13
- import "../../../charts/Viewport/index.js";
14
- import "../../../charts/ScatterPlot/index.js";
15
- import q from "../../../atomic/ImageStack/index.js";
16
- import { Background as z, Graticule as D, ImageStackerWrapper as F, UserObject as J, LatLabel as K, LongLabel as Q, Outline as X } from "./styles.js";
7
+ import U from "../../../atomic/ImageStack/index.js";
8
+ import { Background as V, Graticule as q, ImageStackerWrapper as z, UserObject as D, LatLabel as F, LongLabel as J, Outline as K } from "./styles.js";
9
+ import Q from "../../../charts/Base/index.js";
10
+ import X from "../../../charts/Tooltip/index.js";
17
11
  const Y = ({
18
12
  className: y,
19
13
  objects: g = [],
@@ -21,38 +15,38 @@ const Y = ({
21
15
  visibleImages: w = [],
22
16
  describedById: B
23
17
  }) => {
24
- const [O, W] = L(!1), [f, u] = L(), s = 600, l = 300, i = {
18
+ const [O, W] = L(!1), [f, u] = L(), s = 600, l = 300, a = {
25
19
  top: 20,
26
20
  right: 0,
27
21
  bottom: 20,
28
22
  left: 20
29
- }, j = s + i.right + i.left, C = l + i.top + i.bottom, c = 15, d = 30, k = -90, x = 90, p = -180, b = 180, m = 2, a = E(), r = N();
30
- r.step([d, c]), r.extent([
23
+ }, j = s + a.right + a.left, C = l + a.top + a.bottom, c = 15, d = 30, k = -90, x = 90, p = -180, b = 180, m = 2, i = E(), n = N();
24
+ n.step([d, c]), n.extent([
31
25
  [p, k],
32
26
  [b, x]
33
- ]), a.fitExtent(
27
+ ]), i.fitExtent(
34
28
  [
35
- [i.left, i.top],
36
- [i.left + s - m, i.top + l]
29
+ [a.left, a.top],
30
+ [a.left + s - m, a.top + l]
37
31
  ],
38
- r.outline()
32
+ n.outline()
39
33
  );
40
- const G = M(k + c, x, c), H = M(p + d, b, d), P = R(a).pointRadius(6), n = (t) => P(t) || void 0, e = typeof f < "u" ? g[f] : void 0, S = (e ? a([e == null ? void 0 : e.long, e == null ? void 0 : e.lat]) : [0, 0]) || [0, 0];
41
- return /* @__PURE__ */ h(U, { width: j, height: C, className: y, children: [
42
- /* @__PURE__ */ o("mask", { id: "imageMask", children: /* @__PURE__ */ o("path", { d: n(r.outline()), fill: "white" }) }),
43
- /* @__PURE__ */ o(z, { d: n(r.outline()) }),
44
- /* @__PURE__ */ o(D, { d: n(r()) }),
45
- /* @__PURE__ */ o(
46
- F,
34
+ const G = M(k + c, x, c), H = M(p + d, b, d), P = R(i).pointRadius(6), r = (t) => P(t) || void 0, o = typeof f < "u" ? g[f] : void 0, S = (o ? i([o == null ? void 0 : o.long, o == null ? void 0 : o.lat]) : [0, 0]) || [0, 0];
35
+ return /* @__PURE__ */ h(Q, { width: j, height: C, className: y, children: [
36
+ /* @__PURE__ */ e("mask", { id: "imageMask", children: /* @__PURE__ */ e("path", { d: r(n.outline()), fill: "white" }) }),
37
+ /* @__PURE__ */ e(V, { d: r(n.outline()) }),
38
+ /* @__PURE__ */ e(q, { d: r(n()) }),
39
+ /* @__PURE__ */ e(
40
+ z,
47
41
  {
48
42
  style: { "--image-stack-opacity": O && 1 },
49
- x: i.left,
50
- y: i.top,
43
+ x: a.left,
44
+ y: a.top,
51
45
  width: s - m,
52
46
  height: l,
53
47
  mask: "url(#imageMask)",
54
- children: /* @__PURE__ */ o(
55
- q,
48
+ children: /* @__PURE__ */ e(
49
+ U,
56
50
  {
57
51
  images: v,
58
52
  describedById: B,
@@ -64,10 +58,10 @@ const Y = ({
64
58
  )
65
59
  }
66
60
  ),
67
- /* @__PURE__ */ o("g", { children: g.map(({ id: t, lat: T, long: $ }, A) => /* @__PURE__ */ o(
68
- J,
61
+ /* @__PURE__ */ e("g", { children: g.map(({ id: t, lat: T, long: $ }, A) => /* @__PURE__ */ e(
62
+ D,
69
63
  {
70
- d: n({
64
+ d: r({
71
65
  type: "Point",
72
66
  coordinates: [$, T]
73
67
  }),
@@ -76,14 +70,14 @@ const Y = ({
76
70
  },
77
71
  t
78
72
  )) }),
79
- /* @__PURE__ */ o("g", { "aria-hidden": "true", children: G.map(
73
+ /* @__PURE__ */ e("g", { "aria-hidden": "true", children: G.map(
80
74
  (t) => t === 0 ? null : /* @__PURE__ */ h(
81
- K,
75
+ F,
82
76
  {
83
77
  style: {
84
78
  dominantBaseline: t > 0 ? "text-after-edge" : "text-before-edge"
85
79
  },
86
- transform: `translate(${a([p, t])})`,
80
+ transform: `translate(${i([p, t])})`,
87
81
  children: [
88
82
  t,
89
83
  "°"
@@ -92,10 +86,10 @@ const Y = ({
92
86
  t
93
87
  )
94
88
  ) }),
95
- /* @__PURE__ */ o("g", { "aria-hidden": "true", children: H.map((t) => /* @__PURE__ */ h(
96
- Q,
89
+ /* @__PURE__ */ e("g", { "aria-hidden": "true", children: H.map((t) => /* @__PURE__ */ h(
90
+ J,
97
91
  {
98
- transform: `translate(${a([t, 0])})`,
92
+ transform: `translate(${i([t, 0])})`,
99
93
  children: [
100
94
  t,
101
95
  "°"
@@ -103,20 +97,20 @@ const Y = ({
103
97
  },
104
98
  t
105
99
  )) }),
106
- /* @__PURE__ */ o(
107
- X,
100
+ /* @__PURE__ */ e(
101
+ K,
108
102
  {
109
103
  strokeWidth: m,
110
- d: n(r.outline())
104
+ d: r(n.outline())
111
105
  }
112
106
  ),
113
- /* @__PURE__ */ o(
114
- V,
107
+ /* @__PURE__ */ e(
108
+ X,
115
109
  {
116
- visible: !!e,
110
+ visible: !!o,
117
111
  x: S[0],
118
112
  y: S[1],
119
- children: e == null ? void 0 : e.id
113
+ children: o == null ? void 0 : o.id
120
114
  }
121
115
  )
122
116
  ] });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rubin-epo/epo-widget-lib",
3
- "version": "2.1.0",
3
+ "version": "2.2.0",
4
4
  "description": "Rubin Observatory Education & Public Outreach team React scientific and educational widgets.",
5
5
  "author": "Rubin EPO",
6
6
  "license": "MIT",
@@ -28,7 +28,7 @@
28
28
  "test": "jest --max-workers=2",
29
29
  "test:generate-output": "yarn test --json --outputFile=.jest-test-results.json || true",
30
30
  "prepublishOnly": "yarn build",
31
- "release-old": "semantic-release -e semantic-release-monorepo --debug"
31
+ "release": "semantic-release -e semantic-release-monorepo --debug"
32
32
  },
33
33
  "files": [
34
34
  "README.md",
@@ -69,7 +69,7 @@
69
69
  "@types/d3-array": "^3.2.1",
70
70
  "@types/d3-geo": "^3.1.0",
71
71
  "@types/react": "19.2.3",
72
- "@types/react-dom": "19.2.3`",
72
+ "@types/react-dom": "19.2.3",
73
73
  "@vitejs/plugin-react": "^4",
74
74
  "babel-loader": "^8.3.0",
75
75
  "eslint-plugin-storybook": "^0.11.4",