Subscribe Bookmark RSS Feed

Graph Boxes in the Scripting Index

dqr2

Community Trekker

Joined:

Jun 19, 2015

Hi - I do a quite lot of work with display boxes in general, and Graph Boxes in particular.  While trying to find out more about one its properties (which I've actually now resolved), I looked up "Graph Box" in the Scripting Index - but couldn't actually find it.  Every other type of display box under the sun appears to be listed, including a Graph Builder Box, but not a Graph Box (though there are plenty of references to graph boxes in the examples related to other entries in the index).  Is this actually an oversight, or is there a reason for the omission?

Many thanks

1 ACCEPTED SOLUTION

Accepted Solutions
Solution

GraphBox is a function that returns a nest of displayboxes to make a graph with axes:

12632_pastedImage_0.png

The FrameBox is likely to be the box you want.  The listboxes are concatenating the axisboxes, horizontally and vertically, and you might want them too.  If you are trying to take a bitmap picture, you might want the PictureBox to grab the axes and the graph.

For all that, the OwnerBox returned by GraphBox function does have some special properties to make it easier to work with the graph.  AppBuilder exposes many of the get/set pairs as well.

g=

    Graph Box(

        Frame Size( 300, 300 ),

        Marker(

            Marker State( 3 ),

            [11 44 77],

            [75 25 50]

        );

        Pen Color( "Blue" );

        Line(

            [10 30 70],

            [88 22 44]

        );

    )

DisplayBox[OwnerBox]

showproperties(g)

scriptable [Subtable]

  Title [Action] [Scripting Only]

  FrameSize [Action] [Scripting Only]

  XName [Action] [Scripting Only]

  YName [Action] [Scripting Only]

  XAxis [Action] [Scripting Only]

  YAxis [Action] [Scripting Only]

  X Scale [Action] [Scripting Only]

  Y Scale [Action] [Scripting Only]

  Append Seg [Action] [Scripting Only]

  Get X Name [Action] [Scripting Only]

  Set X Name [Action] [Scripting Only]

  Get Y Name [Action] [Scripting Only]

  Set Y Name [Action] [Scripting Only]

  Get Graphics Script [Action] [Scripting Only]

  Set Graphics Script [Action] [Scripting Only]

  Get X Axis [Action] [Scripting Only]

  Set X Axis [Action] [Scripting Only]

  Get Y Axis [Action] [Scripting Only]

  Set Y Axis [Action] [Scripting Only]

  Get Width [Action] [Scripting Only]

  Set Width [Action] [Scripting Only]

  Get Height [Action] [Scripting Only]

  Set Height [Action] [Scripting Only]

  Get Background Color [Color] [Scripting Only]

  Set Background Color [Color] [Scripting Only]

  Get Background Fill [Boolean] [Scripting Only]

  Set Background Fill [Boolean] [Scripting Only]

  Background Map [Action] [Scripting Only]

  Get Top [Action] [Scripting Only]

  Top [Numeric] [Scripting Only]

  Get Bottom [Action] [Scripting Only]

  Bottom [Numeric] [Scripting Only]

  Get Left [Action] [Scripting Only]

  Left [Numeric] [Scripting Only]

  Get Right [Action] [Scripting Only]

  Right [Numeric] [Scripting Only]

  Get Sides [Action] [Scripting Only]

  Sides [Numeric] [Scripting Only]

Craige
3 REPLIES
Solution

GraphBox is a function that returns a nest of displayboxes to make a graph with axes:

12632_pastedImage_0.png

The FrameBox is likely to be the box you want.  The listboxes are concatenating the axisboxes, horizontally and vertically, and you might want them too.  If you are trying to take a bitmap picture, you might want the PictureBox to grab the axes and the graph.

For all that, the OwnerBox returned by GraphBox function does have some special properties to make it easier to work with the graph.  AppBuilder exposes many of the get/set pairs as well.

g=

    Graph Box(

        Frame Size( 300, 300 ),

        Marker(

            Marker State( 3 ),

            [11 44 77],

            [75 25 50]

        );

        Pen Color( "Blue" );

        Line(

            [10 30 70],

            [88 22 44]

        );

    )

DisplayBox[OwnerBox]

showproperties(g)

scriptable [Subtable]

  Title [Action] [Scripting Only]

  FrameSize [Action] [Scripting Only]

  XName [Action] [Scripting Only]

  YName [Action] [Scripting Only]

  XAxis [Action] [Scripting Only]

  YAxis [Action] [Scripting Only]

  X Scale [Action] [Scripting Only]

  Y Scale [Action] [Scripting Only]

  Append Seg [Action] [Scripting Only]

  Get X Name [Action] [Scripting Only]

  Set X Name [Action] [Scripting Only]

  Get Y Name [Action] [Scripting Only]

  Set Y Name [Action] [Scripting Only]

  Get Graphics Script [Action] [Scripting Only]

  Set Graphics Script [Action] [Scripting Only]

  Get X Axis [Action] [Scripting Only]

  Set X Axis [Action] [Scripting Only]

  Get Y Axis [Action] [Scripting Only]

  Set Y Axis [Action] [Scripting Only]

  Get Width [Action] [Scripting Only]

  Set Width [Action] [Scripting Only]

  Get Height [Action] [Scripting Only]

  Set Height [Action] [Scripting Only]

  Get Background Color [Color] [Scripting Only]

  Set Background Color [Color] [Scripting Only]

  Get Background Fill [Boolean] [Scripting Only]

  Set Background Fill [Boolean] [Scripting Only]

  Background Map [Action] [Scripting Only]

  Get Top [Action] [Scripting Only]

  Top [Numeric] [Scripting Only]

  Get Bottom [Action] [Scripting Only]

  Bottom [Numeric] [Scripting Only]

  Get Left [Action] [Scripting Only]

  Left [Numeric] [Scripting Only]

  Get Right [Action] [Scripting Only]

  Right [Numeric] [Scripting Only]

  Get Sides [Action] [Scripting Only]

  Sides [Numeric] [Scripting Only]

Craige
dqr2

Community Trekker

Joined:

Jun 19, 2015

Perfect - many thanks for the comprehensive explanation!

Craige_Hales

Staff

Joined:

Mar 21, 2013

On the way to the office, I realized there is still a hole in the discussion:  what is it the OwnerBox owns?  It is a scriptable object, which means there should be a graph box object.  For some reason, it is named Custom Graph.  And it is not filled out very well in the scripting index.  I'll add that to the "to do" list.

Thanks!

12634_pastedImage_1.png

Craige