UNPKG

terriajs

Version:

Geospatial data visualization platform.

773 lines (696 loc) 47.9 kB
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>JSDoc: Source: Map/TableColumn.js</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">Source: Map/TableColumn.js</h1> <section> <article> <pre class="prettyprint source linenums"><code>/*global require*/ "use strict"; var defaultValue = require('terriajs-cesium/Source/Core/defaultValue'); var defined = require('terriajs-cesium/Source/Core/defined'); var defineProperties = require('terriajs-cesium/Source/Core/defineProperties'); var destroyObject = require('terriajs-cesium/Source/Core/destroyObject'); var DeveloperError = require('terriajs-cesium/Source/Core/DeveloperError'); var JulianDate = require('terriajs-cesium/Source/Core/JulianDate'); var knockout = require('terriajs-cesium/Source/ThirdParty/knockout'); var formatNumberForLocale = require('../Core/formatNumberForLocale'); var getUniqueValues = require('../Core/getUniqueValues'); var inherit = require('../Core/inherit'); var VarType = require('../Map/VarType'); var VarSubType = require('../Map/VarSubType'); var VariableConcept = require('../Map/VariableConcept'); var typeHintSet = [ { hint: /^(lon|long|longitude|lng)$/i, type: VarType.LON }, { hint: /^(lat|latitude)$/i, type: VarType.LAT }, { hint: /^(address|addr)$/i, type: VarType.ADDR }, { hint: /^(.*[_ ])?(depth|height|elevation)$/i, type: VarType.ALT }, { hint: /^(.*[_ ])?(time|date)/i, type: VarType.TIME }, // Quite general, eg. matches "Start date (AEST)". { hint: /^(year)$/i, type: VarType.TIME }, // Match "year" only, not "Final year" or "0-4 years". { hint: /^postcode|poa|(.*_code)$/i, type: VarType.ENUM } ]; var endDateHintSet = [ { hint: /^(.*[_ ])?end[\s_]?(time|date)/i, type: true }, // Matches "end_date" or "My end time (AEST)". ]; var subtypeHintSet = [ { hint: /^(.*[_ ])?(year)/i, type: VarSubType.YEAR } ]; var defaultReplaceWithNullValues = ['na', 'NA', '-']; var defaultReplaceWithZeroValues = []; /** * TableColumn is a light class containing a single variable (or column) from a TableStructure. * It guesses the variable type (time, enum etc) from the variable name. * It extends VariableConcept, which is used to represent the variable in the NowViewing tab. * This gives it isActive, isSelected and color fields. * In future it may perform additional processing. * * @alias TableColumn * @constructor * @extends {VariableConcept} * @param {String} [name] The name of the variable. * @param {Number[]} [values] An array of values for the variable. * @param {Object} [options] Options: * @param {Boolean} [options.active] Whether the variable should start active. * @param {TableStructure} [options.tableStructure] The table structure this column belongs to. Required so that only one column is selected at a time. * @param {VarType} [options.type] The variable type (eg. VarType.TIME). If not present, an educated guess is made based on the name and values. * @param {VarSubType} [options.subtype] The variable subtype (eg. VarSubType.YEAR). If not present, an educated guess is made based on the name and values. * @param {Boolean} [options.isEndDate] True if this is has type time and is an end_date. If not present, an educated guess is made based on the name and values. * @param {VarType[]} [options.unallowedTypes] An array of types which should not be guessed. If not present, all types are allowed. Cannot include VarType.SCALAR. * @param {VarType[]} [options.displayVariableTypes] If present, only make this variable visible if its type is in this list. * @param {String[]} [options.replaceWithNullValues] If present, and this is a SCALAR type with at least one numerical value, then replace these values with null. * Defaults to ['na', 'NA']. * @param {String[]} [options.replaceWithZeroValues] If present, and this is a SCALAR type with at least one numerical value, then replace these values with 0. * Defaults to [null, '-']. (Blank values like '' are converted to null before they reach here, so use null instead of '' to catch missing values.) * @param {Number} [options.displayDuration] * @param {String} [options.id] Provided so that columns can be renamed; their original name is stored as the id. * @param {String} [options.format] A format string for this column. For numbers, this is passed as options to toLocaleString. * @param {String} [options.units] The units of this column, if known. Not currently used internally by TableStructure or TableColumn. * @param {String} [options.chartLineColor] The string description of the chart line color of this variable, if any. * @param {Number} [options.yAxisMin] Override for the minimum display value of the y axis in charts. * @param {Number} [options.yAxisMax] Override for the maximum display value of the y axis in charts. */ var TableColumn = function(name, values, options) { this.options = defaultValue(options, defaultValue.EMPTY_OBJECT); // Note - if you add more options, be sure to include them in getFullOptions() too. VariableConcept.call(this, name, { parent: this.options.tableStructure, active: this.options.active, color: this.options.chartLineColor }); this.id = defaultValue(this.options.id, this.id); // if options.id is provided, use it to override the default (this.id = this.name). this.format = this.options.format; this.units = this.options.units; this._rawValues = values; this._unallowedTypes = defaultValue(this.options.unallowedTypes, []); this._replaceWithZeroValues = defaultValue(this.options.replaceWithZeroValues, defaultReplaceWithZeroValues); this._replaceWithNullValues = defaultValue(this.options.replaceWithNullValues, defaultReplaceWithNullValues); this._type = this.options.type; this._subtype = this.options.subtype; this._isEndDate = this.options.isEndDate; if (!defined(this._type)) { this.setTypeAndSubTypeFromName(); } var isNumerical = function(value) { return typeof value === 'number'; }; if ((this._type === VarType.SCALAR) &amp;&amp; (values.some(isNumerical))) { // Before setting this._values, replace '-' and 'NA' etc with zero/null. Min/max values ignore nulls. this._values = replaceValues(values, this._replaceWithZeroValues, this._replaceWithNullValues); } else { this._values = values; } this._numericalValues = this._values &amp;&amp; this._values.filter(isNumerical); var nonNullValues = this._values.filter(function(value) {return value !== null;}); this._minimumValue = Math.min.apply(null, nonNullValues); // Note: a single NaN value makes this NaN (hence replaceValues above). this._maximumValue = Math.max.apply(null, nonNullValues); this.yAxisMin = this.options.yAxisMin; this.yAxisMax = this.options.yAxisMax; this._uniqueValues = undefined; this._indicesIntoUniqueValues = undefined; this.displayDuration = this.options.displayDuration; // undefined is fine. /** * this.dates is a version of values that has been converted to javascript Dates. * Only if type === VarType.TIME. */ this.dates = undefined; /** * this.julianDates is a version of values that has been converted to JulianDates. * Only if type === VarType.TIME. */ this.julianDates = undefined; /** * this.finishJulianDates is an Array of JulianDates listing the next different date in the values array, less 1 second. * This is populated by TableStructure, since it may depend on other columns. * Only if type === VarType.TIME. */ this.finishJulianDates = undefined; /** * A TimeInterval Array giving when each row applies. * This is populated by TableStructure, since it may depend on other columns. * Only if type === VarType.TIME. */ this._timeIntervals = undefined; /** * A DataSourceClock whose start and stop times correspond to the first and last visible row. * This is populated by TableStructure, since it may depend on other columns. * Only if type === VarType.TIME. */ this._clock = undefined; if (defined(values) &amp;&amp; this._type === VarType.TIME) { var jsDatesAndJulianDates = convertToDates(this); this.dates = jsDatesAndJulianDates.jsDates; this.julianDates = jsDatesAndJulianDates.julianDates; if (this.dates.length === 0) { // We couldn't interpret this as dates after all. Change type to scalar. this._type = VarType.SCALAR; } else { this._subtype = jsDatesAndJulianDates.subtype; } } // If it looked like a SCALAR but there are no numerical values, change type to ENUM. if (isNaN(this._minimumValue) &amp;&amp; this._type === VarType.SCALAR) { this._type = VarType.ENUM; } // Finally, distinguish between ENUM and html tags. if (this._type === VarType.ENUM &amp;&amp; looksLikeHtmlTags(this.values)) { this._type = VarType.TAG; } updateForType(this); this._formattedValues = getFormattedValues(this); // Track _type so that TableStructure can change columnsByType if type changes. // Track _values so that charts can update live with new data. // Track units so that we can set the units after data has loaded, and the chart panel updates. knockout.track(this, ['_type', '_values', 'units', '_timeIntervals']); }; inherit(VariableConcept, TableColumn); function replaceValues(values, replaceWithZeroValues, replaceWithNullValues) { // Replace "bad" values like "-" with zero, and "na" with null. // Note this does not go back and update TableStructure._rows, so the row descriptions will still show the original values. return values.map(function(value) { if (replaceWithZeroValues.indexOf(value) >= 0) { return 0; } if (replaceWithNullValues.indexOf(value) >= 0) { return null; } return value; }); } function updateForType(tableColumn) { // Currently cannot change type to TIME and expect it to work. // But could update this.dates etc when set to VarType.TIME (if needed). tableColumn._uniqueValues = undefined; tableColumn._indicesIntoUniqueValues = undefined; tableColumn._displayVariableTypes = tableColumn.options.displayVariableTypes; if (defined(tableColumn._displayVariableTypes)) { tableColumn.isVisible = (tableColumn._displayVariableTypes.indexOf(tableColumn._type) >= 0); } } defineProperties(TableColumn.prototype, { /** * Gets or sets the type of this column. * @memberOf TableColumn.prototype * @type {VarType} */ type: { get: function() { return this._type; }, set: function(type) { this._type = type; updateForType(this); } }, /** * Gets or sets the subtype of this column. * @memberOf TableColumn.prototype * @type {VarSubType} */ subtype: { get: function() { return this._subtype; }, set: function(subtype) { this._subtype = subtype; // updateForType(this); } }, /** * Gets the values of this column. * @memberOf TableColumn.prototype * @type {Array} */ values: { get: function() { return this._values; } }, /** * Gets the column's numerical values only. * This is the quantity used for the legend. * @memberOf TableColumn.prototype * @type {Array} */ numericalValues: { get: function() { return this._numericalValues; } }, /** * Returns whether this column is an ENUM type. * @memberOf TableColumn.prototype * @type {Boolean} */ isEnum: { get: function() { return this._type === VarType.ENUM; } }, /** * Gets formatted values of this column. * @memberOf TableColumn.prototype * @type {Array} */ formattedValues: { get: function() { return this._formattedValues; } }, /** * Gets the minimum value of this column. * @memberOf TableColumn.prototype * @type {Number} */ minimumValue: { get: function() { return this._minimumValue; } }, /** * Gets the maximum value of this column. * @memberOf TableColumn.prototype * @type {Number} */ maximumValue: { get: function() { return this._maximumValue; } }, /** * Returns this column's unique values only. Only defined if non-numeric. * @memberOf TableColumn.prototype * @type {Array} */ uniqueValues: { get: function() { if (this.isEnum &amp;&amp; !defined(this._uniqueValues)) { this._uniqueValues = getUniqueValues(this._values).filter(function(value) { return (value !== null); }); sortMostCommonFirst(this._values, this._uniqueValues); } return this._uniqueValues; } }, /** * Returns this column's values, except for TIME-type columns, in which case the julian dates are returned. * @memberOf TableColumn.prototype * @type {Array} */ julianDatesOrValues: { get: function() { return (this.type === VarType.TIME) ? this.julianDates : this._values; } }, /** * Returns an array describing when each row is visible. Only defined if type == VarType.TIME. * @memberOf TableColumn.prototype * @type {TimeIntervalCollection[]} */ timeIntervals: { get: function() { return this._timeIntervals; } }, /** * Returns a clock whose start and stop times correspond to the first and last visible row. * Only defined if type == VarType.TIME. * @memberOf TableColumn.prototype * @type {DataSourceClock} */ clock: { get: function() { return this._clock; } } }); // If -'s or /'s are used to separate the fields, replace them with /'s, and // swap the first and second fields. // Eg. '30-12-2015' => '12/30/2015', the US format, because that is what javascript's Date expects. function swapDateFormat(v) { var part = v.split(/[/-]/); if (part.length === 3) { v = part[1] + '/' + part[0] + '/' + part[2]; } return v; } // Replace hypens with slashes in a three-part date, eg. '4-6-2015' => '4/6/2015' or '2015-12-5' => '2015/12/5'. // This helps because '2015-12-5' will display differently in different browsers, whereas '2015/12/5' will not. // Also, convert timestamp info, dropping milliseconds, timezone and replacing 'T' with a space. // Eg.: 'yyyy-mm-ddThh:mm:ss.qqqqZ' => 'yyyy/mm/dd hh:mm:ss'. function replaceHyphensAndConvertTime(v) { var time = ''; if (!defined(v.indexOf)) { // could be a number, eg. times may be simple numbers like 730. return v; } var tIndex = v.indexOf('T'); if (tIndex >= 0) { var times = v.substr(tIndex + 1).split(':'); if (times &amp;&amp; times.length > 1) { time = ' ' + times[0] + ':' + times[1]; } if (times.length > 2) { time = time + ':' + parseInt(times[2], 10); } v = v.substr(0, tIndex); } var part = v.split(/-/); if (part.length === 3) { v = part[0] + '/' + part[1] + '/' + part[2]; } return v + time; } function isInteger(value) { // Eg. Returns false for '99a', undefined and null, true for '99' and 99. return (!isNaN(value)) &amp;&amp; (parseInt(Number(value), 10) === +value) &amp;&amp; (!isNaN(parseInt(value, 10))); } /** * Returns the options you would pass to recreate this column. * @return {Object} An options parameter suitable for passing to new TableColumn(). */ TableColumn.prototype.getFullOptions = function() { return { tableStructure: this.parent, active: this.isActive, id: this.id, format: this.format, units: this.units, unallowedTypes: this._unallowedTypes, replaceWithZeroValues: this._replaceWithZeroValues, replaceWithNullValues: this._replaceWithNullValues, type: this._type, subtype: this._subtype, isEndDate: this._isEndDate, displayDuration: this.displayDuration, displayVariableTypes: this._displayVariableTypes, chartLineColor: this.color, yAxisMin: this.yAxisMin, yAxisMax: this.yAxisMax }; }; /** * Simple check to try to guess date format, based on max value of first position. * If dates are consistent with US format, it will use US format (mm-dd-yyyy). * * @param {Array} goodValues An array of the column values, with any bad (eg. null) values removed. * @param {Integer} [subtype] If known, eg. VarSubType.YEAR. * @private * @return {Object} Object with keys: * subtype: The identified subtype, or undefined. * jsDates: The values as javascript dates. * julianDates: The values as JulianDates. */ TableColumn.convertToDates = function(goodValues, subtype) { // All browsers appear to understand both yyyy/m/d and m/d/yyyy as arguments to Date (but not with hyphens). // See http://dygraphs.com/date-formats.html var firstPositionMaximum = 0; // call this firstPositionMaximum because parseInt('12-10') = 12. goodValues.forEach(function(value) { var firstPosition = parseInt(value, 10); if (firstPosition > firstPositionMaximum) { firstPositionMaximum = firstPosition; } }); var dateParsers; // returns [jsDate, julianDate]. // First, could it be a simple integer year format? Assume if all integers less than 9999, then years. if (subtype === VarSubType.YEAR || ((firstPositionMaximum &lt; 9999) &amp;&amp; goodValues.every(value => isInteger(value) || !defined(value)))) { // It's ok to have some missing (null or undefined) values. subtype = VarSubType.YEAR; dateParsers = function(v) { var jsDate = new Date(v + '/01/01'); return [jsDate, JulianDate.fromDate(jsDate)]; }; } else if ((firstPositionMaximum &lt; 9999) &amp;&amp; (goodValues.every(value => !defined(value) || (defined(value.indexOf) &amp;&amp; value.indexOf('-Q')) === 4))) { // Is it quarterly data in the format yyyy-Qx ? (Ignoring null values, and failing on any purely numeric values) dateParsers = function(v) { var year = v.slice(0, 4); var quarter = v.slice(6); var monthString; if (quarter === '1') { monthString = '01/01'; } else if (quarter === '2') { monthString = '04/01'; } else if (quarter === '3') { monthString = '07/01'; } else if (quarter === '4') { monthString = '10/01'; } else { return [undefined, undefined]; } var jsDate = new Date(year + '/' + monthString); return [jsDate, JulianDate.fromDate(jsDate)]; }; } else if (firstPositionMaximum > 31) { dateParsers = function(v) { // If it contains a space, it may be either yyyy-mm-dd hh:mm:ss, or yyyy/mm/dd hh:mm:ss. if (v.indexOf(' ') > 0 &amp;&amp; v.indexOf(':') > 0) { var jsDate = new Date(replaceHyphensAndConvertTime(v)); return [jsDate, JulianDate.fromDate(jsDate)]; } else { // Assume it is a properly defined ISO format yyyy-mm-dd or yyyy-mm-ddThh:mm:ss // Note that Safari and some older browsers cannot handle ISO format, hence the need to go via JulianDate. var julianDate = JulianDate.fromIso8601(v); return [JulianDate.toDate(julianDate), julianDate]; // It may be better to use jsDate = new Date(replaceHyphensAndConvertTime(v)); } }; } else if (firstPositionMaximum > 12) { //Int'l javascript format dd-mm-yyyy dateParsers = function(v) { var jsDate = new Date(swapDateFormat(v)); return [jsDate, JulianDate.fromDate(jsDate)]; }; } else { //USA javascript date format mm-dd-yyyy dateParsers = function(v) { var jsDate = new Date(replaceHyphensAndConvertTime(v)); // The T check is overkill for this. return [jsDate, JulianDate.fromDate(jsDate)]; }; } var results = []; try { results = goodValues.map(function(v) { if (defined(v)) { return dateParsers(v); } else { return [undefined, undefined]; } }); } catch (err) { // Repeat one by one so we can display the bad date. try { for (var i = 0; i &lt; goodValues.length; i++) { dateParsers(goodValues[i]); } } catch (err) { console.log('Unable to parse date:', goodValues[i], err); } } // We now have results = [ [jsDate1, julianDate1], [jsDate2, julianDate2], ...] - unzip them and return them. return { subtype: subtype, jsDates: results.map(function(twoDates) { return twoDates[0]; }), julianDates: results.map(function(twoDates) { return twoDates[1]; }) }; }; /** * Simple check to try to guess date format, based on max value of first position. * If dates are consistent with US format, it will use US format (mm-dd-yyyy). * * @param {TableColumn} tableColumn The column. * @return {Object} Object with keys: * subtype: The identified subtype, or undefined. * jsDates: The values as javascript dates. * julianDates: The values as JulianDates. */ function convertToDates(tableColumn) { // Before converting to dates, we ignore values which would be replaced with null or zero. // Do this by replacing both sorts with null. var goodValues = replaceValues(tableColumn._values, [], tableColumn._replaceWithNullValues.concat(tableColumn._replaceWithZeroValues)); return TableColumn.convertToDates(goodValues, tableColumn.subtype); } // Returns true if all non-blank values could be html tags. // Test by checking if the first character is &lt;, and it ends with a >, has length at least 5, and it either: // finishes "/>" (to catch &lt;br/>), // contains "=" (to catch &lt;img src="foo">), or // contains another &lt; and >, but not &lt;&lt; or >> at the start and end (to catch &lt;div>Foo&lt;/div>). function looksLikeHtmlTags(values) { for (var i = values.length - 1; i >= 0; i--) { var value = values[i]; if (value === null) { continue; } if (!defined(value) || !defined(value.indexOf)) { return false; } if ((value[0] !== '&lt;') || (value[value.length - 1] !== '>') || (value.length &lt; 5)) { return false; } if (value[value.length - 2] === '/') { continue; } if (value.indexOf('=') >= 0) { continue; } var cutValue = value.substr(2, value.length - 4); if ((cutValue.indexOf('&lt;') > 0) &amp;&amp; (cutValue.indexOf('>') >= 0)) { continue; } return false; } return true; } // zip([[1, 2, 3], [4, 5, 6]]) = [[1, 4], [2, 5], [3, 6]]. function zip(arrayOfArrays) { return arrayOfArrays[0].map(function(_, secondIndex) { return arrayOfArrays.map(function(_, firstIndex) { return arrayOfArrays[firstIndex][secondIndex]; }); }); } /** * Sums the values of a number of TableColumns. * @param {...TableColumn} The table columns (either a single array or as separate arguments). * @return {Number[]} Array of values of the sum. */ TableColumn.sumValues = function() { var columns; if (arguments.length === 1) { columns = arguments[0]; } else { columns = Array.prototype.slice.call(arguments); // Gives arguments a map property. } var allValues = columns.map(function(column) { return column.values; }); var transposed = zip(allValues); return transposed.map(function(rowValues) { return rowValues.reduce(function(x, y) { if (x === null &amp;&amp; y === null) { return null; } if (x === null) { return +y; } if (y === null) { return +x; } return (+x) + (+y); }); }); }; /** * Divides the values of one TableColumns into another, optionally replacing those with denominator zero. * @param {TableColumn} numerator The column whose values form the numerator. * @param {TableColumn} denominator The column whose values form the denominator. * @return {Number[]} Array of values of numerator / denominator. */ TableColumn.divideValues = function(numerator, denominator, nanReplace) { return denominator.values.map(function(denominatorValue, index) { if (denominatorValue === 0 &amp;&amp; defined(nanReplace)) { return nanReplace; } return (+numerator.values[index]) / (+denominatorValue); }); }; function sortMostCommonFirst(values, uniqueValues) { var frequencies = values.reduce(function(frequencies, thisValue) { if (!defined(frequencies[thisValue])) { frequencies[thisValue] = 1; } else { frequencies[thisValue] += 1; } return frequencies; }, {}); uniqueValues.sort(function(a, b) { // Sort with most common value first; if two have the same frequency, sort by key order. return (frequencies[b] - frequencies[a]) || (a &lt; b ? -1 : (a > b ? 1 : 0)); }); } /** * Guesses the best variable type based on its name. Returns undefined if no guess. * @private * @param {Object[]} hintSet The hint set to use, eg. [{ hint: /^(.*[_ ])?(year)/i, type: VarSubType.YEAR }]. * @param {String} name The variable name, eg. 'Time (AEST)'. * @param {VarType[]|VarSubType[]} unallowedTypes Types not to consider. Pass [] to consider all types or subtypes. * @return {VarType|VarSubType} The variable type or subtype, eg. VarType.SCALAR. */ function applyHintsToName(hintSet, name, unallowedTypes) { for (var i in hintSet) { if (hintSet[i].hint.test(name)) { var guess = hintSet[i].type; if (unallowedTypes.indexOf(guess) === -1) { return guess; } } } } function getFormattedValues(tableColumn) { if (tableColumn.type === VarType.SCALAR) { // Use raw values so no replacements are made in the displayed value, eg. "-" stays "-". return tableColumn._rawValues.map(function(value) { if (isNaN(value)) { return value; } return formatNumberForLocale(value, tableColumn.format); }); } else if (tableColumn.type === VarType.TIME) { return tableColumn.dates.map(function(date, index) { // date is a javascript Date, which will display as eg. Thu Jan 28 2016 15:22:37 GMT+1100 (AEDT). // If the original string contains a "T", then it is ISO8601 format, and we can format it more nicely. var value = tableColumn._values[index]; if ((typeof value === 'string' || value instanceof String) &amp;&amp; value.indexOf('T') >= 0) { // If there was no timezone info in the original, remove the timezone info from the output string. var time = value.split('T')[1]; if (!((time.indexOf('+') >= 0) || (time.indexOf('-') >= 0) || (time.indexOf('Z') >= 0))) { return date.toDateString() + ' ' + date.toTimeString().split(' ')[0]; } else { return date.toString(); } } // If it wasn't ISO8601 format with a 'T', then leave it in the original format. if (defined(value)) { return value; } return ''; }); } else { // For anything else, just replace nulls with '' return tableColumn._values.map(function(value) { return (value === null) ? '' : value; }); } } /** * Try to determine the best variable type based on the variable name. * Sets the _type and _subtype properties. */ TableColumn.prototype.setTypeAndSubTypeFromName = function() { var type = applyHintsToName(typeHintSet, this.name, this._unallowedTypes); if (!defined(type)) { type = VarType.SCALAR; if (this._unallowedTypes.indexOf(VarType.SCALAR) >= 0) { throw new DeveloperError('No suitable variable type found.'); } } this._type = type; this._subtype = applyHintsToName(subtypeHintSet, this.name, []); this._isEndDate = applyHintsToName(endDateHintSet, this.name, []); }; /** * Returns this column as an array, with the name as the first element, eg. ['x', 1, 3, 4]. * @return {Array} The column as an array. */ TableColumn.prototype.toArrayWithName = function() { return [this.name].concat(this.values); }; /** * Destroy the object and release resources. Is this necessary? */ TableColumn.prototype.destroy = function () { return destroyObject(this); }; module.exports = TableColumn; </code></pre> </article> </section> </div> <nav> <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="AbsCode.html">AbsCode</a></li><li><a href="AbsConcept.html">AbsConcept</a></li><li><a href="AbsDataset.html">AbsDataset</a></li><li><a href="AbsIttCatalogGroup.html">AbsIttCatalogGroup</a></li><li><a href="AbsIttCatalogItem.html">AbsIttCatalogItem</a></li><li><a href="AddressGeocoder.html">AddressGeocoder</a></li><li><a href="ArcGisCatalogGroup.html">ArcGisCatalogGroup</a></li><li><a href="ArcGisFeatureServerCatalogGroup.html">ArcGisFeatureServerCatalogGroup</a></li><li><a href="ArcGisFeatureServerCatalogItem.html">ArcGisFeatureServerCatalogItem</a></li><li><a href="ArcGisMapServerCatalogGroup.html">ArcGisMapServerCatalogGroup</a></li><li><a href="ArcGisMapServerCatalogItem.html">ArcGisMapServerCatalogItem</a></li><li><a href="AugmentedVirtuality.html">AugmentedVirtuality</a></li><li><a href="BingMapsCatalogItem.html">BingMapsCatalogItem</a></li><li><a href="BooleanParameter.html">BooleanParameter</a></li><li><a href="BulkAddressGeocoderResult.html">BulkAddressGeocoderResult</a></li><li><a href="CameraView.html">CameraView</a></li><li><a href="Catalog.html">Catalog</a></li><li><a href="CatalogFunction.html">CatalogFunction</a></li><li><a href="CatalogGroup.html">CatalogGroup</a></li><li><a href="CatalogItem.html">CatalogItem</a></li><li><a href="CatalogMember.html">CatalogMember</a></li><li><a href="Cesium.html">Cesium</a></li><li><a href="Cesium3DTilesCatalogItem.html">Cesium3DTilesCatalogItem</a></li><li><a href="CesiumDragPoints.html">CesiumDragPoints</a></li><li><a href="CesiumTerrainCatalogItem.html">CesiumTerrainCatalogItem</a></li><li><a href="CkanCatalogGroup.html">CkanCatalogGroup</a></li><li><a href="CkanCatalogItem.html">CkanCatalogItem</a></li><li><a href="Clock.html">Clock</a></li><li><a href="CompositeCatalogItem.html">CompositeCatalogItem</a></li><li><a href="Concept.html">Concept</a></li><li><a href="CorsProxy.html">CorsProxy</a></li><li><a href="CsvCatalogItem.html">CsvCatalogItem</a></li><li><a href="CswCatalogGroup.html">CswCatalogGroup</a></li><li><a href="CustomComponentType.html">CustomComponentType</a></li><li><a href="CzmlCatalogItem.html">CzmlCatalogItem</a></li><li><a href="DataSourceCatalogItem.html">DataSourceCatalogItem</a></li><li><a href="DateTimeParameter.html">DateTimeParameter</a></li><li><a href="DisplayVariablesConcept.html">DisplayVariablesConcept</a></li><li><a href="EnumerationParameter.html">EnumerationParameter</a></li><li><a href="Feature.html">Feature</a></li><li><a href="FunctionParameter.html">FunctionParameter</a></li><li><a href="GeoJsonCatalogItem.html">GeoJsonCatalogItem</a></li><li><a href="GlobeOrMap.html">GlobeOrMap</a></li><li><a href="GnafAddressGeocoder.html">GnafAddressGeocoder</a></li><li><a href="GnafApi.html">GnafApi</a></li><li><a href="GnafSearchProviderViewModel.html">GnafSearchProviderViewModel</a></li><li><a href="GpxCatalogItem.html">GpxCatalogItem</a></li><li><a href="HelpScreen.html">HelpScreen</a></li><li><a href="HelpSequence.html">HelpSequence</a></li><li><a href="HelpSequences.html">HelpSequences</a></li><li><a href="HelpViewState.html">HelpViewState</a></li><li><a href="ImageryLayerCatalogItem____.html">ImageryLayerCatalogItem</a></li><li><a href="IonImageryCatalogItem.html">IonImageryCatalogItem</a></li><li><a href="KmlCatalogItem.html">KmlCatalogItem</a></li><li><a href="Leaflet.html">Leaflet</a></li><li><a href="LeafletDataSourceDisplay.html">LeafletDataSourceDisplay</a></li><li><a href="LeafletDragPoints.html">LeafletDragPoints</a></li><li><a href="LeafletGeomVisualizer.html">LeafletGeomVisualizer</a></li><li><a href="LegendHelper.html">LegendHelper</a></li><li><a href="LegendUrl.html">LegendUrl</a></li><li><a href="LineParameter.html">LineParameter</a></li><li><a href="MagdaCatalogItem.html">MagdaCatalogItem</a></li><li><a href="MapboxMapCatalogItem.html">MapboxMapCatalogItem</a></li><li><a href="MapInteractionMode.html">MapInteractionMode</a></li><li><a href="Metadata.html">Metadata</a></li><li><a href="MetadataItem.html">MetadataItem</a></li><li><a href="module.html#.exports">exports</a></li><li><a href="OgrCatalogItem.html">OgrCatalogItem</a></li><li><a href="OpenStreetMapCatalogItem.html">OpenStreetMapCatalogItem</a></li><li><a href="PlacesLikeMeCatalogfunction.html">PlacesLikeMeCatalogfunction</a></li><li><a href="PointParameter.html">PointParameter</a></li><li><a href="Polling.html">Polling</a></li><li><a href="PolygonParameter.html">PolygonParameter</a></li><li><a href="RectangleParameter.html">RectangleParameter</a></li><li><a href="RegionDataParameter.html">RegionDataParameter</a></li><li><a href="RegionMapping.html">RegionMapping</a></li><li><a href="RegionParameter.html">RegionParameter</a></li><li><a href="RegionProvider.html">RegionProvider</a></li><li><a href="RegionProviderList.html">RegionProviderList</a></li><li><a href="RegionTypeParameter.html">RegionTypeParameter</a></li><li><a href="ResultPendingCatalogItem.html">ResultPendingCatalogItem</a></li><li><a href="SdmxJsonCatalogItem.html">SdmxJsonCatalogItem</a></li><li><a href="SensorObservationServiceCatalogItem.html">SensorObservationServiceCatalogItem</a></li><li><a href="SocrataCatalogGroup.html">SocrataCatalogGroup</a></li><li><a href="SpatialDetailingCatalogFunction.html">SpatialDetailingCatalogFunction</a></li><li><a href="StringParameter.html">StringParameter</a></li><li><a href="SummaryConcept.html">SummaryConcept</a></li><li><a href="TableCatalogItem.html">TableCatalogItem</a></li><li><a href="TableColumn.html">TableColumn</a></li><li><a href="TableColumnStyle.html">TableColumnStyle</a></li><li><a href="TableDataSource.html">TableDataSource</a></li><li><a href="TableStructure.html">TableStructure</a></li><li><a href="TableStyle.html">TableStyle</a></li><li><a href="TerrainCatalogItem.html">TerrainCatalogItem</a></li><li><a href="Terria.html">Terria</a></li><li><a href="TerriaError.html">TerriaError</a></li><li><a href="TerriaJsonCatalogFunction.html">TerriaJsonCatalogFunction</a></li><li><a href="TimeSeriesStack.html">TimeSeriesStack</a></li><li><a href="UrlTemplateCatalogItem.html">UrlTemplateCatalogItem</a></li><li><a href="UrthecastCatalogGroup.html">UrthecastCatalogGroup</a></li><li><a href="UrthecastServerCatalogItem.html">UrthecastServerCatalogItem</a></li><li><a href="UserDrawing.html">UserDrawing</a></li><li><a href="VariableConcept.html">VariableConcept</a></li><li><a href="ViewerModes..html">ViewerModes.</a></li><li><a href="WebFeatureServiceCatalogGroup.html">WebFeatureServiceCatalogGroup</a></li><li><a href="WebFeatureServiceCatalogItem.html">WebFeatureServiceCatalogItem</a></li><li><a href="WebMapServiceCatalogGroup.html">WebMapServiceCatalogGroup</a></li><li><a href="WebMapServiceCatalogItem.html">WebMapServiceCatalogItem</a></li><li><a href="WebMapTileServiceCatalogGroup.html">WebMapTileServiceCatalogGroup</a></li><li><a href="WebMapTileServiceCatalogItem.html">WebMapTileServiceCatalogItem</a></li><li><a href="WebProcessingServiceCatalogFunction.html">WebProcessingServiceCatalogFunction</a></li><li><a href="WebProcessingServiceCatalogGroup.html">WebProcessingServiceCatalogGroup</a></li><li><a href="WebProcessingServiceCatalogItem.html">WebProcessingServiceCatalogItem</a></li><li><a href="WfsFeaturesCatalogGroup.html">WfsFeaturesCatalogGroup</a></li><li><a href="WhyAmISpecialCatalogFunction.html">WhyAmISpecialCatalogFunction</a></li></ul><h3>Global</h3><ul><li><a href="global.html#_bumpyTerrainProvider">_bumpyTerrainProvider</a></li><li><a href="global.html#_terrain">_terrain</a></li><li><a href="global.html#activeTimeColumnNameIdOrIndex">activeTimeColumnNameIdOrIndex</a></li><li><a href="global.html#addBoundingBox">addBoundingBox</a></li><li><a href="global.html#addMarker">addMarker</a></li><li><a href="global.html#addUserCatalogMember">addUserCatalogMember</a></li><li><a href="global.html#allFeaturesAvailablePromise">allFeaturesAvailablePromise</a></li><li><a href="global.html#allShareKeys">allShareKeys</a></li><li><a href="global.html#arrayProduct">arrayProduct</a></li><li><a href="global.html#barHeightMax">barHeightMax</a></li><li><a href="global.html#barHeightMin">barHeightMin</a></li><li><a href="global.html#barLeft">barLeft</a></li><li><a href="global.html#barTop">barTop</a></li><li><a href="global.html#buildEmptyAccumulator">buildEmptyAccumulator</a></li><li><a href="global.html#buildRequestData">buildRequestData</a></li><li><a href="global.html#buildShareLink">buildShareLink</a></li><li><a href="global.html#buildShortShareLink">buildShortShareLink</a></li><li><a href="global.html#calculateFinishDatesFromStartDates">calculateFinishDatesFromStartDates</a></li><li><a href="global.html#canShorten">canShorten</a></li><li><a href="global.html#categoryName">categoryName</a></li><li><a href="global.html#ChartData">ChartData</a></li><li><a href="global.html#color">color</a></li><li><a href="global.html#ColorMap">ColorMap</a></li><li><a href="global.html#combineData">combineData</a></li><li><a href="global.html#combineFilters">combineFilters</a></li><li><a href="global.html#combineRepeated">combineRepeated</a></li><li><a href="global.html#combineValueArrays">combineValueArrays</a></li><li><a href="global.html#computeRingWindingOrder">computeRingWindingOrder</a></li><li><a href="global.html#computeScreenSpacePosition">computeScreenSpacePosition</a></li><li><a href="global.html#config">config</a></li><li><a href="global.html#containsAny">containsAny</a></li><li><a href="global.html#convertLuceneHit">convertLuceneHit</a></li><li><a href="global.html#convertToDates">convertToDates</a></li><li><a href="global.html#correctEntityHeight">correctEntityHeight</a></li><li><a href="global.html#createCatalogItemFromFileOrUrl">createCatalogItemFromFileOrUrl</a></li><li><a href="global.html#createCatalogItemFromUrl">createCatalogItemFromUrl</a></li><li><a href="global.html#createCatalogMemberFromType">createCatalogMemberFromType</a></li><li><a href="global.html#createLeafletCredit">createLeafletCredit</a></li><li><a href="global.html#createParameterFromType">createParameterFromType</a></li><li><a href="global.html#createRegexDeserializer">createRegexDeserializer</a></li><li><a href="global.html#createRegexSerializer">createRegexSerializer</a></li><li><a href="global.html#cssClass">cssClass</a></li><li><a href="global.html#CustomComponents">CustomComponents</a></li><li><a href="global.html#deIndexWithDescendants">deIndexWithDescendants</a></li><li><a href="global.html#Description">Description</a></li><li><a href="global.html#direction">direction</a></li><li><a href="global.html#disposeSubscription">disposeSubscription</a></li><li><a href="global.html#EarthGravityModel1996">EarthGravityModel1996</a></li><li><a href="global.html#error">error</a></li><li><a href="global.html#extendLoad">extendLoad</a></li><li><a href="global.html#extent">extent</a></li><li><a href="global.html#featureClicked">featureClicked</a></li><li><a href="global.html#featureDataToGeoJson">featureDataToGeoJson</a></li><li><a href="global.html#featureMousedown">featureMousedown</a></li><li><a href="global.html#features">features</a></li><li><a href="global.html#findKeyForGroupElement">findKeyForGroupElement</a></li><li><a href="global.html#flattenCatalog">flattenCatalog</a></li><li><a href="global.html#formatDate">formatDate</a></li><li><a href="global.html#formatDateTime">formatDateTime</a></li><li><a href="global.html#formatNumberForLocale">formatNumberForLocale</a></li><li><a href="global.html#formatPropertyValue">formatPropertyValue</a></li><li><a href="global.html#formatTime">formatTime</a></li><li><a href="global.html#getAncestors">getAncestors</a></li><li><a href="global.html#getColumnOptions">getColumnOptions</a></li><li><a href="global.html#getColumnWithNameIdOrIndex">getColumnWithNameIdOrIndex</a></li><li><a href="global.html#getDataUriFormat">getDataUriFormat</a></li><li><a href="global.html#getGroupChildren">getGroupChildren</a></li><li><a href="global.html#getShareData">getShareData</a></li><li><a href="global.html#getTemporalFiltersContext">getTemporalFiltersContext</a></li><li><a href="global.html#getUniqueValues">getUniqueValues</a></li><li><a href="global.html#gmlToGeoJson">gmlToGeoJson</a></li><li><a href="global.html#gradientColorMap">gradientColorMap</a></li><li><a href="global.html#hasAddress">hasAddress</a></li><li><a href="global.html#hasChildren">hasChildren</a></li><li><a href="global.html#hasLatitudeAndLongitude">hasLatitudeAndLongitude</a></li><li><a href="global.html#hostInDomains">hostInDomains</a></li><li><a href="global.html#id">id</a></li><li><a href="global.html#infoWithoutSources">infoWithoutSources</a></li><li><a href="global.html#isBrowserCompatible">isBrowserCompatible</a></li><li><a href="global.html#isCommonMobilePlatform">isCommonMobilePlatform</a></li><li><a href="global.html#isLoading">isLoading</a></li><li><a href="global.html#isVisible">isVisible</a></li><li><a href="global.html#itemHeight">itemHeight</a></li><li><a href="global.html#itemHeightMin">itemHeightMin</a></li><li><a href="global.html#items">items</a></li><li><a href="global.html#itemSpacing">itemSpacing</a></li><li><a href="global.html#itemWidth">itemWidth</a></li><li><a href="global.html#Legend">Legend</a></li><li><a href="global.html#legendUrl">legendUrl</a></li><li><a href="global.html#map">map</a></li><li><a href="global.html#markdownToHtml">markdownToHtml</a></li><li><a href="global.html#markerVisible">markerVisible</a></li><li><a href="global.html#name">name</a></li><li><a href="global.html#NowViewing">NowViewing</a></li><li><a href="global.html#overrideProperty">overrideProperty</a></li><li><a href="global.html#pad">pad</a></li><li><a href="global.html#parseCustomHtmlToReact">parseCustomHtmlToReact</a></li><li><a href="global.html#parseCustomMarkdownToReact">parseCustomMarkdownToReact</a></li><li><a href="global.html#PickedFeatures">PickedFeatures</a></li><li><a href="global.html#pickPosition">pickPosition</a></li><li><a href="global.html#point">point</a></li><li><a href="global.html#points">points</a></li><li><a href="global.html#position">position</a></li><li><a href="global.html#prettifyCoordinates">prettifyCoordinates</a></li><li><a href="global.html#prettifyProjection">prettifyProjection</a></li><li><a href="global.html#printWindow">printWindow</a></li><li><a href="global.html#processAddress">processAddress</a></li><li><a href="global.html#Proj4Definitions">Proj4Definitions</a></li><li><a href="global.html#propertyGetTimeValues">propertyGetTimeValues</a></li><li><a href="global.html#readJson">readJson</a></li><li><a href="global.html#rectangle">rectangle</a></li><li><a href="global.html#rectangleToLatLngBounds">rectangleToLatLngBounds</a></li><li><a href="global.html#RegionDataValue">RegionDataValue</a></li><li><a href="global.html#regionDetails">regionDetails</a></li><li><a href="global.html#registerCustomComponentTypes">registerCustomComponentTypes</a></li><li><a href="global.html#rememberRejections">rememberRejections</a></li><li><a href="global.html#removeMarker">removeMarker</a></li><li><a href="global.html#replaceUnderscores">replaceUnderscores</a></li><li><a href="global.html#sanitiseAddressNumber">sanitiseAddressNumber</a></li><li><a href="global.html#selectBaseMap">selectBaseMap</a></li><li><a href="global.html#serializeToJson">serializeToJson</a></li><li><a href="global.html#ServerConfig">ServerConfig</a></li><li><a href="global.html#setClockCurrentTime">setClockCurrentTime</a></li><li><a href="global.html#shareKeyIndex">shareKeyIndex</a></li><li><a href="global.html#shouldBeUpdated">shouldBeUpdated</a></li><li><a href="global.html#showSelection">showSelection</a></li><li><a href="global.html#sortByFirst">sortByFirst</a></li><li><a href="global.html#sortedIndices">sortedIndices</a></li><li><a href="global.html#splitIntoBatches">splitIntoBatches</a></li><li><a href="global.html#supportsIntervals">supportsIntervals</a></li><li><a href="global.html#supportsWebGL">supportsWebGL</a></li><li><a href="global.html#TerriaViewer">TerriaViewer</a></li><li><a href="global.html#Title">Title</a></li><li><a href="global.html#toArrayOfRows">toArrayOfRows</a></li><li><a href="global.html#Tooltip">Tooltip</a></li><li><a href="global.html#triggerResize">triggerResize</a></li><li><a href="global.html#unionRectangleArray">unionRectangleArray</a></li><li><a href="global.html#unionRectangles">unionRectangles</a></li><li><a href="global.html#units">units</a></li><li><a href="global.html#up">up</a></li><li><a href="global.html#updateApplicationOnHashChange">updateApplicationOnHashChange</a></li><li><a href="global.html#updateFromJson">updateFromJson</a></li><li><a href="global.html#updateRectangleFromRegion">updateRectangleFromRegion</a></li><li><a href="global.html#variableNameLeft">variableNameLeft</a></li><li><a href="global.html#variableNameTop">variableNameTop</a></li><li><a href="global.html#ViewerMode">ViewerMode</a></li><li><a href="global.html#width">width</a></li><li><a href="global.html#yAxisMax">yAxisMax</a></li><li><a href="global.html#yAxisMin">yAxisMin</a></li></ul> </nav> <br class="clear"> <footer> Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Fri Sep 21 2018 12:26:18 GMT+1000 (AUS Eastern Standard Time) </footer> <script> prettyPrint(); </script> <script src="scripts/linenumber.js"> </script> </body> </html>