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 2025: Register Today!

 

Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.


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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

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