Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
02d6e13
View model definitions
kylebarron Oct 8, 2025
ab8c55d
Allow none
kylebarron Oct 8, 2025
71b0b4e
Pass in views to Map constructor
kylebarron Oct 8, 2025
4bfd2ba
move html export to separate file
kylebarron Oct 8, 2025
f14cdba
move view_state down after view
kylebarron Oct 8, 2025
c490176
Set up maplibre basemap widet
kylebarron Oct 8, 2025
aaf66a3
Define split renderers
kylebarron Oct 14, 2025
ca7bfd4
Implement split renderers
kylebarron Oct 14, 2025
a043703
alphabetize
kylebarron Oct 14, 2025
fa0940c
Merge branch 'main' into kyle/view-basemap-refactor
kylebarron Oct 14, 2025
879bff0
Merge branch 'main' into kyle/split-renderers2
kylebarron Oct 14, 2025
08ce7f8
Merge branch 'kyle/split-renderers2' into kyle/view-basemap-refactor
kylebarron Oct 14, 2025
18aacb4
Merge branch 'main' into kyle/view-basemap-refactor
kylebarron Oct 14, 2025
e185723
Merge branch 'main' into kyle/view-basemap-refactor
kylebarron Oct 15, 2025
05b1ec2
Merge branch 'main' into kyle/view-basemap-refactor
kylebarron Oct 16, 2025
3571acf
reduce diff
kylebarron Oct 16, 2025
2e59606
Support deck views
kylebarron Oct 16, 2025
6ff3540
Apply linear gradient background
kylebarron Oct 16, 2025
e846164
Add dark background when in globe view
kylebarron Oct 16, 2025
8c88487
pass undefined when no views passed
kylebarron Oct 16, 2025
188164c
Remove multi-view support for now
kylebarron Oct 16, 2025
89d70eb
fix basemap when constructing `Map` without any parameters
kylebarron Oct 16, 2025
582d606
Let `views` be None
kylebarron Oct 16, 2025
9b8ebcc
remove accidental render_mode
kylebarron Oct 16, 2025
d72e7b7
reduce diff
kylebarron Oct 16, 2025
5ff4d12
remove controller
kylebarron Oct 17, 2025
a273191
Merge branch 'main' into kyle/view-basemap-refactor
kylebarron Oct 22, 2025
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
Prev Previous commit
Next Next commit
Allow none
  • Loading branch information
kylebarron committed Oct 8, 2025
commit ab8c55d7514cab33eca117fab006742d367013ee
82 changes: 54 additions & 28 deletions lonboard/view.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,25 +10,33 @@ class BaseView(BaseWidget):

"""

x = t.Union([t.Int(), t.Unicode()], default_value=None).tag(sync=True)
x = t.Union([t.Int(), t.Unicode()], allow_none=True, default_value=None).tag(
sync=True,
)
"""The x position of the view.

A relative (e.g. `'50%'`) or absolute position. Default `0`.
"""

y = t.Union([t.Int(), t.Unicode()], default_value=None).tag(sync=True)
y = t.Union([t.Int(), t.Unicode()], allow_none=True, default_value=None).tag(
sync=True,
)
"""The y position of the view.

A relative (e.g. `'50%'`) or absolute position. Default `0`.
"""

width = t.Union([t.Int(), t.Unicode()], default_value=None).tag(sync=True)
width = t.Union([t.Int(), t.Unicode()], allow_none=True, default_value=None).tag(
sync=True,
)
"""The width of the view.

A relative (e.g. `'50%'`) or absolute extent. Default `'100%'`.
"""

height = t.Union([t.Int(), t.Unicode()], default_value=None).tag(sync=True)
height = t.Union([t.Int(), t.Unicode()], allow_none=True, default_value=None).tag(
sync=True,
)
"""The height of the view.

A relative (e.g. `'50%'`) or absolute extent. Default `'100%'`.
Expand All @@ -43,33 +51,39 @@ class FirstPersonView(BaseView):

_view_type = t.Unicode("first-person-view").tag(sync=True)

projection_matrix = t.List(t.Float(), default_value=None, minlen=16, maxlen=16).tag(
projection_matrix = t.List(
t.Float(),
allow_none=True,
default_value=None,
minlen=16,
maxlen=16,
).tag(
sync=True,
)
"""Projection matrix.

If `projectionMatrix` is not supplied, the `View` class will build a projection matrix from the following parameters:
"""

fovy = t.Float(default_value=None).tag(sync=True)
fovy = t.Float(allow_none=True, default_value=None).tag(sync=True)
"""Field of view covered by camera, in the perspective case. In degrees.

Default `50`.
"""

near = t.Float(default_value=None).tag(sync=True)
near = t.Float(allow_none=True, default_value=None).tag(sync=True)
"""Distance of near clipping plane.

Default `0.1`.
"""

far = t.Float(default_value=None).tag(sync=True)
far = t.Float(allow_none=True, default_value=None).tag(sync=True)
"""Distance of far clipping plane.

Default `1000`.
"""

focal_distance = t.Float(default_value=None).tag(sync=True)
focal_distance = t.Float(allow_none=True, default_value=None).tag(sync=True)
"""Modifier of viewport scale.

Corresponds to the number of pixels per meter. Default `1`.
Expand All @@ -84,19 +98,19 @@ class GlobeView(BaseView):

_view_type = t.Unicode("globe-view").tag(sync=True)

resolution = t.Float(default_value=None).tag(sync=True)
resolution = t.Float(allow_none=True, default_value=None).tag(sync=True)
"""The resolution at which to turn flat features into 3D meshes, in degrees.

Smaller numbers will generate more detailed mesh. Default `10`.
"""

near_z_multiplier = t.Float(default_value=None).tag(sync=True)
near_z_multiplier = t.Float(allow_none=True, default_value=None).tag(sync=True)
"""Scaler for the near plane, 1 unit equals to the height of the viewport.

Default to `0.1`. Overwrites the `near` parameter.
"""

far_z_multiplier = t.Float(default_value=None).tag(sync=True)
far_z_multiplier = t.Float(allow_none=True, default_value=None).tag(sync=True)
"""Scaler for the far plane, 1 unit equals to the distance from the camera to the top edge of the screen.

Default to `2`. Overwrites the `far` parameter.
Expand All @@ -111,44 +125,50 @@ class MapView(BaseView):

_view_type = t.Unicode("map-view").tag(sync=True)

repeat = t.Bool(default_value=None).tag(sync=True)
repeat = t.Bool(allow_none=True, default_value=None).tag(sync=True)
"""
Whether to render multiple copies of the map at low zoom levels. Default `false`.
"""

near_z_multiplier = t.Float(default_value=None).tag(sync=True)
near_z_multiplier = t.Float(allow_none=True, default_value=None).tag(sync=True)
"""Scaler for the near plane, 1 unit equals to the height of the viewport.

Default to `0.1`. Overwrites the `near` parameter.
"""

far_z_multiplier = t.Float(default_value=None).tag(sync=True)
far_z_multiplier = t.Float(allow_none=True, default_value=None).tag(sync=True)
"""Scaler for the far plane, 1 unit equals to the distance from the camera to the top edge of the screen.

Default to `1.01`. Overwrites the `far` parameter.
"""

projection_matrix = t.List(t.Float(), default_value=None, minlen=16, maxlen=16).tag(
projection_matrix = t.List(
t.Float(),
allow_none=True,
default_value=None,
minlen=16,
maxlen=16,
).tag(
sync=True,
)
"""Projection matrix.

If `projectionMatrix` is not supplied, the `View` class will build a projection matrix from the following parameters:
"""

fovy = t.Float(default_value=None).tag(sync=True)
fovy = t.Float(allow_none=True, default_value=None).tag(sync=True)
"""Field of view covered by camera, in the perspective case. In degrees.

If not supplied, will be calculated from `altitude`.
"""

altitude = t.Float(default_value=None).tag(sync=True)
altitude = t.Float(allow_none=True, default_value=None).tag(sync=True)
"""Distance of the camera relative to viewport height.

Default `1.5`.
"""

orthographic = t.Bool(default_value=None).tag(sync=True)
orthographic = t.Bool(allow_none=True, default_value=None).tag(sync=True)
"""Whether to create an orthographic or perspective projection matrix.

Default is `false` (perspective projection).
Expand All @@ -163,36 +183,42 @@ class OrbitView(BaseView):

_view_type = t.Unicode("orbit-view").tag(sync=True)

orbit_axis = t.Unicode(default_value=None).tag(sync=True)
orbit_axis = t.Unicode(allow_none=True, default_value=None).tag(sync=True)
"""Axis with 360 degrees rotating freedom, either `'Y'` or `'Z'`, default to `'Z'`."""

projection_matrix = t.List(t.Float(), default_value=None, minlen=16, maxlen=16).tag(
projection_matrix = t.List(
t.Float(),
allow_none=True,
default_value=None,
minlen=16,
maxlen=16,
).tag(
sync=True,
)
"""Projection matrix.

If `projectionMatrix` is not supplied, the `View` class will build a projection matrix from the following parameters:
"""

fovy = t.Float(default_value=None).tag(sync=True)
fovy = t.Float(allow_none=True, default_value=None).tag(sync=True)
"""Field of view covered by camera, in the perspective case. In degrees.

Default `50`.
"""

near = t.Float(default_value=None).tag(sync=True)
near = t.Float(allow_none=True, default_value=None).tag(sync=True)
"""Distance of near clipping plane.

Default `0.1`.
"""

far = t.Float(default_value=None).tag(sync=True)
far = t.Float(allow_none=True, default_value=None).tag(sync=True)
"""Distance of far clipping plane.

Default `1000`.
"""

orthographic = t.Bool(default_value=None).tag(sync=True)
orthographic = t.Bool(allow_none=True, default_value=None).tag(sync=True)
"""Whether to create an orthographic or perspective projection matrix.

Default is `false` (perspective projection).
Expand All @@ -207,20 +233,20 @@ class OrthographicView(BaseView):

_view_type = t.Unicode("orthographic-view").tag(sync=True)

flip_y = t.Bool(default_value=None).tag(sync=True)
flip_y = t.Bool(allow_none=True, default_value=None).tag(sync=True)
"""
Whether to use top-left coordinates (`true`) or bottom-left coordinates (`false`).

Default `true`.
"""

near = t.Float(default_value=None).tag(sync=True)
near = t.Float(allow_none=True, default_value=None).tag(sync=True)
"""Distance of near clipping plane.

Default `0.1`.
"""

far = t.Float(default_value=None).tag(sync=True)
far = t.Float(allow_none=True, default_value=None).tag(sync=True)
"""Distance of far clipping plane.

Default `1000`.
Expand Down