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

makeupsomething/vue-d3-cloud

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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>

About

A word cloud component using d3-cloud

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published