This repository was archived by the owner on Feb 10, 2025. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 26
Updated contributing notes #27
Open
emmanuelle
wants to merge
3
commits into
master
Choose a base branch
from
contributing
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|
||
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 | ||
``` |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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)There was a problem hiding this comment.
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 :-)