PHP Classes

d3: Output charts using D3.js JavaScript library

Recommend this page to a friend!
  Info   View files View files (30)   DownloadInstall with Composer Download .zip   Reputation   Support forum (2)   Blog    
Ratings Unique User Downloads Download Rankings
StarStarStarStar 73%Total: 873 All time: 4,024 This week: 347Up
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  
Name: Tom Schaefer is available for providing paid consulting. Contact Tom Schaefer .
Classes: 39 packages by
Country: Germany Germany
Age: ???
All time rank: 1088 in Germany Germany
Week rank: 368 Down20 in Germany Germany Down
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  
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

  Files folder image Files  /  demos  
File Role Description
Files folder imagecss (1 file)
Files folder imagedata (4 files)
  Accessible without login Plain text file 001.php Example Some basic ops
  Accessible without login Plain text file 002.php Example live bar chart
  Accessible without login Plain text file 003.php Example example using sample high-level wrapper class
  Accessible without login Plain text file 004.php Example treemap example
  Accessible without login Plain text file 005.php Example cluster dendrogram
  Accessible without login Plain text file 006.php Example Reingold-Tilford-Tree Example
  Accessible without login Plain text file 020.php Example stacked bar chart example
  Accessible without login Plain text file 030.php Example pyramid demo chart
  Accessible without login Plain text file 040.php Example sample cluster and json
  Accessible without login Plain text file 041.php Example sunburst
  Accessible without login Plain text file 060.php Example shows how to push a sql query result into a grouped bar chart

  Files folder image Files  /  demos  /  css  
File Role Description
  Accessible without login Plain text file cluster.css Aux. style for cluster and json

  Files folder image Files  /  demos  /  data  
File Role Description
  Accessible without login Plain text file constant.js Data demo data for pyramid example
  Accessible without login Plain text file data.csv Data data csv
  Accessible without login Plain text file flare.json Data sample data
  Accessible without login Plain text file nlwest.json Data example sparkline json

  Files folder image Files  /  wrappers  
File Role Description
  Plain text file barchart.php Class wrapper class
  Plain text file clusterdendrogram.php Class cluster dendrogram
  Plain text file pyramid.php Class pyramid chart
  Plain text file reingoldtilfordtree.php Class Reingold-Tilford Tree
  Plain text file sparkline.php Class Example for a highlevel wrapper
  Plain text file stackedbarchart.php Class wrapper class
  Plain text file treemap.php Class Treemap Wrapper Class

 Version Control Reuses Unique User Downloads Download Rankings  
 0%5
Total:873
This week:0
All time:4,024
This week:347Up
 User Ratings  
 
 All time
Utility:93%StarStarStarStarStar
Consistency:93%StarStarStarStarStar
Documentation:81%StarStarStarStarStar
Examples:87%StarStarStarStarStar
Tests:-
Videos:-
Overall:73%StarStarStarStar
Rank:151