{"id":18411209,"url":"https://github.com/ysenarath/dash-annotate","last_synced_at":"2026-06-23T12:32:17.701Z","repository":{"id":260341751,"uuid":"880578115","full_name":"ysenarath/dash-annotate","owner":"ysenarath","description":"dash-annotate","archived":false,"fork":false,"pushed_at":"2024-11-14T16:58:56.000Z","size":358,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-03T15:47:04.994Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ysenarath.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-10-30T01:04:46.000Z","updated_at":"2024-11-14T16:59:00.000Z","dependencies_parsed_at":"2024-12-24T15:22:47.091Z","dependency_job_id":"dd9dd888-7b64-46b4-a42a-2e66ef28196f","html_url":"https://github.com/ysenarath/dash-annotate","commit_stats":null,"previous_names":["ysenarath/dash-annotate"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ysenarath/dash-annotate","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ysenarath%2Fdash-annotate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ysenarath%2Fdash-annotate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ysenarath%2Fdash-annotate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ysenarath%2Fdash-annotate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ysenarath","download_url":"https://codeload.github.com/ysenarath/dash-annotate/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ysenarath%2Fdash-annotate/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34688074,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-23T02:00:07.161Z","response_time":65,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-06T03:35:38.746Z","updated_at":"2026-06-23T12:32:17.681Z","avatar_url":"https://github.com/ysenarath.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# DashAnnotator\n\nA Dash component for interactive text annotation. This component allows users to select text and create, manage, and visualize annotations with notes.\n\n## Features\n\n- Interactive text selection and annotation\n- Visual highlighting of annotated text\n- Support for overlapping annotations\n- Add and remove annotations with notes\n- Fully integrated with Dash callbacks\n- Responsive and customizable design\n\n## Installation\n\n```bash\npip install dash-annotator\n```\n\n## Quick Start\n\n```python\nimport dash\nfrom dash import html\nfrom dash_annotator import DashAnnotator, register_callbacks\n\n# Initialize the Dash app\napp = dash.Dash(__name__)\n\n# Create the layout with DashAnnotator\napp.layout = html.Div([\n    DashAnnotator(\n        id=\"my-annotator\",\n        value=\"Try selecting some text here to create annotations.\",\n        className=\"max-w-2xl mx-auto\",\n    )\n])\n\n# Register the callbacks\nregister_callbacks(app)\n\nif __name__ == \"__main__\":\n    app.run_server(debug=True)\n```\n\n## Usage\n\n### Basic Component\n\nThe `DashAnnotator` component can be initialized with the following properties:\n\n- `id` (str, required): Unique identifier for the component\n- `value` (str, optional): Initial text content\n- `annotations` (List[Annotation], optional): List of initial annotations\n- `className` (str, optional): Additional CSS classes for styling\n\n### Annotation Format\n\nAnnotations are represented using the `Annotation` dataclass with the following fields:\n\n```python\n@dataclass\nclass Annotation:\n    id: str        # Unique identifier\n    start: int     # Start position in text\n    end: int       # End position in text\n    text: str      # Annotated text content\n    note: str      # Additional note/comment\n```\n\n### Example with Pre-existing Annotations\n\n```python\nfrom dash_annotator import DashAnnotator, Annotation\n\n# Create initial annotations\nannotations = [\n    Annotation(\n        id=\"1\",\n        start=0,\n        end=5,\n        text=\"Hello\",\n        note=\"Greeting annotation\"\n    )\n]\n\n# Use in layout\napp.layout = html.Div([\n    DashAnnotator(\n        id=\"annotator-with-data\",\n        value=\"Hello World! This is an example.\",\n        annotations=annotations,\n        className=\"max-w-2xl mx-auto\",\n    )\n])\n```\n\n## Styling\n\nThe component uses Tailwind CSS classes by default but can be customized using the `className` prop. Make sure to include Tailwind CSS in your project for the default styling to work.\n\n## Development\n\nTo run the example:\n\n1. Clone the repository\n2. Install dependencies: `pip install -e .`\n3. Run the example: `python examples/basic_usage.py`\n4. Open http://localhost:8050 in your browser\n\n## License\n\nMIT License\n\n## Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fysenarath%2Fdash-annotate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fysenarath%2Fdash-annotate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fysenarath%2Fdash-annotate/lists"}