Skip to content

Instantly share code, notes, and snippets.

@simonwuyts
Created March 29, 2019 07:56
Show Gist options
  • Save simonwuyts/810634e3f57c3673e7d756b07d2f7e02 to your computer and use it in GitHub Desktop.
Save simonwuyts/810634e3f57c3673e7d756b07d2f7e02 to your computer and use it in GitHub Desktop.
<template>
<svg width="500" height="500">
</svg>
</template>
<script>
export default {
data() {
return {
flowers: [
{
name: 'Roses',
amount: 25,
color: '#cc2936'
},
{
name: 'Tulips',
amount: 40,
color: '#f2c640'
},
{
name: 'Daisies',
amount: 15,
color: '#2a93d4'
},
{
name: 'Narcissuses',
amount: 9,
color: '#F7AD0A'
}
]
}
},
computed: {
transformedFlowerData() {
return {
name: 'Top Level',
children: this.flowers.map(flower => ({
...flower,
parent: 'Top Level'
}))
}
}
}
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment