Skip to main content

A Shiny for Python extension providing a treeview component

Project description

Shiny TreeView

A TreeView UI component for Shiny for Python, backed by Material UI.

Installation

pip install shiny-treeview

To install the latest development version:

pip install git+https://github.com/davidchall/shiny-treeview.git#egg=shiny_treeview

Quick Start

Create hierarchical data with TreeItem, add the treeview to your Shiny app UI, and use the selected IDs as needed in the rest of the app.

from shiny import App, ui, render
from shiny_treeview import input_treeview, TreeItem

# Define your tree data using TreeItem objects
tree_data = [
    TreeItem(
        "docs",
        "📁 Documents",
        children=[
            TreeItem("report", "📄 Report.pdf"),
            TreeItem("slides", "📄 Slides.pptx"),
        ]
    ),
    TreeItem("readme", "ℹ️ README.md")
]

app_ui = ui.page_fluid(
    ui.h1("My Tree View App"),
    input_treeview("my_tree", tree_data),
    ui.output_text("selected_item")
)

def server(input, output, session):
    @render.text
    def selected_item():
        return f"Selected: {input.my_tree()}"

app = App(app_ui, server)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

shiny_treeview-0.1.0.tar.gz (551.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

shiny_treeview-0.1.0-py3-none-any.whl (316.6 kB view details)

Uploaded Python 3

File details

Details for the file shiny_treeview-0.1.0.tar.gz.

File metadata

  • Download URL: shiny_treeview-0.1.0.tar.gz
  • Upload date:
  • Size: 551.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for shiny_treeview-0.1.0.tar.gz
Algorithm Hash digest
SHA256 d959158f53a98ddd5b6fefdc435194d46794372400eb80f56502f4feb56add47
MD5 de169c1c7e3fd479832b2d47f7fe1bf9
BLAKE2b-256 36ba6a1a45bc8cec66bfadf92685fee10b1bdf57292d4ee87e3192fd02479133

See more details on using hashes here.

Provenance

The following attestation bundles were made for shiny_treeview-0.1.0.tar.gz:

Publisher: ci-cd.yml on davidchall/shiny-treeview

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file shiny_treeview-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: shiny_treeview-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 316.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for shiny_treeview-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 bef349178de28c10673e8b89592ec5a5adff1f3085388b70a864acc319c2b2c1
MD5 b8b4bc829434a1e71b18207dea15675e
BLAKE2b-256 2140ec16feb4c8faf60859214e4b837e511e346c8972be5c39ab116b016ddbb9

See more details on using hashes here.

Provenance

The following attestation bundles were made for shiny_treeview-0.1.0-py3-none-any.whl:

Publisher: ci-cd.yml on davidchall/shiny-treeview

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page