-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(dash): Topsheet + Pie are more or less working
- Loading branch information
Showing
7 changed files
with
190 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
<template lang="pug"> | ||
vue-plotly(:data="data" :layout="layout" :options="options") | ||
|
||
</template> | ||
|
||
<script lang="ts"> | ||
import { Vue, Component, Watch, Prop } from 'vue-property-decorator' | ||
import VuePlotly from '@statnett/vue-plotly' | ||
import { FileSystemConfig } from '@/Globals' | ||
import truncate from '@turf/truncate' | ||
const mockData = { | ||
car: 34, | ||
bike: 18, | ||
pt: 30, | ||
walk: 8, | ||
} | ||
@Component({ components: { VuePlotly } }) | ||
export default class VueComponent extends Vue { | ||
@Prop({ required: true }) fileSystemConfig!: FileSystemConfig | ||
@Prop({ required: true }) subfolder!: string | ||
@Prop({ required: true }) files!: string[] | ||
@Prop({ required: true }) config!: any | ||
private mounted() { | ||
this.$emit('isLoaded') | ||
} | ||
private layout = { | ||
height: 300, | ||
// width: 500, | ||
margin: { t: 30, b: 5, l: 0, r: 0 }, | ||
} | ||
private data = [ | ||
{ | ||
// title: 'hello', | ||
labels: Object.keys(mockData), | ||
values: Object.values(mockData), | ||
type: 'pie', | ||
hole: 0.3, | ||
textinfo: 'label+percent', | ||
textposition: 'inside', | ||
automargin: true, | ||
}, | ||
] | ||
private options = { | ||
displaylogo: false, | ||
responsive: true, | ||
modeBarButtonsToRemove: [ | ||
'pan2d', | ||
'zoom2d', | ||
'select2d', | ||
'lasso2d', | ||
'zoomIn2d', | ||
'zoomOut2d', | ||
'autoScale2d', | ||
'hoverClosestCartesian', | ||
'hoverCompareCartesian', | ||
'resetScale2d', | ||
'toggleSpikelines', | ||
'resetViewMapbox', | ||
], | ||
toImageButtonOptions: { | ||
format: 'svg', // one of png, svg, jpeg, webp | ||
filename: 'incidenceByAgeGroupOverTime', | ||
width: 800, | ||
height: 800, | ||
scale: 1.0, // Multiply title/legend/axis/canvas sizes by this factor | ||
}, | ||
} | ||
} | ||
</script> | ||
|
||
<style scoped lang="scss"> | ||
@import '@/styles.scss'; | ||
@media only screen and (max-width: 640px) { | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters