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 references to Cytoscape.js docs, as well as a description of all
items for the element and style dictionaries in bullet points. Gave an
overview of items for tapNode and tapEdge dictionaries
- id (string; optional): The ID used to identify this component in Dash callbacks
12
-
- className (string; optional): Html Class of the component
13
-
- style (dict; optional): Add inline styles to the root element
14
-
- elements (list; optional): The flat list of Cytoscape elements to be included in the graph, each
15
-
represented as non-stringified JSON.
16
-
- stylesheet (list; optional): The Cytoscape stylesheet as non-stringified JSON. N.b. the prop key is
17
-
stylesheet rather than style, the key used by Cytoscape itself, so as
18
-
to not conflict with the HTML style attribute.
19
-
- layout (dict; optional): The function of a layout is to set the positions on the nodes in the
20
-
graph.
21
-
- pan (dict; optional): The initial panning position of the graph. Make sure to disable viewport
22
-
manipulation options, such as fit, in your layout so that it is not
23
-
overridden when the layout is applied.
24
-
- zoom (number; optional): The initial zoom level of the graph. Make sure to disable viewport
25
-
manipulation options, such as fit, in your layout so that it is not
26
-
overridden when the layout is applied. You can set options.minZoom and
27
-
options.maxZoom to set restrictions on the zoom level.
28
-
- panningEnabled (boolean; optional): Whether panning the graph is enabled, both by user events and programmatically.
29
-
- userPanningEnabled (boolean; optional): Whether user events (e.g. dragging the graph background) are allowed to pan the graph. Programmatic changes to pan are unaffected by this option.
30
-
- minZoom (number; optional): A minimum bound on the zoom level of the graph. The viewport can not be scaled smaller than this zoom level.
11
+
- id (string; optional): The ID used to identify this component in Dash callbacks.
12
+
- className (string; optional): Sets the class name of the element (the value of an element's html
13
+
class attribute).
14
+
- style (dict; optional): Add inline styles to the root element.
15
+
- elements (list; optional): A list of dictionaries representing the elements of the networks. Each
16
+
dictionary describes an element, and specifies its purpose. Keys
17
+
accepted are:
18
+
- `group` (string): Either 'nodes' or 'edges'. If not given, it's automatically inferred.
19
+
- `data` (dictionary): Element specific data.
20
+
- `id` (string): Reference to the element, useful for selectors and edges. Randomly assigned if not given.
21
+
- `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.
22
+
- `parent` (string): Only for nodes. Optional reference to another node. Needed to create compound nodes.
23
+
- `source` (string): Only for edges. The id of the source node, which is where the edge starts.
24
+
- `target` (string): Only for edges. The id of the target node, where the edge ends.
25
+
- `position` (dictionary): Only for nodes. The position of the node.
26
+
- `x` (number): The x-coordinate of the node.
27
+
- `y` (number): The y-coordinate of the node.
28
+
- `selected` (boolean): If the element is selected upon initialisation.
29
+
- `selectable` (boolean): If the element can be selected.
30
+
- `locked` (boolean): Only for nodes. If the position is immutable.
31
+
- `grabbable` (boolean): Only for nodes. If the node can be grabbed and moved by the user.
32
+
- `classes` (string): Space separated string of class names of the element. Those classes can be selected by a style selector.
33
+
34
+
The [official Cytoscape.js documentation](http://js.cytoscape.org/#notation/elements-json)
35
+
offers an extensive overview and examples of element declaration.
36
+
- stylesheet (list; optional): A list of dictionaries representing the styles of the elements. Each
37
+
dictionary requires the following keys:
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
+
- `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.
40
+
41
+
Both [the selector string](http://js.cytoscape.org/#selectors) and
42
+
[the style dictionary](http://js.cytoscape.org/#style/node-body) are
43
+
exhaustively documented in the Cytoscape.js docs. Although methods such
44
+
as `cy.elements(...)` and `cy.filter(...)` are not available, the selector
45
+
string syntax stays the same.
46
+
- layout (dict; optional): A dictionary specifying how to set the position of the elements in your
47
+
graph. * The `'name'` key is required, and indicates which layout (algorithm) to
48
+
use. The layouts available by default are:
49
+
- `random`: Randomly assigns positions
50
+
- `preset`: Assigns position based on the `position` key in element dictionaries
51
+
- `circle`: Single-level circle, with optional radius
52
+
- `concentric`: Multi-level circle, with optional radius
53
+
- `grid`: Square grid, optionally with numbers of `rows` and `cols`
54
+
- `breadthfirst`: Tree structure built using BFS, with optional `roots`
55
+
- `cose`: Force-directed physics simulation
56
+
57
+
The keys accepted by `layout` vary depending on the algorithm, but some
58
+
keys are accepted by all layouts:
59
+
- `fit` (boolean): Whether to render the nodes in order to fit the canvas.
60
+
- `padding` (number): Padding around the sides of the canvas, if fit is enabled.
61
+
- `animate` (boolean): Whether to animate change in position when the layout changes.
62
+
- `animationDuration` (number): Duration of animation in milliseconds, if enabled.
63
+
- `boundingBox` (dictionary): How to constrain the layout in a specific area. Keys accepted are either `x1, y1, x2, y2` or `x1, y1, w, h`, all of which receive a pixel value.
64
+
The complete list of layouts and their accepted options are available
65
+
on the [Cytoscape.js docs](http://js.cytoscape.org/#layouts).
66
+
Note that certain keys are not supported in Dash since the value is a
67
+
JavaScript function or a callback. Please visit [this issue](https://github.com/plotly/dash-cytoscape/issues/25)
68
+
for more information.
69
+
- pan (dict; optional): Dictionary indicating the initial panning position of the graph. The
70
+
following keys are accepted:
71
+
- `x` (number): The x-coordinate of the position.
72
+
- `y` (number): The y-coordinate of the position.
73
+
- zoom (number; optional): The initial zoom level of the graph. You can set `minZoom` and
74
+
`maxZoom` to set restrictions on the zoom level.
75
+
- panningEnabled (boolean; optional): Whether panning the graph is enabled (i.e., the position of the graph is
76
+
mutable overall).
77
+
- userPanningEnabled (boolean; optional): Whether user events (e.g. dragging the graph background) are allowed to
78
+
pan the graph.
79
+
- minZoom (number; optional): A minimum bound on the zoom level of the graph. The viewport can not be
80
+
scaled smaller than this zoom level.
31
81
- maxZoom (number; optional): A maximum bound on the zoom level of the graph. The viewport can not be
32
82
scaled larger than this zoom level.
33
-
- zoomingEnabled (boolean; optional): Whether zooming the graph is enabled, both by user events and programmatically.
34
-
- userZoomingEnabled (boolean; optional): Whether user events (e.g. dragging the graph background) are allowed to pan the graph. Programmatic changes to pan are unaffected by this option.
35
-
- boxSelectionEnabled (boolean; optional): Whether box selection (i.e. drag a box overlay around, and release it to select) is enabled. If enabled, the user must taphold to pan the graph.
36
-
- autoungrabify (boolean; optional): Whether nodes should be ungrabified (not grabbable by user) by default (if true, overrides individual node state).
37
-
- autolock (boolean; optional): Whether nodes should be locked (not draggable at all) by default (if true, overrides individual node state).
38
-
- autounselectify (boolean; optional): Whether nodes should be unselectified (immutable selection state) by default (if true, overrides individual element state).
39
-
- autoRefreshLayout (boolean; optional): Whether the layout should be refreshed when elements are added or removed
40
-
- tapNode (dict; optional): The trimmed node object returned when you tap a node
41
-
- tapNodeData (dict; optional): The data property of the node object returned when you tap a node
42
-
- tapEdge (dict; optional): The trimmed edge object returned when you tap a node
43
-
- tapEdgeData (dict; optional): The data property of the edge object returned when you tap a node
44
-
- mouseoverNodeData (dict; optional): The data property of the edge object returned when you hover over a node
45
-
- mouseoverEdgeData (dict; optional): The data property of the edge object returned when you hover over an edge
46
-
- selectedNodeData (list; optional): The array of node data currently selected by taps and boxes
47
-
- selectedEdgeData (list; optional): The array of edge data currently selected by taps and boxes
83
+
- zoomingEnabled (boolean; optional): Whether zooming the graph is enabled (i.e., the zoom level of the graph
84
+
is mutable overall).
85
+
- userZoomingEnabled (boolean; optional): Whether user events (e.g. dragging the graph background) are allowed
86
+
to pan the graph.
87
+
- boxSelectionEnabled (boolean; optional): Whether box selection (i.e. drag a box overlay around, and release it
88
+
to select) is enabled. If enabled, the user must taphold to pan the graph.
89
+
- autoungrabify (boolean; optional): Whether nodes should be ungrabified (not grabbable by user) by
0 commit comments