Newbie in GoDiagram

Hi sir/madam,

I found this GoDiagram from the internet. It looks interesting to me. I'm trying to write program that can show a multiple relationship diagram. I found some examples from the "\GoDiagram Web 2.6.2 for .NET 2.0\Samples". However i cannot find any suitable example.
The multiple relationship program will read data from the database and draw the relationship in a node type.
Eg. a
/ \ \
b c \
/ \ / \ \
d e f g\
\ /
h
Another question is can i put names on the nodes in the LayoutDemo's example?
Please advice.
Thanks,
way77

DataSetDemo is a sample to look at in terms of reading nodes and links directly from database tables.

LayoutDemo does not set the labels to be editable, but that's certainly an option with GoDiagram.

Dear Jake,

Can you show me an example of multiple relationship diagram with a label on every node? (eg. node a, node b, and etc...)
Thanks,
eeway

In LayoutDemo, if you use the menu item to create a node, you can give the node a unique label…

Hi,

Thanks for your reply. However, I'm using the GoDiagram Web. Does it work the same way? Can you show me an examples that take the data from the database and draw the above diagram automatically?
Please advice.
thanks and regards,
eeway

We have 25 Windows Forms samples, and 20 of them are also available under Web Forms as well.

go to http://www.godotnetweb.com/ to see them running.
DataSetDemo is one of those.

Thanks. By the way, there is no function of the open file button. There is no different if i choose other file to open.

eeway

I assume you are talking about the C# version of GoDiagram Web’s LayoutDemo.

It appears we accidentally removed the OnClick attribute from the OpenButton and the SaveButton elements, in WebForm1.aspx. They need to refer to the OpenButton_Click and SaveButton_Click methods, respectively.

Sorry about that.

However, the Windows Forms version of LayoutDemo has a lot more control over the behavior of each kind of layout, since it has separate dialogs with lots of controls. Since the functionality is the same for both platforms, if you want to play with the different kinds of layout, it would be a lot easier to do so with the Windows Forms version of LayoutDemo.

Also, you’ll want to use GoLayoutLayeredDigraph, not GoLayoutTree. DataSetDemo uses GoLayoutTree since the org chart it shows is just a tree, not the more complex graph that you want to display.

Thanks for your kind help.

Hi Jake,

I have some question on GoDiagram here.
1. Inside the LayoutDemo, what is the file format for AssemblyLine, HoneyComb and etc? These file can be found inside the File folder in the Layout Demo.
2. How do i link two nodes together with arrows or links using c# coding? Which function should i use?
3. How do i change the arrow head's direction using c# coding? Which function should i use?
Please help.
  1. It’s a binary format that we first defined for the LayoutDemo example in JGo, many years ago. I don’t recommend that you try to use it, since it is very specific to that particular sample application.

  2. A number of the sample applications demonstrate this. Something like:

[code] // create two nodes for fun…
GoBasicNode node1 = new GoBasicNode();
// specify label, appearance, and position
node1.LabelSpot = GoObject.Middle;
node1.Text = “first”;
node1.Brush = Brushes.Blue;
node1.Location = new PointF(100, 100);
// add to the document, not to the view
goView1.Document.Add(node1);

  GoBasicNode node2 = new GoBasicNode();
  node2.LabelSpot = GoObject.Middle;
  node2.Text = "second";
  node2.Brush = Brushes.Magenta;
  node2.Location = new PointF(200, 100);
  goView1.Document.Add(node2);

  // create a link between the two nodes' ports
  GoLink link = new GoLink();
  link.ToArrow = true;
  link.FromPort = node1.Port;
  link.ToPort = node2.Port;
  goView1.Document.Add(link);

[/code]

  1. If you want to change arrowhead appearance, you can set the various GoStroke properties whose names start with “ToArrow” or “FromArrow”.

Or you can reverse the link by swapping the GoLink.FromPort and .ToPort property values.

Dear Jake,

I have another question. How do I add one node to several other nodes using coding. (eg. a )
/ \
b c
thanks.

Not quite sure what you’re asking. The code Walter gave you above adds 2 nodes with a link between them. Just extend that. Or look at the code in the samples.

It’s ok. I will try to extend from the example. By the way, is there any function that storing the nodes (which are inside the goView) info. (Eg. their label).

what is the function of AddedChildName() under the GoNode? I cannot understand the meaning inside the user manual. thanks.

The DataSetDemo sample provides a demo of reading/writing a database.
The ProtoApp, FlowCharter, OrgCharter, StateCharter, and Processor samples read/write XML, some in more than one format.

AddChildName allows a node class to name parts (e.g. "leftport" or "label"). It lets the node find that part without having to have an explicit pointer to it in the class.

hi,

How do i check whether a node with text "ABC" is plotted inside the GoView and how do i select that node and start drawing a link from the node to other nodes? Can it be done in coding? For your info, i'm initialize all nodes using the same name (eg. node1).
please advice.
thanks.

Any examples on AddChildName ()?

thanks.

Demo1 and OrgCharter both use AddChildName.

At Northwoods, we all use X1 or Google Desktop to search for specific things in samples. I guess you can use Visual Studio too if you set up a search path that includes the whole Go/Samples tree.

re: How do i check whether a node with text “ABC” is plotted inside the GoView

GoDocument.FindNode can find nodes by label. Samples in the User Guide and Classier and FamilyTree samples.