Skip to content

Commit 77d26a9

Browse files
committed
edits
1 parent ab5f0d6 commit 77d26a9

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

CYLEAFLET.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,24 +23,27 @@ Under the hood, an instance of CyLeaflet consists of:
2323

2424
## Files
2525

26-
CyLeaflet functionality is dimplemented in the following files:
26+
CyLeaflet functionality is implemented in the following files:
2727

2828
1. `dash_cytoscape/CyLeaflet.py`: CyLeaflet class definition, instantiation of underlying Cytoscape and Leaflet components, layout and styling to align the two canvases, and registration of clientside callbacks
2929
2. `src/lib/cyleaflet_clientside.js`: Clientside callback function implementations
3030

3131

3232
## Callbacks
3333

34+
![fig2](img/cyleaflet-callbacks.png)
35+
36+
3437
The following callbacks are used by CyLeaflet:
3538

3639
- **Synchronize Leaflet view with Cytoscape view**
37-
- Input: Cytoscape extent property
38-
- Output: Leaflet viewport property
40+
- Input: Cytoscape `extent` property
41+
- Outputs: Leaflet `viewport` property, Leaflet `invalidateSize` property
3942

40-
Purpose: Ensures that the nodes remain in the same places on the map whenever the view is zoomed or dragged. Whenever the Cytoscape view changes, this callback updates the Leaflet view to match.An additional output, the Leaflet invalidateSize property, ensures the map gets refreshed properly.
43+
Purpose: Ensures that the nodes remain in the same places on the map whenever the view is zoomed or dragged. Whenever the Cytoscape view changes, this callback updates the Leaflet view to match. An additional output, the Leaflet `invalidateSize` property, ensures the map gets refreshed properly.
4144

4245
- **Update Cytoscape graph elements**
4346
- Input: dcc.Store `data` property
4447
- Output: Cytoscape `elements` property
4548

46-
Purpose: Provides a way for the Dash developer to update the graph elements displayed in Cytoscape. This callback transforms the lat and lon coordinates specified in the node data into a corresponding (x, y) canvas position that will align with the map.Updating the Cytoscape nodes directly does not work, because this skips the transformation step, and the nodes will not appear in the correct map positions.
49+
Purpose: Provides a way for the Dash developer to update the graph elements displayed in Cytoscape. This callback transforms the `lat` and `lon` coordinates specified in the node data into a corresponding (x, y) canvas position that will align with the map. Updating the Cytoscape nodes directly does not work, because this skips the transformation step, and the nodes will not appear in the correct map positions.

0 commit comments

Comments
 (0)