Data visualization with SAS programming

How do I know where the OUTLINE box is drawn in the SGPLOT TEXT statement?

Reply
Occasional Contributor
Posts: 16

How do I know where the OUTLINE box is drawn in the SGPLOT TEXT statement?

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)? 

Attachment
SAS Super FREQ
Posts: 1,044

Re: How do I know where the OUTLINE box is drawn in the SGPLOT TEXT statement?

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/

 

Occasional Contributor
Posts: 16

Re: How do I know where the OUTLINE box is drawn in the SGPLOT TEXT statement?

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!

Grand Advisor
Posts: 9,714

Re: How do I know where the OUTLINE box is drawn in the SGPLOT TEXT statement?

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.

SAS Super FREQ
Posts: 1,044

Re: How do I know where the OUTLINE box is drawn in the SGPLOT TEXT statement?

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

Occasional Contributor
Posts: 16

Re: How do I know where the OUTLINE box is drawn in the SGPLOT TEXT statement?

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!

Attachment
Post a Question
Discussion Stats
  • 5 replies
  • 267 views
  • 0 likes
  • 3 in conversation