fffiloni commited on
Commit
cf391a8
·
verified ·
1 Parent(s): 6851251

Remove the Milky Way haze in v0.2.38

Browse files
Files changed (6) hide show
  1. README.md +2 -2
  2. app.mjs +1 -1
  3. index.html +2 -2
  4. package-lock.json +2 -2
  5. package.json +1 -1
  6. paper-sky.mjs +0 -35
README.md CHANGED
@@ -11,7 +11,7 @@ short_description: Explore the live Hugging Face CDN telemetry on a 3D globe
11
 
12
  # HF CDN Live
13
 
14
- Version 0.2.37. An interactive Three.js app for the Hugging Face Static Space SDK.
15
 
16
  The globe displays public [Hugging Face CDN telemetry](https://huggingface.co/buckets/huggingface/cdn-live). Drag to orbit, scroll or pinch to zoom, and select a point of presence on the globe or in the list. The details panel starts closed. Show details opens it and Hide details returns to the full globe. Keyboard users can select any point in the list and use the arrow keys, plus, and minus on the globe. After three seconds of inactivity, the globe gently spins eastward around its geographic poles. The display spin is accelerated while day and night follow current UTC time. The Globe style menu offers Satellite and Midnight along with Pause motion and Reset view. Pause motion stops the spin, meteors, arrival animations, and satellites.
17
 
@@ -27,7 +27,7 @@ HF Radio plays the [HF Radio MultiSource](https://huggingface.co/spaces/fffiloni
27
 
28
  Up to eight small satellites orbit the globe, one per demo from the current [Spaces of the Week](https://huggingface.co/spaces) selection. Each uses a monochrome tint from its Space card. The dashed orbital paths are clipped by Earth. Select a satellite to open its description and link and illuminate its model and orbit. The satellites keep moving while a card is open. The camera follows the selected satellite at the current zoom. Drag, zoom, use the globe keys, or close the card to stop following. Another Space moves the highlight and can reach picks temporarily hidden behind Earth. The selection loads from the public Hub API and refreshes every ten minutes while the page is visible.
29
 
30
- Both globe styles place every paper from this ISO week of [Daily Papers](https://huggingface.co/papers) in a starfield. If the new week is empty, it shows the previous one. Papers with more upvotes shine brighter. The sky and its faint stylized Milky Way follow the camera, and Earth masks the stars behind it. Select a paper to reveal lines to related stars in view. Related papers are ranked by verified shared authors, Hub organizations, and topical similarity. Each card includes the edition date, authors, upvotes, an abstract excerpt, and a link to the paper. The feed refreshes while the globe is visible.
31
 
32
  ## Run locally
33
 
 
11
 
12
  # HF CDN Live
13
 
14
+ Version 0.2.38. An interactive Three.js app for the Hugging Face Static Space SDK.
15
 
16
  The globe displays public [Hugging Face CDN telemetry](https://huggingface.co/buckets/huggingface/cdn-live). Drag to orbit, scroll or pinch to zoom, and select a point of presence on the globe or in the list. The details panel starts closed. Show details opens it and Hide details returns to the full globe. Keyboard users can select any point in the list and use the arrow keys, plus, and minus on the globe. After three seconds of inactivity, the globe gently spins eastward around its geographic poles. The display spin is accelerated while day and night follow current UTC time. The Globe style menu offers Satellite and Midnight along with Pause motion and Reset view. Pause motion stops the spin, meteors, arrival animations, and satellites.
17
 
 
27
 
28
  Up to eight small satellites orbit the globe, one per demo from the current [Spaces of the Week](https://huggingface.co/spaces) selection. Each uses a monochrome tint from its Space card. The dashed orbital paths are clipped by Earth. Select a satellite to open its description and link and illuminate its model and orbit. The satellites keep moving while a card is open. The camera follows the selected satellite at the current zoom. Drag, zoom, use the globe keys, or close the card to stop following. Another Space moves the highlight and can reach picks temporarily hidden behind Earth. The selection loads from the public Hub API and refreshes every ten minutes while the page is visible.
29
 
30
+ Both globe styles place every paper from this ISO week of [Daily Papers](https://huggingface.co/papers) in a starfield. If the new week is empty, it shows the previous one. Papers with more upvotes shine brighter. The sky follows the camera, and Earth masks the stars behind it. Select a paper to reveal lines to related stars in view. Related papers are ranked by verified shared authors, Hub organizations, and topical similarity. Each card includes the edition date, authors, upvotes, an abstract excerpt, and a link to the paper. The feed refreshes while the globe is visible.
31
 
32
  ## Run locally
33
 
app.mjs CHANGED
@@ -302,7 +302,7 @@ async function startGlobe() {
302
  try {
303
  await new Promise((resolve, reject) => {
304
  const script = document.createElement("script");
305
- script.src = "./globe.js?v=0.2.37";
306
  script.onload = () => { clearTimeout(timeout); resolve(); };
307
  script.onerror = () => { clearTimeout(timeout); reject(new Error("Globe script unavailable")); };
308
  const timeout = setTimeout(() => {
 
302
  try {
303
  await new Promise((resolve, reject) => {
304
  const script = document.createElement("script");
305
+ script.src = "./globe.js?v=0.2.38";
306
  script.onload = () => { clearTimeout(timeout); resolve(); };
307
  script.onerror = () => { clearTimeout(timeout); reject(new Error("Globe script unavailable")); };
308
  const timeout = setTimeout(() => {
index.html CHANGED
@@ -6,8 +6,8 @@
6
  <meta name="theme-color" content="#101114">
7
  <meta name="description" content="Explore the public Hugging Face CDN telemetry on an interactive globe.">
8
  <title>HF CDN Live</title>
9
- <link rel="stylesheet" href="./styles.css?v=0.2.37">
10
- <script defer src="./app.js?v=0.2.37"></script>
11
  </head>
12
  <body class="details-hidden">
13
  <header class="masthead">
 
6
  <meta name="theme-color" content="#101114">
7
  <meta name="description" content="Explore the public Hugging Face CDN telemetry on an interactive globe.">
8
  <title>HF CDN Live</title>
9
+ <link rel="stylesheet" href="./styles.css?v=0.2.38">
10
+ <script defer src="./app.js?v=0.2.38"></script>
11
  </head>
12
  <body class="details-hidden">
13
  <header class="masthead">
package-lock.json CHANGED
@@ -1,12 +1,12 @@
1
  {
2
  "name": "hf-cdn-live",
3
- "version": "0.2.37",
4
  "lockfileVersion": 3,
5
  "requires": true,
6
  "packages": {
7
  "": {
8
  "name": "hf-cdn-live",
9
- "version": "0.2.37",
10
  "devDependencies": {
11
  "esbuild": "0.25.12",
12
  "flag-icons": "7.3.2"
 
1
  {
2
  "name": "hf-cdn-live",
3
+ "version": "0.2.38",
4
  "lockfileVersion": 3,
5
  "requires": true,
6
  "packages": {
7
  "": {
8
  "name": "hf-cdn-live",
9
+ "version": "0.2.38",
10
  "devDependencies": {
11
  "esbuild": "0.25.12",
12
  "flag-icons": "7.3.2"
package.json CHANGED
@@ -1,6 +1,6 @@
1
  {
2
  "name": "hf-cdn-live",
3
- "version": "0.2.37",
4
  "private": true,
5
  "type": "module",
6
  "scripts": {
 
1
  {
2
  "name": "hf-cdn-live",
3
+ "version": "0.2.38",
4
  "private": true,
5
  "type": "module",
6
  "scripts": {
paper-sky.mjs CHANGED
@@ -31,32 +31,6 @@ export function createPaperSky(layer, canvas, initialDirection) {
31
  const forward = initialDirection.clone().negate();
32
  const east = new THREE.Vector3().crossVectors(WORLD_UP, initialDirection).normalize();
33
  const north = new THREE.Vector3().crossVectors(initialDirection, east);
34
- const bandOrigin = forward.clone().addScaledVector(north, .18).normalize();
35
- const bandAxis = east.clone().multiplyScalar(.87).addScaledVector(north, .49).normalize();
36
- const bandPole = new THREE.Vector3().crossVectors(bandOrigin, bandAxis).normalize();
37
- bandAxis.crossVectors(bandPole, bandOrigin);
38
- const dust = Array.from({ length: 570 }, () => {
39
- const angle = random() * TAU;
40
- const width = .035 + .042 * Math.sin(3 * angle) ** 2;
41
- const spread = (random() + random() + random() - 1.5) * width;
42
- return {
43
- direction: bandOrigin.clone().multiplyScalar(Math.cos(angle)).addScaledVector(bandAxis, Math.sin(angle))
44
- .addScaledVector(bandPole, spread).normalize(),
45
- intensity: (.028 + .06 * Math.sin(2 * angle + .8) ** 2) * (.5 + random() * .5),
46
- size: 8 + random() * 28,
47
- };
48
- });
49
- const dustSprite = document.createElement("canvas");
50
- dustSprite.width = dustSprite.height = 64;
51
- const spriteContext = dustSprite.getContext?.("2d");
52
- if (spriteContext) {
53
- const gradient = spriteContext.createRadialGradient(32, 32, 0, 32, 32, 32);
54
- gradient.addColorStop(0, "#dfd2b57a");
55
- gradient.addColorStop(.54, "#ccc0aa26");
56
- gradient.addColorStop(1, "#ccc0aa00");
57
- spriteContext.fillStyle = gradient;
58
- spriteContext.fillRect(0, 0, 64, 64);
59
- }
60
  const center = new THREE.Vector3();
61
  const rotation = new THREE.Matrix4();
62
  const projection = new THREE.Matrix4();
@@ -185,15 +159,6 @@ export function createPaperSky(layer, canvas, initialDirection) {
185
  }
186
  context.setTransform(ratio, 0, 0, ratio, 0, 0);
187
  context.clearRect(0, 0, width, height);
188
- if (spriteContext) {
189
- const dustScale = Math.max(.65, Math.min(1.5, height / 650));
190
- for (const star of dust) {
191
- if (!project(star.direction)) continue;
192
- const size = star.size * dustScale;
193
- context.globalAlpha = star.intensity;
194
- context.drawImage(dustSprite, x - size / 2, y - size / 2, size, size);
195
- }
196
- }
197
  for (const star of background) {
198
  if (!project(star.direction)) continue;
199
  context.globalAlpha = star.intensity;
 
31
  const forward = initialDirection.clone().negate();
32
  const east = new THREE.Vector3().crossVectors(WORLD_UP, initialDirection).normalize();
33
  const north = new THREE.Vector3().crossVectors(initialDirection, east);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
34
  const center = new THREE.Vector3();
35
  const rotation = new THREE.Matrix4();
36
  const projection = new THREE.Matrix4();
 
159
  }
160
  context.setTransform(ratio, 0, 0, ratio, 0, 0);
161
  context.clearRect(0, 0, width, height);
 
 
 
 
 
 
 
 
 
162
  for (const star of background) {
163
  if (!project(star.direction)) continue;
164
  context.globalAlpha = star.intensity;