@rubin-epo/epo-widget-lib 2.0.5 → 2.0.7

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.
@@ -12,6 +12,7 @@ export declare const SwappableOrbitsData: {
12
12
  objectColor: string;
13
13
  objectRadius: number;
14
14
  }[];
15
+ defaultZoom: number;
15
16
  };
16
17
  swappableOrbits: boolean;
17
18
  };
@@ -153,7 +154,7 @@ export declare const ObjectDetailsData: {
153
154
  selectionCallback: () => void;
154
155
  paused: null;
155
156
  pov: null;
156
- defaultZoom: null;
157
+ defaultZoom: number;
157
158
  potentialOrbits: null;
158
159
  observations: null;
159
160
  detailsSet: string;
@@ -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"),V=require("./Camera/CameraController.cjs"),W=require("./Camera/Camera.cjs"),B=require("./Orbitals/Orbitals.cjs"),G=require("./Sun.cjs"),N=require("./Controls/PlaybackSpeed.cjs"),A=require("./Controls/PlaybackControls.cjs"),l=require("./styles.cjs"),H=require("./Context/index.cjs");function I(){const{orbits:i,showDetailsTable:q,allowOrbitRotation:v,showTimeControls:m,swappableOrbits:x}=H.useOrbitalSimContext(),{paused:h,pov:y,defaultZoom:c,potentialOrbits:w,detailsRows:P}=i,u={min:1157e-8,max:365.25,initial:11.574,step:1},[n,a]=s.useState(!h),[D,o]=s.useState(1),[R,j]=s.useState(0),[O,d]=s.useState(h?0:u.initial),[g,p]=s.useState(0),[r,b]=s.useState(0),[C,k]=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)},_=()=>{n||o(1),a(!n)},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(l.GlobalStyles,{}),e.jsxs(l.OrbitalSimWrapper,{children:[x?e.jsx(l.SwappableOrbitsContainer,{children:i&&i.neos&&i.neos.map(t=>e.jsx(l.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:[P&&q&&e.jsx(M.default,{}),m&&e.jsxs(e.Fragment,{children:[e.jsx(N.default,{elapsedTime:g,dayPerVizSec:O,speeds:u,sliderOnChangeCallback:Z}),e.jsx(A.default,{playing:n,handleStartStop:_,handleNext:z,handlePrevious:L,isDisabled:!1,handleReset:F})]})]}),e.jsxs(l.CanvasWrapper,{orthographic:!0,children:[e.jsx(V.default,{pov:v?null:y??"top",reset:r}),e.jsx(W.default,{left:-15e3,right:15e3,top:15e3,bottom:-15e3,near:.1,far:3e4,position:[0,0,8e3],defaultZoom:c||1}),e.jsx("ambientLight",{intensity:.9}),e.jsx(B.default,{defaultZoom:c||1,playing:n,stepDirection:D,dayPerVizSec:O,frameOverride:R,potentialOrbits:w,elapsedTime:g,setElapsedTime:p,reset:r,zoomLevel:C,setZoomLevel:k,orbits:x?f:i}),e.jsx(G.default,{zoomLevel:C,defaultZoom:c||1})]})]})]})}exports.default=I;
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"),V=require("./Camera/CameraController.cjs"),W=require("./Camera/Camera.cjs"),B=require("./Orbitals/Orbitals.cjs"),G=require("./Sun.cjs"),N=require("./Controls/PlaybackSpeed.cjs"),A=require("./Controls/PlaybackControls.cjs"),l=require("./styles.cjs"),H=require("./Context/index.cjs");function I(){const{orbits:i,showDetailsTable:q,allowOrbitRotation:v,showTimeControls:m,swappableOrbits:x}=H.useOrbitalSimContext(),{paused:h,pov:y,defaultZoom:c,potentialOrbits:w,detailsRows:P}=i,u={min:1157e-8,max:365.25,initial:11.574,step:1},[n,a]=s.useState(!h),[D,o]=s.useState(1),[R,j]=s.useState(0),[O,d]=s.useState(h?0:u.initial),[g,p]=s.useState(0),[r,b]=s.useState(0),[C,k]=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)},_=()=>{n||o(1),a(!n)},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(l.GlobalStyles,{}),e.jsxs(l.OrbitalSimWrapper,{children:[x?e.jsx(l.SwappableOrbitsContainer,{children:i&&i.neos&&i.neos.map(t=>e.jsx(l.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:[P&&q&&e.jsx(M.default,{}),m&&e.jsxs(e.Fragment,{children:[e.jsx(N.default,{elapsedTime:g,dayPerVizSec:O,speeds:u,sliderOnChangeCallback:Z}),e.jsx(A.default,{playing:n,handleStartStop:_,handleNext:z,handlePrevious:L,isDisabled:!1,handleReset:F})]})]}),e.jsxs(l.CanvasWrapper,{orthographic:!0,children:[e.jsx(V.default,{pov:v?null:y??"top",reset:r}),e.jsx(W.default,{near:-1e3,far:1e3,position:[0,0,10],defaultZoom:c||3}),e.jsx("ambientLight",{intensity:.9}),e.jsx(B.default,{defaultZoom:c||1,playing:n,stepDirection:D,dayPerVizSec:O,frameOverride:R,potentialOrbits:w,elapsedTime:g,setElapsedTime:p,reset:r,zoomLevel:C,setZoomLevel:k,orbits:x?f:i}),e.jsx(G.default,{zoomLevel:C,defaultZoom:c||1})]})]})]})}exports.default=I;
@@ -10,27 +10,27 @@ import I from "./Controls/PlaybackSpeed.js";
10
10
  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
- function ce() {
14
- const { orbits: a, showDetailsTable: P, allowOrbitRotation: D, showTimeControls: S, swappableOrbits: O } = Y(), {
13
+ function me() {
14
+ const { orbits: o, showDetailsTable: P, allowOrbitRotation: D, showTimeControls: S, swappableOrbits: O } = Y(), {
15
15
  paused: C,
16
16
  pov: x,
17
17
  defaultZoom: p,
18
18
  potentialOrbits: k,
19
19
  detailsRows: R
20
- } = a, m = { min: 1157e-8, max: 365.25, initial: 11.574, step: 1 }, [l, o] = i(!C), [Z, n] = i(1), [T, g] = i(0), [w, c] = i(C ? 0 : m.initial), [v, d] = i(0), [r, f] = i(0), [y, j] = i(1), [b, z] = i({ neos: [{ Principal_desig: "" }] });
20
+ } = o, c = { min: 1157e-8, max: 365.25, initial: 11.574, step: 1 }, [l, a] = i(!C), [Z, n] = i(1), [T, g] = i(0), [w, m] = i(C ? 0 : c.initial), [v, d] = i(0), [r, f] = i(0), [y, j] = i(1), [b, z] = i({ neos: [{ Principal_desig: "" }] });
21
21
  B(() => {
22
- S || (o(!1), c(0)), r > 0 ? (c(m.initial), n(1), d(0), f(-1)) : r < 0 && (d(0), o(!0), f(0));
22
+ S || (a(!1), m(0)), r > 0 ? (m(c.initial), n(1), d(0), f(-1)) : r < 0 && (d(0), a(!0), f(0));
23
23
  }, [r]);
24
24
  const L = (e) => {
25
- c(+e);
25
+ m(+e);
26
26
  }, _ = () => {
27
- l || n(1), o(!l);
27
+ l || n(1), a(!l);
28
28
  }, E = () => {
29
- o((e) => !1), f((e) => e + 1);
29
+ a((e) => !1), f((e) => e + 1);
30
30
  }, F = (e) => {
31
- o(!1), n(1), g((u) => u + 1);
31
+ a(!1), n(1), g((u) => u + 1);
32
32
  }, V = (e) => {
33
- o(!1), n(-1), g((u) => u + 1);
33
+ a(!1), n(-1), g((u) => u + 1);
34
34
  }, W = (e) => {
35
35
  z({
36
36
  neos: [e]
@@ -39,7 +39,7 @@ function ce() {
39
39
  return /* @__PURE__ */ s(h, { children: [
40
40
  /* @__PURE__ */ t(K, {}),
41
41
  /* @__PURE__ */ s(M, { children: [
42
- O ? /* @__PURE__ */ t(Q, { children: a && a.neos && a.neos.map((e) => /* @__PURE__ */ t(
42
+ O ? /* @__PURE__ */ t(Q, { children: o && o.neos && o.neos.map((e) => /* @__PURE__ */ t(
43
43
  U,
44
44
  {
45
45
  onClick: () => W(e),
@@ -54,7 +54,7 @@ function ce() {
54
54
  {
55
55
  elapsedTime: v,
56
56
  dayPerVizSec: w,
57
- speeds: m,
57
+ speeds: c,
58
58
  sliderOnChangeCallback: L
59
59
  }
60
60
  ),
@@ -76,14 +76,10 @@ function ce() {
76
76
  /* @__PURE__ */ t(
77
77
  q,
78
78
  {
79
- left: -15e3,
80
- right: 15e3,
81
- top: 15e3,
82
- bottom: -15e3,
83
- near: 0.1,
84
- far: 3e4,
85
- position: [0, 0, 8e3],
86
- defaultZoom: p || 1
79
+ near: -1e3,
80
+ far: 1e3,
81
+ position: [0, 0, 10],
82
+ defaultZoom: p || 3
87
83
  }
88
84
  ),
89
85
  /* @__PURE__ */ t("ambientLight", { intensity: 0.9 }),
@@ -101,7 +97,7 @@ function ce() {
101
97
  reset: r,
102
98
  zoomLevel: y,
103
99
  setZoomLevel: j,
104
- orbits: O ? b : a
100
+ orbits: O ? b : o
105
101
  }
106
102
  ),
107
103
  /* @__PURE__ */ t(
@@ -116,5 +112,5 @@ function ce() {
116
112
  ] });
117
113
  }
118
114
  export {
119
- ce as default
115
+ me as default
120
116
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rubin-epo/epo-widget-lib",
3
- "version": "2.0.5",
3
+ "version": "2.0.7",
4
4
  "description": "Rubin Observatory Education & Public Outreach team React scientific and educational widgets.",
5
5
  "author": "Rubin EPO",
6
6
  "license": "MIT",