Skip to content
This repository has been archived by the owner on Mar 2, 2022. It is now read-only.

Latest commit

 

History

History
41 lines (34 loc) · 803 Bytes

README.md

File metadata and controls

41 lines (34 loc) · 803 Bytes

vue-d3-cloud

A Vue implementation of react-d3-cloud

Installation

npm install vue-d3-cloud --save

Usage

//App.vue
<template>
  <div id="app">
    <cloud :data="words" :fontSizeMapper="fontSizeMapper" />
  </div>
</template>

<script>
import Cloud from 'vue-d3-cloud'

export default {
    name: 'app',
    data() {
        return {
            words: [
                { text: 'Vue', value: 1000 },
                { text: 'js', value: 200 },
                { text: 'is', value: 800 },
                { text: 'very cool', value: 1000000 },
                { text: 'lunch', value: 100 },
            ],
            fontSizeMapper: word => Math.log2(word.value) * 5,
        }
    },
    components: {
        Cloud,
    },
}
</script>