Skip to content

Commit

Permalink
remove workaround for vega height bug
Browse files Browse the repository at this point in the history
Related to #31461
  • Loading branch information
alexwizp committed Jul 22, 2020
1 parent d56a0fa commit bd26897
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 3 additions & 7 deletions src/plugins/vis_type_vega/public/vega_view/vega_base_view.js
Original file line number Diff line number Diff line change
Expand Up @@ -195,13 +195,9 @@ export class VegaBaseView {
const width = Math.max(0, this._$container.width() - this._parser.paddingWidth);
const height =
Math.max(0, this._$container.height() - this._parser.paddingHeight) - heightExtraPadding;
// Somehow the `height` signal in vega becomes zero if the height is set exactly to
// an even number. This is a dirty workaround for this.
// when vega itself is updated again, it should be checked whether this is still
// necessary.
const adjustedHeight = height + 0.00000001;
if (view.width() !== width || view.height() !== adjustedHeight) {
view.width(width).height(adjustedHeight);

if (view.width() !== width || view.height() !== height) {
view.width(width).height(height);
return true;
}
return false;
Expand Down

0 comments on commit bd26897

Please sign in to comment.