You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Added ability to download image files generated with `generateImage` client-side without sending
14
-
data to the server.
15
-
* Used the newly added `generateImage` and `imageData` properties to enable svg generation using https://github.com/kinimesi/cytoscape-svg
16
-
* Added responsive cytoscape.js graph feature toggled using the `responsive` property.
14
+
data to the server (PR [#88](https://github.com/plotly/dash-cytoscape/pull/88)).
15
+
* Used the newly added `generateImage` and `imageData` properties to enable svg generation using [cytoscape-svg](https://github.com/kinimesi/cytoscape-svg).
16
+
* Added responsive cytoscape.js graph feature toggled using the `responsive` property (PR [#93](https://github.com/plotly/dash-cytoscape/pull/92)).
17
17
* One new demo:
18
18
*`demos/usage-responsive-graph.py`: Example of graph with the ability to toggle the responsive feature on and off.
19
+
*`demos/usage-image-export.py`: Shows how to export images as JPG, PNG or SVG.
19
20
20
21
### Changed
22
+
* Changed the official package manager from `yarn` to `npm`.
21
23
*`utils.Tree`: v0.1.1 broke compatibility with Python 2. Therefore, modified code to be compatible
22
24
with Python 2. Added `props` and `edge_props` properties to accept arguments passed directly to
23
25
the node's and edge's dictionaries, respectively (e.g., 'classes', 'positions', etc.).
24
26
* Removed `Tree`'s method `add_child`, because it is redundant with `add_children` called with an
25
27
argument of length 1.
26
-
*`setup.py`: Remove `dash-html-components` and `dash_renderer` from `install_requires`
28
+
*`setup.py`: Remove `dash-html-components` and `dash_renderer` from `install_requires`.
29
+
*`usage-events.py`: Fix the size of the cytoscape graph to 500px by 500px.
30
+
* Upgrade `react-cytoscape.js` to latest.
27
31
28
32
### Fixed
29
33
*`setup.py`: Use `packages=find_packages(include=[package_name, package_name + ".*"])` so that all
30
34
subpackages like `utils` will be included when you `pip install dash-cytoscape`.
35
+
* Issue where `dash-cytoscape` cannot read property of 'length' of undefined when elements is not specified.
Copy file name to clipboardExpand all lines: CODE_OF_CONDUCT.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -34,7 +34,7 @@ This Code of Conduct applies both within project spaces and in public spaces whe
34
34
35
35
## Enforcement
36
36
37
-
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at [email protected]. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
37
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at [email protected] or [email protected]. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
38
38
39
39
Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+8-9Lines changed: 8 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -27,10 +27,14 @@ venv\Scripts\activate
27
27
28
28
3. Install the JavaScript dependencies and build the code:
29
29
```commandline
30
-
yarn
31
-
yarn run build:all
30
+
npm install
31
+
npm run build:all
32
32
```
33
33
34
+
#### Package manager
35
+
36
+
Before v0.2.0, our preferred package manager for this project is Yarn. Starting with v0.2.0, we will be using `npm` in order to create less confusion and ensure a unified package manager with other Dash components. Therefore we use `package-lock.json` rather than `yarn.lock.`. If you are contributing a PR to dash-cytoscape, we encourage you to also use `npm`.
37
+
34
38
## Coding Style
35
39
36
40
Please lint any additions to Python code with `pylint` and `flake8`:
@@ -108,7 +112,7 @@ Those tests are rendered into images located inside `tests/screenshots`, which a
108
112
109
113
## Publishing
110
114
111
-
Create a pull request and tag the Plotly team (`@plotly/dash_bio`) and tag / request review from [@xhlulu](https://github.com/xhlulu).
115
+
Create a pull request and tag the Plotly team (`@plotly/dash-core`) and tag / request review from [@xhlulu](https://github.com/xhlulu).
112
116
113
117
After a review has been done and your changes have been approved, create a prerelease and comment in the PR. Version numbers should follow [semantic versioning][].
114
118
@@ -190,12 +194,7 @@ Complete the "Publishing" section.
190
194
-[ ] Step 1 and 2 of Post-merge checklist are completed.
191
195
-[ ] You have closed all issues that this pull request solves, and commented the new version number users should install.
192
196
-[ ] If significant enough, you have created an issue about documenting the new feature or change and you have added it to the [Documentation] project.
193
-
-[ ] 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.
194
-
195
-
## Notes
196
-
197
-
#### Package manager
198
-
Our preferred package manager for this project is Yarn. Therefore we use `yarn.lock` rather than `package-lock.json`. If you decide to start using npm for package management (which will create package-lock.json) and you commit this project to Dokku, make sure to delete `yarn.lock`.
197
+
-[ ] 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).
You can also add external layouts. Use the `cyto.load_extra_layouts()` function to get started:
63
+
64
+
```python
65
+
import dash
66
+
import dash_cytoscape as cyto
67
+
import dash_html_components as html
68
+
69
+
cyto.load_extra_layouts()
70
+
71
+
app = dash.Dash(__name__)
72
+
app.layout = html.Div([
73
+
cyto.Cytoscape(...)
74
+
])
75
+
```
76
+
77
+
Calling `cyto.load_extra_layouts()` also enables generating SVG images.
78
+
79
+
80
+
## Getting Started in R
81
+
82
+
### Prerequisites
83
+
84
+
```R
85
+
install.packages(c("devtools", "dash"))
86
+
```
87
+
### Usage
67
88
68
89
Install the library using devtools:
69
90
@@ -100,23 +121,6 @@ app$layout(
100
121
app$run_server()
101
122
```
102
123
103
-
### External layouts
104
-
105
-
You can also add external layouts. Use the `cyto.load_extra_layouts()` function to get started:
106
-
107
-
```python
108
-
import dash
109
-
import dash_cytoscape as cyto
110
-
import dash_html_components as html
111
-
112
-
cyto.load_extra_layouts()
113
-
114
-
app = dash.Dash(__name__)
115
-
app.layout = html.Div([
116
-
cyto.Cytoscape(...)
117
-
])
118
-
```
119
-
120
124
## Documentation
121
125
122
126
The [Dash Cytoscape User Guide](https://dash.plotly.com/cytoscape/) contains everything you need to know about the library. It contains useful examples, functioning code, and is fully interactive. You can also use the [component reference](https://dash.plotly.com/cytoscape/reference/) for a complete and concise specification of the API.
@@ -127,7 +131,11 @@ For supplementary information about the underlying Javascript API, view the [Cy
127
131
128
132
## Contributing
129
133
130
-
Make sure that you have read and understood our [code of conduct](CODE_OF_CONDUCT.md), then head over to [CONTRIBUTING](CONTRIBUTING.md) to get started.
134
+
Make sure that you have read and understood our [code of conduct](CODE_OF_CONDUCT.md), then head over to [CONTRIBUTING](CONTRIBUTING.md) to get started.
135
+
136
+
### Testing
137
+
138
+
Instructions on how to run [tests](CONTRIBUTING.md#tests) are given in [CONTRIBUTING.md](CONTRIBUTING.md).
Copy file name to clipboardExpand all lines: dash_cytoscape/Cytoscape.py
+18-18Lines changed: 18 additions & 18 deletions
Original file line number
Diff line number
Diff line change
@@ -12,8 +12,8 @@ class Cytoscape(Component):
12
12
- id (string; optional): The ID used to identify this component in Dash callbacks.
13
13
- className (string; optional): Sets the class name of the element (the value of an element's html
14
14
class attribute).
15
-
- style (dict; default {width: '600px', height: '600px'}): Add inline styles to the root element.
16
-
- elements (list of dicts | dict; optional): A list of dictionaries representing the elements of the networks.
15
+
- style (dict; optional): Add inline styles to the root element.
16
+
- elements (list | dict; optional): A list of dictionaries representing the elements of the networks.
17
17
1. Each dictionary describes an element, and specifies its purpose.
18
18
- `group` (string): Either 'nodes' or 'edges'. If not given, it's automatically inferred.
19
19
- `data` (dictionary): Element specific data.
@@ -33,7 +33,7 @@ class attribute).
33
33
34
34
2. The [official Cytoscape.js documentation](http://js.cytoscape.org/#notation/elements-json) offers an extensive overview and examples of element declaration.
35
35
Alternatively, a dictionary with the format { 'nodes': [], 'edges': [] } is allowed at initialization, but arrays remain the recommended format.
36
-
- stylesheet (list of dicts; optional): A list of dictionaries representing the styles of the elements.
36
+
- stylesheet (list; optional): A list of dictionaries representing the styles of the elements.
37
37
1. Each dictionary requires the following keys:
38
38
- `selector` (string): Which elements you are styling. Generally, you select a group of elements (node, edges, both), a class (that you declare in the element dictionary), or an element by ID.
39
39
- `style` (dictionary): What aspects of the elements you want to modify. This could be the size or color of a node, the shape of an edge arrow, or many more.
@@ -43,7 +43,7 @@ class attribute).
43
43
exhaustively documented in the Cytoscape.js docs. Although methods such
44
44
as `cy.elements(...)` and `cy.filter(...)` are not available, the selector
45
45
string syntax stays the same.
46
-
- layout (dict; default {name: 'grid'}): A dictionary specifying how to set the position of the elements in your
46
+
- layout (dict; optional): A dictionary specifying how to set the position of the elements in your
47
47
graph. The `'name'` key is required, and indicates which layout (algorithm) to
48
48
use.
49
49
1. The layouts available by default are:
@@ -81,33 +81,33 @@ class attribute).
81
81
Note that certain keys are not supported in Dash since the value is a
82
82
JavaScript function or a callback. Please visit [this issue](https://github.com/plotly/dash-cytoscape/issues/25)
83
83
for more information.
84
-
- pan (dict; default {x: 0, y: 0}): Dictionary indicating the initial panning position of the graph. The
84
+
- pan (dict; optional): Dictionary indicating the initial panning position of the graph. The
85
85
following keys are accepted:
86
86
- `x` (number): The x-coordinate of the position.
87
87
- `y` (number): The y-coordinate of the position.
88
-
- zoom (number; default 1): The initial zoom level of the graph. You can set `minZoom` and
88
+
- zoom (number; optional): The initial zoom level of the graph. You can set `minZoom` and
89
89
`maxZoom` to set restrictions on the zoom level.
90
-
- panningEnabled (boolean; default True): Whether panning the graph is enabled (i.e., the position of the graph is
90
+
- panningEnabled (boolean; optional): Whether panning the graph is enabled (i.e., the position of the graph is
91
91
mutable overall).
92
-
- userPanningEnabled (boolean; default True): Whether user events (e.g. dragging the graph background) are allowed to
92
+
- userPanningEnabled (boolean; optional): Whether user events (e.g. dragging the graph background) are allowed to
93
93
pan the graph.
94
-
- minZoom (number; default 1e-50): A minimum bound on the zoom level of the graph. The viewport can not be
94
+
- minZoom (number; optional): A minimum bound on the zoom level of the graph. The viewport can not be
95
95
scaled smaller than this zoom level.
96
-
- maxZoom (number; default 1e50): A maximum bound on the zoom level of the graph. The viewport can not be
96
+
- maxZoom (number; optional): A maximum bound on the zoom level of the graph. The viewport can not be
97
97
scaled larger than this zoom level.
98
-
- zoomingEnabled (boolean; default True): Whether zooming the graph is enabled (i.e., the zoom level of the graph
98
+
- zoomingEnabled (boolean; optional): Whether zooming the graph is enabled (i.e., the zoom level of the graph
99
99
is mutable overall).
100
-
- userZoomingEnabled (boolean; default True): Whether user events (e.g. dragging the graph background) are allowed
100
+
- userZoomingEnabled (boolean; optional): Whether user events (e.g. dragging the graph background) are allowed
101
101
to pan the graph.
102
-
- boxSelectionEnabled (boolean; default False): Whether box selection (i.e. drag a box overlay around, and release it
102
+
- boxSelectionEnabled (boolean; optional): Whether box selection (i.e. drag a box overlay around, and release it
103
103
to select) is enabled. If enabled, the user must taphold to pan the graph.
104
-
- autoungrabify (boolean; default False): Whether nodes should be ungrabified (not grabbable by user) by
104
+
- autoungrabify (boolean; optional): Whether nodes should be ungrabified (not grabbable by user) by
0 commit comments