Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dynamical height parameter #59

Merged
merged 1 commit into from
May 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 0 additions & 10 deletions ipyaladin/aladin_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,16 +172,6 @@ def __init__(self, **kwargs):
# see: http://jupyter-notebook.readthedocs.io/en/latest/comms.html
self.on_msg(self.handle_aladin_event)

@observe("height")
def _immutable_height(self, change):
"""Inform the users that height is immutable outside of instantiation.
"""
# change["old"] is None when doing the instantiation, and has an other value
# at every other times
if change["old"] != None:
raise UserWarning("height cannot be changed outside of the instantiation"
" of an Aladin() object.")

# Note: (about the classe's functions)
# As it is only possible to communicate with the js side of the application by using traitlets,
# we can not directly call a js function from the python side
Expand Down
4 changes: 4 additions & 0 deletions js/lib/jupyter-aladin.js
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,10 @@ export class AladinView extends DOMWidgetView {
this.listenTo(this.model, 'change:coo_frame', () => {
this.al.setFrame(this.model.get('coo_frame'));
}, this);
this.listenTo(this.model, 'change:height', () => {
let height = this.model.get('height');
this.div.setAttribute("style","width:100%;height:" + height + "px;");
}, this);
this.listenTo(this.model, 'change:survey', () => {
this.al.setImageSurvey(this.model.get('survey'));
}, this);
Expand Down