Skip to content
This repository was archived by the owner on Feb 10, 2025. It is now read-only.

Updated contributing notes #27

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 39 additions & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,46 @@
# CONTRIBUTING

Welcome to dash-canvas!
Welcome to dash-canvas! Contributions, bug reports, comments about the
package are very welcome. The project is hosted on
https://github.com/plotly/dash-canvas.

## Structure of the code
This project was initially generated by the
[dash-component-boilerplate](https://github.com/plotly/dash-component-boilerplate),
which contains the minimal set of code required to create your own custom
Dash component.

React component DashCanvas: `src/lib/components/DashCanvas.react.js`
## Structure of the code:

Build Javascript component: `npm run build:all` at the root (see https://dash.plot.ly/react-for-python-developers for more details).
- the source code of the ``dash_canvas.DashCanvas`` canvas reactive
object is the JavaScript React class in
``src/lib/components/DashCanvas.react.js``. If you are not familiar with
React and JavaScript, [this
tutorial](https://dash.plot.ly/react-for-python-developers) is a good
primer. In order to build the Javascript component: execute at the root
of the package
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you also want to add a comment about installing the Python package? (e.g. pip install -e . or equivalent)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea. Since I'm terrified by Javascript but fluent with Python I assumed it would be the same for other contributors but it could be the other way around :-)


Utility Python functions: `dash_canvas/utils`
```
npm run build:all
```

- the ``dash_canvas/utils`` submodule contains utility functions in order
to use annotations retrieved from the DashCanvas object for further
image processing.

- for examples of applications using dash-canvas, see the https://github.com/plotly/canvas-portal. These examples show in particular how to write callbacks using the DashCanvas object properties.

## Testing

For testing the DashCanvas objects using Selenium

```
pytest tests --webdriver Chrome
```

(or using another webdriver).

For testing the Python package and utility functions

```
pytest dash_canvas
```