473,411 Members | 1,975 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,411 software developers and data experts.

How to draw nodes with arcs in PHP?

Will any body will tell me how to draw nodes with arcs by using PHP?

The nodes values is gene names.
May 9 '11 #1
3 2133
nathj
938 Expert 512MB
The best way to get some help on this forum is to show you've had a go first.

So I would suggest having a look around and have a go at it. then when you get stuck post back with the code and the specific problem.

Perhaps a look at the manual?

Cheers
nathj
May 13 '11 #2
dgreenhouse
250 Expert 100+
Look at the graphics libraries built in and that can extend php.
May 14 '11 #3
Thanks for ur reply. I got some package Graph.jar. They designed it in Smarty. It is working well. If i do change the coding in .tpl file, the result is not coming.

Do anybody know about template_c?

The coding is

draw_Nodes.tpl
Expand|Select|Wrap|Line Numbers
  1. <div style= "border:1px solid #000000;position: relative; width: 760px;  left:50%; margin-left: -380px;z-index: 2; " id="layer65">
  2.  
  3. <table border="0" width="300"  bordercolor="#C0C0C0" cellspacing="0" cellpadding="0" align ="center">
  4. <td><p align=left"><b><font face="Verdana" size="2">Network Visualization</font></b></td></table>
  5. </table>
  6. <table border="1" width="95%" height="250"  cellpadding="0"  cellspacing="0" align="center" bordercolor="#C0C0C0">
  7. <tr><td>
  8. <table border="0" width="700" height="400"  cellpadding="0"  cellspacing="0" align="center" bordercolor="#C0C0C0">
  9. <tr><td>
  10. {if $regulation_array[0][0] == ''}
  11. <table border="1" width="120" height="120"  cellpadding="0"  cellspacing="0" align="center" bordercolor="#C0C0C0"><tr><td align = center><font size="2"><b></b></font></td></tr></table>
  12.  
  13. {else}
  14. <table border="0" width="120" height="120"  cellpadding="0"  cellspacing="0" align="center" bordercolor="#C0C0C0"><tr><td align =center><font size ="2"><b>Regulators/sRNAs</b></font></td></tr><tr><td><p align="center"><form method="GET" action="regulation_query.php?acc="><select size="3" name="acc" multiple>{section name=sec1 loop=$regulation_array}
  15. <option value = {$regulation_array[sec1][0]}>{$regulation_array[sec1][1]}</option>
  16. {/section}<option  value = {section name=sec1 loop=$regulation_array}{$regulation_array[sec1][0]}-{/section} selected>Select All</option></select><br><input type="submit" value="    Submit    " ></form></p></td></tr></table>{/if}</td>
  17.  
  18. <td rowspan="3"><table border="1" width="550" height="300"  cellpadding="0"  cellspacing="0" align="center" bordercolor="#C0C0C0"><tr><td>
  19.  <applet codebase="./Graph/" code="Graph.class" archive="SGraph.jar" width=550 height=330>
  20.                 <param name=edges value="{if $targeting_array[0][0] == ''}
  21.         {else}
  22.         {section name=sec1 loop=$targeting_array}{$gene_array[1]}({$gene_array[0]})-{$targeting_array[sec1][1]}({$targeting_array[sec1][2]})/ST:({$targeting_array[sec1][0]}),{/section}
  23.         {/if}
  24.         {if $regulation_array[0][0] == ''}
  25.         {else}
  26.         {section name=sec1 loop=$regulation_array}{$gene_array[1]}({$gene_array[0]})-{$regulation_array[sec1][1]}({$regulation_array[sec1][2]})/SR:({$regulation_array[sec1][0]}),{/section}
  27.         {/if}">
  28.                 <param name=center value="{$gene_array[1]}({$gene_array[0]})/S">
  29.         alt="Your browser understands the &lt;APPLET&gt; tag but isn't running the applet, for some reason."
  30.         Your browser is completely ignoring the &lt;APPLET&gt; tag!
  31.  </applet><font face="Verdana" size="2">
  32.  Requires <a href ="http://www.java.com/en/download/index.jsp">Java Web Start</a>, which is automatically installed when you install JRE/JDK with version 1.4.2 above.</font>
  33. </td></tr></table></td></tr>
  34. <tr><td>
  35. {if $targeting_array[0][0] == ''}
  36. <table border="1" width="120" height="120"  cellpadding="0"  cellspacing="0" align="center" bordercolor="#C0C0C0"><tr><td align = center><font size="2"><b></b></font></td></tr></table>
  37. {else}
  38. <table border="0" width="120" height="120"  cellpadding="0"  cellspacing="0" align="center" bordercolor="#C0C0C0"><tr><td align = center><font size="2"><b>sRNAs/Targets</b></font></td></tr><tr><td><p align="center"><form method="GET" action="targeting_query.php?acc={$acc}"><select size="3" name="acc">
  39. {section name=sec1 loop=$targeting_array}<option value = {$targeting_array[sec1][0]}>{$targeting_array[sec1][1]}</option>
  40. {/section}
  41. <option value ={section name=sec1 loop=$targeting_array}{$targeting_array[sec1][0]}-{/section} selected>Select All</option>
  42. </select><br><input type="submit" value="    Submit    " ></form></p></td></tr></table>
  43. {/if}</td>
  44.  
  45.  
  46. <tr><td>
  47. {if $coprotein[0][0] == ''}
  48. <table border="0" width="120" height="120"  cellpadding="0"  cellspacing="0" align="center" bordercolor="#C0C0C0"><tr><td align = center><font size="2"><b></b></font></td></tr></table></td></tr></table>
  49. {else}
  50. <table border="1" width="120" height="80"  cellpadding="0"  cellspacing="0" align="center" bordercolor="#C0C0C0"><tr><td align=center><font size ="2"><b>Co protein</b></font></td></tr><tr><td  align = center><form method="GET" action="co_protein.php"><select size="2" name="coprotein"></select><br><input type="submit" value="    Submit    " ></form></td></tr></table></td></tr></table></td></tr></table>
  51. {/if}</td></tr></table>
  52.  
  53. </div>
draw_Nodes.php
Expand|Select|Wrap|Line Numbers
  1. <?php
  2.  
  3.  
  4. $targeting_array = array(0=>array(0=>"sRNAT0003",1 =>"ftsZ",2 =>"sRNATG0002"));
  5. $gene_array = array(0 =>"sRNAG0012",1 =>"dicF",2 =>"ECK1568;b1574;",3 =>"1647406",4 =>"1647458",5 =>"forward",6 =>"Qin prophage; DicF antisense RNA",7 =>"Escherichia coli K12 MG1655",8=>"Inferred from genetic interaction;Inferred from direct assay;",9 =>"TTTCTGGTGACGTTTGGCGGTATCAGTTTTACTCCGTGACTGCTCTGCCGCCC",10=>"regulonDB",11=>"The DicF RNA acts to inhibit cell division (Bouche F,1989). DicF causes inhibition of the formation of the constriction and the separation of the replicated chromosomes into the daughter nucleoids (Tetart F,1992). DicF RNA interferes with FtsZ mRNA translation (Tetart F,1992); DicF may bind to and occlude the ribosome binding site on the FtsZ mRNA (Tetart F,1992). The DicF-mediated delay in nucleoid segregation is suppressed by FtsZ overproduction (Tetart F,1992). The DicF-mediated decrease in FtsZ abundance and activity is suppressed by an rpoB mutation, and this effect is partially counteracted by an rpoS mutation (Cam K,1995). The DicF RNA is subject to processing by RNase III and RNase E (Faubladier M,1990). The DicF gene has similarity to multiple prophage sequences (Faubladier M,1994). Regulation has been described (Faubladier M,1990). Reviews: (Delihas N.,1995. Wassarman KM,1999).",12=>"2477663;1552861;7651342;7540245;7508908;1691299;1372677;10068996;"); 
  6. $regulation_array =array(0=>array(0=>"sRNAR0026",1=>"hfq ",2=>"sRNARG0025"));
  7.  
  8. require './library/smarty/Smarty.class.php';
  9.  
  10. $tpl = new Smarty;
  11. $tpl->compile_check = true;
  12.  
  13. $tpl->assign("gene_array", $gene_array);
  14. $tpl->assign("regulation_array", $regulation_array);
  15. $tpl->assign("targeting_array",$targeting_array);
  16. $tpl->display('draw_Nodes.tpl');
  17.  
  18. ?>
  19.  
May 16 '11 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Raja | last post by:
Dear Members, Has anyone used the Vector Draw (www.vdraw.com) Component in Visual Basic. I need to create an application to be able to draw the plan view of a building. Any help in this regard...
7
by: Florian Lindner | last post by:
Hello, I'm looking for a program or python library to draw graphs. They should look like the that: /--------\ /--------\ | Node A | ------ belongs to ----> | Node B |...
2
by: _andrea.l | last post by:
I'd like to draw a graph using a different pictures for each node. How can I do? I'd like to link the nodes and the arcs. There is a library for doing that? if it not exists what is the best...
7
by: Mark Ingram | last post by:
Hi, how can i draw a rounded rectange, with a border within a specified area? i.e. if i have a Rectangle with width and height of 100, how can i draw a rectange with 2 pixel border inside of the...
15
by: Jeff Uchtman | last post by:
Can I draw from 2 XML sources, the structure is exactly the same execpt for data contained into 1 xslt using math to add some structrure, and displaying others as node 1 and node 2? This data is...
6
by: serge calderara | last post by:
Dear all, I was wondering is there is a way to customise the treView control in order to get any Control as a Node. What I try to do is having a Progress bar as a treeview node object. Is...
5
by: lgeastwood | last post by:
I have tweaked the PictureBox97.mdb (Stephen Lebans <www.lebans.com>) code to nicely draw lines, rectangles and circles to the specs that I input. I'm at a loss though with trying to setup an...
7
by: =?iso-8859-1?Q?Vicente_Garc=EDa?= | last post by:
Hi, I need to programmatically draw a graph (his nodes and his edges) from dynamic XML file. The graph is very complex and I don't know how I could do this task. Any ideas please? Microsoft...
3
by: mistusen | last post by:
the nodes of the graph has got x and y coordinate.we'll have to draw a directed graph with the nodes in java.where can i find the source code or what is used to draw the graph?plz suggest.how can i...
0
by: John | last post by:
Hi All, I have a simple TreeView app that I need to color out certain nodes (draw text only). The problem is the root node (which is a normal node) will be unwantedly colored over when expanding...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.