APP: IMatch Cloud Words

Started by Jingo, August 16, 2023, 02:02:02 AM

Previous topic - Next topic

Jingo

Hi all.. Markus recently requested some functionality in this thread: https://www.photools.com/community/index.php/topic,13507.msg95184.html#msg95184 and it seemed to fit the bill for an App quite nicely.  So, given a few hours to tinker, I found a bit of source code and modified it to produce a "cloud word" example App using IMatch data. 

The App currently will pull the Standard Location Category and produce a Word Cloud by size of each directly assigned or indirectly assigned child category.  It is far from perfect - trying to come up with a quick mechanism to handle font size display in px's vs category count is not easy.  Some of my locations had 10,000+ files while others had only 10... trying to determine how to convert 10000 files to a displayable pixel count is not easy.  I'm sure this app is going to need a lot of further tweaking but I wanted to at least get it out there for review/comment before I ran out of time to work on it further.

So, I present you with.. the IMatch Word Cloud !  The all important App Icon:
Vy0oeLTsbB.png

The App Window:

IMatch2023x64_R2LyICQ52Z.png

To use:
  • Just Launch the App - it should show you the word cloud after a few moments.  For a larger display canvas, try the browser version. 
As always - please unzip the file folder into your app path and the icon will load.  If you note any issues, please let me know and I'll do my best to correct.

Enjoy!! - Andy.

sinus

Hi Andy
The app, your image (with United States) looks great.

I loaded you App, the app appears in a panel with the title (Cloud Words!) and the explain-senteces, but nothing else.
What must I do for seeing the words? What I found out, that I can drag-n-drop an image into your panel and it will be displayed.  ;D

But I guess, this is not the correct thing.
I have not more the standard - categories from IMatch, but I created your target 
IMatch Standard Categories|Image Files|Location

Where exactly I have to go and must I select some images or what?
I can create categories, no problem. 
I tried to change your line (with the categories above) but did not help.

I think anyway, to create your cloud words, I can imagine, that your app uses for the source

- selected files
- a special created category
- a folder 
...

But finally for me personally I could imagine selected images or a category, where I put the wished images. 
Hmmm, maybe a category would be the best, I can put some images in and see, what happens. I can add images or unassign. 

Unfortunately I have just now not more time to look into it and think about it, hence I wrote only this here. 

Have a good day!











Best wishes from Switzerland! :-)
Markus

Jingo

Hi Markus - hmm... do you have the following special category established - I chose it because I thought it was a standard thing in IMatch so figured this would work for everyone out of the box:

IMatch2023x64_C0AWueqyDl.png

This is where I am currently pulling the data from though this can be changed to pull from other locations by modifying part of the code (I got busy with work so didn't have time to redesign this to be more global).

Thx! - Andy.

Mario

The IMatch Standard Categories (and IMatch Workflow Categories) are standard now for new databases.
There were several iterations over the years, too.

Older databases may not necessarily contain these categories, if a) the database was created before I've introduced these categories or b) the user did not need the categories and removed them for better performance.

Users can re-import the system categories from "C:\ProgramData\photools.com\IMatch6\Presets\system-LANG.imcsx", where LANG  means one of the supported languages.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

Jingo

Quote from: Mario on August 16, 2023, 02:17:37 PMThe IMatch Standard Categories (and IMatch Workflow Categories) are standard now for new databases.
There were several iterations over the years, too.

Older databases may not necessarily contain these categories, if a) the database was created before I've introduced these categories or b) the user did not need the categories and removed them for better performance.

Users can re-import the system categories from "C:\ProgramData\photools.com\IMatch6\Presets\system-LANG.imcsx", where LANG  means one of the supported languages.
Aha!   8)

Markus - please let me know if you do not wish to import the categories if they are not in your database.  If you point me to a specific field you would be interested in the data pulling from, I can modify the code to use that one instead.

Thx all! - Andy.

Jingo

Hmm.. In thinking about this a bit more - I wonder if it is better to have a color and/or weight distro instead of font size... something like this?

chrome_bpUmcoAFMJ.png

sinus

Hi Jingo
Thanks for your input (and Mario too).

I created the standard location and now it works. 

Now, Andy, as you pointed out, nothing is perfect, of course.

First, if I try your app with my 360'000 image (simply my main-DB), 15 minutes nothing, and the app is somehow blocked. 
Maybe I should wait longer, but finally, I think it makes no sense to work with such an amount of files. 

I think, there would be simply too many words, and we can not read something good (or even not readable).
Therefore I think (these are only my thoughts now, they can be not good of course):

1) we should be able to create such a list only with selected files OR (maybe better) a simple category. 
I believe (but I am not sure), a DD - category works always with all files in the DB and this is too much. Hence we should work with a normal category, push say 1000 images in and say, create words from cities (or countries ....).
But this is technically maybe very difficult. 

2) Like you tried above, maybe work with different colors is better. Or a combination. Say, the smallest fontsize should be still readable. I do not exactly how, but if the smallest word is not readable, then it makes not a lot of sense.

3) In your current app the main-sentence is always visible, maybe it should not more there after the work is done. 

4) I think, to makes visually some tags, like you did, there could be some other tags too, like
City
Country
States
meter above sea
...

But, Jingo, even if you let you app, like it is now, it is really cool! 
Your code works super.
Thanks a lot. My ideas are simply ... well, ideas.  ;D And maybe not all makes sense. 

I attached some screenshots with 3000, 6000 and about 11000 images. 
With 11'000 images it took about 1 minutes to create the words (hence with 360'000 files I should simply wait longer).

Best wishes from Switzerland! :-)
Markus

sinus

update.

If the difference between the sizes is too big, the words a too big.
Means, in I tried with my 360'000 files 

countries
states

and of course e.g. Switzerland has a lot more entried then say, Indonesia. 
Hence the word Switzerland is too big.

See my 2 attachements. 
But your app works really ... 

and Mario, I have again spotted the DD to correct some wrong states  8) (zb wenn da steht "Kanton Hessen"  ::) ;D )
Best wishes from Switzerland! :-)
Markus

sinus

#8
Hi Andy
I have played a bit, and changed with try and error some numbers.
With this main-changes

    trace: true,
    spiralResolution: 1, //Lower = better resolution
   spiralLimit: 360 * 5,
   lineHeight: 0.65,
   xWordPadding: 1,
    yWordPadding: 3.5,



and this line
   var word = createWordObject(words[i].word, Math.max(words[i].freq/1777,62));

I got the result in the attachement. Quite nice, but not exactly the desired output.
Also in the attachement is my DD-result from the countries.

I think, the problem is the BIG gap between my home-country and the others.
Switzerland get's 247'000 files (roughly) and e.g. Mexico 1 or Spain 1'530.

But expect Switzerland all other countries seems to be equal big. That is, I guess, because the big difference from the home-country.

Well, I think, almost a lot of users with have the most images from the home-country, including you, I guess.  :D

Therefore there should be a solution for this.

Maybe we could mark the country with the most files somehow the biggest, but not above a given size.
All other would be calculated "normal", like your first screenshot.

Or, maybe combine this with colors. Your second screenshot looks also cool, though a bit different size looks very cool ... as far they are still readable.

You know, this here is finally "just for fun", hence it does not matter, if you have time or desire (Zeit und Lust), something to do with your app or not.
Best wishes from Switzerland! :-)
Markus

Jingo

Thx Markus - yeah.. got busy with "normal life" so haven't had time to revisit... I might need to create a "matrix" that swaps a font size for a given range of numbers rather than just do a bogus frequency division which doesn't work.  I'm thinking a table, mixed with a font coloring might work well... you wouldn't get all unique sizes.. but it should at least show a cloud that signifies size clusters.  Stay tuned!!

sinus

Quote from: Jingo on August 26, 2023, 01:54:03 PMThx Markus - yeah.. got busy with "normal life" so haven't had time to revisit... I might need to create a "matrix" that swaps a font size for a given range of numbers rather than just do a bogus frequency division which doesn't work.  I'm thinking a table, mixed with a font coloring might work well... you wouldn't get all unique sizes.. but it should at least show a cloud that signifies size clusters.  Stay tuned!!

Thanks, Andy, your idea sounds cool  :)

How does Mario says for a new update? "It is ready, when it is ready" ... or something like this.
Hence of course no stress.

Have a nice weekend! 
Best wishes from Switzerland! :-)
Markus