Dash porting version of the React project React Picture Annotation. Provide a simple annotation window for a single picture.
Project description
Dash Picture Annotation
Dash Picture Annotation is a Dash component library.
Dash porting version of the React project React Picture Annotation :link:. Provide a simple annotation window for a single picture.
The following two figures compare the demos of the original React version and the ported Dash version. Since this project is just a dash component wrapper on the original React component, the performance is the same.
| React Picture Annotation | Dash Picture Annotation |
|---|---|
Compared to the original project, this project has the following special features that the original React project does not support:
- Responsive sizing: The width of the annotator can be automatically adjusted according to the parent web element.
- Different modes: When selecting an annotation, the modifier can be configured as an input box or a dropdown menu box.
- Data sanitized: The data is simply sanitized. Even if a not standardized data is passed to the annotator, it still works.
- Anti-mistakes: A threshold of the annotation size can be configured to prevent users create a tiny annotation item by mistake.
- Disabled: A flag can be configured to make the annotator disabled.
- Specified colors: A special color can be configured for an annotator with a specific comment. Different comments can have different colors.
- Dynamic colors: Without specifying colors manually, a flag can enable the colors to be automatically calculated based on the hash code of the annotation comments.
Preview a quick video demo here:
https://github.com/user-attachments/assets/398fa4ff-4926-4594-a9c6-9bb92d170c63
1. Install
Intall the latest released version of this package by using the PyPI source:
python -m pip install dash-picture-annotation
Or use the following commands to install the developing version from the GitHub Source when you have already installed Git :hammer:, NodeJS :hammer:, and Yarn :hammer::
git clone https://github.com/cainmagi/dash-picture-annotation
cd dash-picture-annotation
python -m pip install -r requirements-dev.txt
yarn install
yarn build
python -m pip install .
2. Usage
The following signature shows the basic usage of this component.
import dash_picture_annotation as dpa
dpa.DashPictureAnnotation(
id="annotator",
style={"height": "80vh"},
data=default_data, # Can be `None`
image="/assets/test_image.svg", # Can be `None`
options=None,
)
where the data is typed by dpa.Annotations. It should be formatted like this:
{
"timestamp": 0,
"data": [
{
"id": "N5fewQ",
"mark": {
"x": -224.45, "y": 62.76, "width": 125.53, "height": 125.53, "type": "RECT"
},
"comment": "has-a-type"
},
{
"id": "ibJMdK",
"mark": {
"x": -36.15, "y": 62.76, "width": 125.53, "height": 125.53, "type": "RECT"
},
},
{
"id": "...",
"...": "...",
}
]
}
A full demo for a minimal example can be found here :link:.
A full demo for an integrated application can be found here :link:, where the basic usages are displayed.
3. Documentation
Check the documentation to find more details about the examples and APIs.
https://cainmagi.github.io/dash-picture-annotation/
4. Contributing
5. Changelog
6. Acknowledgements
- Kunduin/react-picture-annotation :link:: The original React component implementation of this project.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file dash_picture_annotation-0.2.1.tar.gz.
File metadata
- Download URL: dash_picture_annotation-0.2.1.tar.gz
- Upload date:
- Size: 2.9 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3386941be5cd6205b5388f89f26814c36e7ce1197cfd6e1ae04c86b465608ce0
|
|
| MD5 |
abf7dd13d9e08c8863549f7cf21b74ce
|
|
| BLAKE2b-256 |
e5386575f3a959e5a594b68d3eca76c1d338d609e3f9a3d7a36bc90d46748e76
|
Provenance
The following attestation bundles were made for dash_picture_annotation-0.2.1.tar.gz:
Publisher:
python-publish.yml on cainmagi/dash-picture-annotation
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
dash_picture_annotation-0.2.1.tar.gz -
Subject digest:
3386941be5cd6205b5388f89f26814c36e7ce1197cfd6e1ae04c86b465608ce0 - Sigstore transparency entry: 176497376
- Sigstore integration time:
-
Permalink:
cainmagi/dash-picture-annotation@a7cfc7bbfd960902660d0af5ebf70b364e80a043 -
Branch / Tag:
refs/tags/v0.2.1 - Owner: https://github.com/cainmagi
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@a7cfc7bbfd960902660d0af5ebf70b364e80a043 -
Trigger Event:
release
-
Statement type:
File details
Details for the file dash_picture_annotation-0.2.1-py3-none-any.whl.
File metadata
- Download URL: dash_picture_annotation-0.2.1-py3-none-any.whl
- Upload date:
- Size: 264.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cc7f2fbe18cfcec82aeb2b238afe9dafafc68381e606cdc4a9c0d97697faf3ab
|
|
| MD5 |
9d38a4eb02316793ebc564db622d47f0
|
|
| BLAKE2b-256 |
5f387e99287af09ead30123036e2004b77304d75a4fcce9e588c9f8a79e480ee
|
Provenance
The following attestation bundles were made for dash_picture_annotation-0.2.1-py3-none-any.whl:
Publisher:
python-publish.yml on cainmagi/dash-picture-annotation
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
dash_picture_annotation-0.2.1-py3-none-any.whl -
Subject digest:
cc7f2fbe18cfcec82aeb2b238afe9dafafc68381e606cdc4a9c0d97697faf3ab - Sigstore transparency entry: 176497381
- Sigstore integration time:
-
Permalink:
cainmagi/dash-picture-annotation@a7cfc7bbfd960902660d0af5ebf70b364e80a043 -
Branch / Tag:
refs/tags/v0.2.1 - Owner: https://github.com/cainmagi
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@a7cfc7bbfd960902660d0af5ebf70b364e80a043 -
Trigger Event:
release
-
Statement type: