Code Monkey home page Code Monkey logo

Comments (3)

cornhundred avatar cornhundred commented on September 25, 2024 1

Thanks, that is my understanding too that it is passed into Deck directly.

Here's how I'm setting the view on an ObservableHQ notebook

const view = new deck.OrthographicView({id: 'ortho'})

deck.DeckGL({
    container,
    views:[view],
    initialViewState:INITIAL_VIEW_STATE,
    controller: true,
  });

I can have a look at lonboard to see if I can figure out how to make a pull request.

from lonboard.

kylebarron avatar kylebarron commented on September 25, 2024 1

A PR would be great. In general, models are defined first in TS https://github.com/developmentseed/lonboard/blob/main/src/model/layer.ts (maybe create a new file for view.ts?), then create wrapper classes (subclassing from ipywidgets.Widget) that map to the deck.gl api:

lonboard/lonboard/_layer.py

Lines 288 to 357 in 4daca9b

class BitmapLayer(BaseLayer):
"""
The `BitmapLayer` renders a bitmap (e.g. PNG, JPEG, or WebP) at specified
boundaries.
**Example:**
```py
from lonboard import Map, BitmapLayer
layer = BitmapLayer(
image='https://raw.githubusercontent.com/visgl/deck.gl-data/master/website/sf-districts.png',
bounds=[-122.5190, 37.7045, -122.355, 37.829]
)
m = Map(layer)
m
```
"""
_layer_type = traitlets.Unicode("bitmap").tag(sync=True)
image = traitlets.Unicode().tag(sync=True)
"""The URL to an image to display.
- Type: `str`
"""
bounds = traitlets.Union(
[
traitlets.List(traitlets.Float(), minlen=4, maxlen=4),
traitlets.List(
traitlets.List(traitlets.Float(), minlen=2, maxlen=2),
minlen=4,
maxlen=4,
),
]
).tag(sync=True)
"""The bounds of the image.
Supported formats:
- Coordinates of the bounding box of the bitmap `[left, bottom, right, top]`
- Coordinates of four corners of the bitmap, should follow the sequence of
`[[left, bottom], [left, top], [right, top], [right, bottom]]`.
"""
desaturate = traitlets.Float(0, min=0, max=1).tag(sync=True)
"""The desaturation of the bitmap. Between `[0, 1]`.
- Type: `float`, optional
- Default: `0`
"""
transparent_color = traitlets.List(
traitlets.Float(), default_value=None, allow_none=True, minlen=3, maxlen=4
)
"""The color to use for transparent pixels, in `[r, g, b, a]`.
- Type: `List[float]`, optional
- Default: `[0, 0, 0, 0]`
"""
tint_color = traitlets.List(
traitlets.Float(), default_value=None, allow_none=True, minlen=3, maxlen=4
)
"""The color to tint the bitmap by, in `[r, g, b]`.
- Type: `List[float]`, optional
- Default: `[255, 255, 255]`
"""

from lonboard.

kylebarron avatar kylebarron commented on September 25, 2024

This is related to #322.

I think that View is always passed in to Deck directly, not the Layer class, right? In that case it should be relatively simple.

As a general statement, much of lonboard so far has geospatial assumptions baked in, but I think nothing should preclude using non-geospatial data

from lonboard.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.