Skip to content

Commit 1474a9d

Browse files
kylebarronisaacbrodskybatpadvgeorge
authored
Select by bounding box (#417)
Building on top of #412 with help from @batpad ### Change list - Draw bbox in deck instead of separate layer ### Notes - Create mode for when picking bbox should be active - Send data back to Python - Make multiple draw calls, one per set of layer ids, then set on layer state - Maybe delegate to sub models directly. Add a `pick` callback directly onto the models, and then iterate over each model, calling `pick` which picks and then assigns directly onto that model's state? - Note about crossing international dateline - Ensure we're not creating more than 256 layers. --------- Co-authored-by: Isaac Brodsky <[email protected]> Co-authored-by: Sanjay Bhangar <[email protected]> Co-authored-by: Vitor George <[email protected]>
1 parent 95dbd52 commit 1474a9d

15 files changed

+10164
-2668
lines changed

.gitignore

+5
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,8 @@ static
2424
.pnp.loader.mjs
2525
node_modules
2626
*.h5
27+
28+
# Ignore environment variable files
29+
.env
30+
.env.local
31+
.env.*.local

build.mjs

+29-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,20 @@
1-
// build.js
21
import esbuild from "esbuild";
2+
import dotenv from "dotenv";
3+
import { sassPlugin } from "esbuild-sass-plugin";
4+
import tailwindcss from "tailwindcss";
5+
import autoprefixer from "autoprefixer";
6+
import postcss from "postcss";
7+
import postcssPresetEnv from "postcss-preset-env";
8+
9+
// Load environment variables from .env file
10+
dotenv.config();
11+
12+
// List of environment variables to expose to the build
13+
const env = {
14+
"process.env.XSTATE_INSPECT": JSON.stringify(
15+
process.env.XSTATE_INSPECT || "false",
16+
),
17+
};
318

419
esbuild.build({
520
entryPoints: ["./src/index.tsx"],
@@ -11,7 +26,20 @@ esbuild.build({
1126
// Ref https://github.com/manzt/anywidget/issues/369#issuecomment-1792376003
1227
define: {
1328
"define.amd": "false",
29+
...env,
1430
},
31+
plugins: [
32+
sassPlugin({
33+
async transform(source) {
34+
const { css } = await postcss([
35+
tailwindcss,
36+
autoprefixer,
37+
postcssPresetEnv({ stage: 0 }),
38+
]).process(source, { from: undefined });
39+
return css;
40+
},
41+
}),
42+
],
1543
// Code splitting didn't work initially because it tried to load from a local
1644
// relative path ./chunk.js
1745
// splitting: true,

lonboard/_layer.py

+16
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,22 @@ def _add_extension_traits(self, extensions: Sequence[BaseExtension]):
194194
- Default: `False`
195195
"""
196196

197+
selected_bounds = traitlets.Tuple(
198+
traitlets.Float(),
199+
traitlets.Float(),
200+
traitlets.Float(),
201+
traitlets.Float(),
202+
allow_none=True,
203+
default_value=None,
204+
).tag(sync=True)
205+
"""
206+
Bounds selected by the user, represented as a tuple of floats ordered as
207+
208+
```
209+
(minx, miny, maxx, maxy)
210+
```
211+
"""
212+
197213
selected_index = traitlets.Int(None, allow_none=True).tag(sync=True)
198214
"""
199215
The positional index of the most-recently clicked on row of data.

0 commit comments

Comments
 (0)