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
Copy file name to clipboardExpand all lines: dash_cytoscape/Cytoscape.py
+19-18Lines changed: 19 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; optional): Add inline styles to the root element.
16
-
- elements (list; optional): A list of dictionaries representing the elements of the networks.
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.
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.
@@ -32,7 +32,8 @@ class attribute).
32
32
- `classes` (string): Space separated string of class names of the element. Those classes can be selected by a style selector.
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
-
- stylesheet (list; optional): A list of dictionaries representing the styles of the elements.
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
37
1. Each dictionary requires the following keys:
37
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.
38
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.
@@ -42,7 +43,7 @@ class attribute).
42
43
exhaustively documented in the Cytoscape.js docs. Although methods such
43
44
as `cy.elements(...)` and `cy.filter(...)` are not available, the selector
44
45
string syntax stays the same.
45
-
- layout (dict; optional): A dictionary specifying how to set the position of the elements in your
46
+
- layout (dict; default {name: 'grid'}): A dictionary specifying how to set the position of the elements in your
46
47
graph. The `'name'` key is required, and indicates which layout (algorithm) to
47
48
use.
48
49
1. The layouts available by default are:
@@ -80,33 +81,33 @@ class attribute).
80
81
Note that certain keys are not supported in Dash since the value is a
81
82
JavaScript function or a callback. Please visit [this issue](https://github.com/plotly/dash-cytoscape/issues/25)
82
83
for more information.
83
-
- pan (dict; optional): Dictionary indicating the initial panning position of the graph. The
84
+
- pan (dict; default {x: 0, y: 0}): Dictionary indicating the initial panning position of the graph. The
84
85
following keys are accepted:
85
86
- `x` (number): The x-coordinate of the position.
86
87
- `y` (number): The y-coordinate of the position.
87
-
- zoom (number; optional): The initial zoom level of the graph. You can set `minZoom` and
88
+
- zoom (number; default 1): The initial zoom level of the graph. You can set `minZoom` and
88
89
`maxZoom` to set restrictions on the zoom level.
89
-
- panningEnabled (boolean; optional): Whether panning the graph is enabled (i.e., the position of the graph is
90
+
- panningEnabled (boolean; default True): Whether panning the graph is enabled (i.e., the position of the graph is
90
91
mutable overall).
91
-
- userPanningEnabled (boolean; optional): Whether user events (e.g. dragging the graph background) are allowed to
92
+
- userPanningEnabled (boolean; default True): Whether user events (e.g. dragging the graph background) are allowed to
92
93
pan the graph.
93
-
- minZoom (number; optional): A minimum bound on the zoom level of the graph. The viewport can not be
94
+
- minZoom (number; default 1e-50): A minimum bound on the zoom level of the graph. The viewport can not be
94
95
scaled smaller than this zoom level.
95
-
- maxZoom (number; optional): A maximum bound on the zoom level of the graph. The viewport can not be
96
+
- maxZoom (number; default 1e50): A maximum bound on the zoom level of the graph. The viewport can not be
96
97
scaled larger than this zoom level.
97
-
- zoomingEnabled (boolean; optional): Whether zooming the graph is enabled (i.e., the zoom level of the graph
98
+
- zoomingEnabled (boolean; default True): Whether zooming the graph is enabled (i.e., the zoom level of the graph
98
99
is mutable overall).
99
-
- userZoomingEnabled (boolean; optional): Whether user events (e.g. dragging the graph background) are allowed
100
+
- userZoomingEnabled (boolean; default True): Whether user events (e.g. dragging the graph background) are allowed
100
101
to pan the graph.
101
-
- boxSelectionEnabled (boolean; optional): Whether box selection (i.e. drag a box overlay around, and release it
102
+
- boxSelectionEnabled (boolean; default False): Whether box selection (i.e. drag a box overlay around, and release it
102
103
to select) is enabled. If enabled, the user must taphold to pan the graph.
103
-
- autoungrabify (boolean; optional): Whether nodes should be ungrabified (not grabbable by user) by
104
+
- autoungrabify (boolean; default False): Whether nodes should be ungrabified (not grabbable by user) by
Copy file name to clipboardExpand all lines: dash_cytoscape/metadata.json
+17-5Lines changed: 17 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -115,13 +115,25 @@
115
115
},
116
116
"elements": {
117
117
"type": {
118
-
"name": "arrayOf",
119
-
"value": {
120
-
"name": "object"
121
-
}
118
+
"name": "union",
119
+
"value": [
120
+
{
121
+
"name": "arrayOf",
122
+
"value": {
123
+
"name": "object"
124
+
}
125
+
},
126
+
{
127
+
"name": "object"
128
+
}
129
+
]
122
130
},
123
131
"required": false,
124
-
"description": "A list of dictionaries representing the elements of the networks.\n 1. Each dictionary describes an element, and specifies its purpose.\n - `group` (string): Either 'nodes' or 'edges'. If not given, it's automatically inferred.\n - `data` (dictionary): Element specific data.\n - `id` (string): Reference to the element, useful for selectors and edges. Randomly assigned if not given.\n - `label` (string): Optional name for the element, useful when `data(label)` is given to a style's `content` or `label`. It is only a convention.\n - `parent` (string): Only for nodes. Optional reference to another node. Needed to create compound nodes.\n - `source` (string): Only for edges. The id of the source node, which is where the edge starts.\n - `target` (string): Only for edges. The id of the target node, where the edge ends.\n - `position` (dictionary): Only for nodes. The position of the node.\n - `x` (number): The x-coordinate of the node.\n - `y` (number): The y-coordinate of the node.\n - `selected` (boolean): If the element is selected upon initialisation.\n - `selectable` (boolean): If the element can be selected.\n - `locked` (boolean): Only for nodes. If the position is immutable.\n - `grabbable` (boolean): Only for nodes. If the node can be grabbed and moved by the user.\n - `classes` (string): Space separated string of class names of the element. Those classes can be selected by a style selector.\n\n 2. The [official Cytoscape.js documentation](http://js.cytoscape.org/#notation/elements-json) offers an extensive overview and examples of element declaration."
132
+
"description": "A list of dictionaries representing the elements of the networks.\n 1. Each dictionary describes an element, and specifies its purpose.\n - `group` (string): Either 'nodes' or 'edges'. If not given, it's automatically inferred.\n - `data` (dictionary): Element specific data.\n - `id` (string): Reference to the element, useful for selectors and edges. Randomly assigned if not given.\n - `label` (string): Optional name for the element, useful when `data(label)` is given to a style's `content` or `label`. It is only a convention.\n - `parent` (string): Only for nodes. Optional reference to another node. Needed to create compound nodes.\n - `source` (string): Only for edges. The id of the source node, which is where the edge starts.\n - `target` (string): Only for edges. The id of the target node, where the edge ends.\n - `position` (dictionary): Only for nodes. The position of the node.\n - `x` (number): The x-coordinate of the node.\n - `y` (number): The y-coordinate of the node.\n - `selected` (boolean): If the element is selected upon initialisation.\n - `selectable` (boolean): If the element can be selected.\n - `locked` (boolean): Only for nodes. If the position is immutable.\n - `grabbable` (boolean): Only for nodes. If the node can be grabbed and moved by the user.\n - `classes` (string): Space separated string of class names of the element. Those classes can be selected by a style selector.\n\n 2. The [official Cytoscape.js documentation](http://js.cytoscape.org/#notation/elements-json) offers an extensive overview and examples of element declaration.\nAlternatively, a dictionary with the format { 'nodes': [], 'edges': [] } is allowed at initialization, but arrays remain the recommended format.",
Copy file name to clipboardExpand all lines: src/lib/components/Cytoscape.react.js
+4-2Lines changed: 4 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -530,8 +530,9 @@ Cytoscape.propTypes = {
530
530
* - `classes` (string): Space separated string of class names of the element. Those classes can be selected by a style selector.
531
531
*
532
532
* 2. The [official Cytoscape.js documentation](http://js.cytoscape.org/#notation/elements-json) offers an extensive overview and examples of element declaration.
533
+
* Alternatively, a dictionary with the format { 'nodes': [], 'edges': [] } is allowed at initialization, but arrays remain the recommended format.
0 commit comments