Recommend this page to a friend! |
Download .zip |
Info | Screenshots | View files (11) | Download .zip | Reputation | Support forum (9) | Blog | Links |
Last Updated | Ratings | Unique User Downloads | Download Rankings | |||||
2005-03-21 (11 years ago) | 72% | Total: 3,170 | All time: 1,094 This week: 614 |
Version | License | Categories | ||||
diagram2 1.0.0 | GNU General Publi... | XML, Graphics |
Description | Author | ||||||||||||||
This package can draw diagrams of hierarchy trees defined in XML files. |
|
Hi, This class is so simple I don't think you'll need documentation. The class draws a diagram with only one root node. You can define properties for every node on the diagram. After instanciating the class you can pass the diagram structure in 2 diferent ways: xml file or xml data. If you pass the xml file it will then call the xml data function so if you're just opening the xml file and passing it to the function.. don't bother, just use the xml file feature. The function names are very simple: - loadXmlFile() With this function you can pass a file path as an argument. It will open the file and send the data to loadXmlData() to be parsed. - loadXmlData() With this function you can pass xml directly to the xml parser of the function. - Draw() After using one of the above function you should call this one to draw the diagram. The optional argument can be a path to where the image should be saved. If no argument is set, the image will be sent to stdout with the apropriate header. Now that you know all you need to build a diagram, you might be wondering how the xml file is. Well, it's simple. The basic structure is like this: <?xml version="1.0" encoding="UTF-8"?> <diagram> <node name="this is the name"> this is the data inside the node </node> </diagram> To load this file you would do: <?php include 'class.diagram.php'; $diagram = new Diagram(realpath('myfirstdiagram.xml')); $diagram->Draw(); ?> This would work if you save the previous xml in myfirstdiagram.xml and both the file and the class are in the same directory as this php file. Confused? Hope not. You have 2 examples. One simple and another a bit more complex with two-color backgrounds and text over lines. Hope you like it. To view them simply view test1.html and test2.html (on your server, not offline because it calls test.php). Any doubt, e-mail me at: me (at) diogoresende (dot) net Diogo Resende |
Screenshots | ||
Files |
File | Role | Description |
---|---|---|
class.diagram-ext.php | Class | Class extension |
class.diagram.php | Class | Main class |
class.xmlparser.php | Class | Small auxiliary class to parse xml |
readme.txt | Doc. | Read it first if you're not sure what you're doing |
test.php | Example | This will load one of the two examples |
test1.html | Data | Example 1 |
test1.xml | Data | Test1 diagram in xml format |
test2.html | Data | Example 2 |
test2.php | Example | This will load the class with an array |
test2.xml | Data | Test2 diagram in xml format |
test4.php | Example | Test class extension |
Version Control | Unique User Downloads | Download Rankings | |||||||||||||||
0% |
|
|
User Ratings | User Comments (2) | |||||||||||||||||||||||||||||||||||||
|
|
Applications that use this package |
If you know an application of this package, send a message to the author to add a link here.