Skip to content

Commit c060feb

Browse files
author
Xing
authored
Merge pull request #30 from plotly/dev
Pre-release updates - Remove files, improve demos, update documentation
2 parents db9787b + 7c41360 commit c060feb

37 files changed

+430
-430
lines changed

.github/ISSUE_TEMPLATE.md

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
<!--
2+
Thanks for your interest in Plotly's Dash Cytoscape Component!
3+
4+
Note that GitHub issues in this repo are reserved for bug reports and feature
5+
requests. Implementation questions should be discussed in our
6+
[Dash Community Forum](https://community.plot.ly/c/dash).
7+
8+
Before opening a new issue, please search through existing issues (including
9+
closed issues) and the [Dash Community Forum](https://community.plot.ly/c/dash).
10+
11+
When reporting a bug, please include a reproducible example! We recommend using
12+
the [latest version](https://github.com/plotly/dash-cytoscape/blob/master/CHANGELOG.md)
13+
as this project is frequently updated. Issues can be browser-specific so
14+
it's usually helpful to mention the browser and version that you are using.
15+
16+
-->
17+
18+
#### Description
19+
20+
#### Steps/Code to Reproduce
21+
<!--
22+
Example:
23+
```python
24+
import dash
25+
import dash_cytoscape as cyto
26+
import dash_html_components as html
27+
28+
app = dash.Dash(__name__)
29+
app.scripts.config.serve_locally = True
30+
app.css.config.serve_locally = True
31+
32+
app.layout = html.Div([
33+
cyto.Cytoscape(
34+
id='cytoscape',
35+
elements=[
36+
{'data': {'id': 'one', 'label': 'Node 1'}, 'position': {'x': 50, 'y': 50}},
37+
{'data': {'id': 'two', 'label': 'Node 2'}, 'position': {'x': 200, 'y': 200}},
38+
{'data': {'source': 'one', 'target': 'two','label': 'Node 1 to 2'}}
39+
],
40+
layout={'name': 'preset'}
41+
)
42+
])
43+
44+
if __name__ == '__main__':
45+
app.run_server(debug=True)
46+
```
47+
If the code is too long, feel free to put it in a public gist and link
48+
it in the issue: https://gist.github.com
49+
-->
50+
51+
#### Expected Results
52+
<!-- Please paste or describe the expected results.-->
53+
54+
#### Actual Results
55+
<!-- Please paste or specifically describe the actual output or traceback. -->
56+
57+
#### Versions
58+
<!--
59+
Please run the following snippet and paste the output below:
60+
61+
from __future__ import print_function
62+
import dash; print("Dash", dash.__version__)
63+
import dash_html_components; print("Dash Core Components", dash_html_components.__version__)
64+
import dash_core_components; print("Dash HTML Components", dash_core_components.__version__)
65+
import dash_renderer; print("Dash Renderer", dash_renderer.__version)
66+
import dash_cytoscape; print("Dash HTML Components", dash_cytoscape.__version__)
67+
-->
68+
69+
70+
<!--
71+
Thanks for taking the time to help up improve this component. Dash Cytoscape
72+
would not be possible without awesome contributors like you!
73+
-->

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
<!--
2+
Thanks for contributing a pull request! Please ensure you have taken a look at
3+
the contribution guidelines:
4+
https://github.com/plotly/dash-cytoscape/blob/master/CONTRIBUTING.md
5+
-->
6+
7+
8+
## About
9+
<!--
10+
What is your PR about? It could be that:
11+
- This is a new component
12+
- I am adding a feature to an existing component, or improving an existing feature
13+
- I am closing an issue
14+
-->
15+
16+
17+
## Description of changes
18+
<!--
19+
What does this implement/fix? Explain your changes.
20+
-->
21+
22+
## Pre-Merge checklist
23+
- [ ] The project was correctly built with `npm run build:all`.
24+
- [ ] If there was any conflict, it was solved correctly
25+
- [ ] All changes were documented in CHANGELOG.md.
26+
- [ ] All tests on CircleCI have passed.
27+
- [ ] All Percy visual changes have been approved.
28+
- [ ] Two people have :dancer:'d the pull request. You can be one of these people if you are a Dash Cytoscape core contributor.
29+
30+
31+
## Reference Issues
32+
<!--
33+
Example: Closes #1234. See also #3456.
34+
Please use keywords (e.g., Fixes) to create link to the issues or pull requests
35+
you resolved, so that they will automatically be closed when your pull request
36+
is merged. See https://github.com/blog/1506-closing-issues-via-pull-requests
37+
38+
If you are adding a new feature, consider discussing it by opening up an issue.
39+
Otherwise, delete the following line:
40+
-->
41+
42+
Closes #[issue number]
43+
44+
45+
## Other comments

.npmignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ public
2020
src
2121
scripts
2222
config
23+
venv
2324
.travis.yml
2425
CHANGELOG.md
2526
README.md

CHANGELOG.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,21 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
66

77
## [Unreleased]
88

9+
## Added
10+
* Two new demos: `usage-grid-social-network.py` and `usage-concentric-social-network.py`
11+
* Add Issue and PR templates for Github (located in `.github`)
12+
13+
## Changed
14+
* `usage-*.py` - Modified all the import statements from `import dash_cytoscape` to `import dash_cytoscape as cyto`. Also optimized imports.
15+
* `usage-phylogeny.py` - Clear callback conditional statement
16+
* `CONTRIBUTING.md` - changed `dash-cytoscape-0.0.1` to `dash-cytoscape-x.x.x`. Added a **Code quality & design** section. Changed the **Making a contribution** section and updated title to **Publishing**. Updated **Pre-Release checklist**.
17+
* `npmignore` - Added `venv` to avoid venvs to be included in the npm distribution package, which makes us a large amount of space and many unnecessary files being distributed.
18+
19+
## Removed
20+
* `extract-meta.js`, `extract-meta` - they were moved to the dash component CLI, thus are not needed anymore
21+
* `config.py`, `runtime.txt`, `Procfile`, `index.html` - only needed for hosting `usage-*.py` on DDS, they are now moved to `plotly/dash-cytoscape-demos`.
22+
* `review_checklist.md` - redundant since all the information is already contained in CONTRIBUTING.md
23+
924
## [0.0.4] - 2018-01-19
1025

1126
### Added

CONTRIBUTING.md

Lines changed: 42 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,31 @@ Refer to the [readme](README.md) for installation and development instructions.
88

99
Please lint any additions to Python code with `pylint` and `flake8`.
1010

11-
## Pull Request Guidelines
11+
## Code quality & design
12+
13+
- Is your code clear? If you had to go back to it in a month, would you be happy to? If someone else had to contribute to it, would they be able to?
14+
15+
A few suggestions:
16+
17+
- Make your variable names descriptive and use the same naming conventions throughout the code.
18+
19+
- For more complex pieces of logic, consider putting a comment, and maybe an example.
20+
21+
- In the comments, focus on describing _why_ the code does what it does, rather than describing _what_ it does. The reader can most likely read the code, but not necessarily understand why it was necessary.
22+
23+
- Don't overdo it in the comments. The code should be clear enough to speak for itself. Stale comments that no longer reflect the intent of the code can hurt code comprehension.
24+
25+
* Don't repeat yourself. Any time you see that the same piece of logic can be applied in multiple places, factor it out into a function, or variable, and reuse that code.
26+
* Scan your code for expensive operations (large computations, DOM queries, React re-renders). Have you done your possible to limit their impact? If not, it is going to slow your app down.
27+
* Can you think of cases where your current code will break? How are you handling errors? Should the user see them as notifications? Should your app try to auto-correct them for them?
1228

13-
Use the [GitHub flow][] when proposing contributions to this repository (i.e. create a feature branch and submit a PR against the master branch).
1429

1530
## Running the Tests
1631

1732
_To be added_
1833

1934

20-
## Making a contribution
21-
_For larger features, your contribution will have a higher likelihood of getting merged if you create an issue to discuss the changes that you'd like to make before you create a pull request._
35+
## Publishing
2236

2337
Create a pull request and tag the Plotly team (`@plotly/dash_bio`) and tag / request review from [@xhlulu](https://github.com/xhlulu).
2438

@@ -39,66 +53,74 @@ python setup.py sdist
3953
```
4054
6. Copy the tarball into a separate folder and try to install it and run the examples:
4155
```
42-
cp dist/dash-cytoscape-0.0.1.tar.gz ../temp
56+
cp dist/dash_cytoscape-x.x.x.tar.gz ../temp
4357
cp usage.py ../temp
4458
cd ../temp
4559
source venv/bin/activate
46-
pip install dash-cytoscape-0.0.1.tar.gz
60+
pip install dash_cytoscape-x.x.x.tar.gz
4761
python usage.py
4862
```
4963
7. If the examples work, then publish:
5064
```
5165
npm publish
52-
twine upload dist/dash-cytoscape-0.0.1.tar.gz
66+
twine upload dist/dash_cytoscape-x.x.x.tar.gz
5367
```
5468
8. Tag your release with git:
5569
```
56-
git tag -a 'v0.0.1' -m 'v0.0.1'
70+
git tag -a 'vx.x.x' -m 'vx.x.x'
5771
git push origin master --follow-tags
5872
```
5973
9. Verify that the publish worked by installing it:
6074
```
6175
cd ../temp
62-
pip install dash-cytoscape==0.0.1
76+
pip install dash-cytoscape==x.x.x
6377
python usage.py
6478
```
6579

6680

67-
Make a post in the [Dash Community Forum][]
68-
* Title it `":mega: Announcement! New <Your Feature> - Feedback Welcome"`
69-
* In the description, link to the PR and any relevant issue(s)
70-
* Pin the topic so that it appears at the top of the forum for two weeks
81+
Make a post in the [Dash Community Forum](https://community.plot.ly/c/dash)
82+
* Title it `":mega: Announcement! New <Your Feature> - Feedback Welcome"`
83+
* In the description, link to the PR and any relevant issue(s)
84+
* Pin the topic so that it appears at the top of the forum for two weeks
7185

7286
## [Checklists](http://rs.io/unreasonable-effectiveness-of-checklists/)
7387
**Beginner tip:** _Copy and paste this section as a comment in your PR, then check off the boxes as you go!_
7488
### Pre-Merge checklist
75-
- [ ] If changes are significant, a release candidate has been created and posted to Slack, the Plotly forums, and at the very top of the pull request.
76-
- [ ] Two people have :dancer:'d the pull request. You can be one of these people if you are a Dash core contributor.
89+
- [ ] The project was correctly built with `npm run build:all`.
90+
- [ ] If there was any conflict, it was solved correctly
91+
- [ ] All changes were documented in CHANGELOG.md.
92+
- [ ] All tests on CircleCI have passed.
93+
- [ ] All Percy visual changes have been approved.
94+
- [ ] Two people have :dancer:'d the pull request. You can be one of these people if you are a Dash Cytoscape core contributor.
95+
96+
### Merge step
97+
1. Make sure to *Squash and Merge* your contribution if you have created multiple commits to change a specific feature.
98+
2. Make sure to *Rebase and Merge* if you added many different features, and need to contribute multiple different commits.
7799

78100
### Post-Merge checklist
79101
- [ ] You have tagged the release using `git tag v<version_number>` _(for the contributor merging the PR)_.
80102
- [ ] You have pushed this tag using `git push <tag_name>` _(for the contributor merging the PR)_.
81103
- [ ] You have deleted the branch.
82104

83105
### Pre-Release checklist
84-
- [ ] Everything in the Pre-Merge checklist is completed. (Except the last two if this is a release candidate).
106+
- [ ] Everything in the Pre-Merge checklist is completed.
85107
- [ ] `git remote show origin` shows you are in the correct repository.
86108
- [ ] `git branch` shows that you are on the expected branch.
87109
- [ ] `git status` shows that there are no unexpected changes.
88-
- [ ] `dash/version.py` is at the correct version.
110+
- [ ] Both `package.json` and `dash_cytoscape/package.json` versions have been correctly updated.
89111

90112
### Release Step
91-
- `python setup.py sdist` to build.
92-
- `twine upload dist/<the_version_you_just_built>` to upload to PyPi.
113+
Complete the "Publishing" section.
93114

94115
### Post-Release checklist
116+
- [ ] Step 1 and 2 of Post-merge checklist are completed.
95117
- [ ] You have closed all issues that this pull request solves, and commented the new version number users should install.
96118
- [ ] If significant enough, you have created an issue about documenting the new feature or change and you have added it to the [Documentation] project.
97119
- [ ] You have created a pull request in [Dash Docs] with the new release of your feature by editing that project's [`requirements.txt` file](https://github.com/plotly/dash-docs/blob/master/requirements.txt) and you have assigned `@chriddyp` to review.
98120

99121
## Financial Contributions
100122

101-
Dash, and many of Plotly's open source products, have been funded through direct sponsorship by companies. [Get in touch] about funding feature additions, consulting, or custom app development.
123+
Dash, and many of Plotly's open source products, have been funded through direct sponsorship by companies. [Get in touch](https://plot.ly/products/on-premise/) about funding feature additions, consulting, or custom app development.
102124

103125
[Dash Core Components]: https://dash.plot.ly/dash-core-components
104126
[Dash HTML Components]: https://github.com/plotly/dash-html-components

Procfile

Lines changed: 0 additions & 1 deletion
This file was deleted.

README.md

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
# Dash Cytoscape
1+
# Dash Cytoscape [![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/plotly/dash-cytoscape/blob/master/LICENSE) [![PyPi Version](https://img.shields.io/pypi/v/dash-cytoscape.svg)](https://pypi.org/project/dash-cytoscape/)
22

3-
A Component Library for Dash aimed at facilitating network visualization in Python, wrapped around [Cytoscape.js](http://js.cytoscape.org/)
3+
A Component Library for Dash aimed at facilitating network visualization in Python, wrapped around [Cytoscape.js](http://js.cytoscape.org/).
44

55
Interacting with the stylesheet:
6-
![usage-stylesheet-demo](demos/images/usage-stylesheet-demo.gif)
6+
![usage-stylesheet-demo](https://raw.githubusercontent.com/plotly/dash-cytoscape/master/demos/images/usage-stylesheet-demo.gif)
77

88
Interacting with the elements:
9-
![usage-elements-demo](demos/images/usage-elements-demo.gif)
9+
![usage-elements-demo](https://raw.githubusercontent.com/plotly/dash-cytoscape/master/demos/images/usage-elements-demo.gif)
1010

1111
## Getting Started
1212

@@ -35,12 +35,12 @@ Create the following example inside an `app.py` file:
3535

3636
```python
3737
import dash
38-
import dash_cytoscape
38+
import dash_cytoscape as cyto
3939
import dash_html_components as html
4040

4141
app = dash.Dash(__name__)
4242
app.layout = html.Div([
43-
dash_cytoscape.Cytoscape(
43+
cyto.Cytoscape(
4444
id='cytoscape',
4545
elements=[
4646
{'data': {'id': 'one', 'label': 'Node 1'}, 'position': {'x': 50, 'y': 50}},
@@ -55,6 +55,15 @@ if __name__ == '__main__':
5555
app.run_server(debug=True)
5656
```
5757

58+
59+
## Documentation
60+
61+
View the [Dash Cytoscape User Guide](https://dash.plot.ly/cytoscape/) to get started now. You can also use the [component reference](https://dash.plot.ly/cytoscape/reference/) to find how to use a certain feature.
62+
63+
To learn more about the core Dash components and how to use callbacks, view the [Dash documentation](https://dash.plot.ly/).
64+
65+
For supplementary information about the underlying Javascript API, view the [Cytoscape.js documentation](http://js.cytoscape.org/).
66+
5867
## Development
5968

6069
Please follow the following steps for local testing:
@@ -90,13 +99,6 @@ $ python setup.py install
9099
```
91100

92101

93-
## Documentation
94-
95-
For using Dash and for a Python-specific overview of Dash Cytoscape, view the [Dash User Guide](https://dash.plot.ly/). It's chock-full of examples, pro tips, and guiding principles.
96-
97-
For supplementary information about the underlying javascript API, view the [Cytoscape.js documentation](http://js.cytoscape.org/).
98-
99-
100102

101103
## Notes
102104

@@ -115,3 +117,6 @@ See https://plot.ly/dash/support for ways to get in touch.
115117
## Acknowledgments
116118

117119
Huge thanks to the Cytoscape Consortium and the Cytoscape.js team for their contribution in making such a complete API for creating interactive networks. This library would not have been possible without their massive work!
120+
121+
The Pull Request and Issue Templates were inspired from the
122+
[]scikit-learn project](https://github.com/scikit-learn/scikit-learn).

0 commit comments

Comments
 (0)