Skip to content

Commit 0a27393

Browse files
website: WebGPU scatterplot example (#9715)
1 parent a3224c9 commit 0a27393

File tree

3 files changed

+14
-11
lines changed

3 files changed

+14
-11
lines changed

examples/website/point-cloud/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"@loaders.gl/las": "^4.2.0",
1313
"@types/react": "^18.0.0",
1414
"@types/react-dom": "^18.0.0",
15-
"deck.gl": "^9.0.0",
15+
"deck.gl": "^9.2.0-alpha.2",
1616
"react": "^18.0.0",
1717
"react-dom": "^18.0.0"
1818
},

website/src/examples/point-cloud-layer.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class PointCloudDemo extends Component {
3737

3838
render() {
3939
return <div style={{width: '100%', height: '100%', background: '#ecdbce'}}>
40-
<App key={this.props.device?.type} onLoad={this._onLoad} device={this.props.device} />
40+
<App key={this.props.device?.type} device={this.props.device} onLoad={this._onLoad} />
4141
</div>;
4242
}
4343
}

website/src/examples/scatterplot-layer.js

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,27 +2,29 @@
22
// SPDX-License-Identifier: MIT
33
// Copyright (c) vis.gl contributors
44

5-
import React, {Component} from 'react';
6-
import {MAPBOX_STYLES, DATA_URI, GITHUB_TREE} from '../constants/defaults';
7-
import {readableInteger} from '../utils/format-utils';
5+
import React, { Component } from 'react';
6+
import { MAPBOX_STYLES, DATA_URI, GITHUB_TREE } from '../constants/defaults';
7+
import { readableInteger } from '../utils/format-utils';
88
import App from 'website-examples/scatterplot/app';
99

10-
import {makeExample} from '../components';
10+
import { makeExample } from '../components';
1111

1212
class ScatterPlotDemo extends Component {
1313
static title = 'Every Person in New York City';
1414

1515
static code = `${GITHUB_TREE}/examples/website/scatterplot`;
1616

17+
static hasDeviceTabs = true;
18+
1719
static data = {
1820
url: `${DATA_URI}/scatterplot-data.txt`,
1921
worker: '/workers/scatterplot-data-decoder.js'
2022
};
2123

2224
static parameters = {
23-
colorM: {displayName: 'Male', type: 'color', value: [0, 128, 255]},
24-
colorF: {displayName: 'Female', type: 'color', value: [255, 0, 128]},
25-
radius: {displayName: 'Radius', type: 'range', value: 10, step: 0.1, min: 1, max: 20}
25+
colorM: { displayName: 'Male', type: 'color', value: [0, 128, 255] },
26+
colorF: { displayName: 'Female', type: 'color', value: [255, 0, 128] },
27+
radius: { displayName: 'Radius', type: 'range', value: 10, step: 0.1, min: 1, max: 20 }
2628
};
2729

2830
static mapStyle = MAPBOX_STYLES.LIGHT;
@@ -43,11 +45,12 @@ class ScatterPlotDemo extends Component {
4345
}
4446

4547
render() {
46-
const {params, data} = this.props;
48+
const { params, data } = this.props;
4749

4850
return (
4951
<App
50-
{...this.props}
52+
key={this.props.device?.type}
53+
device={this.props.device}
5154
data={data}
5255
maleColor={params.colorM.value}
5356
femaleColor={params.colorF.value}

0 commit comments

Comments
 (0)