https://github.com/do-me/d3wordcloud
A simple Jupyter (Lab/Notebook) wrapper of Jason Davies d3 JS wordcloud generator https://www.jasondavies.com/wordcloud/
https://github.com/do-me/d3wordcloud
d3 d3js dataviz svg wordcloud wordcloud-generator wordcloud-visualization
Last synced: 22 days ago
JSON representation
A simple Jupyter (Lab/Notebook) wrapper of Jason Davies d3 JS wordcloud generator https://www.jasondavies.com/wordcloud/
- Host: GitHub
- URL: https://github.com/do-me/d3wordcloud
- Owner: do-me
- License: mit
- Created: 2022-09-22T10:41:13.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-10-06T14:06:04.000Z (over 2 years ago)
- Last Synced: 2025-04-13T13:15:35.585Z (22 days ago)
- Topics: d3, d3js, dataviz, svg, wordcloud, wordcloud-generator, wordcloud-visualization
- Language: Python
- Homepage:
- Size: 137 KB
- Stars: 3
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# d3wordcloud
A simple Jupyter (Lab/Notebook) wrapper of Jason Davies d3 JS wordcloud generator https://www.jasondavies.com/wordcloud/
## Installation
`pip install d3wordcloud`## Usage
Displays the interactive SVG wordcloud right in your Jupyter Notebook (or Jupyter Lab).```python
import d3wordcloud as d3wc
d3wc.display_wordcloud(sample_data, show_settings=False)
```
- `sample_data` is a space-separated string, e.g. `"energy fossil fuel EU"`
- `show_settings` shows the original settings for interactive control in your notebook, just like in the [original version](https://www.jasondavies.com/wordcloud/)
## Settings
If you'd like to use all the customization the library offers, either use the manual mode or build a modified wheel yourself.
For the manual mode, simply copy the `manual` folder with the two files to your working directory and edit the html template directly.## Building the installable Python wheel yourself
1. `git clone https://github.com/do-me/d3wordcloud.git`
2. `cd d3wordcloud`
3. `python setup.py sdist`
4. `tar tzf dist/d3wordcloud-0.0.1.tar.gz`
5. `python setup.py bdist_wheel sdist`
6. `cd dist`
7. `pip install d3wordcloud-0.0.1-py3-none-any.whl`Uninstalling is as easy as
`pip uninstall d3wordcloud-0.0.1-py3-none-any.whl`
## Troubleshooting
If you are using a virtual env (like conda env) and the wordcloud SVG is not showing it is probably related to a [Jupyter bug](https://github.com/jupyter-widgets/ipywidgets/issues/2257). A possible workaround is [working in just one notebook at a time](https://github.com/jupyter-widgets/ipywidgets/issues/2257#issuecomment-1270112153)## To Do
- Port all the settings for full control in Python.