Metadata-Version: 2.1
Name: andeplane_reveal_streamlit_component
Version: 0.0.2
Summary: Streamlit wrapper for Cognite Reveal to view 3D content from Cognite Data Fsion
Home-page: 
Author: John Smith
Author-email: john@example.com
Requires-Python: >=3.7
Description-Content-Type: text/markdown
Requires-Dist: streamlit>=0.63
Provides-Extra: devel
Requires-Dist: wheel; extra == "devel"
Requires-Dist: pytest==7.4.0; extra == "devel"
Requires-Dist: playwright==1.39.0; extra == "devel"
Requires-Dist: requests==2.31.0; extra == "devel"
Requires-Dist: pytest-playwright-snapshot==1.0; extra == "devel"
Requires-Dist: pytest-rerunfailures==12.0; extra == "devel"

# Cognite 3D Reveal Streamlit

This is a Streamlit library that can be used to show 3D models inside a Streamlit app. It works especially good when used inside Streamlit in Fusion, but can also be used in standalone Streamlit apps.

## How to install

You simply install it by running
`pip install cognite-streamlit-reveal`

## How to use

Here is an example app

```
import streamlit as st
import os
from cognite.streamlit import reveal
from cognite.client import CogniteClient

st.subheader("Cognite Reveal Streamlit example")
client = CogniteClient()
model_id = 123
revision_id = 234

selected_node_id = reveal(client, model_id, revision_id)
st.markdown("Selected node id: %d!" % int(selected_node_id))

```

## Local development

It's recommended to add a clean environment. You need `pip` and `node`.

Clone repo
`git clone https://github.com/cognitedata/hackathon-reveal-streamlit.git`

Install Python packages
`pip install streamlit`

Install NPM packages and start server

```
cd cognite/streamlit/reveal/frontend
yarn
yarn start
```

Open repo folder in another terminal. Install this package as development package
`pip install -e .`

Extract a token from Fusion, and start with

`COGNITE_TOKEN="TOKEN" streamlit run examples/example.py`
