UNPKG

terriajs

Version:

Geospatial data visualization platform.

3,633 lines (959 loc) 117 kB
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>JSDoc: Class: TableStructure</title> <script src="scripts/prettify/prettify.js"> </script> <script src="scripts/prettify/lang-css.js"> </script> <!--[if lt IE 9]> <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script> <![endif]--> <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css"> <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css"> </head> <body> <div id="main"> <h1 class="page-title">Class: TableStructure</h1> <section> <header> <h2><span class="attribs"><span class="type-signature"></span></span>TableStructure<span class="signature">(name<span class="signature-attributes">opt</span>, options<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></h2> </header> <article> <div class="container-overview"> <h4 class="name" id="TableStructure"><span class="type-signature"></span>new TableStructure<span class="signature">(name<span class="signature-attributes">opt</span>, options<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></h4> <div class="description"> <p>TableStructure provides an abstraction of a data table, ie. a structure with rows and columns. Its primary responsibility is to load and parse the data, from csvs or other. It stores each column as a TableColumn, and saves the rows too if conversion to rows is requested. Columns are also sorted by type for easier access.</p> </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th>Attributes</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>name</code></td> <td class="type"> <span class="param-type">String</span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="description last"><p>Name to use in the NowViewing tab, defaults to 'Display Variable'.</p></td> </tr> <tr> <td class="name"><code>options</code></td> <td class="type"> <span class="param-type">Object</span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="description last"><p>Options:</p> <h6>Properties</h6> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th>Attributes</th> <th>Default</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>displayVariableTypes</code></td> <td class="type"> <span class="param-type">Array</span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="default"> </td> <td class="description last"><p>Which variable types to show in the NowViewing tab. Defaults to ENUM, SCALAR, and ALT (not LAT, LON or TIME).</p></td> </tr> <tr> <td class="name"><code>unallowedTypes</code></td> <td class="type"> <span class="param-type">Array.&lt;VarType></span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="default"> </td> <td class="description last"><p>An array of types which should not be guessed. If not present, all types are allowed. Cannot include VarType.SCALAR.</p></td> </tr> <tr> <td class="name"><code>initialTimeSource</code></td> <td class="type"> <span class="param-type">String</span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="default"> </td> <td class="description last"><p>A string specifiying the value of the animation timeline at start. Valid options are: (&quot;present&quot;: closest to today's date, &quot;start&quot;: start of time range of animation, &quot;end&quot;: end of time range of animation, An ISO8601 date e.g. &quot;2015-08-08&quot;: specified date or nearest if date is outside range).</p></td> </tr> <tr> <td class="name"><code>displayDuration</code></td> <td class="type"> <span class="param-type">Number</span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="default"> </td> <td class="description last"><p>Passed on to TableColumn, unless overridden by options.columnOptions.</p></td> </tr> <tr> <td class="name"><code>replaceWithNullValues</code></td> <td class="type"> <span class="param-type">Array.&lt;String></span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="default"> </td> <td class="description last"><p>Passed on to TableColumn, unless overridden by options.columnOptions.</p></td> </tr> <tr> <td class="name"><code>replaceWithZeroValues</code></td> <td class="type"> <span class="param-type">Array.&lt;String></span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="default"> </td> <td class="description last"><p>Passed on to TableColumn, unless overridden by options.columnOptions.</p></td> </tr> <tr> <td class="name"><code>columnOptions</code></td> <td class="type"> <span class="param-type">Object</span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="default"> </td> <td class="description last"><p>An object with keys identifying columns (column names or indices), and per-column properties displayDuration, replaceWithNullValues, replaceWithZeroValues, name, active, units and/or type. For type, converts strings, which are case-insensitive keys of VarType, to their VarType integer.</p></td> </tr> <tr> <td class="name"><code>getColorCallback</code></td> <td class="type"> <span class="param-type">function</span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="default"> </td> <td class="description last"><p>Passed to DisplayVariableConcept.</p></td> </tr> <tr> <td class="name"><code>sourceFeature</code></td> <td class="type"> <span class="param-type">Entity</span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="default"> </td> <td class="description last"><p>The feature to which this table applies, if any; not used internally by TableStructure or TableColumn.</p></td> </tr> <tr> <td class="name"><code>idColumnNames</code></td> <td class="type"> <span class="param-type">Array</span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="default"> </td> <td class="description last"><p>An array of column names/indexes/ids which identify unique features across rows (see CsvCatalogItem.idColumns).</p></td> </tr> <tr> <td class="name"><code>isSampled</code></td> <td class="type"> <span class="param-type">Boolean</span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="default"> </td> <td class="description last"><p>Does this data correspond to &quot;sampled&quot; data? See CsvCatalogItem.isSampled for an explanation.</p></td> </tr> <tr> <td class="name"><code>shaveSeconds</code></td> <td class="type"> <span class="param-type">Number</span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="default"> </td> <td class="description last"><p>How many seconds to shave off each time period so periods do not overlap. Defaults to 1 second.</p></td> </tr> <tr> <td class="name"><code>finalEndJulianDate</code></td> <td class="type"> <span class="param-type">JulianDate</span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="default"> </td> <td class="description last"><p>If present, use this as the final end date for all points.</p></td> </tr> <tr> <td class="name"><code>requireSomeActive</code></td> <td class="type"> <span class="param-type">Boolean</span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="default"> false </td> <td class="description last"><p>Set to true if at least one column must be selected at all times.</p></td> </tr> </tbody> </table> </td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="Map_TableStructure.js.html">Map/TableStructure.js</a>, <a href="Map_TableStructure.js.html#line66">line 66</a> </li></ul></dd> </dl> </div> <h3 class="subsection-title">Extends</h3> <ul> <li><a href="DisplayVariablesConcept.html">DisplayVariablesConcept</a></li> </ul> <h3 class="subsection-title">Members</h3> <h4 class="name" id=".defaultDisplayVariableTypes"><span class="type-signature">(static) </span>defaultDisplayVariableTypes<span class="type-signature"> :Array</span></h4> <div class="description"> <p>Expose the default display variable types.</p> </div> <h5>Type:</h5> <ul> <li> <span class="param-type">Array</span> </li> </ul> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="Map_TableStructure.js.html">Map/TableStructure.js</a>, <a href="Map_TableStructure.js.html#line281">line 281</a> </li></ul></dd> </dl> <h4 class="name" id="_activeTimeColumnNameIdOrIndex"><span class="type-signature"></span>_activeTimeColumnNameIdOrIndex<span class="type-signature"> :String|Number|Array.&lt;String>|Array.&lt;Number>|undefined</span></h4> <div class="description"> <p>Gets or sets the active time column name, id or index. If you pass an array of two such, eg. [0, 1], treats these as the start and end date column identifiers.</p> </div> <h5>Type:</h5> <ul> <li> <span class="param-type">String</span> | <span class="param-type">Number</span> | <span class="param-type">Array.&lt;String></span> | <span class="param-type">Array.&lt;Number></span> | <span class="param-type">undefined</span> </li> </ul> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="Map_TableStructure.js.html">Map/TableStructure.js</a>, <a href="Map_TableStructure.js.html#line91">line 91</a> </li></ul></dd> </dl> <h4 class="name" id="activeTimeColumn"><span class="type-signature"></span>activeTimeColumn<span class="type-signature"> :<a href="TableColumn.html">TableColumn</a></span></h4> <div class="description"> <p>Gets the active time column for this structure. If two were provided (for the start and end times), return only the start date column.</p> </div> <h5>Type:</h5> <ul> <li> <span class="param-type"><a href="TableColumn.html">TableColumn</a></span> </li> </ul> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="Map_TableStructure.js.html">Map/TableStructure.js</a>, <a href="Map_TableStructure.js.html#line205">line 205</a> </li></ul></dd> </dl> <h4 class="name" id="allowMultiple"><span class="type-signature"></span>allowMultiple<span class="type-signature"> :Boolean</span></h4> <div class="description"> <p>Gets or sets a flag for whether more than one checkbox can be selected at a time. Default false.</p> </div> <h5>Type:</h5> <ul> <li> <span class="param-type">Boolean</span> </li> </ul> <dl class="details"> <dt class="inherited-from">Inherited From:</dt> <dd class="inherited-from"><ul class="dummy"><li> <a href="DisplayVariablesConcept.html#allowMultiple">DisplayVariablesConcept#allowMultiple</a> </li></ul></dd> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="Map_DisplayVariablesConcept.js.html">Map/DisplayVariablesConcept.js</a>, <a href="Map_DisplayVariablesConcept.js.html#line43">line 43</a> </li></ul></dd> </dl> <h4 class="name" id="color"><span class="type-signature"></span>color<span class="type-signature"> :String</span></h4> <div class="description"> <p>String describing the color of this node, if applicable. This property is observable.</p> </div> <h5>Type:</h5> <ul> <li> <span class="param-type">String</span> </li> </ul> <dl class="details"> <dt class="inherited-from">Inherited From:</dt> <dd class="inherited-from"><ul class="dummy"><li> <a href="VariableConcept.html#color">VariableConcept#color</a> </li></ul></dd> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="Map_VariableConcept.js.html">Map/VariableConcept.js</a>, <a href="Map_VariableConcept.js.html#line53">line 53</a> </li></ul></dd> </dl> <h4 class="name" id="columns"><span class="type-signature"></span>columns<span class="type-signature"> :Array.&lt;<a href="TableColumn.html">TableColumn</a>></span></h4> <div class="description"> <p>Gets or sets the columns for this structure.</p> </div> <h5>Type:</h5> <ul> <li> <span class="param-type">Array.&lt;<a href="TableColumn.html">TableColumn</a>></span> </li> </ul> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="Map_TableStructure.js.html">Map/TableStructure.js</a>, <a href="Map_TableStructure.js.html#line118">line 118</a> </li></ul></dd> </dl> <h4 class="name" id="exclusiveChildIds"><span class="type-signature"></span>exclusiveChildIds<span class="type-signature"> :Array.&lt;String></span></h4> <div class="description"> <p>Gets or sets a list of child ids which cannot be selected at the same time as any other child. Defaults to []. Only relevant with allowMultiple = true. Eg. Suppose the child concepts have ids &quot;10&quot; for 10 year olds, etc, plus &quot;ALL&quot; for all ages, &quot;U21&quot; and &quot;21PLUS&quot; for under and over 21 year olds. Then by specifying [&quot;ALL&quot;, &quot;U21&quot;, &quot;21PLUS&quot;], when the user selects one of these values, any other values will be unselected. And when the user selects any other value (eg. &quot;10&quot;), if any of these values were selected, they will be unselected.</p> </div> <h5>Type:</h5> <ul> <li> <span class="param-type">Array.&lt;String></span> </li> </ul> <dl class="details"> <dt class="inherited-from">Inherited From:</dt> <dd class="inherited-from"><ul class="dummy"><li> <a href="DisplayVariablesConcept.html#exclusiveChildIds">DisplayVariablesConcept#exclusiveChildIds</a> </li></ul></dd> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="Map_DisplayVariablesConcept.js.html">Map/DisplayVariablesConcept.js</a>, <a href="Map_DisplayVariablesConcept.js.html#line88">line 88</a> </li></ul></dd> </dl> <h4 class="name" id="finishJulianDates"><span class="type-signature"></span>finishJulianDates<span class="type-signature"> :Array.&lt;JulianDate></span></h4> <div class="description"> <p>Returns an array of the finish Julian dates for each row. Only defined if there is an active time column.</p> </div> <h5>Type:</h5> <ul> <li> <span class="param-type">Array.&lt;JulianDate></span> </li> </ul> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="Map_TableStructure.js.html">Map/TableStructure.js</a>, <a href="Map_TableStructure.js.html#line234">line 234</a> </li></ul></dd> </dl> <h4 class="name" id="getColorCallback"><span class="type-signature"></span>getColorCallback<span class="type-signature"> :function</span></h4> <div class="description"> <p>Gets or sets a function with no arguments that returns a color for the VariableConcept. If undefined, no color is set (the default).</p> </div> <h5>Type:</h5> <ul> <li> <span class="param-type">function</span> </li> </ul> <dl class="details"> <dt class="inherited-from">Inherited From:</dt> <dd class="inherited-from"><ul class="dummy"><li> <a href="DisplayVariablesConcept.html#getColorCallback">DisplayVariablesConcept#getColorCallback</a> </li></ul></dd> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="Map_DisplayVariablesConcept.js.html">Map/DisplayVariablesConcept.js</a>, <a href="Map_DisplayVariablesConcept.js.html#line56">line 56</a> </li></ul></dd> </dl> <h4 class="name" id="id"><span class="type-signature"></span>id<span class="type-signature"> :String</span></h4> <div class="description"> <p>Gets or sets the id of the concept item. By default this is the same as the name. It is allowed to be different eg. for csv files with tersely-named columns.</p> </div> <h5>Type:</h5> <ul> <li> <span class="param-type">String</span> </li> </ul> <dl class="details"> <dt class="inherited-from">Inherited From:</dt> <dd class="inherited-from"><ul class="dummy"><li> <a href="Concept.html#id">Concept#id</a> </li></ul></dd> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="Map_Concept.js.html">Map/Concept.js</a>, <a href="Map_Concept.js.html#line20">line 20</a> </li></ul></dd> </dl> <h4 class="name" id="isActive"><span class="type-signature"></span>isActive<span class="type-signature"> :Boolean</span></h4> <div class="description"> <p>Gets or sets a value indicating whether this variable is currently active. This property is observable.</p> </div> <h5>Type:</h5> <ul> <li> <span class="param-type">Boolean</span> </li> </ul> <dl class="details"> <dt class="inherited-from">Inherited From:</dt> <dd class="inherited-from"><ul class="dummy"><li> <a href="VariableConcept.html#isActive">VariableConcept#isActive</a> </li></ul></dd> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="Map_VariableConcept.js.html">Map/VariableConcept.js</a>, <a href="Map_VariableConcept.js.html#line41">line 41</a> </li></ul></dd> </dl> <h4 class="name" id="isOpen"><span class="type-signature"></span>isOpen<span class="type-signature"> :Boolean</span></h4> <div class="description"> <p>Gets or sets a value indicating whether this concept item is currently open. When an item is open, its child items (if any) are visible. Default true.</p> </div> <h5>Type:</h5> <ul> <li> <span class="param-type">Boolean</span> </li> </ul> <dl class="details"> <dt class="inherited-from">Inherited From:</dt> <dd class="inherited-from"><ul class="dummy"><li> <a href="DisplayVariablesConcept.html#isOpen">DisplayVariablesConcept#isOpen</a> </li></ul></dd> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="Map_DisplayVariablesConcept.js.html">Map/DisplayVariablesConcept.js</a>, <a href="Map_DisplayVariablesConcept.js.html#line71">line 71</a> </li></ul></dd> </dl> <h4 class="name" id="isSelectable"><span class="type-signature"></span>isSelectable<span class="type-signature"> :Boolean</span></h4> <div class="description"> <p>Gets or sets a flag indicating whether this node is selectable.</p> </div> <h5>Type:</h5> <ul> <li> <span class="param-type">Boolean</span> </li> </ul> <dl class="details"> <dt class="inherited-from">Inherited From:</dt> <dd class="inherited-from"><ul class="dummy"><li> <a href="DisplayVariablesConcept.html#isSelectable">DisplayVariablesConcept#isSelectable</a> </li></ul></dd> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="Map_DisplayVariablesConcept.js.html">Map/DisplayVariablesConcept.js</a>, <a href="Map_DisplayVariablesConcept.js.html#line77">line 77</a> </li></ul></dd> </dl> <h4 class="name" id="isVisible"><span class="type-signature"></span>isVisible<span class="type-signature"> :Boolean</span></h4> <div class="description"> <p>Gets or sets a value indicating whether this concept is visible. Defaults to true.</p> </div> <h5>Type:</h5> <ul> <li> <span class="param-type">Boolean</span> </li> </ul> <dl class="details"> <dt class="inherited-from">Inherited From:</dt> <dd class="inherited-from"><ul class="dummy"><li> <a href="Concept.html#isVisible">Concept#isVisible</a> </li></ul></dd> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="Map_Concept.js.html">Map/Concept.js</a>, <a href="Map_Concept.js.html#line61">line 61</a> </li></ul></dd> </dl> <h4 class="name" id="items"><span class="type-signature"></span>items<span class="type-signature"> :Array.&lt;<a href="Concept.html">Concept</a>></span></h4> <div class="description"> <p>Gets or sets the array of concepts contained in this group. If options.items is present, each item's parent property is overridden with <code>this</code>.</p> </div> <h5>Type:</h5> <ul> <li> <span class="param-type">Array.&lt;<a href="Concept.html">Concept</a>></span> </li> </ul> <dl class="details"> <dt class="inherited-from">Inherited From:</dt> <dd class="inherited-from"><ul class="dummy"><li> <a href="DisplayVariablesConcept.html#items">DisplayVariablesConcept#items</a> </li></ul></dd> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="Map_DisplayVariablesConcept.js.html">Map/DisplayVariablesConcept.js</a>, <a href="Map_DisplayVariablesConcept.js.html#line63">line 63</a> </li></ul></dd> </dl> <h4 class="name" id="name"><span class="type-signature"></span>name<span class="type-signature"> :String</span></h4> <div class="description"> <p>Gets or sets the name of the concept item. This property is observable.</p> </div> <h5>Type:</h5> <ul> <li> <span class="param-type">String</span> </li> </ul> <dl class="details"> <dt class="inherited-from">Inherited From:</dt> <dd class="inherited-from"><ul class="dummy"><li> <a href="Concept.html#name">Concept#name</a> </li></ul></dd> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="Map_Concept.js.html">Map/Concept.js</a>, <a href="Map_Concept.js.html#line26">line 26</a> </li></ul></dd> </dl> <h4 class="name" id="parent"><span class="type-signature"></span>parent<span class="type-signature"> :Array.&lt;<a href="VariableConcept.html">VariableConcept</a>></span></h4> <div class="description"> <p>Gets or sets the parent for a node. This property is observable.</p> </div> <h5>Type:</h5> <ul> <li> <span class="param-type">Array.&lt;<a href="VariableConcept.html">VariableConcept</a>></span> </li> </ul> <dl class="details"> <dt class="inherited-from">Inherited From:</dt> <dd class="inherited-from"><ul class="dummy"><li> <a href="VariableConcept.html#parent">VariableConcept#parent</a> </li></ul></dd> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="Map_VariableConcept.js.html">Map/VariableConcept.js</a>, <a href="Map_VariableConcept.js.html#line34">line 34</a> </li></ul></dd> </dl> <h4 class="name" id="requireSomeActive"><span class="type-signature"></span>requireSomeActive<span class="type-signature"> :Boolean</span></h4> <div class="description"> <p>Gets or sets a flag for whether at least one checkbox must be selected at all times. Default false.</p> </div> <h5>Type:</h5> <ul> <li> <span class="param-type">Boolean</span> </li> </ul> <dl class="details"> <dt class="inherited-from">Inherited From:</dt> <dd class="inherited-from"><ul class="dummy"><li> <a href="DisplayVariablesConcept.html#requireSomeActive">DisplayVariablesConcept#requireSomeActive</a> </li></ul></dd> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="Map_DisplayVariablesConcept.js.html">Map/DisplayVariablesConcept.js</a>, <a href="Map_DisplayVariablesConcept.js.html#line50">line 50</a> </li></ul></dd> </dl> <h4 class="name" id="timeIntervals"><span class="type-signature"></span>timeIntervals<span class="type-signature"> :Array.&lt;TimeIntervalCollection></span></h4> <div class="description"> <p>Returns an array describing when each row is visible. Only defined if there is an active time column.</p> </div> <h5>Type:</h5> <ul> <li> <span class="param-type">Array.&lt;TimeIntervalCollection></span> </li> </ul> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="Map_TableStructure.js.html">Map/TableStructure.js</a>, <a href="Map_TableStructure.js.html#line219">line 219</a> </li></ul></dd> </dl> <h4 class="name" id="toggleActiveCallback"><span class="type-signature"></span>toggleActiveCallback<span class="type-signature"> :function</span></h4> <div class="description"> <p>Gets or sets a function which is called whenever a child item is successfully toggled. Its sole argument is the toggled child item.</p> </div> <h5>Type:</h5> <ul> <li> <span class="param-type">function</span> </li> </ul> <dl class="details"> <dt class="inherited-from">Inherited From:</dt> <dd class="inherited-from"><ul class="dummy"><li> <a href="DisplayVariablesConcept.html#toggleActiveCallback">DisplayVariablesConcept#toggleActiveCallback</a> </li></ul></dd> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="Map_DisplayVariablesConcept.js.html">Map/DisplayVariablesConcept.js</a>, <a href="Map_DisplayVariablesConcept.js.html#line95">line 95</a> </li></ul></dd> </dl> <h3 class="subsection-title">Methods</h3> <h4 class="name" id=".fromCsv"><span class="type-signature">(static) </span>fromCsv<span class="signature">(csvString, result<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></h4> <div class="description"> <p>Create a TableStructure from a string in csv format. Understands \r\n, \r and \n as newlines.</p> </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th>Attributes</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>csvString</code></td> <td class="type"> <span class="param-type">String</span> </td> <td class="attributes"> </td> <td class="description last"><p>String in csv format.</p></td> </tr> <tr> <td class="name"><code>result</code></td> <td class="type"> <span class="param-type"><a href="TableStructure.html">TableStructure</a></span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="description last"><p>A pre-existing TableStructure object; if not present, creates a new one.</p></td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="Map_TableStructure.js.html">Map/TableStructure.js</a>, <a href="Map_TableStructure.js.html#line320">line 320</a> </li></ul></dd> </dl> <h4 class="name" id=".fromJson"><span class="type-signature">(static) </span>fromJson<span class="signature">(json, result<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></h4> <div class="description"> <p>Create a TableStructure from a JSON object, eg. [['x', 'y'], [1, 5], [3, 8], [4, -3]].</p> </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th>Attributes</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>json</code></td> <td class="type"> <span class="param-type">Object</span> </td> <td class="attributes"> </td> <td class="description last"><p>Table data as an object (in json format).</p></td> </tr> <tr> <td class="name"><code>result</code></td> <td class="type"> <span class="param-type"><a href="TableStructure.html">TableStructure</a></span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="description last"><p>A pre-existing TableStructure object; if not present, creates a new one.</p></td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="Map_TableStructure.js.html">Map/TableStructure.js</a>, <a href="Map_TableStructure.js.html#line289">line 289</a> </li></ul></dd> </dl> <h4 class="name" id="addColumn"><span class="type-signature"></span>addColumn<span class="signature">(name, values)</span><span class="type-signature"></span></h4> <div class="description"> <p>Add column to tableStructure.</p> </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>name</code></td> <td class="type"> <span class="param-type">String</span> </td> <td class="description last"><p>Name of column (column header).</p></td> </tr> <tr> <td class="name"><code>values</code></td> <td class="type"> <span class="param-type">Array.&lt;Number></span> </td> <td class="description last"><p>Values of column to add to table.</p></td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="Map_TableStructure.js.html">Map/TableStructure.js</a>, <a href="Map_TableStructure.js.html#line931">line 931</a> </li></ul></dd> </dl> <h4 class="name" id="append"><span class="type-signature"></span>append<span class="signature">(table2, rowNumbers<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></h4> <div class="description"> <p>Appends table2 to this table. If rowNumbers are provided, only takes those row numbers from table2. Changes all the columns in one go, to avoid partial updates from tracked values.</p> </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th>Attributes</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>table2</code></td> <td class="type"> <span class="param-type"><a href="TableStructure.html">TableStructure</a></span> </td> <td class="attributes"> </td> <td class="description last"><p>The table to add to this one.</p></td> </tr> <tr> <td class="name"><code>rowNumbers</code></td> <td class="type"> <span class="param-type">Array.&lt;Integer></span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="description last"><p>The row numbers from table2 to add (defaults to all).</p></td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="Map_TableStructure.js.html">Map/TableStructure.js</a>, <a href="Map_TableStructure.js.html#line1016">line 1016</a> </li></ul></dd> </dl> <h4 class="name" id="destroy"><span class="type-signature"></span>destroy<span class="signature">()</span><span class="type-signature"></span></h4> <div class="description"> <p>Destroy the object and release resources. Is this necessary?</p> </div> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="Map_TableStructure.js.html">Map/TableStructure.js</a>, <a href="Map_TableStructure.js.html#line1286">line 1286</a> </li></ul></dd> </dl> <h4 class="name" id="getActiveColumns"><span class="type-signature"></span>getActiveColumns<span class="signature">()</span><span class="type-signature"> &rarr; {Array.&lt;<a href="TableColumn.html">TableColumn</a>>}</span></h4> <div class="description"> <p>Returns an array of active columns.</p> </div> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="Map_TableStructure.js.html">Map/TableStructure.js</a>, <a href="Map_TableStructure.js.html#line390">line 390</a> </li></ul></dd> </dl> <h5>Returns:</h5> <div class="param-desc"> <p>An array of active columns.</p> </div> <dl> <dt> Type </dt> <dd> <span class="param-type">Array.&lt;<a href="TableColumn.html">TableColumn</a>></span> </dd> </dl> <h4 class="name" id="getChartDetailsForRowNumbers"><span class="type-signature"></span>getChartDetailsForRowNumbers<span class="signature">(rowNumbers<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {Object}</span></h4> <div class="description"> <p>Given an optional array of row numbers of the table which you would like to make into a chart, returns the key information for that chart, ie. the data (in csv string format), units, and x and y labels.</p> </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th>Attributes</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>rowNumbers</code></td> <td class="type"> <span class="param-type">Array.&lt;Number></span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="description last"><p>The row numbers.</p></td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="Map_TableStructure.js.html">Map/TableStructure.js</a>, <a href="Map_TableStructure.js.html#line1217">line 1217</a> </li></ul></dd> </dl> <h5>Returns:</h5> <div class="param-desc"> <p>An object with xName, yName, csvData (Strings) and units (String[]) properties.</p> </div> <dl> <dt> Type </dt> <dd> <span class="param-type">Object</span> </dd> </dl> <h4 class="name" id="getColumnAliases"><span class="type-signature"></span>getColumnAliases<span class="signature">()</span><span class="type-signature"> &rarr; {Array.&lt;Object>}</span></h4> <div class="description"> <p>Provide an array which maps ids to names, if they differ.</p> </div> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="Map_TableStructure.js.html">Map/TableStructure.js</a>, <a href="Map_TableStructure.js.html#line757">line 757</a> </li></ul></dd> </dl> <h5>Returns:</h5> <div class="param-desc"> <p>An array of objects with 'id' and 'name' properties; only where the id and name differ.</p> </div> <dl> <dt> Type </dt> <dd> <span class="param-type">Array.&lt;Object></span> </dd> </dl> <h4 class="name" id="getColumnIndex"><span class="type-signature"></span>getColumnIndex<span class="signature">(id)</span><span class="type-signature"> &rarr; {Number}</span></h4> <div class="description"> <p>Given an id, find the index of the column and return that. Will return undefined if column with matching id cannot be found in tableStructure.</p> </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>id</code></td> <td class="type"> <span class="param-type">Number</span> </td> <td class="description last"><p>Id of column to find index of.</p></td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="Map_TableStructure.js.html">Map/TableStructure.js</a>, <a href="Map_TableStructure.js.html#line1201">line 1201</a> </li></ul></dd> </