Android Question Keyword Cloud

ykucuk

Well-Known Member
Licensed User
Longtime User
I'm currently working on a project where I need to incorporate a keyword cloud, similar to the one pictured in the attached image. I've been looking for suitable libraries to create this, but so far I haven't been successful.

Could anyone provide me with some guidance on how to implement this?
 

Attachments

  • Screenshot 2023-06-16 at 2.51.18 AM.png
    Screenshot 2023-06-16 at 2.51.18 AM.png
    102.4 KB · Views: 84

Hamied Abou Hulaikah

Well-Known Member
Licensed User
Longtime User
Yes you can:
B4X:
Sub keywordsCloud
    Dim lst As List
    lst.Initialize
    lst.AddAll(Array As String("Erel","B4X","Hamied","Newyork","Sana'a","Dubai","ykucuk","toby","Egypt","Frankfourt","Erel","B4X","Hamied","Newyork","Sana'a","Dubai","ykucuk","toby","Egypt","Frankfourt"))
    For i=0 To lst.Size-1
        Dim lbl As Label
        lbl.Initialize("")   
        lbl.TextColor=Colors.Green   
        lbl.Text=lst.Get(i)
        lbl.TextSize=Rnd(8,30)
        Panel1.AddView(lbl,Rnd(0,Panel1.Width),Rnd(0,Panel1.Height),100dip,40dip)       
    Next
End Sub
See attached example also
 

Attachments

  • keywordcloud.zip
    9.2 KB · Views: 56
Upvote 0

William Lancee

Well-Known Member
Licensed User
Longtime User
Curious...

1. Are you talking about a general algorithm to create these clouds on the fly?
2. Are you planning to develop a library for this yourself?
3. Are you aware of the complexity involved?
- the science of creating metrics for 'importance'
- the science of optimal packing rectangles in a rectangle or oval
- the art of composition
 
Upvote 0

William Lancee

Well-Known Member
Licensed User
Longtime User
For example: word frequency relative to overall frequency in Alice Adventures in Wonderland. Organized in a spiral.

alice.jpg
 
Upvote 0
Top