Open louisyu1234 opened 1 year ago
from pyvis.network import Network net = Network('500', '50%',notebook=True,cdn_resources='remote') net.toggle_physics(True) net.set_options("""var options = { "manipulation": { "enabled": true, "initiallyActive": false "editNode": true } net.add_node(1, label="Node 1",color='green') net.add_node(2, label="Node 2",color='red') net.add_edge(1,2) net.show('mygraph.html')
when I run it, it throw a error:
net.set_options("""var options = { self.options = self.options.set(options) options = json.loads(options) return _default_decoder.decode(s) obj, end = self.raw_decode(s, idx=_w(s, 0).end()) obj, end = self.scan_once(s, idx) json.decoder.JSONDecodeError: Expecting ',' delimiter: line 1 column 56 (char 55)
Who can help me? Thx
Looks like you missed comma in line with "initiallyActive" and some brackets. Try this:
net.set_options("""var options = { "manipulation": { "enabled": true, "initiallyActive": false, "editNode": true } } """)
from pyvis.network import Network net = Network('500', '50%',notebook=True,cdn_resources='remote') net.toggle_physics(True) net.set_options("""var options = { "manipulation": { "enabled": true, "initiallyActive": false "editNode": true } net.add_node(1, label="Node 1",color='green') net.add_node(2, label="Node 2",color='red') net.add_edge(1,2) net.show('mygraph.html')
when I run it, it throw a error:
net.set_options("""var options = { self.options = self.options.set(options) options = json.loads(options) return _default_decoder.decode(s) obj, end = self.raw_decode(s, idx=_w(s, 0).end()) obj, end = self.scan_once(s, idx) json.decoder.JSONDecodeError: Expecting ',' delimiter: line 1 column 56 (char 55)
Who can help me? Thx