astro-viewer 1.5.0 β 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +23 -0
- package/README.md +45 -84
- package/package.json +6 -6
package/LICENSE.md
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
AstroViewer
|
|
2
|
+
Copyright (C) Fabrizio Giordano
|
|
3
|
+
|
|
4
|
+
This repository uses a dual-license model.
|
|
5
|
+
|
|
6
|
+
Choose the license track that matches your use case:
|
|
7
|
+
|
|
8
|
+
1. Commercial use
|
|
9
|
+
|
|
10
|
+
Commercial, proprietary, internal business, SaaS, paid-service, OEM, or other
|
|
11
|
+
revenue-generating use requires a separate commercial license agreement from
|
|
12
|
+
the copyright holder. See `LICENSE-COMMERCIAL.md`.
|
|
13
|
+
|
|
14
|
+
2. Non-commercial use
|
|
15
|
+
|
|
16
|
+
Personal study, academic work, research, evaluation, hobby, and other
|
|
17
|
+
non-commercial use may be carried out under the source-available terms
|
|
18
|
+
described in `LICENSE-NONCOMMERCIAL.md`.
|
|
19
|
+
|
|
20
|
+
The non-commercial license track is not an OSI-approved open source license.
|
|
21
|
+
|
|
22
|
+
If your intended use is commercial or if there is any uncertainty, use the
|
|
23
|
+
commercial licensing track.
|
package/README.md
CHANGED
|
@@ -1,11 +1,26 @@
|
|
|
1
1
|
# π AstroViewer
|
|
2
2
|
|
|
3
|
-
[](#licensing)
|
|
4
4
|
[](https://www.typescriptlang.org/)
|
|
5
5
|
[](https://developer.mozilla.org/en-US/docs/Web/API/WebGL_API)
|
|
6
6
|
|
|
7
7
|
**AstroViewer** is a lightweight 3D engine for **HiPS (Hierarchical Progressive Surveys)** visualisation and exploration, written in **TypeScript** and **WebGL**.
|
|
8
|
-
It powers the next generation of **Astrobrowser** and provides a simple API for embedding 3D HiPS viewers, catalogue overlays, and
|
|
8
|
+
It powers the next generation of **Astrobrowser** and provides a simple API for embedding 3D HiPS viewers, catalogue overlays, footprints, and camera/navigation controls in any web project.
|
|
9
|
+
|
|
10
|
+
## Licensing
|
|
11
|
+
|
|
12
|
+
AstroViewer is distributed under a dual-license model:
|
|
13
|
+
|
|
14
|
+
- a commercial license for proprietary or revenue-generating use
|
|
15
|
+
- a separate non-commercial, source-available license for personal, academic,
|
|
16
|
+
research, evaluation, or other non-commercial use
|
|
17
|
+
|
|
18
|
+
The non-commercial option is not an OSI open source license. See
|
|
19
|
+
`LICENSE.md`, `LICENSE-COMMERCIAL.md`, and `LICENSE-NONCOMMERCIAL.md` for the
|
|
20
|
+
repository-level licensing structure.
|
|
21
|
+
|
|
22
|
+
The commercial posture of `astro-viewer` also depends on the licensing alignment
|
|
23
|
+
of its first-party dependency chain. See `DEPENDENCY-LICENSING.md`.
|
|
9
24
|
|
|
10
25
|
---
|
|
11
26
|
|
|
@@ -31,7 +46,7 @@ Copy the bundle into your project and link it in your HTML page:
|
|
|
31
46
|
```
|
|
32
47
|
|
|
33
48
|
Then you can use the global `astroviewer` object directly.
|
|
34
|
-
Here is a minimal example that loads
|
|
49
|
+
Here is a minimal example that loads a HiPS survey and starts the viewer.
|
|
35
50
|
|
|
36
51
|
```html
|
|
37
52
|
<!DOCTYPE html>
|
|
@@ -54,16 +69,9 @@ Here is a minimal example that loads the HiPS survey, activates a TAP service, a
|
|
|
54
69
|
const resp = await fetch(hipsUrl + "properties");
|
|
55
70
|
const propsText = await resp.text();
|
|
56
71
|
|
|
57
|
-
const desc = new astroviewer.HiPSDescriptor(propsText,
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
window.AstroAPI.activateHiPS(desc, insideSphere);
|
|
72
|
+
const desc = new astroviewer.HiPSDescriptor(propsText, hipsUrl);
|
|
73
|
+
window.AstroAPI.activateHiPS(desc);
|
|
61
74
|
window.AstroAPI.run();
|
|
62
|
-
|
|
63
|
-
const tapRepo = await astroviewer.addTAPRepo("https://sky.esa.int/esasky-tap/tap");
|
|
64
|
-
const catalogue = tapRepo.cataloguesList.find(cat => cat.name === "catalogues.integral_ibis");
|
|
65
|
-
|
|
66
|
-
window.AstroAPI.showCatalogue(catalogue);
|
|
67
75
|
}
|
|
68
76
|
</script>
|
|
69
77
|
</body>
|
|
@@ -77,17 +85,17 @@ Here is a minimal example that loads the HiPS survey, activates a TAP service, a
|
|
|
77
85
|
You can also use AstroViewer as a Node module:
|
|
78
86
|
|
|
79
87
|
```bash
|
|
80
|
-
npm install
|
|
88
|
+
npm install astro-viewer
|
|
81
89
|
```
|
|
82
90
|
|
|
83
91
|
Then import from your code:
|
|
84
92
|
|
|
85
93
|
```ts
|
|
86
94
|
// ESM
|
|
87
|
-
import { AstroViewer, HiPSDescriptor
|
|
95
|
+
import { AstroViewer, HiPSDescriptor } from 'astro-viewer';
|
|
88
96
|
|
|
89
97
|
// or CommonJS
|
|
90
|
-
const { AstroViewer, HiPSDescriptor
|
|
98
|
+
const { AstroViewer, HiPSDescriptor } = require('astro-viewer');
|
|
91
99
|
```
|
|
92
100
|
|
|
93
101
|
---
|
|
@@ -109,24 +117,10 @@ This command will:
|
|
|
109
117
|
- Prepare the web testing interface
|
|
110
118
|
- Start a local web server
|
|
111
119
|
|
|
112
|
-
You should see
|
|
120
|
+
You should see output similar to:
|
|
113
121
|
|
|
114
122
|
```
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
http-server version: 14.1.1
|
|
118
|
-
|
|
119
|
-
http-server settings:
|
|
120
|
-
CORS: disabled
|
|
121
|
-
Cache: 3600 seconds
|
|
122
|
-
Connection Timeout: 120 seconds
|
|
123
|
-
Directory Listings: visible
|
|
124
|
-
AutoIndex: visible
|
|
125
|
-
|
|
126
|
-
Available on:
|
|
127
|
-
http://127.0.0.1:8080
|
|
128
|
-
http://10.0.0.184:8080
|
|
129
|
-
Hit CTRL-C to stop the server
|
|
123
|
+
Serving HTTP on 0.0.0.0 port 8080
|
|
130
124
|
```
|
|
131
125
|
|
|
132
126
|
Then open one of the links in your browser (e.g. [http://127.0.0.1:8080](http://127.0.0.1:8080)) to start exploring **AstroViewer**.
|
|
@@ -153,8 +147,7 @@ Main exported classes and utilities:
|
|
|
153
147
|
- `HiPSDescriptor` β handles HiPS metadata and configuration
|
|
154
148
|
- `FootprintSetGL` β renders observation footprints
|
|
155
149
|
- `CatalogueGL` β renders astronomical catalogues
|
|
156
|
-
- `
|
|
157
|
-
- `FoV`, `AstroSphere`, `HealpixGridSingleton`, etc. β geometry, camera, and rendering utilities
|
|
150
|
+
- `FoV` and related geometry/color-map utilities β camera and rendering helpers
|
|
158
151
|
|
|
159
152
|
---
|
|
160
153
|
|
|
@@ -181,7 +174,7 @@ const AC = new astroviewer.AstroViewer({
|
|
|
181
174
|
|
|
182
175
|
```ts
|
|
183
176
|
// Node/ESM
|
|
184
|
-
import { AstroViewer } from 'astro-
|
|
177
|
+
import { AstroViewer } from 'astro-viewer';
|
|
185
178
|
const AC = new AstroViewer();
|
|
186
179
|
```
|
|
187
180
|
|
|
@@ -192,26 +185,17 @@ Start the render loop and event handling.
|
|
|
192
185
|
AC.run();
|
|
193
186
|
```
|
|
194
187
|
|
|
195
|
-
#### `stop()`
|
|
196
|
-
Stop/pause the render loop.
|
|
197
|
-
|
|
198
|
-
```js
|
|
199
|
-
AC.stop();
|
|
200
|
-
```
|
|
201
|
-
|
|
202
|
-
---
|
|
203
|
-
|
|
204
188
|
### HiPS Datasets
|
|
205
189
|
|
|
206
|
-
#### `activateHiPS(descriptor: HiPSDescriptor
|
|
190
|
+
#### `activateHiPS(descriptor: HiPSDescriptor)`
|
|
207
191
|
Activate a HiPS dataset for rendering.
|
|
208
192
|
|
|
209
193
|
```js
|
|
210
194
|
const hipsUrl = "https://alasky.cds.unistra.fr/DSS/DSSColor/";
|
|
211
195
|
const props = await (await fetch(hipsUrl + "properties")).text();
|
|
212
|
-
const desc = new astroviewer.HiPSDescriptor(props,
|
|
196
|
+
const desc = new astroviewer.HiPSDescriptor(props, hipsUrl);
|
|
213
197
|
|
|
214
|
-
AC.activateHiPS(desc
|
|
198
|
+
AC.activateHiPS(desc);
|
|
215
199
|
```
|
|
216
200
|
|
|
217
201
|
#### `toggleInsideSphere()`
|
|
@@ -225,14 +209,11 @@ AC.toggleInsideSphere(); // outside <-> inside
|
|
|
225
209
|
|
|
226
210
|
### Camera & Navigation
|
|
227
211
|
|
|
228
|
-
#### `
|
|
229
|
-
|
|
230
|
-
- `fovDeg?: number` β target field of view (angular diameter)
|
|
231
|
-
- `durationMs?: number` β animation duration (default ~1000β1500 ms)
|
|
232
|
-
- `easing?: (t:number)=>number` β custom easing
|
|
212
|
+
#### `goTo(raDeg: number, decDeg: number)`
|
|
213
|
+
Move the camera to a sky coordinate (ICRS).
|
|
233
214
|
|
|
234
215
|
```js
|
|
235
|
-
|
|
216
|
+
AC.goTo(287.0, 12.5);
|
|
236
217
|
```
|
|
237
218
|
|
|
238
219
|
|
|
@@ -249,24 +230,12 @@ AC.toggleHealpixGrid();
|
|
|
249
230
|
|
|
250
231
|
---
|
|
251
232
|
|
|
252
|
-
###
|
|
253
|
-
|
|
254
|
-
#### `addTAPRepo(url: string): Promise<TapRepo>`
|
|
255
|
-
Discover capabilities and available datasets (catalogues, footprints, etc.).
|
|
256
|
-
|
|
257
|
-
```js
|
|
258
|
-
const tapRepo = await astroviewer.addTAPRepo("https://sky.esa.int/esasky-tap/tap");
|
|
259
|
-
|
|
260
|
-
// Explore the lists (names depend on the service)
|
|
261
|
-
console.log(tapRepo.cataloguesList.map(c => c.name));
|
|
262
|
-
console.log(tapRepo.obsList?.map(o => o.name)); // if provided
|
|
263
|
-
```
|
|
233
|
+
### Catalogues
|
|
264
234
|
|
|
265
235
|
#### `showCatalogue(catalogue: CatalogueGL)`
|
|
266
|
-
Render a catalogue
|
|
236
|
+
Render a catalogue layer.
|
|
267
237
|
|
|
268
238
|
```js
|
|
269
|
-
const cat = tapRepo.cataloguesList.find(c => c.name === "catalogues.integral_ibis");
|
|
270
239
|
AC.showCatalogue(cat);
|
|
271
240
|
```
|
|
272
241
|
|
|
@@ -326,26 +295,16 @@ AC.changeFootprintSetColor(footprints, "#00ffaa");
|
|
|
326
295
|
|
|
327
296
|
Depending on your build, you may also have helpers like:
|
|
328
297
|
|
|
329
|
-
#### `
|
|
330
|
-
Listen to viewer events (e.g., click on source, pointer move).
|
|
331
|
-
|
|
332
|
-
```js
|
|
333
|
-
AC.on?.("pointermove", (info) => {
|
|
334
|
-
// info.ra, info.dec, info.pixelX, info.pixelY, etc.
|
|
335
|
-
console.log("Hover:", info);
|
|
336
|
-
});
|
|
337
|
-
```
|
|
338
|
-
|
|
339
|
-
#### `getCenterCoords()`
|
|
298
|
+
#### `getCenterCoordinates()`
|
|
340
299
|
Return the current ICRS center of the viewport.
|
|
341
300
|
|
|
342
301
|
```js
|
|
343
|
-
const
|
|
302
|
+
const coords = AC.getCenterCoordinates();
|
|
344
303
|
```
|
|
345
304
|
|
|
346
|
-
#### `
|
|
305
|
+
#### `toggleInsideSphere()`
|
|
347
306
|
```js
|
|
348
|
-
AC.
|
|
307
|
+
AC.toggleInsideSphere();
|
|
349
308
|
```
|
|
350
309
|
|
|
351
310
|
> If a method above is not present in your build, it means itβs not exported by `src/index.ts`.
|
|
@@ -360,14 +319,16 @@ AC.setBackgroundColor?.("#000000");
|
|
|
360
319
|
|
|
361
320
|
## π License
|
|
362
321
|
|
|
363
|
-
This
|
|
364
|
-
|
|
322
|
+
This repository uses a dual-license model.
|
|
323
|
+
Commercial use requires a separate written agreement.
|
|
324
|
+
Non-commercial use is available under the source-available terms in `LICENSE-NONCOMMERCIAL.md`.
|
|
325
|
+
See also `LICENSE.md` and `LICENSE-COMMERCIAL.md`.
|
|
365
326
|
|
|
366
327
|
---
|
|
367
328
|
|
|
368
329
|
## π Links
|
|
369
330
|
|
|
370
|
-
- π [GitHub Repository](https://github.com/fab77/astro-
|
|
331
|
+
- π [GitHub Repository](https://github.com/fab77/astro-viewer)
|
|
371
332
|
- πͺ [HiPS Standard (IVOA)](https://www.ivoa.net/documents/HiPS/)
|
|
372
333
|
- π°οΈ [ESA Sky TAP Service](https://sky.esa.int/esasky-tap/tap)
|
|
373
|
-
- βοΈ [Report Issues](https://github.com/fab77/astro-
|
|
334
|
+
- βοΈ [Report Issues](https://github.com/fab77/astro-viewer/issues)
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "astro-viewer",
|
|
3
3
|
"description": "Astrobrowser 3d engine.",
|
|
4
4
|
|
|
5
|
-
"version": "
|
|
5
|
+
"version": "2.0.0",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"HiPS",
|
|
8
8
|
"HiPS cutout",
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"3D"
|
|
16
16
|
],
|
|
17
17
|
"author": "Fabrizio Giordano (fab77)",
|
|
18
|
-
"license": "
|
|
18
|
+
"license": "SEE LICENSE IN LICENSE.md",
|
|
19
19
|
"homepage": "https://github.com/fab77/astro-viewer#readme",
|
|
20
20
|
"repository": {
|
|
21
21
|
"type": "git",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"prod": "npm run clean && tsc -p tsconfig.build.json && webpack --mode=production && npm run web",
|
|
51
51
|
"build": "npm run clean && tsc -p tsconfig.build.json && webpack --mode=production",
|
|
52
52
|
"web": "cp dist/* public/javascripts/; cp -R src/html/javascripts/ public/javascripts/; cp -R src/html/css/ public/css/; cp src/html/*.html public/",
|
|
53
|
-
"start-server": "
|
|
53
|
+
"start-server": "python3 -m http.server 8080 -d public",
|
|
54
54
|
"all": "npm run clean; npm run prod; npm run start-server",
|
|
55
55
|
"prepublishOnly": "npm run build"
|
|
56
56
|
},
|
|
@@ -72,9 +72,9 @@
|
|
|
72
72
|
"dependencies": {
|
|
73
73
|
"canvas": "3.1.0",
|
|
74
74
|
"gl-matrix": "^3.3.0",
|
|
75
|
-
"jsfitsio": "
|
|
76
|
-
"healpixjs": "^
|
|
77
|
-
"wcslight": "
|
|
75
|
+
"jsfitsio": "^2.0.0",
|
|
76
|
+
"healpixjs": "^2.0.0",
|
|
77
|
+
"wcslight": "^3.0.0",
|
|
78
78
|
"cross-fetch": "^3.1.5"
|
|
79
79
|
},
|
|
80
80
|
"browser": {
|