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:
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!
Hi Kharp,
Thanks a lot, it looks like exactly what was needed!
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!
You could try this one
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 ).
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.
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.
Ready to level-up your skills? Choose your own adventure.