Skip to content

Commit 24ebde1

Browse files
committed
Round arrows
1 parent 805b59b commit 24ebde1

File tree

5 files changed

+16
-13
lines changed

5 files changed

+16
-13
lines changed

labextension/vpython/src/glowcommlab.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -477,7 +477,7 @@ var attrsb = {'a':'userzoom', 'b':'userspin', 'c':'range', 'd':'autoscale', 'e':
477477
'p':'left', 'q':'right', 'r':'top', 's':'bottom', 't':'_cloneid',
478478
'u':'logx', 'v':'logy', 'w':'dot', 'x':'dot_radius',
479479
'y':'markers', 'z':'legend', 'A':'label','B':'delta', 'C':'marker_color',
480-
'D':'size_units', 'E':'userpan', 'F':'scroll', 'G':'choices', 'H':'depth'}
480+
'D':'size_units', 'E':'userpan', 'F':'scroll', 'G':'choices', 'H':'depth', 'I':'round'}
481481

482482
// methods are X in {'m': '23X....'}
483483
var methods = {'a':'select', 'b':'pos', 'c':'start', 'd':'stop', 'f':'clear', // unused eghijklmnopvxyzCDFAB

vpython/vpython.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@
9797
'right':'q', 'top':'r', 'bottom':'s', '_cloneid':'t',
9898
'logx':'u', 'logy':'v', 'dot':'w', 'dot_radius':'x',
9999
'markers':'y', 'legend':'z', 'label':'A', 'delta':'B', 'marker_color':'C',
100-
'size_units':'D', 'userpan':'E', 'scroll':'F'}
100+
'size_units':'D', 'userpan':'E', 'scroll':'F', 'choices':'G', 'depth':'H', 'round':'I'}
101101

102102
# methods are X in {'m': '23X....'}
103103
# pos is normally updated as an attribute, but for interval-based trails, it is updated (multiply) as a method
@@ -488,7 +488,7 @@ class standardAttributes(baseObj):
488488
'shininess', 'emissive', 'texture', 'frame', 'material',
489489
'make_trail', 'trail_type', 'interval',
490490
'retain', 'trail_color', 'trail_radius', 'texture',
491-
'shaftwidth', 'headwidth', 'headlength', 'pickable'],
491+
'round', 'shaftwidth', 'headwidth', 'headlength', 'pickable'],
492492
['red', 'green', 'blue','length', 'width', 'height']],
493493
'ring':[['pos', 'color', 'trail_color', 'size'],
494494
['axis', 'up'],
@@ -1242,12 +1242,20 @@ class arrow(standardAttributes):
12421242
def __init__(self, **args):
12431243
args['_default_size'] = vector(1,0.2,0.2)
12441244
args['_objName'] = "arrow"
1245+
self._round = False
12451246
self._shaftwidth = 0
12461247
self._headwidth = 0
12471248
self._headlength = 0
12481249

12491250
super(arrow, self).setup(args)
12501251

1252+
@property
1253+
def round(self):
1254+
return self._round
1255+
@round.setter
1256+
def round(self,value):
1257+
raise AttributeError('Cannot change the "round" attribute of an arrow.')
1258+
12511259
@property
12521260
def shaftwidth(self):
12531261
return self._shaftwidth

vpython/vpython_libraries/glow.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vpython/vpython_libraries/glowcomm.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,7 @@
399399
'p':'left', 'q':'right', 'r':'top', 's':'bottom', 't':'_cloneid',
400400
'u':'logx', 'v':'logy', 'w':'dot', 'x':'dot_radius',
401401
'y':'markers', 'z':'legend', 'A':'label','B':'delta', 'C':'marker_color',
402-
'D':'size_units', 'E':'userpan', 'F':'scroll', 'G':'choices', 'H':'depth'}
402+
'D':'size_units', 'E':'userpan', 'F':'scroll', 'G':'choices', 'H':'depth', 'I':'round'}
403403

404404
// methods are X in {'m': '23X....'}
405405
var methods = {'a':'select', 'b':'pos', 'c':'start', 'd':'stop', 'f':'clear', // unused eghijklmnopvxyzCDFAB

vpython/vpython_libraries/glowcomm.js

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,8 @@ IPython.notebook.kernel.comm_manager.register_target('glow',
3636
} else {
3737
new_uri = "ws:";
3838
}
39-
if (document.location.hostname.includes("localhost")){
40-
url = "ws://localhost:" + port + uri;
41-
}
42-
else {
43-
new_uri += '//' + document.location.host + service_url;
44-
url = new_uri
45-
}
39+
new_uri += '//' + document.location.host + service_url;
40+
url = new_uri
4641
ws = new WebSocket(url);
4742
ws.binaryType = "arraybuffer";
4843

@@ -449,7 +444,7 @@ var attrsb = {'a':'userzoom', 'b':'userspin', 'c':'range', 'd':'autoscale', 'e':
449444
'p':'left', 'q':'right', 'r':'top', 's':'bottom', 't':'_cloneid',
450445
'u':'logx', 'v':'logy', 'w':'dot', 'x':'dot_radius',
451446
'y':'markers', 'z':'legend', 'A':'label','B':'delta', 'C':'marker_color',
452-
'D':'size_units', 'E':'userpan', 'F':'scroll', 'G':'choices', 'H':'depth'}
447+
'D':'size_units', 'E':'userpan', 'F':'scroll', 'G':'choices', 'H':'depth', 'I':'round'}
453448

454449
// methods are X in {'m': '23X....'}
455450
var methods = {'a':'select', 'b':'pos', 'c':'start', 'd':'stop', 'f':'clear', // unused eghijklmnopvxyzCDFAB

0 commit comments

Comments
 (0)