Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
SeregPie committed Jun 2, 2020
1 parent 59f2b62 commit 0efc3bd
Showing 1 changed file with 6 additions and 15 deletions.
21 changes: 6 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,12 @@ Generates a cloud out of the words.

[Try it out!](https://seregpie.github.io/VueWordCloud/)

## dependencies

- [Vue](https://github.com/vuejs/vue)

## setup

### npm

```shell
npm install vuewordcloud
npm i vuewordcloud
```

### ES module
Expand All @@ -40,7 +36,6 @@ export default {
components: {
[VueWordCloud.name]: VueWordCloud,
},
// ...
};
```

Expand All @@ -51,12 +46,16 @@ export default {
<script src="https://unpkg.com/vuewordcloud"></script>
```

If Vue is detected, the component will be registered automatically.
The component is globally available as `VueWordCloud`. If Vue is detected, the component will be registered automatically.

## usage

```html
<vue-word-cloud
style="
height: 480px;
width: 640px;
"
:words="[['romance', 19], ['horror', 3], ['fantasy', 7], ['adventure', 3]]"
:color="([, weight]) => weight > 10 ? 'DeepPink' : weight > 5 ? 'RoyalBlue' : 'Indigo'"
font-family="Roboto"
Expand Down Expand Up @@ -170,11 +169,3 @@ let createWorker = function(code) {
| event | description |
| ---: | :--- |
| `update:progress` | The current progress of the cloud words computation. |

## todo

- An option to customize the animation order of the cloud words by weight, font size and distance from center.
- An option to privide an array of colors to colorize the cloud words by weight, font size and distance from center.
- Prevent the recomputing of cloud words when changing color only.
- An option to switch between canvas and dom renderer.
- Speed up the computing of cloud words and improve the placing by reducing the image pixels.

0 comments on commit 0efc3bd

Please sign in to comment.