Skip to content
Merged
Show file tree
Hide file tree
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
73 changes: 73 additions & 0 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
<!--
Thanks for your interest in Plotly's Dash Cytoscape Component!

Note that GitHub issues in this repo are reserved for bug reports and feature
requests. Implementation questions should be discussed in our
[Dash Community Forum](https://community.plot.ly/c/dash).

Before opening a new issue, please search through existing issues (including
closed issues) and the [Dash Community Forum](https://community.plot.ly/c/dash).

When reporting a bug, please include a reproducible example! We recommend using
the [latest version](https://github.com/plotly/dash-cytoscape/blob/master/CHANGELOG.md)
as this project is frequently updated. Issues can be browser-specific so
it's usually helpful to mention the browser and version that you are using.

-->

#### Description

#### Steps/Code to Reproduce
<!--
Example:
```python
import dash
import dash_cytoscape as cyto
import dash_html_components as html

app = dash.Dash(__name__)
app.scripts.config.serve_locally = True
app.css.config.serve_locally = True

app.layout = html.Div([
cyto.Cytoscape(
id='cytoscape',
elements=[
{'data': {'id': 'one', 'label': 'Node 1'}, 'position': {'x': 50, 'y': 50}},
{'data': {'id': 'two', 'label': 'Node 2'}, 'position': {'x': 200, 'y': 200}},
{'data': {'source': 'one', 'target': 'two','label': 'Node 1 to 2'}}
],
layout={'name': 'preset'}
)
])

if __name__ == '__main__':
app.run_server(debug=True)
```
If the code is too long, feel free to put it in a public gist and link
it in the issue: https://gist.github.com
-->

#### Expected Results
<!-- Please paste or describe the expected results.-->

#### Actual Results
<!-- Please paste or specifically describe the actual output or traceback. -->

#### Versions
<!--
Please run the following snippet and paste the output below:

from __future__ import print_function
import dash; print("Dash", dash.__version__)
import dash_html_components; print("Dash Core Components", dash_html_components.__version__)
import dash_core_components; print("Dash HTML Components", dash_core_components.__version__)
import dash_renderer; print("Dash Renderer", dash_renderer.__version)
import dash_cytoscape; print("Dash HTML Components", dash_cytoscape.__version__)
-->


<!--
Thanks for taking the time to help up improve this component. Dash Cytoscape
would not be possible without awesome contributors like you!
-->
45 changes: 45 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<!--
Thanks for contributing a pull request! Please ensure you have taken a look at
the contribution guidelines:
https://github.com/plotly/dash-cytoscape/blob/master/CONTRIBUTING.md
-->


## About
<!--
What is your PR about? It could be that:
- This is a new component
- I am adding a feature to an existing component, or improving an existing feature
- I am closing an issue
-->


## Description of changes
<!--
What does this implement/fix? Explain your changes.
-->

## Pre-Merge checklist
- [ ] The project was correctly built with `npm run build:all`.
- [ ] If there was any conflict, it was solved correctly
- [ ] All changes were documented in CHANGELOG.md.
- [ ] All tests on CircleCI have passed.
- [ ] All Percy visual changes have been approved.
- [ ] Two people have :dancer:'d the pull request. You can be one of these people if you are a Dash Cytoscape core contributor.


## Reference Issues
<!--
Example: Closes #1234. See also #3456.
Please use keywords (e.g., Fixes) to create link to the issues or pull requests
you resolved, so that they will automatically be closed when your pull request
is merged. See https://github.com/blog/1506-closing-issues-via-pull-requests

If you are adding a new feature, consider discussing it by opening up an issue.
Otherwise, delete the following line:
-->

Closes #[issue number]


## Other comments
1 change: 1 addition & 0 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ public
src
scripts
config
venv
.travis.yml
CHANGELOG.md
README.md
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,21 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## Added
* Two new demos: `usage-grid-social-network.py` and `usage-concentric-social-network.py`
* Add Issue and PR templates for Github (located in `.github`)

## Changed
* `usage-*.py` - Modified all the import statements from `import dash_cytoscape` to `import dash_cytoscape as cyto`. Also optimized imports.
* `usage-phylogeny.py` - Clear callback conditional statement
* `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**.
* `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.

## Removed
* `extract-meta.js`, `extract-meta` - they were moved to the dash component CLI, thus are not needed anymore
* `config.py`, `runtime.txt`, `Procfile`, `index.html` - only needed for hosting `usage-*.py` on DDS, they are now moved to `plotly/dash-cytoscape-demos`.
* `review_checklist.md` - redundant since all the information is already contained in CONTRIBUTING.md

## [0.0.4] - 2018-01-19

### Added
Expand Down
62 changes: 42 additions & 20 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,31 @@ Refer to the [readme](README.md) for installation and development instructions.

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

## Pull Request Guidelines
## Code quality & design

- 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?

A few suggestions:

- Make your variable names descriptive and use the same naming conventions throughout the code.

- For more complex pieces of logic, consider putting a comment, and maybe an example.

- 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.

- 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.

* 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.
* 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.
* 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?

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

## Running the Tests

_To be added_


## Making a contribution
_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._
## Publishing

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

Expand All @@ -39,66 +53,74 @@ python setup.py sdist
```
6. Copy the tarball into a separate folder and try to install it and run the examples:
```
cp dist/dash-cytoscape-0.0.1.tar.gz ../temp
cp dist/dash_cytoscape-x.x.x.tar.gz ../temp
cp usage.py ../temp
cd ../temp
source venv/bin/activate
pip install dash-cytoscape-0.0.1.tar.gz
pip install dash_cytoscape-x.x.x.tar.gz
python usage.py
```
7. If the examples work, then publish:
```
npm publish
twine upload dist/dash-cytoscape-0.0.1.tar.gz
twine upload dist/dash_cytoscape-x.x.x.tar.gz
```
8. Tag your release with git:
```
git tag -a 'v0.0.1' -m 'v0.0.1'
git tag -a 'vx.x.x' -m 'vx.x.x'
git push origin master --follow-tags
```
9. Verify that the publish worked by installing it:
```
cd ../temp
pip install dash-cytoscape==0.0.1
pip install dash-cytoscape==x.x.x
python usage.py
```


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

## [Checklists](http://rs.io/unreasonable-effectiveness-of-checklists/)
**Beginner tip:** _Copy and paste this section as a comment in your PR, then check off the boxes as you go!_
### Pre-Merge checklist
- [ ] 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.
- [ ] Two people have :dancer:'d the pull request. You can be one of these people if you are a Dash core contributor.
- [ ] The project was correctly built with `npm run build:all`.
- [ ] If there was any conflict, it was solved correctly
- [ ] All changes were documented in CHANGELOG.md.
- [ ] All tests on CircleCI have passed.
- [ ] All Percy visual changes have been approved.
- [ ] Two people have :dancer:'d the pull request. You can be one of these people if you are a Dash Cytoscape core contributor.

### Merge step
1. Make sure to *Squash and Merge* your contribution if you have created multiple commits to change a specific feature.
2. Make sure to *Rebase and Merge* if you added many different features, and need to contribute multiple different commits.

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

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

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

### Post-Release checklist
- [ ] Step 1 and 2 of Post-merge checklist are completed.
- [ ] You have closed all issues that this pull request solves, and commented the new version number users should install.
- [ ] If significant enough, you have created an issue about documenting the new feature or change and you have added it to the [Documentation] project.
- [ ] 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.

## Financial Contributions

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.
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.

[Dash Core Components]: https://dash.plot.ly/dash-core-components
[Dash HTML Components]: https://github.com/plotly/dash-html-components
Expand Down
1 change: 0 additions & 1 deletion Procfile

This file was deleted.

31 changes: 18 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Dash Cytoscape
# 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/)

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

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

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

## Getting Started

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

```python
import dash
import dash_cytoscape
import dash_cytoscape as cyto
import dash_html_components as html

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


## Documentation

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.

To learn more about the core Dash components and how to use callbacks, view the [Dash documentation](https://dash.plot.ly/).

For supplementary information about the underlying Javascript API, view the [Cytoscape.js documentation](http://js.cytoscape.org/).

## Development

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


## Documentation

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.

For supplementary information about the underlying javascript API, view the [Cytoscape.js documentation](http://js.cytoscape.org/).



## Notes

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

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!

The Pull Request and Issue Templates were inspired from the
[]scikit-learn project](https://github.com/scikit-learn/scikit-learn).
Loading