@rubin-epo/epo-widget-lib 1.1.0 → 1.1.1
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/ViewIndicator.cjs +1 -1
- package/dist/ViewIndicator.js +50 -44
- package/dist/charts/Readout/index.cjs +1 -1
- package/dist/charts/Readout/index.js +18 -25
- package/dist/charts/ScatterPlot/index.cjs +1 -1
- package/dist/charts/ScatterPlot/index.js +50 -53
- package/dist/widgets/CameraFilter/styles.d.ts +1 -1
- package/dist/widgets/SupernovaThreeVector/Skymap/index.cjs +1 -1
- package/dist/widgets/SupernovaThreeVector/Skymap/index.js +39 -45
- package/dist/widgets/ViewIndicator/styles.cjs +9 -24
- package/dist/widgets/ViewIndicator/styles.d.ts +164 -3056
- package/dist/widgets/ViewIndicator/styles.js +10 -32
- package/package.json +1 -1
package/dist/ViewIndicator.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("react/jsx-runtime"),k=require("react"),j=require("d3-geo"),u=require("./widgets/ViewIndicator/styles.cjs"),O=require("./lib/utils.cjs"),g=10,q=10,A=[g,q],m=100,v=100,d=j.geoGraticule();d.step([180,180]);d.precision(90);const b=t=>{const{backFaces:n=!1,applyRotation:i=!0}=t||{},e=j.geoOrthographic();e.fitExtent([[0,0],[m,v]],d.outline()),i&&e.rotate(A),n&&e.clipAngle(null);const s=j.geoPath(e).digits(1);return{projection:e,pathGenerator:c=>s(c)||void 0}},C=()=>{const{pathGenerator:t}=b({applyRotation:!1});return o.jsx("path",{strokeWidth:3,d:t(d.outline())})},$=({backFaces:t})=>{const{pathGenerator:n}=b({backFaces:t});return o.jsx("path",{d:n(d()),opacity:t?.8:void 0})},N=(t,n)=>{const i=t>90-g&&t<270-g,e=n>0+q,s=t>180-g,r=["top","bottom"],c=["left","right"];e&&r.reverse(),s&&c.reverse();const a=["plane",r[0],...c,r[1]];return i&&a.reverse(),a},z=({ra:t,dec:n,fov:i})=>{const{pathGenerator:e}=b({backFaces:!0}),[s,r]=i,c=Math.max(s,.1)/2,a=Math.max(r,.1)/2,S=n+a,M=n-a,w=t+c,G=t-c,l=[w,S],f=[G,S],y=[w,M],x=[G,M],P=m/2,V=v/2,h=p=>`${p}L${P},${V}`,L={plane:o.jsx("path",{opacity:.8,d:e({type:"Polygon",coordinates:[[l,f,x,y,l]]})}),top:o.jsx("path",{opacity:.5,d:h(e({type:"LineString",coordinates:[l,f]}))}),bottom:o.jsx("path",{opacity:.5,d:h(e({type:"LineString",coordinates:[x,y]}))}),left:o.jsx("path",{opacity:.3,d:h(e({type:"LineString",coordinates:[y,l]}))}),right:o.jsx("path",{opacity:.3,d:h(e({type:"LineString",coordinates:[f,x]}))})},W=N(t,n),R=O.getLinearScale([0,180],[0,100],{clamp:!0,fractionDigits:0})(Math.abs(180-t));return o.jsx(u.ViewCone,{style:{"--percent-mix-primary":`${R}%`,"--percent-mix-secondary":`${100-R}%`},children:W.map(p=>{if(L[p])return o.jsx(k.Fragment,{children:L[p]},p)})})},F=({size:t="var(--size-spacing-m)",className:n,ra:i,dec:e,fov:s})=>{const r=typeof i<"u"&&typeof e<"u"&&typeof s<"u";return o.jsxs(u.Container,{style:{"--size-container":t},className:n,children:[o.jsx(u.NorthDirection,{children:"N"}),o.jsxs(u.SVG,{preserveAspectRatio:"xMidYMid meet",viewBox:`0 0 ${m} ${v}`,children:[o.jsx($,{backFaces:!0}),r&&o.jsx(z,{ra:i,dec:e,fov:s}),o.jsx($,{}),o.jsx(C,{})]})]})};F.displayName="Widget.ViewIndicator";exports.default=F;
|
package/dist/ViewIndicator.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { Fragment as
|
|
1
|
+
import { jsxs as $, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { Fragment as j } from "react";
|
|
3
3
|
import { geoGraticule as k, geoOrthographic as A, geoPath as C } from "d3-geo";
|
|
4
|
-
import { Container as N, NorthDirection as
|
|
5
|
-
import { getLinearScale as
|
|
6
|
-
const
|
|
7
|
-
|
|
4
|
+
import { Container as N, NorthDirection as O, SVG as z, ViewCone as B } from "./widgets/ViewIndicator/styles.js";
|
|
5
|
+
import { getLinearScale as D } from "./lib/utils.js";
|
|
6
|
+
const f = 10, R = 10, E = [f, R], y = 100, v = 100, d = k();
|
|
7
|
+
d.step([180, 180]);
|
|
8
|
+
d.precision(90);
|
|
8
9
|
const x = (t) => {
|
|
9
10
|
const { backFaces: n = !1, applyRotation: i = !0 } = t || {}, e = A();
|
|
10
11
|
e.fitExtent(
|
|
@@ -12,52 +13,55 @@ const x = (t) => {
|
|
|
12
13
|
[0, 0],
|
|
13
14
|
[y, v]
|
|
14
15
|
],
|
|
15
|
-
|
|
16
|
-
), i && e.rotate(
|
|
17
|
-
const r = C(e);
|
|
16
|
+
d.outline()
|
|
17
|
+
), i && e.rotate(E), n && e.clipAngle(null);
|
|
18
|
+
const r = C(e).digits(1);
|
|
18
19
|
return { projection: e, pathGenerator: (s) => r(s) || void 0 };
|
|
19
|
-
},
|
|
20
|
+
}, H = () => {
|
|
20
21
|
const { pathGenerator: t } = x({ applyRotation: !1 });
|
|
21
|
-
return /* @__PURE__ */ o(
|
|
22
|
-
},
|
|
22
|
+
return /* @__PURE__ */ o("path", { strokeWidth: 3, d: t(d.outline()) });
|
|
23
|
+
}, F = ({ backFaces: t }) => {
|
|
23
24
|
const { pathGenerator: n } = x({ backFaces: t });
|
|
24
25
|
return /* @__PURE__ */ o(
|
|
25
|
-
|
|
26
|
+
"path",
|
|
26
27
|
{
|
|
27
|
-
d: n(
|
|
28
|
+
d: n(d()),
|
|
28
29
|
opacity: t ? 0.8 : void 0
|
|
29
30
|
}
|
|
30
31
|
);
|
|
31
|
-
},
|
|
32
|
-
const i = t > 90 -
|
|
32
|
+
}, I = (t, n) => {
|
|
33
|
+
const i = t > 90 - f && t < 270 - f, e = n > 0 + R, r = t > 180 - f, c = ["top", "bottom"], s = ["left", "right"];
|
|
33
34
|
e && c.reverse(), r && s.reverse();
|
|
34
35
|
const a = ["plane", c[0], ...s, c[1]];
|
|
35
36
|
return i && a.reverse(), a;
|
|
36
|
-
},
|
|
37
|
-
const { pathGenerator: e } = x({ backFaces: !0 }), [r, c] = i, s = Math.max(r, 0.1) / 2, a = Math.max(c, 0.1) / 2, b = n + a,
|
|
37
|
+
}, Y = ({ ra: t, dec: n, fov: i }) => {
|
|
38
|
+
const { pathGenerator: e } = x({ backFaces: !0 }), [r, c] = i, s = Math.max(r, 0.1) / 2, a = Math.max(c, 0.1) / 2, b = n + a, w = n - a, L = t + s, S = t - s, h = [L, b], g = [S, b], m = [L, w], u = [S, w], P = y / 2, V = v / 2, l = (p) => `${p}L${P},${V}`, G = {
|
|
38
39
|
plane: /* @__PURE__ */ o(
|
|
39
|
-
|
|
40
|
+
"path",
|
|
40
41
|
{
|
|
42
|
+
opacity: 0.8,
|
|
41
43
|
d: e({
|
|
42
44
|
type: "Polygon",
|
|
43
|
-
coordinates: [[
|
|
45
|
+
coordinates: [[h, g, u, m, h]]
|
|
44
46
|
})
|
|
45
47
|
}
|
|
46
48
|
),
|
|
47
49
|
top: /* @__PURE__ */ o(
|
|
48
|
-
|
|
50
|
+
"path",
|
|
49
51
|
{
|
|
52
|
+
opacity: 0.5,
|
|
50
53
|
d: l(
|
|
51
54
|
e({
|
|
52
55
|
type: "LineString",
|
|
53
|
-
coordinates: [
|
|
56
|
+
coordinates: [h, g]
|
|
54
57
|
})
|
|
55
58
|
)
|
|
56
59
|
}
|
|
57
60
|
),
|
|
58
61
|
bottom: /* @__PURE__ */ o(
|
|
59
|
-
|
|
62
|
+
"path",
|
|
60
63
|
{
|
|
64
|
+
opacity: 0.5,
|
|
61
65
|
d: l(
|
|
62
66
|
e({
|
|
63
67
|
type: "LineString",
|
|
@@ -67,19 +71,21 @@ const x = (t) => {
|
|
|
67
71
|
}
|
|
68
72
|
),
|
|
69
73
|
left: /* @__PURE__ */ o(
|
|
70
|
-
|
|
74
|
+
"path",
|
|
71
75
|
{
|
|
76
|
+
opacity: 0.3,
|
|
72
77
|
d: l(
|
|
73
78
|
e({
|
|
74
79
|
type: "LineString",
|
|
75
|
-
coordinates: [m,
|
|
80
|
+
coordinates: [m, h]
|
|
76
81
|
})
|
|
77
82
|
)
|
|
78
83
|
}
|
|
79
84
|
),
|
|
80
85
|
right: /* @__PURE__ */ o(
|
|
81
|
-
|
|
86
|
+
"path",
|
|
82
87
|
{
|
|
88
|
+
opacity: 0.3,
|
|
83
89
|
d: l(
|
|
84
90
|
e({
|
|
85
91
|
type: "LineString",
|
|
@@ -88,24 +94,24 @@ const x = (t) => {
|
|
|
88
94
|
)
|
|
89
95
|
}
|
|
90
96
|
)
|
|
91
|
-
},
|
|
97
|
+
}, W = I(t, n), M = D([0, 180], [0, 100], {
|
|
92
98
|
clamp: !0,
|
|
93
99
|
fractionDigits: 0
|
|
94
100
|
})(Math.abs(180 - t));
|
|
95
101
|
return /* @__PURE__ */ o(
|
|
96
|
-
|
|
102
|
+
B,
|
|
97
103
|
{
|
|
98
104
|
style: {
|
|
99
|
-
"--percent-mix-primary": `${
|
|
100
|
-
"--percent-mix-secondary": `${100 -
|
|
105
|
+
"--percent-mix-primary": `${M}%`,
|
|
106
|
+
"--percent-mix-secondary": `${100 - M}%`
|
|
101
107
|
},
|
|
102
|
-
children:
|
|
103
|
-
if (
|
|
104
|
-
return /* @__PURE__ */ o(
|
|
108
|
+
children: W.map((p) => {
|
|
109
|
+
if (G[p])
|
|
110
|
+
return /* @__PURE__ */ o(j, { children: G[p] }, p);
|
|
105
111
|
})
|
|
106
112
|
}
|
|
107
113
|
);
|
|
108
|
-
},
|
|
114
|
+
}, q = ({
|
|
109
115
|
size: t = "var(--size-spacing-m)",
|
|
110
116
|
className: n,
|
|
111
117
|
ra: i,
|
|
@@ -113,23 +119,23 @@ const x = (t) => {
|
|
|
113
119
|
fov: r
|
|
114
120
|
}) => {
|
|
115
121
|
const c = typeof i < "u" && typeof e < "u" && typeof r < "u";
|
|
116
|
-
return /* @__PURE__ */
|
|
122
|
+
return /* @__PURE__ */ $(
|
|
117
123
|
N,
|
|
118
124
|
{
|
|
119
125
|
style: { "--size-container": t },
|
|
120
126
|
className: n,
|
|
121
127
|
children: [
|
|
122
|
-
/* @__PURE__ */ o(
|
|
123
|
-
/* @__PURE__ */
|
|
124
|
-
|
|
128
|
+
/* @__PURE__ */ o(O, { children: "N" }),
|
|
129
|
+
/* @__PURE__ */ $(
|
|
130
|
+
z,
|
|
125
131
|
{
|
|
126
132
|
preserveAspectRatio: "xMidYMid meet",
|
|
127
133
|
viewBox: `0 0 ${y} ${v}`,
|
|
128
134
|
children: [
|
|
129
|
-
/* @__PURE__ */ o(
|
|
130
|
-
c && /* @__PURE__ */ o(
|
|
131
|
-
/* @__PURE__ */ o(
|
|
132
|
-
/* @__PURE__ */ o(
|
|
135
|
+
/* @__PURE__ */ o(F, { backFaces: !0 }),
|
|
136
|
+
c && /* @__PURE__ */ o(Y, { ra: i, dec: e, fov: r }),
|
|
137
|
+
/* @__PURE__ */ o(F, {}),
|
|
138
|
+
/* @__PURE__ */ o(H, {})
|
|
133
139
|
]
|
|
134
140
|
}
|
|
135
141
|
)
|
|
@@ -137,7 +143,7 @@ const x = (t) => {
|
|
|
137
143
|
}
|
|
138
144
|
);
|
|
139
145
|
};
|
|
140
|
-
|
|
146
|
+
q.displayName = "Widget.ViewIndicator";
|
|
141
147
|
export {
|
|
142
|
-
|
|
148
|
+
q as default
|
|
143
149
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("react/jsx-runtime"),
|
|
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 "
|
|
4
|
-
import "../
|
|
5
|
-
import "../
|
|
6
|
-
|
|
7
|
-
|
|
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
|
|
19
|
-
switch (
|
|
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:
|
|
39
|
-
children:
|
|
40
|
-
position:
|
|
41
|
-
viewport:
|
|
31
|
+
className: n,
|
|
32
|
+
children: s,
|
|
33
|
+
position: o,
|
|
34
|
+
viewport: i,
|
|
42
35
|
forIds: t,
|
|
43
|
-
forScreenreaders:
|
|
36
|
+
forScreenreaders: r
|
|
44
37
|
}) => {
|
|
45
|
-
const a = /* @__PURE__ */ e(
|
|
46
|
-
|
|
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:
|
|
42
|
+
className: n,
|
|
50
43
|
children: [
|
|
51
|
-
/* @__PURE__ */ e("span", { "aria-hidden": !!
|
|
52
|
-
/* @__PURE__ */ e(c, { children:
|
|
44
|
+
/* @__PURE__ */ e("span", { "aria-hidden": !!r, children: s }),
|
|
45
|
+
/* @__PURE__ */ e(c, { children: r })
|
|
53
46
|
]
|
|
54
47
|
}
|
|
55
48
|
) }) });
|
|
56
|
-
return
|
|
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")
|
|
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
|
|
2
|
+
import { jsxs as u, jsx as i } from "react/jsx-runtime";
|
|
3
3
|
import { useState as F } from "react";
|
|
4
|
-
import "../
|
|
5
|
-
import J from "
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import Q from "../
|
|
9
|
-
import U from "../
|
|
10
|
-
import
|
|
11
|
-
import "../
|
|
12
|
-
import "../
|
|
13
|
-
import
|
|
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:
|
|
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,
|
|
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 ? (
|
|
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:
|
|
44
|
-
yScale:
|
|
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:
|
|
51
|
-
yScale:
|
|
47
|
+
xScale: e,
|
|
48
|
+
yScale: o,
|
|
52
49
|
yStart: S,
|
|
53
50
|
yEnd: k,
|
|
54
|
-
xStart:
|
|
51
|
+
xStart: v,
|
|
55
52
|
xEnd: O,
|
|
56
|
-
yDomain:
|
|
57
|
-
xDomain:
|
|
53
|
+
yDomain: a,
|
|
54
|
+
xDomain: s
|
|
58
55
|
};
|
|
59
56
|
return /* @__PURE__ */ u(
|
|
60
|
-
|
|
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__ */
|
|
72
|
-
|
|
68
|
+
/* @__PURE__ */ i(
|
|
69
|
+
Q,
|
|
73
70
|
{
|
|
74
71
|
ticks: P,
|
|
75
|
-
x:
|
|
72
|
+
x: v,
|
|
76
73
|
labelledById: L,
|
|
77
|
-
yDomain:
|
|
78
|
-
yScale:
|
|
74
|
+
yDomain: a,
|
|
75
|
+
yScale: o
|
|
79
76
|
}
|
|
80
77
|
),
|
|
81
78
|
/* @__PURE__ */ u(
|
|
82
|
-
|
|
79
|
+
U,
|
|
83
80
|
{
|
|
84
|
-
x:
|
|
81
|
+
x: v,
|
|
85
82
|
y: k,
|
|
86
83
|
width: W,
|
|
87
84
|
height: X,
|
|
88
85
|
children: [
|
|
89
|
-
l.guidelines && /* @__PURE__ */
|
|
90
|
-
|
|
86
|
+
l.guidelines && /* @__PURE__ */ i(
|
|
87
|
+
T,
|
|
91
88
|
{
|
|
92
89
|
guides: I.length,
|
|
93
90
|
direction: "vertical",
|
|
94
|
-
xDomain:
|
|
95
|
-
yDomain:
|
|
96
|
-
xScale:
|
|
97
|
-
yScale:
|
|
91
|
+
xDomain: s,
|
|
92
|
+
yDomain: a,
|
|
93
|
+
xScale: e,
|
|
94
|
+
yScale: o
|
|
98
95
|
}
|
|
99
96
|
),
|
|
100
|
-
c.guidelines && /* @__PURE__ */
|
|
101
|
-
|
|
97
|
+
c.guidelines && /* @__PURE__ */ i(
|
|
98
|
+
T,
|
|
102
99
|
{
|
|
103
100
|
guides: P.length,
|
|
104
|
-
xDomain:
|
|
105
|
-
yDomain:
|
|
106
|
-
xScale:
|
|
107
|
-
yScale:
|
|
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__ */
|
|
115
|
-
|
|
111
|
+
/* @__PURE__ */ i(
|
|
112
|
+
V,
|
|
116
113
|
{
|
|
117
114
|
ticks: I,
|
|
118
115
|
y: S,
|
|
119
116
|
labelledById: C,
|
|
120
|
-
xDomain:
|
|
121
|
-
xScale:
|
|
117
|
+
xDomain: s,
|
|
118
|
+
xScale: e
|
|
122
119
|
}
|
|
123
120
|
),
|
|
124
121
|
n && /* @__PURE__ */ u(
|
|
125
|
-
|
|
122
|
+
Z,
|
|
126
123
|
{
|
|
127
|
-
x: t ?
|
|
128
|
-
y: t ?
|
|
124
|
+
x: t ? e(t.x) : void 0,
|
|
125
|
+
y: t ? o(t.y) : void 0,
|
|
129
126
|
visible: !!t,
|
|
130
|
-
offset:
|
|
127
|
+
offset: D.pointRadius,
|
|
131
128
|
children: [
|
|
132
129
|
t && typeof n == "function" && n(t),
|
|
133
130
|
t && typeof n == "string" && n
|
|
@@ -1385,7 +1385,7 @@ export declare const FilterRange: import('styled-components').IStyledComponent<"
|
|
|
1385
1385
|
abbr?: string | undefined;
|
|
1386
1386
|
height?: string | number | undefined;
|
|
1387
1387
|
width?: string | number | undefined;
|
|
1388
|
-
valign?: "
|
|
1388
|
+
valign?: "top" | "bottom" | "baseline" | "middle" | undefined;
|
|
1389
1389
|
defaultChecked?: boolean | undefined;
|
|
1390
1390
|
defaultValue?: string | number | readonly string[] | undefined;
|
|
1391
1391
|
suppressContentEditableWarning?: boolean | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("react/jsx-runtime"),
|
|
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;
|