BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Yura2301
Quartz | Level 8

Hi ,

Would like to ask the best way to visualize the relations like:

data Relations;

          RelationId= 1 ; From= 'Node 1' ;to= 'Node 2' ;Output;

          RelationId= 2 ; From= 'Node 1' ;to= 'Node 3' ;Output;

          RelationId= 3 ; From= 'Node 1' ;to= 'Node 4' ;Output;

          RelationId= 4 ; From= 'Node 2' ;to= 'Node 4' ;Output;

run;

 

In the end I would like to have graph or tree like that:

Yura2301_0-1643208335654.png

 

Offcourse ideally will be if links will not cross etc. I see there are a lot of options, proc sgplot proc ,proc gtree , hpsplit etc. 

Looked a bit deeper to sgplot ,  built approximately needed tree but the view complitely not scalable, plus requires manually calculating X and Y axis, nodes names looks like can't be placed inside of nodes(like on image above) etc., so I just hope maybe there is some more logical and elegant way for the simple goal.

 

Thanks in adwanced for any advices!

 

1 ACCEPTED SOLUTION
5 REPLIES 5
Yura2301
Quartz | Level 8

Hi Kharp,

Thanks a lot, it looks like exactly what was needed!

Yura2301
Quartz | Level 8

Hi Ksharp,

Thanks for the input.

Already tried the sgplot procedure and drows the basic diagrams, as was needed.

But when there are a lot of nodes, links(relations between objects) - the diagram not scalable, nod readble, lines crosses etc.

Generally I hoped that maybe there are ready procedure that took relations table and build the tree in smart way, so doing all tech. pre-tasks for you, taking into consideration basic tree traversal properties like - number of child nodes, depth of tree etc.

Instead sgplot procedure requires partly manually calcualte X Y axis, take into consider size of page, ODS(in physical image - view can be readble but in SAS EG outptut  -nop, and reversally etc.).

I've found a few third-party tools that do the drawing of diagram, but generally I just really wonder that SAS doesn't have so obvious feature ready, like a bit strange do not have that feature but to have cool and powerfull f.e. proc forecast and tens of other procedures that BI/DB developer will not find in any other products, but it's just thoughts in loud:), I 'm sure there are serious arguments why the procedure not ready yet, f.e. if it's 500 nodes and 1000 relations - draw it correctly and readable - chanlanging for sure.

 

Have a nice weekend!

Ksharp
Super User

You could try this one

Ksharp_0-1643433863927.png

But I never used it before.

 

And if you have SAS/EM ,you also could try LINKED node (search it documentation at support.sas.com ).

Ksharp_1-1643433958171.png

Ksharp_3-1643433992814.png

 

Ksharp_4-1643434019967.pngKsharp_5-1643434043176.png

 

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 5 replies
  • 558 views
  • 2 likes
  • 2 in conversation