Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
4 changes: 2 additions & 2 deletions examples/worldview/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
},
"dependencies": {
"deck.gl": "8.2.0",
"@loaders.gl/core": "^2.3.13",
"@loaders.gl/json": "^2.3.13",
"@loaders.gl/core": "^4.3.3",
"@loaders.gl/json": "^4.3.3",
"@reduxjs/toolkit": "^1.5.0",
"d3-request": "^1.0.6",
"global": "^4.3.0",
Expand Down
25 changes: 11 additions & 14 deletions modules/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,28 +35,25 @@
"build-bundle": "ocular-bundle ./bundle.ts"
},
"dependencies": {
"@loaders.gl/core": "^3.0.0",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd prefer to use the version of loaders on master since there's an issue with GIF encoding the videos module in later versions, and we're not using anything from the newer version of loaders

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

^3.4.13 ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In order to bump to deck9.1, I need @loaders.gl/core@"^4.2.0", where is the encoding issue discussed?

Copy link
Collaborator

@chrisgervang chrisgervang Feb 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

visgl/loaders.gl#2164

A fix was attempted, but it's still an issue. I have a reproduction in #305

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It actually still affects this branch too after removing the resolution

"@loaders.gl/video": "^3.0.12",
"@loaders.gl/zip": "^3.0.12",
"@math.gl/core": "^3.6.0",
"@math.gl/web-mercator": "^3.6.2",
"@loaders.gl/core": "^4.3.3",
"@loaders.gl/video": "^4.3.3",
"@loaders.gl/zip": "^4.3.3",
"@math.gl/core": "^4.1.0",
"@math.gl/web-mercator": "^4.1.0",
"downloadjs": "^1.4.7",
"popmotion": "9.3.1",
"probe.gl": "^3.4.0",
"webm-writer": "^1.0.0"
},
"resolutions": {
"@loaders.gl/video": "3.0.12"
},
"peerDependencies": {
"@deck.gl/core": ">=8.3",
"@luma.gl/core": ">=8.3",
"@luma.gl/engine": ">=8.3"
"@deck.gl/core": ">=9.0",
"@luma.gl/core": ">=9.0",
"@luma.gl/engine": ">=9.0"
},
"devDependencies": {
"@deck.gl/core": "^8.9",
"@luma.gl/core": "^8.5.0",
"@luma.gl/engine": "^8.5.0",
"@deck.gl/core": "^9.0",
"@luma.gl/core": "^9.0.0",
"@luma.gl/engine": "^9.0.0",
"@types/tape-catch": "^1.0.2"
}
}
11 changes: 5 additions & 6 deletions modules/core/src/adapters/deck-adapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,22 @@
import {type FrameEncoder, PreviewEncoder, type FormatConfigs} from '../encoders/index';
import {AnimationManager} from '../animations/index';
import {type Timecode, VideoCapture} from '../capture/video-capture';
import type {Deck, Layer, DeckProps} from '@deck.gl/core/typed';
import {Deck, Layer, DeckProps} from '@deck.gl/core';

export default class DeckAdapter {
deck?: Deck;
animationManager: AnimationManager;
shouldAnimate: boolean;
enabled: boolean;
glContext?: WebGLRenderingContext;
glContext?: WebGL2RenderingContext;
videoCapture: VideoCapture;

constructor({
animationManager = undefined,
glContext = undefined
}: {
animationManager?: AnimationManager;
glContext?: WebGLRenderingContext;
glContext?: WebGL2RenderingContext;
}) {
this.animationManager = animationManager || new AnimationManager({});
this.glContext = glContext;
Expand Down Expand Up @@ -65,7 +65,7 @@ export default class DeckAdapter {
}

if (this.glContext) {
props.gl = this.glContext;
props.deviceProps.gl = this.glContext;
}
return {...extraProps, ...props};
}
Expand Down Expand Up @@ -124,8 +124,7 @@ export default class DeckAdapter {
const areAllLayersLoaded =
this.deck && this.deck.props.layers.every(layer => (layer as Layer).isLoaded);
if (this.videoCapture.isRecording() && areAllLayersLoaded && readyToCapture) {
// @ts-expect-error TODO use getCanvas
const canvas = this.deck.canvas;
const canvas = this.deck.getCanvas();
this.videoCapture.capture(canvas, nextTimeMs => {
this.seek({timeMs: nextTimeMs});
proceedToNextFrame(nextTimeMs);
Expand Down
2 changes: 1 addition & 1 deletion modules/core/src/animations/deck-animation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
DeckLayerKeyframeProps
} from '../keyframes/index';
import Animation, {AnimationConstructor} from './animation';
import type {Layer} from '@deck.gl/core/typed';
import type {Layer} from '@deck.gl/core';

function noop() {}

Expand Down
4 changes: 2 additions & 2 deletions modules/main/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@
"@hubble.gl/react": "1.4.0-alpha.0"
},
"peerDependencies": {
"react": ">=16.3.0",
"react-dom": ">=16.3.0"
"react": ">=18.3.0",
"react-dom": ">=18.3.0"
},
"peerDependenciesMeta": {
"react": {
Expand Down
20 changes: 10 additions & 10 deletions modules/react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
],
"sideEffects": false,
"dependencies": {
"@loaders.gl/zip": "^3.0.12",
"@loaders.gl/zip": "^4.3.3",
"@turf/helpers": "^5.1.5",
"@turf/transform-translate": "^5.1.5",
"classnames": "^2.2.6",
Expand All @@ -53,19 +53,19 @@
"styled-components": "^6.1.11"
},
"peerDependencies": {
"@deck.gl/core": ">=8.3",
"@deck.gl/mapbox": ">=8.3",
"@deck.gl/react": ">=8.3",
"@hubble.gl/core": "^1.3.0",
"@loaders.gl/core": "^3.0.0",
"@deck.gl/core": ">=9.0",
"@deck.gl/mapbox": ">=9.0",
"@deck.gl/react": ">=9.0",
"@hubble.gl/core": "1.4.0-alpha.0",
"@loaders.gl/core": "^4.3.3",
"mapbox-gl": "<=2.4.1",
"react": ">=16.3.0",
"react": ">=18.3.0",
"react-dom": ">=16.3.0"
},
"devDependencies": {
"@deck.gl/core": "^8.9",
"@deck.gl/mapbox": "^8.9",
"@deck.gl/react": "^8.9",
"@deck.gl/core": "^9.0",
"@deck.gl/mapbox": "^9.0",
"@deck.gl/react": "^9.0",
"@types/lodash.get": "^4.4.9",
"@types/lodash.isequal": "^4.5.8",
"@types/react": "^18.3.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import ExportVideoPanel from './export-video-panel';
import {parseSetCameraType, scaleToVideoExport} from './utils';
import {DEFAULT_FILENAME, getResolutionSetting} from './constants';
import {StaticMapProps} from 'react-map-gl';
import type {DeckProps, MapViewState} from '@deck.gl/core/typed';
import type {DeckProps, MapViewState} from '@deck.gl/core';

const ENCODERS = {
gif: GifEncoder,
Expand All @@ -39,7 +39,7 @@ export type ExportVideoSettings = {

type ExportVideoPanelContainerProps = {
initialState?: Partial<ExportVideoPanelContainerState>;
glContext?: WebGLRenderingContext;
glContext?: WebGL2RenderingContext;

exportVideoWidth: number;
handleClose: () => void;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
/* global window */

import React, {Component, RefObject} from 'react';
import DeckGL, {DeckGLRef} from '@deck.gl/react/typed';
import DeckGL, {DeckGLRef} from '@deck.gl/react';
import {MapRef, StaticMap, StaticMapProps} from 'react-map-gl';
import {MapboxLayer} from '@deck.gl/mapbox/typed';
import type {DeckProps, MapViewState} from '@deck.gl/core/typed';
import {MapboxOverlay as MapboxLayer} from '@deck.gl/mapbox';
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, this actually isn't a drop-in replacement and will require some changes to work. http://deck.gl/docs/upgrade-guide#deckglmapbox

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As a temporary fix I believe we can still import MapboxLayer with import MapboxLayer from '@deck.gl/mapbox/mapbox-layer'

Copy link
Contributor Author

@charlieforward9 charlieforward9 Jan 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rather get this out of the way now. Im not getting any type errors, and all instances in the src/ folder implement the same props {id: ..., ...deck} where id is a string and deck is a Deck obj that may have also been changed in v9 to reflect the change. Let me know.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The API is different in MapboxOverlay. It creates a deck instance rather than getting passed an instance and that inversion would require a bit of refactoring

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@chrisgervang

I replaced the deck instance with the deck props in 03a2f0f

I see that the link shows that MapboxLayer to MapboxOverlay shows interleaved: true as the replacement. Should the updated API include this?

import type {DeckProps, MapViewState} from '@deck.gl/core';
import isEqual from 'lodash.isequal';

import {deckStyle, DeckCanvas} from './styled-components';
Expand Down Expand Up @@ -163,13 +163,13 @@ export class ExportVideoPanelPreview extends Component<

// If there aren't any layers, combine map and deck with a fake layer.
if (!keplerLayers.length) {
map.addLayer(new MapboxLayer({id: '%%blank-layer', deck}));
map.addLayer(new MapboxLayer({id: '%%blank-layer', ...deck}));
mapboxLayerIds.push('%%blank-layer');
}

for (let i = 0; i < keplerLayers.length; i++) {
// Adds DeckGL layers to Mapbox so Mapbox can be the bottom layer. Removing this clips DeckGL layers
map.addLayer(new MapboxLayer({id: keplerLayers[i].id, deck}), beforeId);
map.addLayer(new MapboxLayer({id: keplerLayers[i].id, ...deck}), beforeId);
mapboxLayerIds.push(keplerLayers[i].id);
}

Expand Down Expand Up @@ -207,7 +207,7 @@ export class ExportVideoPanelPreview extends Component<
controller={true}
glOptions={{stencil: true}}
onWebGLInitialized={gl => this.setState({glContext: gl})}
onViewStateChange={({viewState: vs}) => setViewState(vs as MapViewState)}
onViewStateChange={({viewState: vs}) => setViewState(vs)}
{...(disableStaticMap ? {onAfterRender: this._onAfterRender} : {})}
width={resolution[0]}
height={resolution[1]}
Expand Down
2 changes: 1 addition & 1 deletion modules/react/src/components/export-video/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import {point} from '@turf/helpers';
import transformTranslate from '@turf/transform-translate';
import {WebMercatorViewport} from '@deck.gl/core';
import type {MapViewState} from '@deck.gl/core/typed';
import type {MapViewState} from '@deck.gl/core';

export function scaleToVideoExport(
viewState: MapViewState,
Expand Down
7 changes: 2 additions & 5 deletions modules/react/src/components/quick-animation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@
// SPDX-License-Identifier: MIT
// Copyright (c) vis.gl contributors
import React, {useState, useRef, useMemo} from 'react';
import DeckGL, {DeckGLRef} from '@deck.gl/react/typed';
import DeckGL, {DeckGLRef} from '@deck.gl/react';
import BasicControls from './basic-controls';
import {useDeckAdapter, useNextFrame} from '../hooks';
import type {MapViewState} from '@deck.gl/core/typed';
import {FormatConfigs} from '@hubble.gl/core';

export const QuickAnimation = ({
Expand Down Expand Up @@ -57,9 +56,7 @@ export const QuickAnimation = ({
ref={deckRef}
style={{position: 'unset'}}
viewState={cameraFrame}
onViewStateChange={({viewState: vs}) => {
setCameraFrame(vs as MapViewState);
}}
onViewStateChange={({viewState: vs}) => setCameraFrame(vs)}
controller={true}
width={resolution.width}
height={resolution.height}
Expand Down
7 changes: 4 additions & 3 deletions modules/react/src/components/render-player.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,14 @@ import styled from 'styled-components';
import {type Encoders, GIF, JPEG, PNG, WEBM} from './encoders';

const parseImages = async (blob: Blob, encoder?: Encoders): Promise<{[name: string]: string}> => {
const images = await parse(blob, ZipLoader);
const images = (await parse(blob, ZipLoader)) as {[name: string]: ArrayBuffer};
const imageUrls: {[name: string]: string} = {};
for (const image in images) {
images[image] = URL.createObjectURL(
imageUrls[image] = URL.createObjectURL(
new Blob([images[image]], {type: encoder === JPEG ? 'image/jpeg' : 'image/png'})
);
}
return images;
return imageUrls;
};

const VideoPlayer = styled.video`
Expand Down
10 changes: 5 additions & 5 deletions modules/react/src/hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

import {useState, useCallback, useMemo, RefObject} from 'react';
import {DeckAdapter, DeckAnimation, DeckAnimationConstructor} from '@hubble.gl/core';
import {MapboxLayer} from '@deck.gl/mapbox/typed';
import type {Layer, MapViewState} from '@deck.gl/core/typed';
import type {DeckGLRef} from '@deck.gl/react/typed';
import {MapboxOverlay as MapboxLayer} from '@deck.gl/mapbox';
import type {Layer, MapViewState} from '@deck.gl/core';
import type {DeckGLRef} from '@deck.gl/react';
import {MapRef} from 'react-map-gl';

export function useNextFrame() {
Expand Down Expand Up @@ -60,11 +60,11 @@ export function useHubbleGl({
const map = staticMapRef.current.getMap();
// If there aren't any layers, combine map and deck with a fake layer.
if (!layers.length) {
map.addLayer(new MapboxLayer({id: '%%blank-layer', deck}));
map.addLayer(new MapboxLayer({id: '%%blank-layer', ...deck}));
}
for (let i = 0; i < layers.length; i++) {
// Adds DeckGL layers to Mapbox so Mapbox can be the bottom layer. Removing this clips DeckGL layers
map.addLayer(new MapboxLayer({id: layers[i].id, deck}));
map.addLayer(new MapboxLayer({id: layers[i].id, ...deck}));
}
map.on('render', () => adapter.onAfterRender(nextFrame, map.areTilesLoaded()));
}
Expand Down
2 changes: 1 addition & 1 deletion modules/react/src/kepler-layers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// Copyright (c) vis.gl contributors

import {createSelector} from 'reselect';
import type {Layer, MapViewState} from '@deck.gl/core/typed';
import type {Layer, MapViewState} from '@deck.gl/core';

/**
* Kepler Layer Creation
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.module.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"build": true,
// "build": true,
"esModuleInterop": true,
"declaration": true,
"declarationMap": true,
Expand Down
Loading