Skip to content

Commit

Permalink
WIP resize based on parent cell, works for dashboard, not for notebook
Browse files Browse the repository at this point in the history
…jupyter-incubator#59

(c) Copyright IBM Corp. 2016
  • Loading branch information
peller committed Aug 18, 2016
1 parent 7d8bcf7 commit 903b7f0
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions urth-viz-explorer.html
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,15 @@
},

_resize: function() {
// Measure the parent Jupyter Notebook cell, if any
// NOTE: JQuery dependency as well as Jupyter
var cellSize = $(this).parents('.cell').first().css(['height', 'width']);
if (cellSize) {
this.style.width = cellSize.width;
this.style.height = cellSize.height;
}

// Resize the child urth-viz-vega widget
var vega = this.$$('urth-viz-vega');
if (vega) vega._resize();
},
Expand Down

0 comments on commit 903b7f0

Please sign in to comment.