Skip to content
Merged
Show file tree
Hide file tree
Changes from 32 commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
957466c
chore: bump deps
charlieforward9 Jan 19, 2025
e63204f
chore: bump deps
charlieforward9 Jan 19, 2025
03a2f0f
refactor: replace deck instance with props in MapboxOverlay
charlieforward9 Jan 23, 2025
8c419bf
New Website
chrisgervang Feb 3, 2025
02ffe2f
links
chrisgervang Feb 3, 2025
0e6eeae
Delete README.md
chrisgervang Feb 3, 2025
621f594
fix kepler
chrisgervang Feb 4, 2025
465f103
website action
chrisgervang Feb 4, 2025
fcfd2d9
pull latest changes in and bump
charlieforward9 Feb 4, 2025
cf8a4ea
pull latest changes in and bump
charlieforward9 Feb 4, 2025
9e69a10
chore: apply suggestions
charlieforward9 Feb 9, 2025
5e8d373
Merge branch 'master' of https://github.com/visgl/hubble.gl
charlieforward9 Feb 9, 2025
290b99c
chore: resolve comments, warnings
charlieforward9 Feb 10, 2025
485e7db
chore: bump to deck9.1
charlieforward9 Feb 10, 2025
fdb6e24
fix: build error
charlieforward9 Feb 10, 2025
256fe24
Merge branch 'master' into pr/285
chrisgervang Feb 10, 2025
a6f0a4c
yarn and lint
chrisgervang Feb 10, 2025
fce220c
set next version
chrisgervang Feb 10, 2025
d2ea066
add missing peer to fix test [ 'full' | 'dist' | 'bench' | 'ci' | 'co…
chrisgervang Feb 10, 2025
69c4da2
mapbox as peer, remove loader resolution
chrisgervang Feb 10, 2025
93f7f59
wip refactor: improve types, bump example decks
charlieforward9 Feb 11, 2025
6334935
chore: pin yarn version
charlieforward9 Feb 11, 2025
4967fc8
wip chore: bump & test examples
charlieforward9 Feb 24, 2025
5e79461
fix: #277
charlieforward9 Feb 24, 2025
5bbf88a
feat: add types to react quick animation component
charlieforward9 Feb 24, 2025
093ab76
refactor(Animator): remove
charlieforward9 Feb 26, 2025
b7ce53a
refactor(encoders): remove archive format, standardize zip
charlieforward9 Feb 26, 2025
b011b98
minor: animator refactor
charlieforward9 Feb 26, 2025
c4e99fe
minor: linting, formatting
charlieforward9 Feb 26, 2025
52af878
refactor(keyframes): remove unused features field
charlieforward9 Feb 27, 2025
57d31c3
chore(examples): bump / migrate, depend on local repo
charlieforward9 Feb 27, 2025
cc61f96
refactor(keyframes): remove kepler keyframe features
charlieforward9 Feb 27, 2025
547d5e8
Apply suggestions from code review
chrisgervang Mar 17, 2025
b299616
Merge branch 'master' into pr/285
chrisgervang Mar 20, 2025
20d76c7
Merge branch 'master' into pr/285
chrisgervang Mar 20, 2025
b6ac51f
Disable node tests
chrisgervang Mar 20, 2025
00272be
Enable headless browser tests
chrisgervang Mar 20, 2025
9807328
Use deck 9.1 in scripting
chrisgervang Mar 20, 2025
3204ff6
audit html
chrisgervang Mar 20, 2025
46b66a5
Remove packageManager
chrisgervang Mar 20, 2025
57fc004
Fix website build
chrisgervang Mar 20, 2025
dcd38a2
Revert "Remove packageManager"
chrisgervang Mar 20, 2025
7bbed20
add packageManager to website
chrisgervang Mar 20, 2025
1a069de
define clear color in views for each example
chrisgervang Mar 20, 2025
c339bf9
use browser tests in CI instead of node tests
chrisgervang Mar 20, 2025
0f61f3d
hack around dev-tools running node tests in CI
chrisgervang Mar 20, 2025
fa014a0
restore lint in ci
chrisgervang Mar 20, 2025
46193b3
TODO
chrisgervang Mar 20, 2025
877c8da
old docs
chrisgervang Mar 20, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ coverage/
.cache/

tsconfig.tsbuildinfo
tsconfig.build.tsbuildinfo

*/**/yarn.lock
!website/yarn.lock
Expand Down
8 changes: 4 additions & 4 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Hubble.gl is a JavaScript library for animating and video encoding WebGL data vi
<script src="https://unpkg.com/hubble.gl@latest/dist.min.js"></script>
```

- [Standalone example](https://github.com/visgl/hubble.gl/tree/master/examples/standalone)
- [Standalone example](https://github.com/visgl/hubble.gl/tree/-release/examples/standalone)

### NPM Module

Expand All @@ -26,13 +26,13 @@ npm install hubble.gl

#### Pure JS

- [Pure JS example](https://github.com/visgl/hubble.gl/tree/master/examples/get-started/pure-js)
- [Pure JS example](https://github.com/visgl/hubble.gl/tree/-release/examples/get-started/pure-js)

#### React

- [Get started](https://github.com/visgl/hubble.gl/tree/master/examples/website/camera)
- [Get started](https://github.com/visgl/hubble.gl/tree/-release/examples/website/camera)

- [With basemap](https://github.com/visgl/hubble.gl/tree/master/examples/website/trips)
- [With basemap](https://github.com/visgl/hubble.gl/tree/-release/examples/website/trips)

## Basic Animation

Expand Down
4 changes: 2 additions & 2 deletions docs/api-reference/encoder/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ Encoders are used to capture image frames of an HTML `<canvas/>` and encode them
| [`WebMEncoder`](/docs/api-reference/encoder/webm-encoder) | Video | Encodes `.webm` video using [Whammy](https://antimatter15.com/2012/08/whammy-a-real-time-javascript-webm-encoder/). |
| [`GIFEncoder`](/docs/api-reference/encoder/gif-encoder) | Animated Image | Encodes `.gif` images using `gifshot.js`. |
| [`StreamEncoder`](/docs/api-reference/encoder/stream-encoder) | Video | Encodes `.webm` rough previews, but drops frames. |
| [`PNGSequenceEncoder`](/docs/api-reference/encoder/png-sequence-encoder) | Image Sequence | Encodes video frames as loseless `.png` contained in a `.tar`. |
| [`JPEGSequenceEncoder`](/docs/api-reference/encoder/jpeg-sequence-encoder) | Image Sequence | Encodes video frames as compressed `.jpeg` contained in a `.tar`. |
| [`PNGSequenceEncoder`](/docs/api-reference/encoder/png-sequence-encoder) | Image Sequence | Encodes video frames as loseless `.png` contained in a `.zip`. |
| [`JPEGSequenceEncoder`](/docs/api-reference/encoder/jpeg-sequence-encoder) | Image Sequence | Encodes video frames as compressed `.jpeg` contained in a `.zip`. |

### Attributions

Expand Down
4 changes: 2 additions & 2 deletions docs/api-reference/encoder/jpeg-sequence-encoder.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# JPEGSequenceEncoder

A photo sequence encoder that inherits [FrameEncoder](/docs/api-reference/encoder/frame-encoder). Saves each frame as a photo contained in a `".tar"` archive.
A photo sequence encoder that inherits [FrameEncoder](/docs/api-reference/encoder/frame-encoder). Saves each frame as a photo contained in a `".zip"` archive.

## Constructor

Expand All @@ -12,7 +12,7 @@ In addition to the [FrameEncoder](/docs/api-reference/encoder/frame-encoder) set

* `quality` - See member note. Defaults to 1.0.

* `archive` - `zip` or `tar`. Defaults to `tar`.
* `archive` - `zip`.

## Members

Expand Down
4 changes: 2 additions & 2 deletions docs/api-reference/encoder/png-sequence-encoder.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# PNGSequenceEncoder

A photo sequence encoder that inherits [FrameEncoder](/docs/api-reference/encoder/frame-encoder). Saves each frame as a photo contained in a `".tar"` archive.
A photo sequence encoder that inherits [FrameEncoder](/docs/api-reference/encoder/frame-encoder). Saves each frame as a photo contained in a `".zip"` archive.

## Constructor

Expand All @@ -10,7 +10,7 @@ Construction of the encoder class is not required. Refer to [DeckAdapter.render]

In addition to the [FrameEncoder](/docs/api-reference/encoder/frame-encoder) settings, these settings are available under the `png` namespace.

* `archive` - `zip` or `tar`. Defaults to `tar`.
* `archive` - `zip`.

**Notes:**

Expand Down
4 changes: 1 addition & 3 deletions docs/api-reference/keyframe/deck-layer-keyframes.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# DeckLayerKeyframes

The `DeckLayerKeyframes` class extends the hubble.gl `Keyframes` class and offers support for animating deck.gl layers. The animated `features` can be any deck.gl layer prop, such as `getRadius`. The `id` property may be provided, and should match the layer id of the deck.gl layer it's linked too.
The `DeckLayerKeyframes` class extends the hubble.gl `Keyframes` class and offers support for animating deck.gl layers.

## Usage

Expand All @@ -12,8 +12,6 @@ Parameters:

* `id` (`string`) - deck.gl layer id.

* `features` (`Array<string>`, Optional) - An array of features to animate. If not provided explicitly, the first keyframe must have all animated features.

* `timings` (`Array<number>`) - "N" timestamps for beginning of keyframe.

* `keyframes` (`Array<Object>`) - "N" camera objects to transition between.
Expand Down
7 changes: 2 additions & 5 deletions docs/api-reference/keyframe/keyframes.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Keyframes (Class)

The Keyframes class extends the luma.gl [Keyframes](https://luma.gl/docs/api-reference/engine/animation/key-frames) class and adds additional features. In your application, extend from hubble.gl's Keyframes as shown in the `CameraKeyFrames` example. Add `features` to animate, such as `latitude`. When designing your animation, keyframe values are required for each feature you define.
The Keyframes class extends the luma.gl [Keyframes](https://luma.gl/docs/api-reference/engine/animation/key-frames) class and adds additional features. In your application, extend from hubble.gl's Keyframes as shown in the `CameraKeyFrames` example.

## Usage

Expand All @@ -12,21 +12,18 @@ class CameraKeyFrames extends Keyframes {
constructor(props) {
super({
...props,
features: ['latitude', 'longitude', 'zoom', 'pitch', 'bearing']
});
}
}

// It can be used directly too.
new Keyframes({features, timings, keyframes, easings = linear, interpolators = 'linear'})
new Keyframes({ timings, keyframes, easings = linear, interpolators = 'linear'})
```

## Constructor

Parameters:

* `features` (`Array<string>`) - An array of features to animate.

* `timings` (`Array<number>`) - "N" timestamps for beginning of keyframe.

* `keyframes` (`Array<Object>`) - "N" camera objects to transition between.
Expand Down
12 changes: 7 additions & 5 deletions examples/get-started/pure-js/app.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* global document, URL */
import {Deck} from '@deck.gl/core';
import {Deck, MapView} from '@deck.gl/core';
import {GeoJsonLayer, ArcLayer} from '@deck.gl/layers';
import {DeckAdapter, DeckAnimation, AnimationManager, WebMEncoder} from '@hubble.gl/core';
import {easeInOut} from 'popmotion';
Expand Down Expand Up @@ -82,6 +82,12 @@ export const deck = new Deck({
deck.setProps({viewState});
},
controller: true,
views: new MapView({
// most video formats don't fully support transparency
clear: {
color: [255, 255, 255, 1]
}
}),
layers: [
new GeoJsonLayer({
id: 'base-map',
Expand Down Expand Up @@ -118,10 +124,6 @@ export const deck = new Deck({
getWidth: 1
})
],
// most video formats don't fully support transparency
parameters: {
clearColor: [255, 255, 255, 1]
},
// retina displays will double resolution
useDevicePixels: false
});
Expand Down
6 changes: 3 additions & 3 deletions examples/get-started/pure-js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
"build": "vite build"
},
"dependencies": {
"@hubble.gl/core": "^1.4.0",
"deck.gl": "^8.9",
"@hubble.gl/core": "file:../../../modules/main",
"deck.gl": "^9.1.3",
"popmotion": "9.3.1"
},
"devDependencies": {
"vite": "^4.0.0"
"vite": "^6.2.0"
}
}
30 changes: 22 additions & 8 deletions examples/get-started/scripting/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,32 +3,46 @@
<!-- deck.gl standalone bundle -->
<script src="https://unpkg.com/[email protected]/dist.min.js"></script>
<script src="https://unpkg.com/[email protected]/dist.min.js"></script>
<script src='https://api.tiles.mapbox.com/mapbox-gl-js/v0.53.1/mapbox-gl.js'></script>
<link href='https://api.tiles.mapbox.com/mapbox-gl-js/v0.53.1/mapbox-gl.css' rel='stylesheet' />
<script src="https://api.tiles.mapbox.com/mapbox-gl-js/v0.53.1/mapbox-gl.js"></script>
<link href="https://api.tiles.mapbox.com/mapbox-gl-js/v0.53.1/mapbox-gl.css" rel="stylesheet" />
<style>
body {margin: 0; padding: 0; font-family: Helvetica, Arial, sans-serif;}
#geo, #non-geo {position: absolute; width: 50vw; height: 50vh;}
body {
margin: 0;
padding: 0;
font-family: Helvetica, Arial, sans-serif;
}
#geo,
#non-geo {
position: absolute;
width: 50vw;
height: 50vh;
}
/* #non-geo {left: 50vw; top: 0;} */
.render-result {
position: absolute;
z-index: 1;
top: 0;
right: 0;
background-color: #FFF;
background-color: #fff;
margin: 24px;
padding: 10px 24px;
box-shadow: rgba(0, 0, 0, 0.16) 0px 1px 4px;
min-width: 300px;
}
.render-result h3 { font-size: 16px; margin: 8px 0; }
#re-render { margin-top: 8px; }
.render-result h3 {
font-size: 16px;
margin: 8px 0;
}
#re-render {
margin-top: 8px;
}
#result {
display: none;
}
</style>
</head>
<body>
<div id="non-geo" ></div>
<div id="non-geo"></div>
<div class="render-result">
<h3 id="render-status">Rendering video...</h3>
<div id="result">
Expand Down
27 changes: 10 additions & 17 deletions examples/website/basic-basemap-mapbox-legacy/app.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,8 @@ const formatConfigs = {
webm: {
quality: 0.8
},
png: {
archive: 'zip'
},
png: {},
jpeg: {
archive: 'zip',
quality: 0.8
},
gif: {
Expand All @@ -73,17 +70,16 @@ const timecode = {
};

const DeckGLOverlay = forwardRef((props, ref) => {
// MapboxOverlay handles a variety of props differently than the Deck class.
// https://deck.gl/docs/api-reference/mapbox/mapbox-overlay#constructor
const deck = useControl(() => new MapboxOverlay({...props, interleaved: true}));
// MapboxOverlay handles a variety of props differently than the Deck class.
// https://deck.gl/docs/api-reference/mapbox/mapbox-overlay#constructor
const deck = useControl(() => new MapboxOverlay({...props, interleaved: true}));

deck.setProps(props);
deck.setProps(props);

// @ts-expect-error private property
setRef(ref, deck._deck);
return null;
}
);
// @ts-expect-error private property
setRef(ref, deck._deck);
return null;
});

const Container = ({children}) => (
<div
Expand Down Expand Up @@ -169,10 +165,7 @@ export default function App({mapStyle = 'mapbox://styles/mapbox/streets-v11'}) {
onMove={onViewStateChange}
// Note: 'reuseMap' prop with gatsby and mapbox extension causes stale reference error.
>
<DeckGLOverlay
ref={deckRef}
{...deckProps}
/>
<DeckGLOverlay ref={deckRef} {...deckProps} />
</Map>
</div>
<BasicControls
Expand Down
2 changes: 1 addition & 1 deletion examples/website/basic-basemap-mapbox-legacy/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
},
"dependencies": {
"deck.gl": "^8.9",
"hubble.gl": "^1.4.0",
"hubble.gl": "file:../../../modules/main",
"react": "^18.3.0",
"react-dom": "^18.3.0",
"react-map-gl": "^7.1.8",
Expand Down
16 changes: 5 additions & 11 deletions examples/website/basic-basemap-mapbox/app.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import React, {useState, useRef, useEffect, forwardRef} from 'react';
import {createRoot} from 'react-dom/client';
import {BasicControls, useHubbleGl, useDeckAnimation} from '@hubble.gl/react';
import {MapboxOverlay} from '@deck.gl/mapbox';
import Map, {useControl} from 'react-map-gl';
import {Map, useControl} from 'react-map-gl/mapbox';
import {PolygonLayer} from '@deck.gl/layers';
import {easeInOut} from 'popmotion';
import {setRef} from './set-ref';
Expand Down Expand Up @@ -52,11 +52,8 @@ const formatConfigs = {
webm: {
quality: 0.8
},
png: {
archive: 'zip'
},
png: {},
jpeg: {
archive: 'zip',
quality: 0.8
},
gif: {
Expand All @@ -82,8 +79,8 @@ const DeckGLOverlay = forwardRef((props, ref) => {
// @ts-expect-error private property
setRef(ref, deck._deck);
return null;
}
);
});
DeckGLOverlay.displayName = 'DeckGLOverlay';

const Container = ({children}) => (
<div
Expand Down Expand Up @@ -169,10 +166,7 @@ export default function App({mapStyle = 'mapbox://styles/mapbox/streets-v11'}) {
onMove={onViewStateChange}
// Note: 'reuseMap' prop with gatsby and mapbox extension causes stale reference error.
>
<DeckGLOverlay
ref={deckRef}
{...deckProps}
/>
<DeckGLOverlay ref={deckRef} {...deckProps} />
</Map>
</div>
<BasicControls
Expand Down
42 changes: 26 additions & 16 deletions examples/website/basic-basemap-mapbox/index.html
Original file line number Diff line number Diff line change
@@ -1,19 +1,29 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>hubble.gl Example</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
body {margin: 0; font-family: sans-serif; width: 100vw; height: 100vh; overflow: hidden;}
#app {width: 100%; height: 100%;}
</style>
</head>
<body>
<div id="app"></div>
</body>
<script type="module">
import {renderToDOM} from './app.jsx';
renderToDOM(document.getElementById('app'));
</script>
<head>
<link href="https://api.mapbox.com/gl-js-seats/v2.13.0/mapbox-gl-seats.css" rel="stylesheet" />
<meta charset="utf-8" />
<title>hubble.gl Example</title>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<style>
body {
margin: 0;
font-family: sans-serif;
width: 100vw;
height: 100vh;
overflow: hidden;
}
#app {
width: 100%;
height: 100%;
}
</style>
</head>
<body>
<div id="app"></div>
</body>
<script type="module">
import {renderToDOM} from './app.jsx';
renderToDOM(document.getElementById('app'));
</script>
</html>
Loading
Loading