Skip to content

Latest commit

 

History

History
260 lines (218 loc) · 8.96 KB

File metadata and controls

260 lines (218 loc) · 8.96 KB

/** * View is a representation of raw data.<br/> * <b>Note:</b> Default View is a view with default mapping. * @constructor * @extends {anychart.core.Base} */ anychart.data.View;

/** * Creates a derived view, containing just the same data set and order as this view does. * @category Data * @example anychart.data.View.derive * @return {!anychart.data.View} The new derived view. */ anychart.data.View.prototype.derive;

/* * Creates a derived view, containing only the rows that pass the filter. * @category Data * @example anychart.data.View.filter * @param {string} fieldName A field which value will be passed to a filter function. * @param {function():boolean} func A filter function that should accept a field value and return true if the row * should be included into the resulting view. * @return {!anychart.data.View} The new derived view. */ anychart.data.View.prototype.filter;

/* * Creates a derived view that ensures sorting by a passed field. * @shortDescription Data sorting. * @category Data * @example anychart.data.View.sort_set_asFunc * @param {string} fieldName A field name to make sort by. * @param {function(, *):number=} opt_comparator A sorting function that should accept two field values and return * numeric result of the comparison. * @return {!anychart.data.View} The new derived view. */ anychart.data.View.prototype.sort;

/** * Creates a derived view that ensures sorting by a passed field. * @example anychart.data.View.sort_set_asEnum * @param {string} fieldName A field name to make sort by. * @param {anychart.enums.Sort=} opt_order ['asc'] String value of anychart.enums.Sort enumeration except NONE. * @return {!anychart.data.View} The new derived view. */ anychart.data.View.prototype.sort;

/** * Concatenates two views to make a derived view that contains rows from both views. * @category Data * @example anychart.data.View.concat_set_asTwoView Concatenation of two Views * @example anychart.data.View.concat_set_asViewDataSet Concatenation of a View and a data Set * @example anychart.data.View.concat_set_asViewArray Concatenation of a View and an Array * @param {!(anychart.data.View|Array)} otherView A view, data set or even an array to concat with. * @return {!anychart.data.View} The new derived view. */ anychart.data.View.prototype.concat;

/* * Gets a full row of the set by an index. * @shortDescription Row of the set by an index * @category Data * @detailed <b>Note:</b> If there is no row with the given index, methods returns <b>undefined</b>. * See sample at {@link anychart.data.Set#row} * @listing Example. * // Data * [ * [1, 2, 4, 7], * [11, 12, 14, 17], * [21, 22, 24, 27] * ] * view.row(2); // returns [21, 22, 24, 27] * view.row(3); // returns undefined * @example anychart.data.View.row_get * @param {number} rowIndex An index of the row to fetch. * @return {} The row. */ anychart.data.View.prototype.row;

/* * Sets a row of the set by an index. * @detailed <b>Note:</b> Previous value of a row is returned but it is lost completely after that!. * @listing Example. * // Data * [ * [1, 2, 4, 7], * [11, 12, 14, 17], * [21, 22, 24, 27] * ] * view.row(2, [2, 2, 2, 2]); // returns [21, 22, 24, 27] * view.row(3, {'low': 4, 'high': 11}); // returns undefined * @example anychart.data.View.row_set * @param {number} rowIndex An index of the row to fetch. * @param {=} opt_value A value to set. * @return {*} Previous value of the row. */ anychart.data.View.prototype.row;

/** * Returns the number of the rows in the current view. * @category Data * @example anychart.data.View.getRowsCount * @return {number} The number of the rows in the set. */ anychart.data.View.prototype.getRowsCount;

/* * Searches fieldName by fieldValue and returns it index (or the first match). * @category Data * @example anychart.data.View.find * @param {string} fieldName Name of the field. * @param {} fieldValue Value of the field. * @return {number} Index in view. */ anychart.data.View.prototype.find;

/* * Gets the value from the row by row index and field name. * @category Data * @example anychart.data.View.get * @param {number} rowIndex Index of the row to get field value from. * @param {string} fieldName The name of the field to be fetched from the current row. * @return {} The field value or undefined, if not found. */ anychart.data.View.prototype.get;

/* * Sets the value to the row field by row index and field name. * @category Data * @example anychart.data.View.set * @param {number} rowIndex * @param {string} fieldName * @param {} value * @return {!anychart.data.View} Itself for chaining. */ anychart.data.View.prototype.set;

/** * Returns a new iterator for the current view. * @category Data * @example anychart.data.View.getIterator * @return {!anychart.data.Iterator} New iterator. */ anychart.data.View.prototype.getIterator;

/* * Getter for a metadata value. * Learn how it works at {@link anychart.data.Iterator#meta}. * @shortDescription Metadata settings. * @category Data * @example anychart.data.View.meta_get * @param {number} index Row index. * @param {string} name Name of the metadata field. * @return {} Current value. */ anychart.data.View.prototype.meta;

/* * Setter for a metadata value. Learn how it works at {@link anychart.data.Iterator#meta}. * @example anychart.data.View.meta_set * @param {number} index Row index. * @param {string} name Name of the metadata field. * @param {=} opt_value Value to set. * @return {anychart.data.View} Self instance for method chaining. */ anychart.data.View.prototype.meta;

/** @inheritDoc */ anychart.data.View.prototype.listen;

/** @inheritDoc */ anychart.data.View.prototype.listenOnce;

/** @inheritDoc */ anychart.data.View.prototype.unlisten;

/** @inheritDoc */ anychart.data.View.prototype.unlistenByKey;

/** @inheritDoc */ anychart.data.View.prototype.removeAllListeners;