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(() => {
this.view.signal('width', this.state.bounds.width - 70);
this.view.signal('height', 0.4 * (this.state.bounds.width - 70)); // 5:2 aspect ratio
this.view.signal('width', this.state.bounds.width - 90);
this.view.signal('height', 0.4 * (this.state.bounds.width - 90)); // 5:2 aspect ratio
this.view.run();
}, 100);

View File

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