Skip to content
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

Select by bounding box #417

Merged
merged 38 commits into from
Jul 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
e8e4da4
prototype showing selection drawing on top of the map
isaacbrodsky Mar 8, 2024
7db62b2
cleanup
isaacbrodsky Mar 8, 2024
48d4d33
restyle
isaacbrodsky Mar 8, 2024
22f79f7
[wip] select bbox on map
batpad Mar 13, 2024
add1a76
add pickobjects to pick selected objects
batpad Mar 13, 2024
3244bcd
fix width calculation bug so that it picks objects correctly
batpad Mar 13, 2024
d726e75
add some (ugly) UI for user to trigger starting a selection and clear…
batpad Mar 14, 2024
745e989
merge commit + slightly ugly code to get hover interaction working fo…
batpad Mar 23, 2024
82ce22b
lint
batpad Mar 23, 2024
0515769
send selected_bounds back to python after selection
batpad Mar 25, 2024
813abc5
lintfix
batpad Mar 26, 2024
0459aaa
convert lets that should be consts to consts
batpad Mar 26, 2024
5310e8e
remove point layer when initially clicking since we now show box on h…
batpad Mar 26, 2024
1ab3413
cleanups: remove unneeded point layer, move getPolygon to util, remov…
batpad Mar 26, 2024
39dda64
minor, remove unused var
batpad Mar 26, 2024
2245241
add selected bbox to each layer as well as the map
batpad Mar 30, 2024
5b3c8b6
Merge branch 'main' into bbox-map-select
kylebarron Apr 2, 2024
b13c8d1
Use tuple on Python side
kylebarron Apr 2, 2024
aa0b556
Rename getPolygon to makePolygon
kylebarron Apr 2, 2024
c4080fa
Fix bbox map select feature (#567)
vgeorge Jul 11, 2024
f6ba0fc
Merge branch 'main' into bbox-map-select
vgeorge Jul 16, 2024
011fd34
Replace reducer with XState
vgeorge Jul 22, 2024
17ea88f
Fix type definitions for mouse events
vgeorge Jul 22, 2024
1a22f5a
Apply selected_bounds to layers
vgeorge Jul 22, 2024
0139e83
Replace rate limit with throttle
vgeorge Jul 22, 2024
560868b
Define default value for environment variable
vgeorge Jul 22, 2024
0ea37d8
Clear unused elements
vgeorge Jul 22, 2024
91ed1ba
Add property selected_bounds to BaseArrowLayer
vgeorge Jul 24, 2024
b709c99
Setup NextUI component library and use icon on toolbar
vgeorge Jul 24, 2024
f17c416
Rename files to avoid naming conflict with existing state.ts file
vgeorge Jul 24, 2024
b83a91d
Allow cancel/clear bbox
vgeorge Jul 24, 2024
a24be14
Allow cancelling after first point was selected
vgeorge Jul 24, 2024
90e4cfa
Merge branch 'main' into bbox-map-select
vgeorge Jul 24, 2024
cc67f65
lint fixes
vgeorge Jul 24, 2024
0a4306a
Remove selected_bounds from BaseArrowLayer as it is already available…
vgeorge Jul 26, 2024
127ac5e
Remove unnecessary state
vgeorge Jul 26, 2024
fd7dbc3
Update bbox bounds also when it is null
vgeorge Jul 26, 2024
9724d6a
Clean up unused action
vgeorge Jul 29, 2024
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
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,8 @@ static
.pnp.loader.mjs
node_modules
*.h5

# Ignore environment variable files
.env
.env.local
.env.*.local
30 changes: 29 additions & 1 deletion build.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
// build.js
import esbuild from "esbuild";
import dotenv from "dotenv";
import { sassPlugin } from "esbuild-sass-plugin";
import tailwindcss from "tailwindcss";
import autoprefixer from "autoprefixer";
import postcss from "postcss";
import postcssPresetEnv from "postcss-preset-env";

// Load environment variables from .env file
dotenv.config();

// List of environment variables to expose to the build
const env = {
"process.env.XSTATE_INSPECT": JSON.stringify(
process.env.XSTATE_INSPECT || "false",
),
};

esbuild.build({
entryPoints: ["./src/index.tsx"],
Expand All @@ -11,7 +26,20 @@ esbuild.build({
// Ref https://github.com/manzt/anywidget/issues/369#issuecomment-1792376003
define: {
"define.amd": "false",
...env,
},
plugins: [
sassPlugin({
async transform(source) {
const { css } = await postcss([
tailwindcss,
autoprefixer,
postcssPresetEnv({ stage: 0 }),
]).process(source, { from: undefined });
return css;
},
}),
],
// Code splitting didn't work initially because it tried to load from a local
// relative path ./chunk.js
// splitting: true,
Expand Down
16 changes: 16 additions & 0 deletions lonboard/_layer.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,22 @@ def _add_extension_traits(self, extensions: Sequence[BaseExtension]):
- Default: `False`
"""

selected_bounds = traitlets.Tuple(
traitlets.Float(),
traitlets.Float(),
traitlets.Float(),
traitlets.Float(),
allow_none=True,
default_value=None,
).tag(sync=True)
"""
Bounds selected by the user, represented as a tuple of floats ordered as

```
(minx, miny, maxx, maxy)
```
"""

selected_index = traitlets.Int(None, allow_none=True).tag(sync=True)
"""
The positional index of the most-recently clicked on row of data.
Expand Down
Loading