-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hubble example #14
Hubble example #14
Conversation
…or all examples in the hubble folder | Changes applied from review #1
Thanks for the comments to explain everything :) I was wondering if we could split this into two PRs, one for the glTF separate from the hubble-example and viewState changes? Also, could you rename hubble-example to something more related to the view state feature? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On second look, it looks like the examples added might be accidental duplicates of each other?
@@ -28,20 +28,20 @@ import { | |||
} from '@hubble.gl/core'; | |||
import EncoderDropdown from './encoder-dropdown'; | |||
|
|||
export default function BasicControls({adapter, busy, setBusy, encoderSettings}) { | |||
export default function BasicControls({adapter, busy, setBusy, encoderSettings, updateCamera}) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you check to ensure updateCamera is an optional value in both this component and in adapter.getProps?
Want to make sure this feature is "opt in"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm passing updateCamera = undefined
at the end of the props in BasicControls. Now if you don't pass an updateCamera
function in the BasicControls component it will use the default keyframes.
The only change in adapter.getProps was that this.enabled
was added at the end of the check:
// Animating the camera is optional, but if a keyframe is defined then viewState is controlled by camera keyframe.
if (this.scene && this.scene.keyframes.camera && this.enabled) {
props.controller = false;
props.viewState = this._getViewState();
}
What should I change about this?
@@ -24,13 +24,15 @@ export async function sceneBuilder(animationLoop) { | |||
easings: [easing.easeInOut] | |||
}) | |||
}; | |||
animationLoop.timeline.attachAnimation(keyframes.camera); | |||
|
|||
const currentCamera = animationLoop.timeline.attachAnimation(keyframes.camera); | |||
|
|||
return new DeckScene({ | |||
animationLoop, | |||
keyframes, | |||
lengthMs: 5000, | |||
width: 640, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if you're on this task yet but shouldn't this be modular? So that the user can set resolution themselves
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we've ever scoped or discussed setting resolution differently. At the moment it's designed to be set within scene definition since it's how I preferred to set up scenes.
We could change this to be optional if DeckAdapter is changed to only set it if it's defined. Happy to accept a PR for that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it. I imagined those being values being set with state but I must have misremembered.
'https://raw.githubusercontent.com/visgl/deck.gl-data/master/website/sf-zipcodes.json'; | ||
|
||
export const layers = [ | ||
new PolygonLayer({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure what all of these layers are doing. Looking at the filepath it has something to do with GLTF? Which a quick search says is related to 3d assets? Consider adding a README for all of these examples giving a brief overview of what they're showcasing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm deleting the GLTF example as it was from when we were learning.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's fine. The other examples could use a README though
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you think of the README file? I've never written one before so I'm not sure it's correct. The other examples didn't have readme files, should I add to those too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks pretty good! Getting very close. Could you rename the example folder you're keeping to "trips"? (Sorry about the minor requests, I think this consistency will help in the long run)
Pinning node to version 12.6.3 per discussion. Upgrading to deck 8.2.2
Looks good! Please "squash and merge" from the web UI to consolidate the commits into one. |
* Upgrade packages, downgrade node (for now) (#14) Pinning node to version 12.6.3 per discussion. Upgrading to deck 8.2.2 * Improve App Integration: Make Camera and Layers Optional in a DeckScene (#15) * Minor keyframe class clean up, removing unused defaults * Camera and Layers are optional in a DeckScene - Animating the camera is optional, but if a keyframe is defined then viewState is controlled by camera keyframe. - To Use: do not provide a `camera` to `keyframes` parameter when constructing DeckScene. - Animating layers is optional, only replace layers prop when scene provides layers. - To Use: do not provide a `renderLayers` parameter when constructing DeckScene * Adding Camera Example to docs * [FIX/ADD] Fixed missing steps to instructions + added extra notation (#13) * [FIX/ADD] Fixed missing steps to instructions + added extra notation * [FIX] Forgot missing step in #8 * [FIX/ADD] Fix step 9 and added clarification * [DEL] Extraneous folders/files * Adding a ResolutionGuide component to examples...(#17) ...so the background doesn't look so empty. * v1.1.0-alpha.3 (#18) * v1.1.0-alpha.4 * Bump lodash from 4.17.15 to 4.17.19 Bumps [lodash](https://github.com/lodash/lodash) from 4.17.15 to 4.17.19. - [Release notes](https://github.com/lodash/lodash/releases) - [Commits](lodash/lodash@4.17.15...4.17.19) Signed-off-by: dependabot[bot] <[email protected]> * Bump elliptic from 6.5.2 to 6.5.3 Bumps [elliptic](https://github.com/indutny/elliptic) from 6.5.2 to 6.5.3. - [Release notes](https://github.com/indutny/elliptic/releases) - [Commits](indutny/elliptic@v6.5.2...v6.5.3) Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: RaymondDashWu <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* Upgrade packages, downgrade node (for now) (#14) Pinning node to version 12.6.3 per discussion. Upgrading to deck 8.2.2 * Improve App Integration: Make Camera and Layers Optional in a DeckScene (#15) * Minor keyframe class clean up, removing unused defaults * Camera and Layers are optional in a DeckScene - Animating the camera is optional, but if a keyframe is defined then viewState is controlled by camera keyframe. - To Use: do not provide a `camera` to `keyframes` parameter when constructing DeckScene. - Animating layers is optional, only replace layers prop when scene provides layers. - To Use: do not provide a `renderLayers` parameter when constructing DeckScene * Adding Camera Example to docs * [FIX/ADD] Fixed missing steps to instructions + added extra notation (#13) * [FIX/ADD] Fixed missing steps to instructions + added extra notation * [FIX] Forgot missing step in #8 * [FIX/ADD] Fix step 9 and added clarification * [DEL] Extraneous folders/files * Adding a ResolutionGuide component to examples...(#17) ...so the background doesn't look so empty. * v1.1.0-alpha.3 (#18) * v1.1.0-alpha.4 * Bump lodash from 4.17.15 to 4.17.19 Bumps [lodash](https://github.com/lodash/lodash) from 4.17.15 to 4.17.19. - [Release notes](https://github.com/lodash/lodash/releases) - [Commits](lodash/lodash@4.17.15...4.17.19) Signed-off-by: dependabot[bot] <[email protected]> * Bump elliptic from 6.5.2 to 6.5.3 Bumps [elliptic](https://github.com/indutny/elliptic) from 6.5.2 to 6.5.3. - [Release notes](https://github.com/indutny/elliptic/releases) - [Commits](indutny/elliptic@v6.5.2...v6.5.3) Signed-off-by: dependabot[bot] <[email protected]> * lint (#28) * v1.1.0-alpha.5 * Documentation fixes additions (#21) * [FIX/ADD] Fixed missing steps to instructions + added extra notation * [FIX] Forgot missing step in #8 * [FIX/ADD] Fix step 9 and added clarification * [DEL] Extraneous folders/files * [TEST] Is this how you link markdown images? * [ADD] Rendering tips/guide * [FIX] Separated GIF/MP4 so it can't be interpreted together * [FIX] Made steps more clear by bolding and fixed sequence conversion to gif not mp4 * [FIX?] Image not loading * [FIX] MP4 => GIF error * [FIX] Spacing between Step #s * [FIX] Step #4 spacing * [FIX/ADD] Removed MP4 from docs + added entry to table of contents * [MOVE] Images move to website static folder + location updated * [FIX] Image URLS * Bump http-proxy from 1.18.0 to 1.18.1 (#25) Bumps [http-proxy](https://github.com/http-party/node-http-proxy) from 1.18.0 to 1.18.1. - [Release notes](https://github.com/http-party/node-http-proxy/releases) - [Changelog](https://github.com/http-party/node-http-proxy/blob/master/CHANGELOG.md) - [Commits](http-party/node-http-proxy@1.18.0...1.18.1) Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump node-fetch from 2.6.0 to 2.6.1 (#26) Bumps [node-fetch](https://github.com/bitinn/node-fetch) from 2.6.0 to 2.6.1. - [Release notes](https://github.com/bitinn/node-fetch/releases) - [Changelog](https://github.com/node-fetch/node-fetch/blob/master/docs/CHANGELOG.md) - [Commits](node-fetch/node-fetch@v2.6.0...v2.6.1) Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: RaymondDashWu <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Pinning node to version 12.6.3 per discussion. Upgrading to deck 8.2.2
… an animation for some datasets (#15) * Upgrade packages, downgrade node (for now) (#14) Pinning node to version 12.6.3 per discussion. Upgrading to deck 8.2.2 * Improve App Integration: Make Camera and Layers Optional in a DeckScene (#15) * Minor keyframe class clean up, removing unused defaults * Camera and Layers are optional in a DeckScene - Animating the camera is optional, but if a keyframe is defined then viewState is controlled by camera keyframe. - To Use: do not provide a `camera` to `keyframes` parameter when constructing DeckScene. - Animating layers is optional, only replace layers prop when scene provides layers. - To Use: do not provide a `renderLayers` parameter when constructing DeckScene * Adding Camera Example to docs * [FIX/ADD] Fixed missing steps to instructions + added extra notation (#13) * [FIX/ADD] Fixed missing steps to instructions + added extra notation * [FIX] Forgot missing step in #8 * [FIX/ADD] Fix step 9 and added clarification * [DEL] Extraneous folders/files * Adding a ResolutionGuide component to examples...(#17) ...so the background doesn't look so empty. * v1.1.0-alpha.3 (#18) * v1.1.0-alpha.4 * Bump lodash from 4.17.15 to 4.17.19 Bumps [lodash](https://github.com/lodash/lodash) from 4.17.15 to 4.17.19. - [Release notes](https://github.com/lodash/lodash/releases) - [Commits](lodash/lodash@4.17.15...4.17.19) Signed-off-by: dependabot[bot] <[email protected]> * Bump elliptic from 6.5.2 to 6.5.3 Bumps [elliptic](https://github.com/indutny/elliptic) from 6.5.2 to 6.5.3. - [Release notes](https://github.com/indutny/elliptic/releases) - [Commits](indutny/elliptic@v6.5.2...v6.5.3) Signed-off-by: dependabot[bot] <[email protected]> * Initial commit. Mini kepler example but not connected to Redux * [BLOCKED] Can't connect to Kepler's Redux store * [BLOCKED] Can't connect to Redux * lint (#28) * v1.1.0-alpha.5 * Documentation fixes additions (#21) * [FIX/ADD] Fixed missing steps to instructions + added extra notation * [FIX] Forgot missing step in #8 * [FIX/ADD] Fix step 9 and added clarification * [DEL] Extraneous folders/files * [TEST] Is this how you link markdown images? * [ADD] Rendering tips/guide * [FIX] Separated GIF/MP4 so it can't be interpreted together * [FIX] Made steps more clear by bolding and fixed sequence conversion to gif not mp4 * [FIX?] Image not loading * [FIX] MP4 => GIF error * [FIX] Spacing between Step #s * [FIX] Step #4 spacing * [FIX/ADD] Removed MP4 from docs + added entry to table of contents * [MOVE] Images move to website static folder + location updated * [FIX] Image URLS * Bump http-proxy from 1.18.0 to 1.18.1 (#25) Bumps [http-proxy](https://github.com/http-party/node-http-proxy) from 1.18.0 to 1.18.1. - [Release notes](https://github.com/http-party/node-http-proxy/releases) - [Changelog](https://github.com/http-party/node-http-proxy/blob/master/CHANGELOG.md) - [Commits](http-party/node-http-proxy@1.18.0...1.18.1) Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * [BLOCKED] Issues in #12 Codelabs * [FIX] Modal now opens * Bump node-fetch from 2.6.0 to 2.6.1 (#26) Bumps [node-fetch](https://github.com/bitinn/node-fetch) from 2.6.0 to 2.6.1. - [Release notes](https://github.com/bitinn/node-fetch/releases) - [Changelog](https://github.com/node-fetch/node-fetch/blob/master/docs/CHANGELOG.md) - [Commits](node-fetch/node-fetch@v2.6.0...v2.6.1) Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * [BLOCKED] Can't find module ocular.config * [FIX] Webpack config now boots start-local * [FIX] Modal now opens with map but animations bugged * Documentation Grammer Edit (#29) Just a missing comma * [ADD] Incorporated initial view state + default/update keyframes * [FIX] Updated keyframes were wrong bug * [REFACTOR] Created new panel-preview + scene now consistent with hubble's scene * Mapbox And Deck.gl Canvas Merged When Exported With Hubble.gl In Example Trips (#31) * Mapbox and Deck.gl canvas merged when exported with Hubble.gl Co-authored-by: Chris Gervang <[email protected]> * [FIX] updateCamera temporary fix * [FIX/REFACTOR] updateCamera now updates keyframe, parseSetCameraType now a generic util * [FIX/CLEAN] Bug where keyframes weren't updating properly + cleaned dead code in preparation to merge to master * [CLEAN] Removed unused code, packages, + lint fixes Co-authored-by: Chris Gervang <[email protected]> Co-authored-by: Chris Gervang <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Chris Gervang <[email protected]> Co-authored-by: Vitor Dino <[email protected]> Co-authored-by: Elisa Martinez <[email protected]>
Issue referencing this pull request
Issue #28 (Still it's needed to integrate into kepler)
Changes [To add this functionality to any example]:
DeckGl
componentviewState
stateconst [viewState, setViewState] = useState(INITIAL_VIEW_STATE);
BasicControls
component (optional)updateCamera={updateCamera}
viewState
(optional)const currentCamera = animationLoop.timeline.attachAnimation(keyframes.camera);
DeckScene