473,761 Members | 4,511 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to visualize network

Hi.

I have a couple of nodes (just ids, no coordinates whatsoever) and
links betweens them (weighted).
Is there any existing solution to visualize this network in php?

Thanks

itschy
Jan 18 '08 #1
15 1774
itschy wrote:
I have a couple of nodes (just ids, no coordinates whatsoever) and
links betweens them (weighted).
Is there any existing solution to visualize this network in php?
You have to ask yourself the following question:

Is there any existing solution to visualize this network in HTML?
Cheers,
--
----------------------------------
Iván Sánchez Ortega -ivansanchez-algarroba-escomposlinux-punto-org-

El tiempo libre es más volátil que el éter...
Jan 18 '08 #2
Hello,

itschy wrote:
Hi.

I have a couple of nodes (just ids, no coordinates whatsoever) and
links betweens them (weighted).
Is there any existing solution to visualize this network in php?

Thanks

itschy
PHP has support to create images, so my guess is - if I understand the
problem correctly - you'll just need to find a way to draw dots and
lines, making them thicker depending on the weight they have.

I'm sure some examples exist, but I can't really name one to be honest.

- Jensen
Jan 18 '08 #3
On 18 Jan., 23:31, Jensen Somers <jensen.som...@ gmail.comwrote:
PHP has support to create images, so my guess is - if I understand the
problem correctly - you'll just need to find a way to draw dots and
lines, making them thicker depending on the weight they have.
Not quite.
You missed the part, where I mentiond that I do not have any
coordinates of the nodes. Thus I'cant just draw them, cause I don't
know where. :)
What I seek is some solution, which finds a representation according
to the information I have about the edges (that is, connected or not,
and if, what weight/line length do they have).

E.g.:
I have three nodes A,B,C and 3 connections a(A,B,3), b(B,C,4), c(A,C,
5) (each with infos about from_node, to_node and weight/length.
In this szenario, there are only two possible ways to draw that
network correctly:
5
A-----C B
3\ /4 3/ \4
B A-----C
5

And their rotations.
I try to find some tool/algorithm which is able to do this (and draw
it) in php.
Tough luck I guess... :(

itschy
Jan 18 '08 #4
itschy wrote:
On 18 Jan., 23:31, Jensen Somers <jensen.som...@ gmail.comwrote:
>PHP has support to create images, so my guess is - if I understand the
problem correctly - you'll just need to find a way to draw dots and
lines, making them thicker depending on the weight they have.

Not quite.
You missed the part, where I mentiond that I do not have any
coordinates of the nodes. Thus I'cant just draw them, cause I don't
know where. :)
What I seek is some solution, which finds a representation according
to the information I have about the edges (that is, connected or not,
and if, what weight/line length do they have).

E.g.:
I have three nodes A,B,C and 3 connections a(A,B,3), b(B,C,4), c(A,C,
5) (each with infos about from_node, to_node and weight/length.
In this szenario, there are only two possible ways to draw that
network correctly:
5
A-----C B
3\ /4 3/ \4
B A-----C
5

And their rotations.
I try to find some tool/algorithm which is able to do this (and draw
it) in php.
Tough luck I guess... :(

itschy
Didn't they teach you basic geometry at school?

three nodes with three paths, defines a unique shape, which is constant.
It can be rotated and mirrored,withou t violating the original
definition, but the shape remains constant.

To plot it, simply assume one point (A) is at 0,0, the next one - say
'B' is at the correct distance along the X axis, so in your case its
co-ordinates are 3,0.

Solving the position of the third point C involves solving a pair of
simultaneous quadratic equations. Cf Pythagoras and the dropping of
perpendiculars.

Namely:-

Cx^2+Cy^2=(5)^2
(3-Cx)^2 +Cy^2=(4)^2

Now there are either two, or none, solutions for Cy as there always are
for quadratics. One solution is the mirror of the other.

Now go solve it.

Its your homework, not mine.
Jan 19 '08 #5

"itschy" <go****@00l.des chreef in bericht
news:58******** *************** ***********@v67 g2000hse.google groups.com...
On 18 Jan., 23:31, Jensen Somers <jensen.som...@ gmail.comwrote:
>PHP has support to create images, so my guess is - if I understand the
problem correctly - you'll just need to find a way to draw dots and
lines, making them thicker depending on the weight they have.

Not quite.
You missed the part, where I mentiond that I do not have any
coordinates of the nodes. Thus I'cant just draw them, cause I don't
know where. :)
What I seek is some solution, which finds a representation according
to the information I have about the edges (that is, connected or not,
and if, what weight/line length do they have).

E.g.:
I have three nodes A,B,C and 3 connections a(A,B,3), b(B,C,4), c(A,C,
5) (each with infos about from_node, to_node and weight/length.
In this szenario, there are only two possible ways to draw that
network correctly:
5
A-----C B
3\ /4 3/ \4
B A-----C
5

And their rotations.
I try to find some tool/algorithm which is able to do this (and draw
it) in php.
Tough luck I guess... :(

itschy

aaah, you mean something like:
http://www.graphviz.org/Gallery/directed/hello.html
this is a sample with nodes 'hello' and 'world'
but this sollution does not give you weight...
(see also: http://www.graphviz.org/webdot/basic.html )

and, of course, this is not a PHP solution...


Jan 19 '08 #6
On 19 Jan., 17:19, The Natural Philosopher <a...@b.cwrot e:
itschy wrote:
On 18 Jan., 23:31, Jensen Somers <jensen.som...@ gmail.comwrote:
PHP has support to create images, so my guess is - if I understand the
problem correctly - you'll just need to find a way to draw dots and
lines, making them thicker depending on the weight they have.
Not quite.
You missed the part, where I mentiond that I do not have any
coordinates of the nodes. Thus I'cant just draw them, cause I don't
know where. :)
What I seek is some solution, which finds a representation according
to the information I have about the edges (that is, connected or not,
and if, what weight/line length do they have).
E.g.:
I have three nodes A,B,C and 3 connections a(A,B,3), b(B,C,4), c(A,C,
5) (each with infos about from_node, to_node and weight/length.
In this szenario, there are only two possible ways to draw that
network correctly:
5
A-----C B
3\ /4 3/ \4
B A-----C
5
And their rotations.
I try to find some tool/algorithm which is able to do this (and draw
it) in php.
Tough luck I guess... :(
itschy

Didn't they teach you basic geometry at school?

three nodes with three paths, defines a unique shape, which is constant.
It can be rotated and mirrored,withou t violating the original
definition, but the shape remains constant.

To plot it, simply assume one point (A) is at 0,0, the next one - say
'B' is at the correct distance along the X axis, so in your case its
co-ordinates are 3,0.

Solving the position of the third point C involves solving a pair of
simultaneous quadratic equations. Cf Pythagoras and the dropping of
perpendiculars.

Namely:-

Cx^2+Cy^2=(5)^2
(3-Cx)^2 +Cy^2=(4)^2

Now there are either two, or none, solutions for Cy as there always are
for quadratics. One solution is the mirror of the other.

Now go solve it.

Its your homework, not mine.
Thanks for teaching me.
Now, have you read anything I wrote?
In short words i will summarize:
0. They did not only teach me basic geometry in school, but also
analytical geometry, graph theory and such in university.
1. I try to find an EXISTING solution not write my own.
2. Jensen Somers misunderstood my initial post, so I clarified, what
kind of solution I seek. I described to him exactly what you did to me
(in a visual way).
3. I know well how to do it, I wanted to know if it was done before
(because with all the drwaing stuff it is not worth it to implement it
by myself)
4. Your answer is still welcome, maybe someone searching and finding
this thread can use it. but next time please don't assume everyone
else is stupid! :)
Jan 19 '08 #7
On 19 Jan., 19:08, "Luuk" <l...@invalid.l anwrote:
"itschy" <goo...@00l.des chreef in berichtnews:58* *************** *************** ***@v67g2000hse .googlegroups.c om...
On 18 Jan., 23:31, Jensen Somers <jensen.som...@ gmail.comwrote:
PHP has support to create images, so my guess is - if I understand the
problem correctly - you'll just need to find a way to draw dots and
lines, making them thicker depending on the weight they have.
Not quite.
You missed the part, where I mentiond that I do not have any
coordinates of the nodes. Thus I'cant just draw them, cause I don't
know where. :)
What I seek is some solution, which finds a representation according
to the information I have about the edges (that is, connected or not,
and if, what weight/line length do they have).
E.g.:
I have three nodes A,B,C and 3 connections a(A,B,3), b(B,C,4), c(A,C,
5) (each with infos about from_node, to_node and weight/length.
In this szenario, there are only two possible ways to draw that
network correctly:
5
A-----C B
3\ /4 3/ \4
B A-----C
5
And their rotations.
I try to find some tool/algorithm which is able to do this (and draw
it) in php.
Tough luck I guess... :(
itschy

aaah, you mean something like:http://www.graphviz.org/Gallery/directed/hello.html
this is a sample with nodes 'hello' and 'world'
but this sollution does not give you weight...
(see also:http://www.graphviz.org/webdot/basic.html)

and, of course, this is not a PHP solution...
Thanks for your answer.
I know the dot package, actually wrote my master thesis using it, but
as you said, its not a php solution. :(

To anticipate the next answer in this thread: I know about cgi etc,
but I do not have any rights on the server this is supposed to run, so
i search a PURE php solution.
Jan 19 '08 #8

"itschy" <go****@00l.des chreef in bericht
news:f3******** *************** ***********@i7g 2000prf.googleg roups.com...
On 19 Jan., 19:08, "Luuk" <l...@invalid.l anwrote:
>"itschy" <goo...@00l.des chreef in
berichtnews:58 *************** *************** ****@v67g2000hs e.googlegroups. com...
On 18 Jan., 23:31, Jensen Somers <jensen.som...@ gmail.comwrote:
PHP has support to create images, so my guess is - if I understand the
problem correctly - you'll just need to find a way to draw dots and
lines, making them thicker depending on the weight they have.
Not quite.
You missed the part, where I mentiond that I do not have any
coordinates of the nodes. Thus I'cant just draw them, cause I don't
know where. :)
What I seek is some solution, which finds a representation according
to the information I have about the edges (that is, connected or not,
and if, what weight/line length do they have).
E.g.:
I have three nodes A,B,C and 3 connections a(A,B,3), b(B,C,4), c(A,C,
5) (each with infos about from_node, to_node and weight/length.
In this szenario, there are only two possible ways to draw that
network correctly:
5
A-----C B
3\ /4 3/ \4
B A-----C
5
And their rotations.
I try to find some tool/algorithm which is able to do this (and draw
it) in php.
Tough luck I guess... :(
itschy

aaah, you mean something
like:http://www.graphviz.org/Gallery/directed/hello.html
this is a sample with nodes 'hello' and 'world'
but this sollution does not give you weight...
(see also:http://www.graphviz.org/webdot/basic.html)

and, of course, this is not a PHP solution...

Thanks for your answer.
I know the dot package, actually wrote my master thesis using it, but
as you said, its not a php solution. :(

To anticipate the next answer in this thread: I know about cgi etc,
but I do not have any rights on the server this is supposed to run, so
i search a PURE php solution.

as you know the stuff.....

and you know php.net

it took me 5 mins to create this:
<?php
header("Content-type: image/png");
$im = @imagecreate(11 0, 120)
or die("Cannot Initialize new GD image stream");
$background_col or = imagecoloralloc ate($im, 0, 0, 0);
$text_color = imagecoloralloc ate($im, 233, 14, 91);
//imagestring($im , 1, 5, 5, "A Simple Text String", $text_color);
imageline($im, 10,10, 100, 10, $text_color);
imageline($im, 10,10, 50, 110, $text_color);
imageline($im, 100,10, 50, 110, $text_color);
imagepng($im);
imagedestroy($i m);
?>

which is a nice triangular... ;-)
(thanks to the docs..!!!)

i whish you suc6..


Jan 19 '08 #9
On 19 Jan., 19:47, "Luuk" <l...@invalid.l anwrote:
"itschy" <goo...@00l.des chreef in berichtnews:f3* *************** *************** ***@i7g2000prf. googlegroups.co m...
On 19 Jan., 19:08, "Luuk" <l...@invalid.l anwrote:
"itschy" <goo...@00l.des chreef in
berichtnews:58* *************** *************** ***@v67g2000hse .googlegroups.c om...
On 18 Jan., 23:31, Jensen Somers <jensen.som...@ gmail.comwrote:
PHP has support to create images, so my guess is - if I understand the
problem correctly - you'll just need to find a way to draw dots and
lines, making them thicker depending on the weight they have.
Not quite.
You missed the part, where I mentiond that I do not have any
coordinates of the nodes. Thus I'cant just draw them, cause I don't
know where. :)
What I seek is some solution, which finds a representation according
to the information I have about the edges (that is, connected or not,
and if, what weight/line length do they have).
E.g.:
I have three nodes A,B,C and 3 connections a(A,B,3), b(B,C,4), c(A,C,
5) (each with infos about from_node, to_node and weight/length.
In this szenario, there are only two possible ways to draw that
network correctly:
5
A-----C B
3\ /4 3/ \4
B A-----C
5
And their rotations.
I try to find some tool/algorithm which is able to do this (and draw
it) in php.
Tough luck I guess... :(
itschy
aaah, you mean something
like:http://www.graphviz.org/Gallery/directed/hello.html
this is a sample with nodes 'hello' and 'world'
but this sollution does not give you weight...
(see also:http://www.graphviz.org/webdot/basic.html)
and, of course, this is not a PHP solution...
Thanks for your answer.
I know the dot package, actually wrote my master thesis using it, but
as you said, its not a php solution. :(
To anticipate the next answer in this thread: I know about cgi etc,
but I do not have any rights on the server this is supposed to run, so
i search a PURE php solution.

as you know the stuff.....

and you know php.net

it took me 5 mins to create this:
<?php
header("Content-type: image/png");
$im = @imagecreate(11 0, 120)
or die("Cannot Initialize new GD image stream");
$background_col or = imagecoloralloc ate($im, 0, 0, 0);
$text_color = imagecoloralloc ate($im, 233, 14, 91);
//imagestring($im , 1, 5, 5, "A Simple Text String", $text_color);
imageline($im, 10,10, 100, 10, $text_color);
imageline($im, 10,10, 50, 110, $text_color);
imageline($im, 100,10, 50, 110, $text_color);
imagepng($im);
imagedestroy($i m);
?>

which is a nice triangular... ;-)
(thanks to the docs..!!!)

i whish you suc6..
Luuk, please explain to me how you do that without ANY explicit
coordinates, like 10,10,100,10!
Please, everybody, READ what I write! cheers
Jan 19 '08 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
2537
by: A. Novruzi | last post by:
Hi, I am looking for a free 3D visualization software, running in Linux, and able to visualize 3D functions in nonstructured mesh (basically, my mesh is a set of thetraheders used for some 3D FE computations). Can anyone confirm that indeed MayaVi can visualize 3D functions in nonstructured mesh? I went through the manuals but I didn't find that MayVi can do so.
1
1861
by: Thomas Korimort | last post by:
Hi, how can i visualize the content of the symbol table in Python? Sometimes i want to know which symbols are imported from apackage and such kind of things Greetings, THomas Korimort
9
2995
by: svenn.are | last post by:
Hi, has anybody thought of / already used graphviz to convert the output of trace.py into a graph? I looked at PyUMLGraph, but 1. PyUMLGraph does not successfully create a dot file, and 2. I don't really want a UML representation but a compact representation of program execution. Maybe there is some other tool that I am not aware of which can create this kind of trace. I use eclipse with pydev plugin on MacOS 10.3.9
2
4765
by: Koen | last post by:
Hi all, Is there any example code available somewhere that graphical visualizes a simple network planning (PERT chart)? I have two tables: tblAction: ActionID (PK) Description
7
9501
by: Enrico Castagnola | last post by:
Hi, I have a problem. How can I print a file pdf on server without to visualize it? Thanks Best regard
1
1213
by: Israel | last post by:
Hi... Somebody knows how can i visualize TIF image in my .Net Webproyect, is there a .NET webcontrol who can open and visualize TIF image (Black and white, gray scale and color)? Is there a windows control to use ISIS scanners with VB .NET?
2
1398
by: Rasmus | last post by:
I'm looking for a way to visualize the structure of namespaces in my C# project. Idealy a program that can inspect the dll and provide me with a overview of the namespaces and the classes contain in each. Any ideas?
1
1655
by: richard.hallgren | last post by:
Hi, I have several Xml schemas that I like to visualize in some sort of tree view (so it's possible to expand and collapse different nodes in the schema). I also have to make it possible to select a single element in a node so I need a checkbox (or a click event on the element) to handle this. When fished I'd like to show a schema and to make it possible to select an element and have the name of this element saved in a database.
0
9554
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9377
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9989
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
7358
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6640
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5266
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5405
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
3509
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2788
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.