Skip to content

Commit d55b207

Browse files
chore(dev/timeline-layers): wire example into workspace + local dev setup
- Add dev/timeline-layers/examples/* to root workspace glob so yarn resolves the package correctly - Add vite.config.local.mjs (aliases @deck.gl-community/timeline-layers to src/ so dist/ is never stale during dev) - Fix tsconfig.json extends depth (examples/ moved one level deeper vs original PR path) - Update example README with prototype video + end-goal screenshot from PR #379, start-local instructions, and context links to #379/#517/#38 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 26967c4 commit d55b207

File tree

5 files changed

+237
-87
lines changed

5 files changed

+237
-87
lines changed
Lines changed: 26 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
# Timeline Layer Example
22

3-
An interactive timeline visualization built with `@deck.gl-community/timeline-layers`.
3+
An interactive GPU-accelerated timeline built with `@deck.gl-community/timeline-layers` — a deck.gl `CompositeLayer` that replaces DOM-driven timelines and handles hundreds of thousands of datapoints without lag.
4+
5+
### Prototype
6+
7+
https://github.com/user-attachments/assets/95006924-913f-4025-a0ef-6d74b336ca67
8+
9+
### End Goal
10+
11+
<img width="2560" height="1531" alt="Timeline end goal" src="https://github.com/user-attachments/assets/d6b52261-4d03-487d-8bba-e01b9035be7a" />
412

513
## Features
614

@@ -14,25 +22,31 @@ An interactive timeline visualization built with `@deck.gl-community/timeline-la
1422
## Usage
1523

1624
```bash
25+
# Against installed packages
1726
yarn start
18-
```
1927

20-
Open [http://localhost:5173](http://localhost:5173)
28+
# Against local source (dev)
29+
yarn start-local
30+
```
2131

2232
## API
2333

24-
Import `TimelineLayer` from `@deck.gl-community/timeline-layers`:
25-
2634
```ts
2735
import {TimelineLayer} from '@deck.gl-community/timeline-layers';
2836

29-
const layer = new TimelineLayer({
30-
data: tracks, // TimelineTrack[]
31-
timelineStart: 0, // start of full range (ms)
32-
timelineEnd: 60000, // end of full range (ms)
33-
currentTimeMs: 5000, // current playhead position
34-
onClipClick: ({clip, track}) => console.log('clicked', clip.label)
37+
new TimelineLayer({
38+
data: tracks, // TimelineTrack[]
39+
timelineStart: 0, // start of full range (ms)
40+
timelineEnd: 60_000, // end of full range (ms)
41+
currentTimeMs: 5_000, // current playhead position
42+
onClipClick: ({clip, track}) => console.log('clicked', clip.label),
43+
onViewportChange: (startMs, endMs) => setViewport({startMs, endMs}),
44+
onZoomChange: (zoom) => setZoom(zoom)
3545
});
3646
```
3747

38-
See `TimelineLayerProps` for the full API reference.
48+
See [`TimelineLayerProps`](../../src/layers/timeline-layer/timeline-types.ts) for the full API reference.
49+
50+
## Context
51+
52+
Originally prototyped in PR [#379](https://github.com/visgl/deck.gl-community/pull/379), refined in PR [#517](https://github.com/visgl/deck.gl-community/pull/517). Lives in `dev/timeline-layers` until promoted to `modules/` — tracked in [#38](https://github.com/visgl/deck.gl-community/issues/38).
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
2-
"extends": "../../../tsconfig.json",
2+
"extends": "../../../../tsconfig.json",
33
"include": ["./*.tsx", "./*.ts"]
44
}
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
// Allows examples in dev/timeline-layers/examples/ to be built against
2+
// the source code in this repo instead of installed node_modules.
3+
4+
import {defineConfig} from 'vite';
5+
import {getOcularConfig} from '@vis.gl/dev-tools';
6+
import {join} from 'path';
7+
8+
const rootDir = join(__dirname, '../..');
9+
10+
/** https://vitejs.dev/config/ */
11+
export default defineConfig(async () => {
12+
const {aliases} = await getOcularConfig({root: rootDir});
13+
14+
return {
15+
resolve: {
16+
alias: {
17+
...aliases,
18+
'@deck.gl-community/timeline-layers': join(rootDir, './dev/timeline-layers/src'),
19+
'@deck.gl': join(rootDir, './node_modules/@deck.gl'),
20+
'@luma.gl': join(rootDir, './node_modules/@luma.gl'),
21+
'@math.gl': join(rootDir, './node_modules/@math.gl'),
22+
'@loaders.gl': join(rootDir, './node_modules/@loaders.gl'),
23+
'react': join(rootDir, './node_modules/react'),
24+
'react-dom': join(rootDir, './node_modules/react-dom'),
25+
}
26+
},
27+
server: {
28+
open: true,
29+
port: 8080
30+
},
31+
optimizeDeps: {
32+
esbuildOptions: {target: 'es2020'}
33+
}
34+
};
35+
});

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
"workspaces": [
1515
"modules/*",
1616
"dev/*",
17+
"dev/timeline-layers/examples/*",
1718
"examples/**"
1819
],
1920
"scripts": {

0 commit comments

Comments
 (0)