PHP Classes

d3: Output charts using D3.js JavaScript library

Recommend this page to a friend!
     
  Info   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
StarStarStarStar 66%Total: 874 All time: 4,024 This week: 455Up
Version License PHP version Categories
d3 0.1GNU General Publi...5.3PHP 5, Graphics
Description 

Author

This package can output charts using D3.js JavaScript library.

It can generate HTML with JavaScript that can render charts of several types using a fluent interface calls to the classes.

The package comes with wrapper classes to render charts of types like bar, pyramid, reingold tilforld, tree map, cluster dendogram, etc..

Picture of Tom Schaefer
  Performance   Level  
Innovation award
Innovation award
Nominee: 9x

Winner: 1x

 

Details

This set of classes is for creating d3 javascript charts. @see http://d3js.org/ While writing php it stacks variables, methods etc. and generates javascript code on echo. d3 charts can be written by following the fluid design pattern. So you can easily translate any d3 javascript example into php source. It supports closures, variables, methods and more. By using this class set there is no need to write html full of nearly unreadable javascript code. You can develop and write your own reusable and customizable php wrapper classes for creating d3 graphs, charts etc. The main goal of this class to provide an easy to use a php interface to the wonderful d3 library. PHP based and server side chart generation of d3 charts in a d3 related object notation is now available. Go to http://d3js.org/ and get an impression of what you can do with this class set. Instructions You can translate d3 javascript code into php code by following rules: - php arrows (->) become to javascript dots (.) - php variable dollar prefixes ($) will be removed - php closures will be transformed to javascript closures - php concatenating dots (.) within closures will be translated to javascript plus operators (+) - php is written fluently - by cloning a d3 php code new instances will created holding a copy of the original d3 js code - each d3 method is available is as magic php method within the scope of a d3 php object - js variables can be created by using d3::variable - js functions can be created by using f3 - js objects can be created by using o3 Take a look at example 002.php and see how it works. For more complex graphs examine the classes d3ClusterDendrogram (demos/005.php), d3Treemap (demos/004.php) or ReingoldTilfordTree (demos/006.php). If you created your own class, please tell me. If there is sufficient feedback I will provide an open source git hub respository where all these classes and a extensive documentation will reside. Regards Thomas Schäfer P.S.: You can easily adapt following library (http://nvd3.org/livecode/ ) which offers d3 models. This allows you to write less php code while creating stunning charts. Combined with canvg library you can export the svg charts while operating with the canvas object of supporting browsers and save them as image. But that is another story. ;-) - added an autocompletion support file. do not load this file in an ide only. do not use it in production mode.

  Files folder image Files (30)  
File Role Description
Files folder imagedemos (11 files, 2 directories)
Files folder imagewrappers (7 files)
Accessible without login Plain text file d3.autocompletion.in.ide.php Data autocompletion support file
Plain text file d3.classes.0.4.php Class version 0.4, adding some new features
Plain text file d3.classes.002.php Class version 0.2, adding console, move __call to processor method for better reusability
Plain text file d3.classes.003.php Class version 0.3, fixing strict error for returnVar method
Plain text file d3.classes.inc.php Class set of basic classes for d3 charts
Accessible without login Plain text file readme.txt Doc. show hints
Accessible without login Plain text file sales.sql Data mysql data for example 060.php

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Reuses Unique User Downloads Download Rankings  
 0%5
Total:874
This week:0
All time:4,024
This week:455Up
 User Ratings  
 
 All time
Utility:85%StarStarStarStarStar
Consistency:85%StarStarStarStarStar
Documentation:75%StarStarStarStar
Examples:80%StarStarStarStarStar
Tests:-
Videos:-
Overall:66%StarStarStarStar
Rank:536