react-tag-cloud
Advanced tools
Comparing version 1.0.1 to 1.1.0
@@ -219,3 +219,15 @@ module.exports = | ||
value: function text(word) { | ||
return word.child.props.children; | ||
var text = word.child.props.text; | ||
if (!text) { | ||
var children = word.child.props.children; | ||
if (Array.isArray(children)) { | ||
text = children[0]; | ||
} else { | ||
text = children; | ||
} | ||
} | ||
return text; | ||
} | ||
@@ -222,0 +234,0 @@ }, { |
{ | ||
"name": "react-tag-cloud", | ||
"version": "1.0.1", | ||
"version": "1.1.0", | ||
"description": "Create beautiful tag/word clouds using React", | ||
"keywords": [ | ||
"react-tag-cloud", | ||
"tag-cloud", | ||
"word-cloud", | ||
"d3-cloud", | ||
"react-cloud", | ||
"react-word-cloud", | ||
"react-words", | ||
"react-tags" | ||
], | ||
"main": "dist/TagCloud.js", | ||
@@ -6,0 +16,0 @@ "repository": "https://github.com/IjzerenHein/react-tag-cloud", |
@@ -76,2 +76,3 @@ # react-tag-cloud ☁️ | ||
- [example](./examples/tagCloud/src/App.js) | ||
- [ijzerenhein.nl](http://ijzerenhein.nl/) | ||
@@ -78,0 +79,0 @@ |
@@ -166,3 +166,15 @@ import React, { Component } from 'react'; | ||
text(word) { | ||
return word.child.props.children; | ||
let text = word.child.props.text; | ||
if (!text) { | ||
const children = word.child.props.children; | ||
if (Array.isArray(children)) { | ||
text = children[0]; | ||
} else { | ||
text = children; | ||
} | ||
} | ||
return text; | ||
} | ||
@@ -169,0 +181,0 @@ |
21943
487
88