Skip to content

Commit

Permalink
Merge pull request #286 from pkgw/more-jlab-3
Browse files Browse the repository at this point in the history
frontend/package.json: proclaim compatibility with @jupyter-widgets/base 4.x
  • Loading branch information
pkgw authored Jan 26, 2021
2 parents e3c3e99 + 1778382 commit b3844e2
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
2 changes: 1 addition & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"url": "https://github.com/WorldWideTelescope/pywwt/issues"
},
"dependencies": {
"@jupyter-widgets/base": "^2 || ^3",
"@jupyter-widgets/base": "^2 || ^3 || ^4",
"underscore": "^1"
},
"description": "AAS WorldWide Telescope from Python",
Expand Down
13 changes: 11 additions & 2 deletions pywwt/annotation.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,16 @@ def __init__(self, parent=None, **kwargs):

self.parent._send_msg(event='annotation_create',
id=self.id, shape=self.shape)
super(Annotation, self).__init__(**kwargs)

# Normally we would pass the kwargs off to super().__init__(), but it
# seems that doing so bypasses the validation functions, which (at a
# minimum) causes problems for circles because it doesn't normalize
# their radius measurements to the proper units. Just apply the settings
# manually, which invokes the validation machinery properly.
super(Annotation, self).__init__()

for k, v in kwargs.items():
setattr(self, k, v)

self.parent._annotation_set.add(self)

Expand Down Expand Up @@ -103,7 +112,7 @@ class Circle(Annotation):
line_width = AstropyQuantity(1 * u.pixel,
help='Assigns line width in pixels '
'(:class:`~astropy.units.Quantity`)').tag(wwt='lineWidth')
radius = AstropyQuantity(80 * u.pixel,
radius = AstropyQuantity(1 * u.degree,
help='Sets the radius for the circle '
'(:class:`~astropy.units.Quantity`)').tag(wwt='radius')

Expand Down

0 comments on commit b3844e2

Please sign in to comment.