fixed graph size

fixes #112
main
Joost Wooning 2022-03-15 17:18:44 +01:00
parent 18b21025d9
commit b6a44d6d81
2 changed files with 11 additions and 8 deletions

View File

@ -138,8 +138,9 @@ export default class CanGraph extends Component {
} }
updateBounds = debounce(() => { updateBounds = debounce(() => {
this.view.signal('width', this.state.bounds.width - 70); this.view.signal('width', this.state.bounds.width - 90);
this.view.signal('height', 0.4 * (this.state.bounds.width - 70)); // 5:2 aspect ratio this.view.signal('height', 0.4 * (this.state.bounds.width - 90)); // 5:2 aspect ratio
this.view.run(); this.view.run();
}, 100); }, 100);

View File

@ -1,12 +1,13 @@
export default { export default {
"$schema": "https://vega.github.io/schema/vega/v5.json", "$schema": "https://vega.github.io/schema/vega/v5.json",
"width": 400, "width": 500,
"height": 200, "height": 212,
"autosize": "none",
"padding": { "padding": {
"top": 5, "top": 5,
"left": 30, "left": 70,
"right": 5, "right": 20,
"bottom": 10 "bottom": 20
}, },
"data": [ "data": [
{ {
@ -121,7 +122,8 @@ export default {
}, },
{ {
"orient": "left", "orient": "left",
"scale": "yscale" "scale": "yscale",
"format": ".6~g"
} }
], ],