Skip to main content

streamlit-sanddance

Streamlit component that allows you to view a SandDance visualization of a dataframe.

Installation instructions

pip install streamlit-sanddance

Usage instructions

import streamlit as st

from streamlit_sanddance import sanddance

#sample random DataFrame
df = pd.DataFrame(
     np.random.randn(20, 3),
     columns=['a', 'b', 'c'])

#make sure to use a key to prevent refreshing after an event
sdEvent = sanddance(df, key='sd1')

#if sdEvent is not None and contains a cubeClick >= 0, display the data row
if sdEvent is not None and 'cubeClick' in sdEvent and sdEvent['cubeClick'] is not None and sdEvent['cubeClick'] >= 0:
        st.write(df.iloc[sdEvent['cubeClick']])
else:
        st.write("No cubeClick event")

The return value is a dictionary of visual interaction events such as selections.

Dev Setup

  • Ensure you have Python 3.6+.
  • Create a new Python virtual environment for the Streamlit component:
$ cd streamlit
$ python3 -m venv venv  # create venv
$ . venv/bin/activate   # activate venv
$ pip install streamlit # install streamlit
  • Initialize and run the component frontend:
$ cd streamlit/sanddance/frontend
$ npm install    # Install npm dependencies
$ npm run start  # Start the Webpack dev server
  • From a separate terminal, run the Streamlit app:
$ cd streamlit
$ . venv/bin/activate  # activate the venv you created earlier
$ pip install -e . # install streamlit-sanddance as editable package
$ streamlit run sanddance/example.py  # run the example

Release files for streamlit-sanddance 0.0.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for streamlit-sanddance 0.0.7
File Size Uploaded
streamlit-sanddance-0.0.7.tar.gz 2.6 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for streamlit-sanddance 0.0.7
File Interpreter ABI Platform
streamlit_sanddance-0.0.7-py3-none-any.whl Python 3 none any Details

Total release size: 13.2 MB

Release files / streamlit-sanddance-0.0.7.tar.gz

Download URL streamlit-sanddance-0.0.7.tar.gz
Size 2.6 MB
Tags Source
SHA-256 checksum
How to use checksums
e59ab2ada90700ca53b5cbefce3cb0f58a92f17f65a4fcb32366325a9483f83d
BLAKE2b-256 checksum
How to use checksums
5393ba62e67f37b05ccaedca53fe531f501d7e808d77f477c5a9a1ce951212d3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.11

Release files / streamlit_sanddance-0.0.7-py3-none-any.whl

Download URL streamlit_sanddance-0.0.7-py3-none-any.whl
Size 10.6 MB
Tags Python 3
SHA-256 checksum
How to use checksums
f008c2b17468e68fecdd042488c44cd9902c7e2934cce804379e5df3bfcc978a
BLAKE2b-256 checksum
How to use checksums
2bd58376fa72d70450bc4f26652af7fec1207f8af96a43e660a9eb6e35661bba
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.11

Release history Release notifications | RSS feed

This release

0.0.7 This release

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page