Skip to main content

No project description provided

Project description

Dash ID Utils

Install

pip install dash-id-utils

Usage

from dash import html, ALL, callback


class AnnotatedImageListSidebar(html.Div):
    class slots:
        id = DashIDGenerator(page="session", type="view", name="image-list")
        image = DashIDGenerator(page="session", type="view", name="image")

    def __init__(self, items, **kwargs):
        self.items = items
        super().__init__(self.render(), id=self.slots.id.get_identifier(), **kwargs)        


    def render(self):
        return [
            html.Img(src=item.url, id=self.slots.image.get_identifier(item.id))
            for item in items
        ]

@callback(
    [...]
    AnnotatedImageListSidebar.slots.image.get_input("n_clicks", ALL),
)
def x(all_n_clicks):
    ...

@callback(
    [
        AnnotatedImageListSidebar.slots.id.get_output("children"),
    ]
    ...
)
def y(...):
    ...

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

dash-id-utils-0.0.1.tar.gz (2.1 kB view details)

Uploaded Source

File details

Details for the file dash-id-utils-0.0.1.tar.gz.

File metadata

  • Download URL: dash-id-utils-0.0.1.tar.gz
  • Upload date:
  • Size: 2.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.12

File hashes

Hashes for dash-id-utils-0.0.1.tar.gz
Algorithm Hash digest
SHA256 9bef15aad84c2a17a4ea094a3b6622497182d93d6ff6b9dd26cebb52c6410032
MD5 cca000e2a504cb319b217daa5f1cc00e
BLAKE2b-256 1d5edf59a47ba999942d1d34824356f69c3d66af92465b0d6a1520634588ce27

See more details on using hashes here.

Supported by

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