New Module: tag_cloud_html5 - a non-Flash 3D tag cloud (both sidebar block and whole cloud page)
shadlaws
Joined: 2012-03-14
Posts: 183 |
![]() |
|||
Hey everyone, NEW: VERSION 7 - new embed feature for putting tag cloud in other places on website! (and minor bug fixes). Attached is my new HTML5-compliant tag cloud module. It functions a non-Flash replacement for both 'tag_cloud' and 'tag_cloud_page' modules, with some extra features added. The 'tags' module is still required. Documentation is available at http://codex.gallery2.org/Gallery3:Modules:tag_cloud_html5. This module uses a modified version of TagCanvas, a non-flash, HTML5-compliant jQuery plugin. It also uses excanvas to maintain compatibility with pre-9.0 Internet Explorer. This means that it's 100% compliant with all modern browsers, including all iOS devices and Internet Explorer 8. Similar to older modules: New features: As mentioned above, I've modified TagCanvas. In particular, I added a new physics-based motion model, some new parameters, and some bug fixes which are not a part of the original package as this writing (2012/06/08). The JS file included in the module is therefore called jquery.tagcanvas.mod.min.js, and has been minified and is therefore largely incomprehensible. I've also included the non-minified version for reference. Let me know what you think. Thanks! Take care,
|
||||
floridave
![]()
Joined: 2003-12-22
Posts: 27300 |
![]() |
|||
Super coool! Dave _____________________________________________ |
||||
Ser Moro
![]()
Joined: 2007-12-08
Posts: 79 |
![]() |
|||
Very good, but sidebar block is empty |
||||
floridave
![]()
Joined: 2003-12-22
Posts: 27300 |
![]() |
|||
URL? Dave |
||||
floridave
![]()
Joined: 2003-12-22
Posts: 27300 |
![]() |
|||
I see an issue. If I scroll the mouse wheel on the full page the cloud dis-appears. if I scroll the mouse wheel on the sidebar block the cloud shrinks or grows. I guess for the sidebar block that would be expected behaviour/behavior. Dave |
||||
shadlaws
Joined: 2012-03-14
Posts: 183 |
![]() |
|||
Hey guys, Thanks for catching the bug! That's what I get for testing on touchpads and not scrolling... Bug should be fixed. New version attached above. Let me know what you think! Thanks, |
||||
shadlaws
Joined: 2012-03-14
Posts: 183 |
![]() |
|||
@floridave - by "behaviour/behavior," are you referencing the subtle enUK->enUS translation I did with the TagCanvas options? ;-) |
||||
suprsidr
![]()
Joined: 2005-04-17
Posts: 8339 |
![]() |
|||
I think it needs a bigger "dead zone" in the middle. -s |
||||
shadlaws
Joined: 2012-03-14
Posts: 183 |
![]() |
|||
A semi-related issue: now that I have a tag cloud that's accent-friendly, I tried changing some of my tags to have accents. The cloud itself works fine, but nearly everyone has a different idea of how to alphabetize them... When I got to the admin|content|tags menu, they show up in another category (É instead of E). When I see the inline tag cloud on the whole page, it's ordered at the end (É goes after Z). When I use autocomplete (e.g. to add tags), it ignores the accents (e.g. E will autocomplete words that start with É), which is the correct approach. Any thoughts on a simple/elegant way to fix this? Take care, |
||||
shadlaws
Joined: 2012-03-14
Posts: 183 |
![]() |
|||
@suprsidr - one thing that can somewhat help that is to increase the "outline offset" settings in the admin menu. This doesn't create a dead zone, per se, but it does make the regions around each tag you use to click on them bigger. Trying to make an actual dead zone would involve hacking the TagCanvas code directly. Hmm... |
||||
floridave
![]()
Joined: 2003-12-22
Posts: 27300 |
![]() |
|||
Quote:
@floridave - by "behaviour/behavior," are you referencing the subtle enUK->enUS translation I did with the TagCanvas options? ;-) No not at all. At work I do that all the time. I spent time in the UK (3 years) and in Florida (2.5 Years, thus the name) and now back home in Canada so have to watch out for all. In Canada we can Dave |
||||
Ser Moro
![]()
Joined: 2007-12-08
Posts: 79 |
![]() |
|||
Works on default theme. SM |
||||
shadlaws
Joined: 2012-03-14
Posts: 183 |
![]() |
|||
Hey guys, DEAD ZONE: ADDED! No more chasing tags I just uploaded a Version 3, with a few new features. It required me hacking into the TagCanvas plugin itself to add 'deadZone' and 'initialDecel' options, and I think the result is much better. So, I've added: Let me know whatcha think! Take care, |
||||
Serge D
![]()
Joined: 2009-06-11
Posts: 2466 |
![]() |
|||
Works great! Thank you 1. see attached SS - mouse need to be 10 px below to highlight the item, not over it [img]http://gallery.menalto.com/files/tc.png[/img] Serge |
||||
shadlaws
Joined: 2012-03-14
Posts: 183 |
![]() |
|||
Hey Serge, Thanks for the feedback! 1. This is adjustable in the admin settings - decrease "outline offset (mouseover region size around text, in pixels)" Thanks, |
||||
Serge D
![]()
Joined: 2009-06-11
Posts: 2466 |
![]() |
|||
shadlaws wrote:
1. This is adjustable in the admin settings - decrease "outline offset (mouseover region size around text, in pixels)" I do not think it work as expected. I set it to 0 and I would expect "hover" to happen when mouse is over the tag text, but it is not. In fact, I think it did make distance even bigger. shadlaws wrote:
2. This is adjustable in the admin settings - increase "zoom". The width and height of the canvas block need to be specified directly to keep TagCanvas happy, but you can change the amount of space by bumping up the zoom. In fact, I did it by default for the wholecloud page (set at 1.25). did that, still some space above and below. I think default logic of the script is to make canvas square... so unless there is some special setting, i think I can live with what we have. (better than to deal with flash...) Serge |
||||
shadlaws
Joined: 2012-03-14
Posts: 183 |
![]() |
|||
Hey Serge, re: the hover problem, maybe I'm not correctly understanding your problem. What I *thought* you meant was that the region for selecting a given tag was too big, which the outline offset thing changes. However, upon re-reading it, it sounds like you're saying is that the size isn't the problem. Rather, it seems you're saying that the region isn't centered on the tag itself. Is that what you mean to say? To further confuse things, both http://www.goat1000.com/tagcanvas-weighted.php and http://photo.dragonsoft.us work equally well for me on IE9, Chrome, and Firefox... <shrug> re: the above/below space issue, this is certainly changeable. All that the TagCanvas plugin needs is the height and width to be defined *before* it starts. So, I wrote JS functions that set the height and weight dynamically before starting it up. All we need to do is change my thinking Here's my current logic: For the sidebar, I figured the width was the constraint, so I set the width and height to be the width of the sidebar block. For the whole cloud page, I dynamically resized it based on the height of the browser window (and added in protection against it being too wide, which it almost never will be). Also for the whole cloud page, I made the width a bit bigger than the height to ensure that long tags don't run off the end (but doing the same for the sidebar could cost extra space). Details are in the respective views (see views/tag_cloud_html5_block.html.php and views/tag_cloud_html5_page.html.php). Do you have any suggestions for a more flexible/elegant way to deal with it? Thanks, |
||||
Serge D
![]()
Joined: 2009-06-11
Posts: 2466 |
![]() |
|||
shadlaws wrote:
re: the hover problem, maybe I'm not correctly understanding your problem. What I *thought* you meant was that the region for selecting a given tag was too big, which the outline offset thing changes. However, upon re-reading it, it sounds like you're saying is that the size isn't the problem. Rather, it seems you're saying that the region isn't centered on the tag itself. Is that what you mean to say? yes, sorry if I did not expressed myself correctly shadlaws wrote:
To further confuse things, both http://www.goat1000.com/tagcanvas-weighted.php and http://photo.dragonsoft.us work equally well for me on IE9, Chrome, and Firefox... yes, module works well, just small things to work out shadlaws wrote:
re: the above/below space issue, this is certainly changeable. All that the TagCanvas plugin needs is the height and width to be defined *before* it starts. So, I wrote JS functions that set the height and weight dynamically before starting it up. All we need to do is change my thinking could you make it part of admin somehow? or leave it to CSS reference and not embedding styles within the tag, so it can be overwritten? Serge |
||||
shadlaws
Joined: 2012-03-14
Posts: 183 |
![]() |
|||
Hey everyone, Version 4 is out with sidebar height option, attached above. Man, four versions in two days... I need to stop adding features at some point Following on Serge's suggestion, I added an option in the admin menu to define the height of the sidebar block as a fraction of the width (i.e. 1.0 would be a square). Then, I changed the defaults a bit to make best use of it, so it should look pretty decent without fiddling with options too much. Thanks! Take care, |
||||
shadlaws
Joined: 2012-03-14
Posts: 183 |
![]() |
|||
@Serge: re: the off-center problem, what browser are you using? I know it's not your server since I can run your website without a problem on three browsers on my end, but I'm curious if we can figure out what's wrong. Does it happen for both the sidebar and the whole cloud page? Thanks, |
||||
Serge D
![]()
Joined: 2009-06-11
Posts: 2466 |
![]() |
|||
shadlaws wrote:
@Serge: re: the off-center problem, what browser are you using? I know it's not your server since I can run your website without a problem on three browsers on my end, but I'm curious if we can figure out what's wrong. Does it happen for both the sidebar and the whole cloud page? I have disabled whole page mode as I do not want extra link in the sidebar for it. Serge |
||||
Serge D
![]()
Joined: 2009-06-11
Posts: 2466 |
![]() |
|||
Installed v.4 a) thank you for proportion setting Serge |
||||
shadlaws
Joined: 2012-03-14
Posts: 183 |
![]() |
|||
Hey Serge, a) you're quite welcome b) aye, sorry about that. I was kind of lazy on the installer, and if it sees an earlier version install, it simply blanks all old variables and adds the new defaults. c) true, there are quite a few settings to keep straight at the moment. Hmm... if another version rolls around, I might add a bit more text. d) ah, interesting! I'm glad we figured it out. Well, *kinda* figured it out. The answer is that it's in the core of TagCanvas - I do nothing to determine X/Y positions afterward. I would try and experiment with it on my end, but I don't have the same symptoms as you do. If interested, I've attached the non-minified JS. The function to look for is MouseMove on line 272 (which is bound to .mousemove on line 877), which calculates the mx and my parameters used as the mouse coordinates for the rest of the script. I'm no jQuery expert, but it seems fairly straightforward to me. One (perhaps stupid and naïve) thought: do you suppose it's a problem with ordering, and it's calculated somehow before the menu is calculated and its space is taken? e) I could, but I'm not sure how useful they'd be. I experimented with them a bit, and didn't find them very useful for me (freezeActive actually seemed to make it harder to find tags...). You can experiment with them by editing the options in the settings|advanced menu. The variable options_sidebar is passed directly to TagCanvas, so you can simply add whatever parameters to the end of it you like. If you find that freezeActive and shape are way more useful that I estimated, let me know and I can put them in there Thanks! Take care, |
||||
Serge D
![]()
Joined: 2009-06-11
Posts: 2466 |
![]() |
|||
shadlaws wrote:
d) ah, interesting! I'm glad we figured it out. Well, *kinda* figured it out. The answer is that it's in the core of TagCanvas - I do nothing to determine X/Y positions afterward. I would try and experiment with it on my end, but I don't have the same symptoms as you do. If interested, I've attached the non-minified JS. The function to look for is MouseMove on line 272 (which is bound to .mousemove on line 877), which calculates the mx and my parameters used as the mouse coordinates for the rest of the script. I'm no jQuery expert, but it seems fairly straightforward to me. One (perhaps stupid and naïve) thought: do you suppose it's a problem with ordering, and it's calculated somehow before the menu is calculated and its space is taken? I had some time to think about it Serge |
||||
BillWill
Joined: 2008-08-28
Posts: 205 |
![]() |
|||
Hi Shadlaws. Nice mod! These days, SEO is a big need. Is there a way to display this on a page outside the gallery in a similar layout to your sidebar display? =========================== |
||||
shadlaws
Joined: 2012-03-14
Posts: 183 |
![]() |
|||
@Serge - Hmm, a good thought. I tried to see if I could duplicate the problem with jsfiddle - see http://jsfiddle.net/shadlaws/jnB4t/. However, even with both left and top margins on the body, it seemed to work fine with both IE9 and Chrome. That said, if I've missed something, I've also shown there how to get the margin-top out of css, so we can fix it @BillWill - It sounds like you want to use the TagCanvas library for another project, which would give a similar display outside Gallery. The links to the TagCanvas page are given above, and you can download my module for my modified version of the library if you like. Take care, |
||||
shadlaws
Joined: 2012-03-14
Posts: 183 |
![]() |
|||
Hey everyone, I finished version 5, which now has a physics-based motion model. I didn't like the way the other one "felt," so I decided to give it some underlying dynamics Let me know what you think. Thanks! Take care, |
||||
Serge D
![]()
Joined: 2009-06-11
Posts: 2466 |
![]() |
|||
shadlaws wrote:
@Serge - Hmm, a good thought. I tried to see if I could duplicate the problem with jsfiddle - see http://jsfiddle.net/shadlaws/jnB4t/. However, even with both left and top margins on the body, it seemed to work fine with both IE9 and Chrome. That said, if I've missed something, I've also shown there how to get the margin-top out of css, so we can fix it Did enable bar for my gallery - http://photo.dragonsoft.us/enter to correct myself a little, instead of padding for body tag, try setting margin-top for <html> tag - I have margin-top: 30px; Serge |
||||
shadlaws
Joined: 2012-03-14
Posts: 183 |
![]() |
|||
Hey Serge, Thanks for setting that. I think I found a solution! Here's what I've found: - simple test case with html margin-top + Chrome = no problem //tc.mx = e.pageX - o.left; tc.mx = e.pageX - o.left + parseInt($("html").css("margin-left"), 10) - $("html").offset().left; // mod Shad Laws //tc.my = e.pageY - o.top; tc.my = e.pageY - o.top + parseInt($("html").css("margin-top"), 10) - $("html").offset().top; // mod Shad Laws So I add the html margin and subtract the html offset... bizarre, eh? Attached is a new JS file - can you drop it in your directory and see how it works? EDIT: note that the file attached is already minified, so you can't look through its source to see the change... EDIT: THIS DOESN'T ACTUALLY WORK - correct solution below, and implemented in Version 6. Thanks! Take care, |
||||
Serge D
![]()
Joined: 2009-06-11
Posts: 2466 |
![]() |
|||
yes, this version solved the issue Edit: installed version 5 with updated js post-fix Thank you |
||||
BillWill
Joined: 2008-08-28
Posts: 205 |
![]() |
|||
hi shadlaws - You've been putting in a lot of work lately. It's pretty exciting to be adding a module while it is in active development. I'm just wanting to display the tag cloud within other pages in my site, outside of the album directory. Like the Photowidget or minislideshow modules for example. Is that considered a different project? If so, I'll go to your site and try to figure it out. Quote:
@BillWill - It sounds like you want to use the TagCanvas library for another project, which would give a similar display outside Gallery. The links to the TagCanvas page are given above, and you can download my module for my modified version of the library if you like. =========================== |
||||
shadlaws
Joined: 2012-03-14
Posts: 183 |
![]() |
|||
@Serge - actually, it seems like I was wrong: that did *not* fix the problem. If you scroll down using Chrome or Firefox, it didn't work. Sorry about that! But, I think I found the *real* solution this time. After spending a couple hours testing various options, I finally figured it out: - pageX and pageY, which jQuery likes to call their standards, are not standardized. PageY = 0 at the top for Chrome/Firefox, but PageY= -margin_top for IE. So... here's what works: o = $(tc.canvas).offset(); // if(e.pageX) { // mod Shad Laws if(e.offsetX) { // mod Shad Laws // this works for IE tc.mx = e.offsetX; // mod Shad Laws tc.my = e.offsetY; // mod Shad Laws } else if(e.pageX) { // mod Shad Laws // this doesn't work for IE --> e.pageY = -parseInt($("html").css("margin-left"), 10) for the top row! tc.mx = e.pageX - o.left; tc.my = e.pageY - o.top; } else { tc.mx = e.clientX + (dd.scrollLeft || doc.body.scrollLeft) - o.left; tc.my = e.clientY + (dd.scrollTop || doc.body.scrollTop) - o.top; } I've tested it with IE9, Chrome, and Firefox, with/without html margin-top, and with/without scrolling... and it seems to work well! New JS attached here. Old JS above deleted. JS in the zip file for the module updated, new version number 6. Take care, |
||||
shadlaws
Joined: 2012-03-14
Posts: 183 |
![]() |
|||
@BillWill - Ah, I see what you mean. It sounds like a nice thing to add. My thought is that it'd be used something like this: <?php include("http://www.example.com/gallery3/tag_cloud/embed/sidebar/optionoverride/123") ?> Where: What do you think? Maybe while I'm at it I should look into what it takes for a REST interface, too... Take care, |
||||
Serge D
![]()
Joined: 2009-06-11
Posts: 2466 |
![]() |
|||
shadlaws wrote:
@Serge - actually, it seems like I was wrong: that did *not* fix the problem. If you scroll down using Chrome or Firefox, it didn't work. Sorry about that! But, I think I found the *real* solution this time. updated with new version, Thank you |
||||
BillWill
Joined: 2008-08-28
Posts: 205 |
![]() |
|||
Hello shadlaws - I tried the include you provided, and can't get it to work. Warning: include(gallery3/tag_cloud/embed/sidebar/optionoverride/123) [function.include]: failed to open stream: No such file or directory I tried different variations of the string you provided, including simply <?php include("gallery3/tag_cloud") ?> didn't get anything to show but warnings. (The URL into the address bar for gallery3/tag_cloud works) If you have any more ideas to try, I'll let you know the results. I know you're still smoothing out the wrinkles in the mod as you originally envisioned it, so if this isn't a big priority for you now, don't sweat it. =========================== |
||||
shadlaws
Joined: 2012-03-14
Posts: 183 |
![]() |
|||
@BillWill - That's because I haven't coded it up yet... I was looking for feedback on what would be useful first Take care, |
||||
BillWill
Joined: 2008-08-28
Posts: 205 |
![]() |
|||
Got a good laugh on myself for that one! Now that I know you're looking for feedback, all the options you mentioned sound great. The controls you're passing via the url seem hit the main controls. The SEO boost this will provide, as well as having interesting links floating around all over the site will be great in drawing in people from other areas of my site into the album. Thanks for putting out this mod. bw =========================== |
||||
xeta
Joined: 2011-11-24
Posts: 42 |
![]() |
|||
Thanks for this really great module!!! Looks very good One really small problem, when the admin page is reloadad, the module alway use a comma (,) for the values height and width and the gallery tells me "Value is not numeric". I have to replace the comma with a . (point) manual. My Gallery3 installation is in german, but the admin area is in english. |
||||
shadlaws
Joined: 2012-03-14
Posts: 183 |
![]() |
|||
Version 7 is out! The big thing is the new embed feature as described above. @xeta - thanks for the catch! I've corrected the problem in the new version. Thanks again! Take care, |
||||
xeta
Joined: 2011-11-24
Posts: 42 |
![]() |
|||
shadlaws wrote:
@xeta - thanks for the catch! I've corrected the problem in the new version. Thanks again! Thanks for the quick update, everything is working now! |
||||
BillWill
Joined: 2008-08-28
Posts: 205 |
![]() |
|||
shadlaws - I'd like to say I've been working on setting this up, but truth is it's too much fun to be called work. Experimenting with all the settings has been a blast. You have everything nicely arranged, and all the major configuration options right there in the admin panel. Size, speed, shape, front click ... everything you'd expect and then some. I love the embed feature, and yes, I played with that too, including making a div the same size as the browser window, and having the whole cloud swirling tags over the entire front page. It's as visually appealing as it is a useful tool in moving people from other parts of the site to the album, and I'm still looking for places to plug it in. All this plus an SEO bump. Thanks for your work on this. =========================== |
||||
shadlaws
Joined: 2012-03-14
Posts: 183 |
![]() |
|||
@BillWill and @xeta - thanks for the feedback, guys! I'm glad to hear it's working well for ya Take care, |
||||
wolfwillson
Joined: 2012-07-16
Posts: 1 |
![]() |
|||
hi,it DID NOT WORK WITH IE 8,the tag cloud will never show up.could help me |
||||
shadlaws
Joined: 2012-03-14
Posts: 183 |
![]() |
|||
@wolfwillson - hmm, that's odd. Have you tried it with other browsers? If yes, and it's only IE8, does "excanvas.compiled.js" appear in the html source it spits out? Take care, |
||||
bigu_c
![]()
Joined: 2007-10-28
Posts: 421 |
![]() |
|||
Simple question: I still don't know how to remove this? [img]http://gallery.menalto.com/files/1_29.jpg[/img] Thanks. |
||||
shadlaws
Joined: 2012-03-14
Posts: 183 |
![]() |
|||
@bigu_c - Hmm, I'm not sure why that's there, either. Can you send me a link to your website so I can take a look? Thanks, |
||||
evadim
Joined: 2013-05-03
Posts: 5 |
![]() |
|||
I found "add tag to album" feature don't work for me. Then I try to add tag, I got something like https://paste.lugons.org/raw/aJmZxsy6ds225hhlVXLG/ and no tags added. BTW, thanks for nice module! |
||||