Ajax Updates |
- Roar – Notifications : MooTools Plugin
- 3D Tag Clouds Using jQuery
- DrasticTools : DataGrid with Tagcloud and Google Map Component
Roar – Notifications : MooTools Plugin Posted: 14 Aug 2009 06:54 AM PDT Roar is a notification widget that streamlines incoming messages, such as updates or errors, without distracting the user from their browser experience or breaking their work-flow by displaying obtrusive alerts. Roar is inspired by Growl, the notification system for Mac OS X and is realised with MooTools. Features * Show any informations you want and style them with class-names. * Messages are queued and interactive o Hover them to read them longer o Add optional click-interaction to provide more information * Customize them via external CSS to your own needs. How to use
Demo: http://digitarald.de/project/roar/1-0/showcase/ad-infinitum/ Download: http://digitarald.de/project/roar/1-0/source/Roar.js http://digitarald.de/project/roar/1-0/assets/Roar.css Source: http://digitarald.de/project/roar/ Related Listings:
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Posted: 14 Aug 2009 06:22 AM PDT With browsers rendering JavaScript faster than ever before, it's a great opportunity to get creative with jQuery. This tutorial will show how to create a scrolling 3D tag cloud…it's not as difficult as you might think. What exactly will we be building? It's somewhat like a carousel, but we're going to have the take fade off into the distance like the lone ranger at the end of cheesy "B" western flick….very dramatic. We're also going to have our tag cloud interact with the users mouse. The further the mouse is away from the center, the faster it will rotate. Simple HTML As the sub title suggests the HTML is painfully simple. Most of the complicated stuff is in the jQuery. All we'll need is a list of anchor tags wrapped in a div. Told you it was simple, here is the HTML.
Styling the List For the most part the CSS is just to make the links pretty. There are a couple of things that need to happen though. The anchor links need to have a position: absolute. This way the jQuery can give it x and y co-ordinates and the links will obey. Also we need to give a height and width of the div wrapper. The jQuery reference the dimensions of the wrapper to help layout the links. It might also be a good idea to give the wrapper a position:relative to keep the links inside the wrapper, this isn't necessary though. Here is the CSS:
The Fun Part (jQuery) Now comes the trigonometry….see…your high school teacher was right, you will use this stuff in the real world. It really isn't that bad though…3 lines of trigonometry is more than acceptable. I'm not going to go into great detail with the math. If you want to learn more about the math behind the 3D I recommend reading Kirupa.com tutorial on it. The tutorial is for flash, but you will get the gist of how it works. Here is the jQuery:
Just to step through what we did. First we setup the mouse event. We figure out how far the mouse is away from the center and assign it to a variable that controls the speed of the scrolling list. After that we step through each element in our list and give each one a spot on our 3D circle. A for loop walks through each one, and evenly assigns an angle to each element. (e.g. 1st = 0 degrees, 2nd = 5 degrees, 3rd = 10 degrees…etc) After we placed each element on our 3D circle it's time to animate it. We use a setInterval to call our render function repeatedly. The render function steps through each element and figures out where and how it should be displayed. The trigonometry basically creates a set of numbers that if you plot it on a graph look like a wave. If you apply those numbers to the size of the text, it gives the appearance of going back and forth in space. If you also apply these numbers to the y, this will give you the appearance that the text is going around in a circle. If you don't understand the math inside this function not to worry. I encourage you to play around with the numbers to see how each number effects the outcome. After we placed each element on our 3D circle it's time to animate it. We use a setInterval to call our render function repeatedly. The render function steps through each element and figures out where and how it should be displayed. The trigonometry basically creates a set of numbers that if you plot it on a graph look like a wave. If you apply those numbers to the size of the text, it gives the appearance of going back and forth in space. If you also apply these numbers to the y, this will give you the appearance that the text is going around in a circle. If you don't understand the math inside this function not to worry. I encourage you to play around with the numbers to see how each number effects the outcome. The Finish Line That's all there is to it. Here is the code all together so you can have a look. Enjoy.
Demo: http://www.devirtuoso.com/Examples/3D-jQuery/ Download: http://www.devirtuoso.com/Examples/3D-jQuery/example.zip Source: http://www.devirtuoso.com/2009/08/how-to-create-a-3d-tag-cloud-in-jquery/ Related Listings:
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
DrasticTools : DataGrid with Tagcloud and Google Map Component Posted: 14 Aug 2009 05:42 AM PDT DrasticTools is a PHP/Javascript/MySQL based open source package with an Ajax-based datagrid with editing support, a configurable tag cloud and a Google mapping component. DrasticTools consists of a number of PHP classes together with a number of javascript files, images and style sheets that provide functionality to build the examples on this site. A more detailed description of the functionality, the prerequisites, the usage and the change history is given in the file Doc.txt in the DrasticTools release. Below, you see it’s contents. HOW TO USE DRASTICTOOLS, VERSION 0.6.17: 1. Introduction DrasticTools is a PHP5 software package for displaying data from different sources in various visualisations. In this version the following data sources are supported: – MySQL (support for other data sources is planned) and the following data visualisations are supported: – DrasticGrid: an Ajax-based data grid – DrasticCloud: an component to display data in a cloud – DrasticMap: a component to display data on a Google Map 2. Prerequisites: - PHP5 or higher - Json (see http://www.json.org); Json is included in PHP by default from PHP 5.2.0 and higher. - for DrasticMap: GD library installed (see http://www.php.net/gd) and of course a Google ApiKey - Note: Mootools (see http://www.mootools.net/) is necessary (included in the drastictools zip). 3. Usage: The best way to see how DrasticTools work is to look at the examples provided in the release and see them in action on http://www.DrasticData.nl DrasticTools uses Ajax requests to communicate with the server. By default DrasticTools calls the same php file from which it was invoked to process AJAX requests. This means that the instantiation of the data source should be done BEFORE ANY OUTPUT IS GENERATED, i.e. before the header information is sent to the client. This means: before the tag in the file. Alternatively you can specify the path option to specify a different php file to call. 4. Connecting to a Data Source: At this moment only a MySQL can be used as data source. This is done using the class drasticSrcMySQL. To connect to a single table, put the following in the php file before the tag:
5. Adding a visualisation: To add a DrasticGrid with default options:
To add a DrasticCloud with default options:
To add a DrasticMap with default options:
5. Advanced Options: You can use DrasticSrcMySQL with the following options: public $add_allowed = true; // may the user add records? Default is true. public $delete_allowed = true; // may the user delete records? Default is true. public $editablecols; // array of columnnames to be editable. Defaults to all columns except the id column public $defaultcols; // array of columnnames and values; only records that satisfy these conditions will be selected; // added records will have these values as default public $sortcol; // name of column to sort on initially. Defaults to the id column. public $sort; // sort ascending (a) or descending (d)? Default is a. Example:
You can use DrasticGrid with the following options: path // path of the php file to call pathimg // path to images pagelength // length of the grid. If dataset is longer the grid will do pagination colwidth // default width (in pixels) of a column pp // page pointer sortcol // name of column to sort on initially. Overrules the default of the data source sort // sort ascending (a) or descending (d)? Overrules the default of the data source columns // optional additional configuration of the columns to show with parameters: - name: the name of the column in the datasource - displayname: the name to be displayed for this column - width: the width (in pixels) of the column - type: the type of the column, which can be one of DDTYPECHAR, DDTYPEINT, DDTYPEBOOL, DDTYPEURL, DDTYPEMAILTO, DDTYPEENUM, DDTYPETEXT, DDTYPEIMG, DDTYPEKEY DDTYPEKEY : is like DDTYPEENUM where you want to redefine the values displayed like (0 -> "no", 1 ->"yes", 2->"Maybe") It can be used in some simple join cases : you edit table A that has an attribute id_b defined in a (small) table B, and you want to display a comboBox for B's labels (and not their ids) Thanks to Eric David (Paris, France). - editable: if the column is editable (true or false) If a parameter is not specified the default from the datasource are taken addparams // parameter string to pass to PHP GET requests, use "&var1=value1&var2=value2" sliderposition // position of the slider: "left" or "right" (default is "right")
Example 1:
You can use DrasticCloud with the following options: path // path of the php file to call nroffonts // The number of different font sizes used in the cloud namecol // name to show in the cloud sizecol // column to use to resize the items in the cloud log // use a logarithmic distribution (true) or linear (false) (default: true) colorcol // column which should be used to color items sortcol // name of column to sort on initially. Overrules the default of the data source sort // sort ascending (a) or descending (d)? Overrules the default of the data source showmenu // Show the menu? (default: true) showmenufull // Show the menu opened (default: false) shownamecol // Show the name selector? (default: true) shownamecolumns // Array of columns that can actually be chosen by user showlog // Show the log/linear selector? (default: true) showsizecol // Show the column selector? (default: true) showsizecolumns // Array of columns that can actually be chosen by user showcolorcol // Show the color column selector? (default: true) showcolorcolumns // Array of columns that can actually be chosen by user showsortcol // Show the sortcolumn selector? (default: true) showsortcolumns // Array of columns that can actually be chosen by user showsort // Show the ascending / descending sort selector? (default: true) addparams // optional parameter string to pass to PHP GET requests, use "&var1=value1&var2=value2" //Events: onClick onMouseOver 6. Style sheets You can use style sheets to influence the appearance of the DrasticGrid. For the grid and the cloud a default style sheet is provided in the DrasticTools release: grid_default.css cloud_default.css For the DrasticMap component, no style sheets are needed. 7. Licenses: DrasticTools is released under the GPL open source license. A file License.txt describing this license is distributed with its release package. DrasticTools uses the mootools library (see http://mootools.net/), which has a MIT Style License. DrasticMap uses the MarkerManager developed by Doug Ricket and others which has an Apache license: see http://www.apache.org/licenses/LICENSE-2.0 8. Donations: If you like the DrasticTools software and would like it to be improved in future, please donate on http://www.drasticdata.nl If you want to use the DrasticTools software under a different license, please contact info@drasticdata.nl 9. Changes from earlier versions: From version 0.6.16 to 0.6.17: - DrasticGrid: support for multiple grids on one page, see ExampleGrid7 - DrasticGrid: new type DDTYPEKEY (a contribution from Eric David, Paris) - DrasticGrid: new example using DDTYPEKEY: ExampleGrid11 From version 0.6.15 to 0.6.16: - DrasticGrid: Support for images in cells, see ExampleGrid8 - DrasticGrid: Support for joined tables (for readonly), see ExampleGrid10 - DrasticGrid: click on link in URL cell opens in new window - Drasticgrid: bug fix MAILTO and URL type of cells could not be edited in IE7 - DrasticGrid: bug fix on blur of enum cell - DrasticGrid: style of scrollbar changed - Bug Fix in ExampleGrid5.php: constraints From version 0.6.14 to 0.6.15: - Drasticgrid: onAddStart, onDeleteStart, onUpdateStart improved - Style sheets improved - Logo removed from grid, cloud and map - Drasticgrid: Bug fix: characters such as & and # can now be included in cells - DrasticGrid: transparent background of delete icons From version 0.6.13 to 0.6.14: - DrasticCloud: animation in cloud upon changes in menu - DrasticCloud: cloud menu are configurable via options 'shownamecolumns', 'showsizecolumns', 'showcolorcolumns' and 'showsortcolumns' - DrasticCloud: many smaller improvements - DrasticGrid: support for multi-line text fields (textarea) - DrasticGrid: checkbox centered horizontally - DrasticMap: new option 'markercolumns' specifies which columns to show in marker - DrasticMap: supports red and green markers for boolean values - All: also tested in Google Chrome - All: addparams parameter also added to refresh function - Bug Fix: wrong column could be displayed when using 'columns' option with less columns then dataset - Bug Fix: in DrasticCloud coloring - Bug Fix: length of scrollbar was sometimes too short - Bug Fix: in DrasticCloud sort menu From version 0.6.12 to 0.6.13: - 'scrollbarposition' option to position scrollbar left or right - 'addparams' option to pass variables to PHP GET requests and some examples to use it - redesign of style of grid (background color on mouseover) - cursors improved in grid - possibility to give headers of readonly / editable columns a different css style - some performance improvements - Bug fix: position of activity indicator is now in the center - Bug fix: column width can be less than width of column label - Bug fix: empty rows cannot be selected any more - Bug fix: no longer display of " " when editing an empty cell - Bug fix: special symbols like <> in a cell were displayed strange when editing - Bug fix: when emptying a field the old content was shown - Bug fix: error when editing an enum field with up/down key From version 0.6.11 to 0.6.12: - support for URL's and email adresses (mailto) in the grid - scrollbar for pagination - column width of grid in absolute pixel value instead of a percentage - easier configuration of drasticgrid via the 'columns' option - some visual redesign - now using mootools 1.2 From version 0.6.10 to 0.6.11: - Events: DrasticGrid, -Map and -Cloud now have events such as OnClick, OnMouseOver and OnChange. - Class DrasticCommon removed. Communication between drastictools components can be done via events such as the Onclick event. - Drastic* classes use the Mootools Options facility - Better support for various Character sets - Better detection of primary key column - bug fix: insert special characters From version 0.6.9 to 0.6.10: - Bug Fix: DrasticTools was not working on FireFox without Firebug. It did work on IE and FF with firebug enabled. From version 0.6.8 to 0.6.9: - A huge performance improvement on using Drasticgrid on Internet Explorer - DrasticCloud was added From version 0.6.7 to 0.6.8: - changed look and feel and style - output is in utf8 to support other character sets - Bug Fix: adding rows when table is empty - Bug Fix: grid supports checkboxes - some minor bug fixes From version 0.6.6 to 0.6.7: - redesign in architecture: more javascript, less php - grid supports checkboxes - selection of row - many new options From version 0.6.5 to 0.6.6: - options "showcols" and "showcolsnot" were added. May be used to explicitly show or not to show columns. - option "defaultcols" was added to drasticSRCMySQL to provide easy way to specify a simple WHERE clause and corresponding ADD function (example3a) - fixed bug: Drasticgrid showing "null" if no content in cell (was a problem in IE) - DrasticMap (alpha): interactively change the label, tooltip and bar height - some small bug fixes From version 0.6.4 (MySQLPHPGrid) to 0.6.5 (DrasticTools): - grid is now completely Ajax based, also for sorting, paging, delete, add, update - configurable which columns are editable; configurable look for editable fields - improved configurability via css, also in ie - ability to display column names different from table field names - new component to visualize data on a google map (alpha version) - new architecture which may support multiple data sources (not only MySQL) and other visualisations - many more... From version 0.6.3 to 0.6.4: - the width of the grid and the individual columns can be controlled in the style sheet - tooltips on cells and columns headers - several minor improvements in presentation of grid - width of input field same as column width - several bugfixes: - bug fix: error on adding or deleting a record right on the border of the display page - bug fix: ability to insert commas - bug fix: using the example sql file in MySQL strict mode From version 0.6.2 to 0.6.3: - using mootools library for ajax update requests - some visual effects on update and delete - tooltips on add, delete and sort buttons - upon add, the grid navigates to the added row - style sheets updated - several minor bug fixes From version 0.6.1 to 0.6.2: - bug fix in the update of the presentation of the grid From version 0.5.1 to 0.6.1: - Update of cells is handled via an AJAX request => no full page load is needed. - Support for MySQL ENUM Datatype via drop down lists. - The ability to disallow adding, deleting or cell updating (used to be one setting for all). - optional arguments removed and implemented as public variables of the class - you may specify if the id field will be shown or not; it is no longer allowed to edit the id field. - many smaller bug fixes Demo: http://www.drasticdata.nl/DrasticTools/ExampleGrid1.php Download: http://www.drasticdata.nl/DrasticTools0617.zip Source: http://www.drasticdata.nl/DDHome.php?m=3 Related Listings:
|
You are subscribed to email updates from Ajax Updates To stop receiving these emails, you may unsubscribe now. | Email delivery powered by Google |
Inbox too full? | |
Google Inc., 20 West Kinzie, Chicago IL USA 60610 |
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.