The Datum class gives you access to datums in T/HIS. More...
The T/HIS JavaScript API provides many class constants, properties and methods. For Arup to
be able to extend and enhance the API in the future any constant, property or method names beginning with a lowercase
or uppercase letter are reserved.
If you need to add your own properties or methods to one of the existing classes then to avoid any potential future conflict you
should ensure that the name begins with either an underscore (_) or a dollar sign ($) or the name is prefixed with your
own unique identifier.
For example if company 'ABC' need to add a property called 'example' then to avoid any potential future conflict use one of:
| Name | Type | Description |
| acronym | string | Datum acronym |
| fill_colour_above | Colour | The colour above the datum line |
| fill_colour_below | Colour | The colour below the datum line |
| fill_colour_between | Colour | The colour in between the datum line and the optional second datum line |
| fill_colour_left | Colour | The colour left of the datum line |
| fill_colour_right | Colour | The colour right of the datum line |
| fill_type | integer | The fill type. Can be Datum.FILL_ABOVE_BELOW, Datum.FILL_RIGHT_LEFT. Note that this can only be changed if the datum is of the type Datum.POINTS. |
| label | string | Datum label |
| label2 | string | Label for optional 2nd datum line |
| label_colour | Colour | The colour of the datum label |
| label_font | integer | The label font. Can be Datum.LABEL_DEFAULT, Datum.LABEL_HELVETICA_BOLD, Datum.LABEL_HELVETICA_MEDIUM, Datum.LABEL_TIMES_BOLD, Datum.LABEL_TIMES_MEDIUM, Datum.LABEL_COURIER_BOLD, Datum.LABEL_COURIER_MEDIUM |
| label_orientation | integer | The orientation of the label. Can be Datum.LABEL_HORIZONTAL, Datum.LABEL_VERTICAL |
| label_position | integer | The label position. Can be Datum.LABEL_NONE, Datum.LABEL_ABOVE_CENTRE, Datum.LABEL_ABOVE_LEFT, Datum.LABEL_ABOVE_RIGHT, Datum.LABEL_BELOW_CENTRE, Datum.LABEL_BELOW_LEFT, Datum.LABEL_BELOW_RIGHT, Datum.LABEL_MIDDLE_LEFT, Datum.LABEL_TOP_LEFT, Datum.LABEL_BOTTOM_LEFT, Datum.LABEL_MIDDLE_RIGHT, Datum.LABEL_TOP_RIGHT, Datum.LABEL_BOTTOM_RIGHT |
| label_size | integer | The label font size. Can be Datum.LABEL_AUTOMATIC, Datum.LABEL_8_POINT, Datum.LABEL_10_POINT, Datum.LABEL_12_POINT, Datum.LABEL_14_POINT, Datum.LABEL_18_POINT, Datum.LABEL_24_POINT, |
| line_colour | Colour | The colour of the datum line |
| line_style | LineStyle | The line style used to draw the datum line |
| line_width | LineWidth | The line width used to draw the datum line |
Detailed DescriptionThe Datum class allows you to create and manipulate datums. See the documentation below for more details. |
Constructornew Datum(acronym[string], type[integer], value[real or array of reals], second value (optional)[real])DescriptionCreate a new Datum object. The datum will be added to all the currently active graphs. |
Datum acronym
Specify type of datum line. Can be Datum.CONSTANT_X, Datum.CONSTANT_Y, Datum.CONSTANT_Y2, Datum.POINTS
Value for Datum.CONSTANT_X, Datum.CONSTANT_Y or Datum.CONSTANT_Y2 type Datum. If it is a Datum.POINTS type Datum then this should be an array of X, Y pairs or a curve ID to copy points from.
Second constant value for use with constant X,Y or Y2 datums and can optionally be provided
ReturnsDatum object Return typeDatum |
Details of functionsAddToGraph(graph (optional)[int])DescriptionAdds a datum to a graph. |
Graph to add the datum to. If undefined then the datum is added to all graphs.
This argument can be repeated if required
Alternatively a single array argument containing the multiple values can be given
ReturnsNo return value. |
ExampleTo add a datum (d) to graphs 1 and 3: d.AddToGraph(1, 3); To add a datum (d) to all graphs: d.AddToGraph();
|
Delete(datum[string]) [static]DescriptionDeletes a datum |
Acronym of datum to delete
ReturnsNo return value |
ExampleTo delete datum "my_datum" Datum.Delete("my_datum");
|
Exists(datum[string]) [static]DescriptionChecks if a datum exists |
Acronym of datum to check
ReturnsTRUE if the datum exists, otherwise FALSE Return typeBoolean |
ExampleTo check if a datum "my_datum" exists var exists = Datum.Exists("my_datum");
|
First() [static]DescriptionReturns the first datum. |
No arguments
ReturnsDatum object (or null if there are no datum in the model). Return typeDatum |
ExampleTo get the 1st datum var d = Datum.First();
|
GetFromAcronym(datum[string]) [static]DescriptionReturns the datum object for a datum acronym. |
Acronym of datum to return object for
ReturnsDatum object (or null if the datum does not exist). Return typeDatum |
ExampleTo get the datum "my_datum" var d = Datum.GetFromAcronym("my_datum");
|
IsOnGraph(graph[int])DescriptionReturns whether a datum is on a graph. |
Graph id
Returnstrue if it is on the graph, false otherwise Return typeBoolean |
ExampleTo check if datum (d) is on graph 3: d.IsOnGraph(3);
|
Next()DescriptionReturns the next datum in the model. |
No arguments
ReturnsDatum object (or null if there are no more datums in the model). Return typeDatum |
ExampleTo get the next datum after datum d: var datum = d.Next();
|
RemoveFromGraph(graph (optional)[int])DescriptionRemoves a datum from a graph. |
Graph to remove the datum from. If undefined then the datum is removed from all graphs.
This argument can be repeated if required
Alternatively a single array argument containing the multiple values can be given
ReturnsNo return value. |
ExampleTo remove a datum (d) from graphs 1 and 3: d.RemoveFromGraph(1,3); To remove a datum (d) from all graphs: d.RemoveFromGraph();
|