streamlit-eidos


Namestreamlit-eidos JSON
Version 0.2.0 PyPI version JSON
download
home_pageNone
SummaryStreamlit component for EIDOS framework
upload_time2024-05-18 05:19:41
maintainerNone
docs_urlNone
authorOceanum
requires_python>=3.10
licenseNone
keywords streamlit oceanum eidos visualisation
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # streamlit-eidos

Streamlit component for EIDOS visualisation with bi-directional transport for events.

## Installation instructions

```sh
pip install streamlit-eidos
```

## Usage

There is one component function `st_eidos` with function signature:

```
component_value=st_eidos(eidos, height=500)
```

### Parameters

    eidos : pydeck.Deck instance
        The pydeck map to render.
    key : str, default "deck_gl"
        The key for the component. This must be unique for each map in the app.
    height : int, default 500
        The height of the map in pixels.
    events : list, default None
        A dict of events to listen for. Can be one or more of:
        - 'click'
        - 'hover'
        - 'drag'
    description : dict, default None
        A dictionary with additional description components to overlay on the map
        The keys are the position which can be one of 'top-right','top-left','bottom-right','bottom-left'
        The values are the html elements to place in each position
        Example {'top-right':<div>This is a nice map</div>}
    configuration : dict, default None
        A dictionary of configuration options for the map.

### Returns

    component_value : dict
        A dictionary containing the info dictionary of the event.

## Example

```python
import streamlit as st
import pydeck as pdk
import pandas as pd

from streamlit_eidos import st_eidos


st.write("## Example")

chart_data = pd.DataFrame(
    np.random.randn(1000, 2) / [50, 50] + [37.76, -122.4], columns=["lat", "lon"]
)

r = pdk.Deck(
    initial_view_state=pdk.ViewState(
        latitude=37.76, longitude=-122.4, zoom=11, pitch=50, height=600
    ),
    layers=[
        pdk.Layer(
            "HexagonLayer",
            data=chart_data,
            get_position="[lon, lat]",
            radius=200,
            elevation_scale=4,
            elevation_range=[0, 1000],
            pickable=True,
            extruded=True,
        ),
        pdk.Layer(
            "ScatterplotLayer",
            data=chart_data,
            get_position="[lon, lat]",
            get_color="[200, 30, 0, 160]",
            get_radius=200,
        ),
    ],
    tooltip={
        "html": "<b>Temperature:</b> {value} °C",
        "style": {"backgroundColor": "steelblue", "color": "white"},
    },
)

value = st_eidos(r,)

st.write(value)
```

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "streamlit-eidos",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.10",
    "maintainer_email": null,
    "keywords": "streamlit, oceanum, eidos, visualisation",
    "author": "Oceanum",
    "author_email": "developers@oceanum.science",
    "download_url": "https://files.pythonhosted.org/packages/88/00/db5dad1656cace34251e2684d693b58724a5fc8bce7021f4e0a0e1f3d6c8/streamlit-eidos-0.2.0.tar.gz",
    "platform": null,
    "description": "# streamlit-eidos\n\nStreamlit component for EIDOS visualisation with bi-directional transport for events.\n\n## Installation instructions\n\n```sh\npip install streamlit-eidos\n```\n\n## Usage\n\nThere is one component function `st_eidos` with function signature:\n\n```\ncomponent_value=st_eidos(eidos, height=500)\n```\n\n### Parameters\n\n    eidos : pydeck.Deck instance\n        The pydeck map to render.\n    key : str, default \"deck_gl\"\n        The key for the component. This must be unique for each map in the app.\n    height : int, default 500\n        The height of the map in pixels.\n    events : list, default None\n        A dict of events to listen for. Can be one or more of:\n        - 'click'\n        - 'hover'\n        - 'drag'\n    description : dict, default None\n        A dictionary with additional description components to overlay on the map\n        The keys are the position which can be one of 'top-right','top-left','bottom-right','bottom-left'\n        The values are the html elements to place in each position\n        Example {'top-right':<div>This is a nice map</div>}\n    configuration : dict, default None\n        A dictionary of configuration options for the map.\n\n### Returns\n\n    component_value : dict\n        A dictionary containing the info dictionary of the event.\n\n## Example\n\n```python\nimport streamlit as st\nimport pydeck as pdk\nimport pandas as pd\n\nfrom streamlit_eidos import st_eidos\n\n\nst.write(\"## Example\")\n\nchart_data = pd.DataFrame(\n    np.random.randn(1000, 2) / [50, 50] + [37.76, -122.4], columns=[\"lat\", \"lon\"]\n)\n\nr = pdk.Deck(\n    initial_view_state=pdk.ViewState(\n        latitude=37.76, longitude=-122.4, zoom=11, pitch=50, height=600\n    ),\n    layers=[\n        pdk.Layer(\n            \"HexagonLayer\",\n            data=chart_data,\n            get_position=\"[lon, lat]\",\n            radius=200,\n            elevation_scale=4,\n            elevation_range=[0, 1000],\n            pickable=True,\n            extruded=True,\n        ),\n        pdk.Layer(\n            \"ScatterplotLayer\",\n            data=chart_data,\n            get_position=\"[lon, lat]\",\n            get_color=\"[200, 30, 0, 160]\",\n            get_radius=200,\n        ),\n    ],\n    tooltip={\n        \"html\": \"<b>Temperature:</b> {value} \u00b0C\",\n        \"style\": {\"backgroundColor\": \"steelblue\", \"color\": \"white\"},\n    },\n)\n\nvalue = st_eidos(r,)\n\nst.write(value)\n```\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "Streamlit component for EIDOS framework",
    "version": "0.2.0",
    "project_urls": null,
    "split_keywords": [
        "streamlit",
        " oceanum",
        " eidos",
        " visualisation"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "8ab26a8582c699ba5a13df6d4ed695d94a253b2b51f5fa12e6f599ba1937c673",
                "md5": "53095b6cee5d50d4527b371bb76107f6",
                "sha256": "3035eefafc81b551a1b42b08a4eeb83a394e9973394e75e224065b4a3ad6a248"
            },
            "downloads": -1,
            "filename": "streamlit_eidos-0.2.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "53095b6cee5d50d4527b371bb76107f6",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10",
            "size": 136431,
            "upload_time": "2024-05-18T05:19:38",
            "upload_time_iso_8601": "2024-05-18T05:19:38.451383Z",
            "url": "https://files.pythonhosted.org/packages/8a/b2/6a8582c699ba5a13df6d4ed695d94a253b2b51f5fa12e6f599ba1937c673/streamlit_eidos-0.2.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "8800db5dad1656cace34251e2684d693b58724a5fc8bce7021f4e0a0e1f3d6c8",
                "md5": "718cbffaecd54e52aaa92b5c6f1af84b",
                "sha256": "b967c57ee7978d1c201ea074f13d67ae9ef9886af1516a2479306d263bbeaf7a"
            },
            "downloads": -1,
            "filename": "streamlit-eidos-0.2.0.tar.gz",
            "has_sig": false,
            "md5_digest": "718cbffaecd54e52aaa92b5c6f1af84b",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10",
            "size": 137683,
            "upload_time": "2024-05-18T05:19:41",
            "upload_time_iso_8601": "2024-05-18T05:19:41.019140Z",
            "url": "https://files.pythonhosted.org/packages/88/00/db5dad1656cace34251e2684d693b58724a5fc8bce7021f4e0a0e1f3d6c8/streamlit-eidos-0.2.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-05-18 05:19:41",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "streamlit-eidos"
}
        
Elapsed time: 0.24290s