add ability to override graph size measurements

This commit is contained in:
Mike Greiling 2018-02-22 01:57:50 -06:00
parent ab9ad2db4f
commit 44b8348d58
No known key found for this signature in database
GPG key ID: 0303DF507FA67596
2 changed files with 12 additions and 1 deletions

View file

@ -26,6 +26,11 @@
required: false,
default: true,
},
forceSmallGraph: {
type: Boolean,
required: false,
default: false,
},
documentationPath: {
type: String,
required: true,
@ -165,6 +170,7 @@
:project-path="projectPath"
:tags-path="tagsPath"
:show-legend="showLegend"
:small-graph="forceSmallGraph"
/>
</graph-group>
</div>

View file

@ -57,6 +57,11 @@
required: false,
default: true,
},
smallGraph: {
type: Boolean,
required: false,
default: false,
},
},
data() {
@ -135,7 +140,7 @@
const breakpointSize = bp.getBreakpointSize();
const query = this.graphData.queries[0];
this.margin = measurements.large.margin;
if (breakpointSize === 'xs' || breakpointSize === 'sm') {
if (this.smallGraph || breakpointSize === 'xs' || breakpointSize === 'sm') {
this.graphHeight = 300;
this.margin = measurements.small.margin;
this.measurements = measurements.small;