BookmarkSubscribeRSS Feed
ShaneRosanbalm
Obsidian | Level 7

I am creating a flow chart with SGPLOT (v9.4m3). This flow chart would have several text boxes with vectors connecting them.

 

Instead of using the annotate RECTANGLE to draw the boxes, I would instead like to take advantage of the OUTLINE feature of the TEXT statement. The problem then becomes, how do I know how big the resulting box is? This is an important detail because I still have to draw my connectors from one box to the next.

 

Is there a way to output the coordinates at which the OUTLINE boxes are drawn (similar to the x1/y1 and x2/y2 that you would specify for a RECTANGLE)? 


sketchy.png
5 REPLIES 5
Jay54
Meteorite | Level 14

It would be interested to know how you go about it.  🙂  

I wrote a few articles on diagrams, including curving the links, and stopping short so the arrowhead could be visible.

You could use a Polygon Plot for the nodes that places the label nicely.

 

http://blogs.sas.com/content/graphicallyspeaking/2016/05/02/directed-link-networks/

 

ShaneRosanbalm
Obsidian | Level 7

I'm currently living under the delusion that I'll be able to perfectly position my connector arrows. Reading between the lines, I think you're saying that the only way that I can know exactly where the boxes are drawn is if I draw them myself (either with annotate RECTANGLE or with the POLYGON statement). Is that a fair conclusion? 

 

Second, I just stumbled upon the OUTFILE= option in GTL TEXTPLOT. I see that it is experimental as of 9.4m3. Is this going to become production with 9.4m4? I wouldn't mind playing around with it if that is the case. Otherwise, I might stick with SGPLOT and POLYGON.

 

Thanks!

ballardw
Super User

You might investigate SAS/OR procedures if they are available at your site. Proc NetDraw for instance uses a data set to create a flow diagram.

If you have enough need it may be worth the additional license if you don't have it as the time spent maintaining vector plot code, especially if you get to insert new steps could be considerable.

Jay54
Meteorite | Level 14

OUTFILE on TEXTPLOT was our first foray into a feedback loop to get back from the renderer the size of a text string as rendered.  

For a text string, we know the height (specified), but not the length of the text box (for proportional fonts).  But the renderer knows.  So we can use the feedback loop and ask the renderer to put the final text box sizes in the file.  Then we can use the final draw size to lay out the words as a Word Cloud in this example.  It is hard to say what would be the future for such a feature.  🙂

 

WordCloud.png

ShaneRosanbalm
Obsidian | Level 7

I'm experimenting with OUTFILE and OUTID using 9.4m3.
1. I understand what DATAHEIGHT and DATAWIDTH represent, but what does DATADESCENT represent?
2. With POSTION=CENTER the OUTLINE box is perfectly centered around the data point. I can use the annotate RECTANGLE to perfectly replicate the box produced by OUTLINE. Is there a way to tell exactly where the OUTLINE box is drawn when POSITION=BOTTOM is specified? I assume it will be the same size as when POSITION=CENTER is specified, but how far down will it have been shifted? Is that information available in the OUTFILE CSV file?
Thanks!


bottom.png

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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
  • 1062 views
  • 0 likes
  • 3 in conversation