From 33ee86aa975ad83f580206415be3e23871fd9f3e Mon Sep 17 00:00:00 2001 From: Anya Wallace Date: Mon, 25 Apr 2022 15:53:47 -0700 Subject: [PATCH 1/2] #161: Fix vega chart responsiveness --- app/src/assets/css/modules/_vega.scss | 8 +++++++- app/src/components/explorer/VegaLiteWrapper.vue | 6 ++++++ nginx/default.conf | 6 +++--- 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/app/src/assets/css/modules/_vega.scss b/app/src/assets/css/modules/_vega.scss index dad80d7b..d35f4397 100644 --- a/app/src/assets/css/modules/_vega.scss +++ b/app/src/assets/css/modules/_vega.scss @@ -1,6 +1,9 @@ .vega { &-view{ - margin: 2.5rem + margin: 2.5rem; + .md-layout-item { + height: fit-content; + } } &-tabs{ height:100% !important; @@ -38,6 +41,9 @@ &-chartview{ margin-top:5rem } + .chart-wrapper { + width: fit-content; + } } } diff --git a/app/src/components/explorer/VegaLiteWrapper.vue b/app/src/components/explorer/VegaLiteWrapper.vue index d816f63a..0af9da2c 100644 --- a/app/src/components/explorer/VegaLiteWrapper.vue +++ b/app/src/components/explorer/VegaLiteWrapper.vue @@ -92,11 +92,17 @@ export default { } this.$emit('new-vega-view', result.view) this.renderError = false + this.alignVegaTooltips() } catch (ex) { console.error('Error while rendering vega-lite specification', ex) this.renderError = true } }, + alignVegaTooltips () { + const canvas = document.getElementsByClassName('marks')[0] + const vegaBindings = document.getElementsByClassName('vega-bindings')[0] + vegaBindings.style.width = canvas.style.width + }, validateSpec (versionNum) { try { const validation = jsonValidate(this.spec, vegaLiteVersions[versionNum].schema) diff --git a/nginx/default.conf b/nginx/default.conf index ea59214b..52c6d3eb 100644 --- a/nginx/default.conf +++ b/nginx/default.conf @@ -39,9 +39,9 @@ server { send_timeout 1500; } - location /whyis { - rewrite /whyis/(.*) /$1 break; - proxy_pass http://whyis; + # location /whyis { + # rewrite /whyis/(.*) /$1 break; + # proxy_pass http://whyis; location /storage { sendfile on; keepalive_timeout 60; From c706b796e4ebdcb37c43c059426cd94afa2dc7f2 Mon Sep 17 00:00:00 2001 From: Anya Wallace Date: Fri, 29 Apr 2022 16:58:53 -0700 Subject: [PATCH 2/2] #161: Uncommented and added curly brace to match previous commits --- nginx/default.conf | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/nginx/default.conf b/nginx/default.conf index 52c6d3eb..9dae26d8 100644 --- a/nginx/default.conf +++ b/nginx/default.conf @@ -39,9 +39,11 @@ server { send_timeout 1500; } - # location /whyis { - # rewrite /whyis/(.*) /$1 break; - # proxy_pass http://whyis; + location /whyis { + rewrite /whyis/(.*) /$1 break; + proxy_pass http://whyis; + } + location /storage { sendfile on; keepalive_timeout 60;