All Projects → guo-yong-zhi → WordCloud.jl

guo-yong-zhi / WordCloud.jl

Licence: MIT License
word cloud generator in julia

Programming Languages

julia
2034 projects
Jupyter Notebook
11667 projects

Projects that are alternatives of or similar to WordCloud.jl

D3 Cloud
Create word clouds in JavaScript.
Stars: ✭ 3,460 (+5142.42%)
Mutual labels:  wordcloud, layout-algorithm
ComputeShaderBVHMeshHit
Unity ComputeShader implementation of BVH(Bounding Volume Hierarchy) based mesh hit checking.
Stars: ✭ 25 (-62.12%)
Mutual labels:  collision-detection
Libbulletjme
A JNI interface to Bullet Physics and V-HACD
Stars: ✭ 55 (-16.67%)
Mutual labels:  collision-detection
blog
I wonder how~, I wonder why~
Stars: ✭ 30 (-54.55%)
Mutual labels:  collision-detection
parry
2D and 3D collision-detection library for Rust.
Stars: ✭ 267 (+304.55%)
Mutual labels:  collision-detection
golq
📡 2D locality queries in Go
Stars: ✭ 28 (-57.58%)
Mutual labels:  collision-detection
Rectangle-Bin-Packing
👜 Haxe algorithms for 2D rectangular bin packing
Stars: ✭ 32 (-51.52%)
Mutual labels:  packing-algorithm
TriangleMeshDistance
Header only, single file, simple and efficient C++11 library to compute the signed distance function (SDF) to a triangle mesh
Stars: ✭ 55 (-16.67%)
Mutual labels:  collision-detection
triangle-mesh-collision
Self-collision detection for triangles meshes (C++, libigl, eigen)
Stars: ✭ 35 (-46.97%)
Mutual labels:  collision-detection
JessicaLim8
Profile ReadME! Join my community word cloud!
Stars: ✭ 81 (+22.73%)
Mutual labels:  wordcloud
BoxPacking
R package for solving three-dimensional bin packing problem
Stars: ✭ 56 (-15.15%)
Mutual labels:  packing-algorithm
wordclouds
Wordclouds in go
Stars: ✭ 41 (-37.88%)
Mutual labels:  wordcloud
von-physics
"Arcade"-style game physics library
Stars: ✭ 35 (-46.97%)
Mutual labels:  collision-detection
gbp
gbp: a bin packing problem solver - an r package solves 1d - 4d bin packing problem.
Stars: ✭ 24 (-63.64%)
Mutual labels:  packing-algorithm
LockstepCollision
A deterministic collision lib for lockstep
Stars: ✭ 51 (-22.73%)
Mutual labels:  collision-detection
National-Petition
청와대 국민청원 분석으로 국민의 생각 알아보기 📈🔬
Stars: ✭ 45 (-31.82%)
Mutual labels:  wordcloud
soan
Social Analysis based on Whatsapp data
Stars: ✭ 106 (+60.61%)
Mutual labels:  wordcloud
Xiecheng Comment
🌈Xiecheng_Comment多线程Threading爬取携程的丽江古城景点评论并生成词云
Stars: ✭ 23 (-65.15%)
Mutual labels:  wordcloud
chartjs-chart-wordcloud
Chart.js Word Clouds
Stars: ✭ 34 (-48.48%)
Mutual labels:  wordcloud
unity-animated-convexhull
Realtime fast convexhull generator for Unity
Stars: ✭ 40 (-39.39%)
Mutual labels:  collision-detection

juliadoc
Dev Binder CI CI-nightly codecov DOI
Word cloud (tag cloud or wordle) is a novelty visual representation of text data. The importance of each word is shown with font size or color. Our generator has the following highlights:

  • Flexible Any mask, any color, any angle, adjustable density. You can specify the initial position of some words. Or you can pin some words and adjust others, etc.
  • Fast 100% in Julia and efficient implementation based on Quadtree & gradient optimization (see Stuffing.jl). The advantage is more obvious when generating large images.
  • Exact Words with the same weight have the exact same size. The algorithm will never scale the word to fit the blank.

run showexample(:juliadoc) to see how to generate the banner


Installation

import Pkg; Pkg.add("WordCloud")

Basic Usage

using WordCloud
using Random
words = [randstring(rand(1:8)) for i in 1:300]
weights = randexp(length(words))
wc1 = wordcloud(words, weights)
generate!(wc1)
paint(wc1, "random.svg")

Or it could be

wc2 = wordcloud("It's easy to generate word clouds") |> generate!
wc3 = wordcloud(open(pkgdir(WordCloud)*"/res/alice.txt")) |> generate!

More Advanced Usage

using WordCloud
stopwords = WordCloud.stopwords_en  ["said"]
textfile = pkgdir(WordCloud)*"/res/alice.txt"
maskfile = pkgdir(WordCloud)*"/res/alice_mask.png"
wc = wordcloud(
    processtext(open(textfile), stopwords=stopwords, maxnum=500), 
    mask = maskfile,
    maskcolor="#faeef8",
    outline = 4,
    linecolor = "purple",
    colors = :Set1_5,
    angles = (0, 90),
    fonts = "Tahoma",
    density = 0.55) |> generate!
paint(wc, "alice.png", ratio=0.5)

Run the command runexample(:alice) or showexample(:alice) to get the result.
alice

More Examples

Fitting animation

animation2
Run the command runexample(:animation2) or showexample(:animation2) to get the result.

Gathering style

gathering
Run the command runexample(:gathering) or showexample(:gathering) to get the result.

Recolor

recolor
Run the command runexample(:recolor) or showexample(:recolor) to get the result.

Semantic

semantic
Run the command runexample(:semantic) or showexample(:semantic) to get the result.
The variable WordCloud.examples holds all available examples. You can also see more examples or try it online.

About Implementation

Unlike most other implementations, WordCloud.jl is programmed based on image local gradient optimization. It’s a non-greedy algorithm in which words can be further moved after they are positioned. This means shrinking words is unnecessary, thus the word size can be kept unchanged during the adjustment. In addition, it allows words to be assigned to any initial position whether or not there will be an overlap. This enables the program to achieve the maximum flexibility. See also Stuffing.jl - Algorithm Description.

  • 权重计算和单词位置初始化
  • 基于四叉树(层次包围盒)的碰撞检测
  • 根据局部灰度梯度平移单词(训练迭代)
  • 引入动量加速训练
  • 分代检测优化性能(for pairwise trainer)
  • 区域四叉树批量碰撞检测
  • LRU优化性能(for element-wise trainer)
  • 控制字体大小和填充密度的策略
  • 使用重新放置策略跳出局部最优
  • 使用缩放策略降低训练难度
  • 训练失败检测和提前中断
  • 主题配色等
  • 并行计算

Note

linux添加中文字体

mv wqy-microhei.ttc ~/.fonts
fc-cache -vf

配置ffmpeg环境

add /path/to/ffmpeg-4.2.1/lib to ENV["LD_LIBRARY_PATH"]
add /path/to/ffmpeg-4.2.1/bin to ENV["PATH"]

External Links

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].