File tree 4 files changed +51
-7
lines changed
4 files changed +51
-7
lines changed Original file line number Diff line number Diff line change @@ -1398,7 +1398,9 @@ function useJsonPatchCallback(initial) {
1398
1398
// We CANNOT mutate the part of the document because React checks some
1399
1399
// attributes of the model (e.g. model.attributes.style is checked for
1400
1400
// identity).
1401
- doc . current = applyNonMutativePatch ( doc , patch ) ;
1401
+ doc . current = applyNonMutativePatch (
1402
+ doc . current ,
1403
+ patch ) ;
1402
1404
} else {
1403
1405
// We CAN mutate the document here though because we know that nothing above
1404
1406
// The patch `path` is changing. Thus, maintaining the identity for that section
Original file line number Diff line number Diff line change
1
+ import idom
2
+
3
+
4
+ react_cytoscapejs = idom .web .module_from_template (
5
+ # we need to use this template because react-cytoscapejs uses a default export
6
+ "react-default" ,
7
+ "react-cytoscapejs" ,
8
+ fallback = "⌛" ,
9
+ )
10
+ Cytoscape = idom .web .export (react_cytoscapejs , "default" )
11
+
12
+
13
+ @idom .component
14
+ def CytoscapeGraph ():
15
+ return Cytoscape (
16
+ {
17
+ "style" : {"width" : "100%" , "height" : "200px" },
18
+ "elements" : [
19
+ {
20
+ "data" : {"id" : "one" , "label" : "Node 1" },
21
+ "position" : {"x" : 100 , "y" : 100 },
22
+ },
23
+ {
24
+ "data" : {"id" : "two" , "label" : "Node 2" },
25
+ "position" : {"x" : 200 , "y" : 100 },
26
+ },
27
+ {
28
+ "data" : {
29
+ "source" : "one" ,
30
+ "target" : "two" ,
31
+ "label" : "Edge from Node1 to Node2" ,
32
+ }
33
+ },
34
+ ],
35
+ }
36
+ )
37
+
38
+
39
+ idom .run (CytoscapeGraph )
Original file line number Diff line number Diff line change @@ -70,17 +70,17 @@ A package for building responsive user interfaces in pure Python.
70
70
71
71
.. grid-item-card ::
72
72
73
- .. interactive-widget :: slideshow
73
+ .. interactive-widget :: cytoscape
74
74
:no-activate-button:
75
75
76
76
.. grid-item-card ::
77
77
78
- .. interactive-widget :: audio_player
78
+ .. interactive-widget :: slideshow
79
79
:no-activate-button:
80
80
81
81
.. grid-item-card ::
82
82
83
- .. interactive-widget :: todo
83
+ .. interactive-widget :: audio_player
84
84
:no-activate-button:
85
85
86
86
.. grid-item ::
@@ -93,8 +93,6 @@ A package for building responsive user interfaces in pure Python.
93
93
.. interactive-widget :: simple_dashboard
94
94
:no-activate-button:
95
95
96
-
97
-
98
96
.. grid-item-card ::
99
97
100
98
.. interactive-widget :: matplotlib_plot
@@ -104,3 +102,8 @@ A package for building responsive user interfaces in pure Python.
104
102
105
103
.. interactive-widget :: material_ui_button_on_click
106
104
:no-activate-button:
105
+
106
+ .. grid-item-card ::
107
+
108
+ .. interactive-widget :: todo
109
+ :no-activate-button:
You can’t perform that action at this time.
0 commit comments