lib/Map/DisplayVariablesConcept.js
function(name, options) {
  const that = this;
  name = defaultValue(name, "Display Variable");

  options = defaultValue(options, defaultValue.EMPTY_OBJECT);
  VariableConcept.call(this, name, options);

  /**
   * Gets or sets a flag for whether more than one checkbox can be selected at a time.
   * Default false.
   * @type {Boolean}
   */
  this.allowMultiple = defaultValue(options.allowMultiple, false);

  /**
   * Gets or sets a flag for whether at least one checkbox must be selected at all times.
   * Default false.
   * @type {Boolean}
   */
  this.requireSomeActive = defaultValue(options.requireSomeActive, false);

  /**
   * Gets or sets a function with no arguments that returns a color for the VariableConcept. If undefined, no color is set (the default).
   * @type {Function}
   */
  this.getColorCallback = options.getColorCallback;

  /**
   * Gets or sets the array of concepts contained in this group.
   * If options.items is present, each item's parent property is overridden with `this`.
   * @type {Concept[]}
   */
  this.items = defaultValue(options.items, []);
  this.items.forEach(function(item) {
    item.parent = that;
  });

  /**
   * 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.
   * @type {Boolean}
   */
  this.isOpen = defaultValue(options.isOpen, true);

  /**
   * Gets or sets a flag indicating whether this node is selectable.
   * @type {Boolean}
   */
  this.isSelectable = defaultValue(options.isSelectable, false);

  /**
   * 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 "10" for 10 year olds, etc, plus "ALL" for all ages,
   * "U21" and "21PLUS" for under and over 21 year olds.
   * Then by specifying ["ALL", "U21", "21PLUS"], when the user selects one of these values, any other values will be unselected.
   * And when the user selects any other value (eg. "10"), if any of these values were selected, they will be unselected.
   * @type {String[]}
   */
  this.exclusiveChildIds = defaultValue(options.exclusiveChildIds, []);

  /**
   * Gets or sets a function which is called whenever a child item is successfully toggled.
   * Its sole argument is the toggled child item.
   * @type {Function}
   */
  this.toggleActiveCallback = undefined;

  knockout.track(this, [
    "items",
    "isOpen",
    "allowMultiple",
    "requireSomeActive"
  ]);

  /**
   * Gets an array of currently active/selected items.
   * @return {VariableConcept[]} Array of active/selected items.
   */
  knockout.defineProperty(this, "activeItems", {
    get: function() {
      return this.items.filter(function(item) {
        return item.isActive;
      });
    }
  });
}
function(name, options) {
  const that = this;
  name = defaultValue(name, "Display Variable");

  options = defaultValue(options, defaultValue.EMPTY_OBJECT);
  VariableConcept.call(this, name, options);

  /**
   * Gets or sets a flag for whether more than one checkbox can be selected at a time.
   * Default false.
   * @type {Boolean}
   */
  this.allowMultiple = defaultValue(options.allowMultiple, false);

  /**
   * Gets or sets a flag for whether at least one checkbox must be selected at all times.
   * Default false.
   * @type {Boolean}
   */
  this.requireSomeActive = defaultValue(options.requireSomeActive, false);

  /**
   * Gets or sets a function with no arguments that returns a color for the VariableConcept. If undefined, no color is set (the default).
   * @type {Function}
   */
  this.getColorCallback = options.getColorCallback;

  /**
   * Gets or sets the array of concepts contained in this group.
   * If options.items is present, each item's parent property is overridden with `this`.
   * @type {Concept[]}
   */
  this.items = defaultValue(options.items, []);
  this.items.forEach(function(item) {
    item.parent = that;
  });

  /**
   * 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.
   * @type {Boolean}
   */
  this.isOpen = defaultValue(options.isOpen, true);

  /**
   * Gets or sets a flag indicating whether this node is selectable.
   * @type {Boolean}
   */
  this.isSelectable = defaultValue(options.isSelectable, false);

  /**
   * 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 "10" for 10 year olds, etc, plus "ALL" for all ages,
   * "U21" and "21PLUS" for under and over 21 year olds.
   * Then by specifying ["ALL", "U21", "21PLUS"], when the user selects one of these values, any other values will be unselected.
   * And when the user selects any other value (eg. "10"), if any of these values were selected, they will be unselected.
   * @type {String[]}
   */
  this.exclusiveChildIds = defaultValue(options.exclusiveChildIds, []);

  /**
   * Gets or sets a function which is called whenever a child item is successfully toggled.
   * Its sole argument is the toggled child item.
   * @type {Function}
   */
  this.toggleActiveCallback = undefined;

  knockout.track(this, [
    "items",
    "isOpen",
    "allowMultiple",
    "requireSomeActive"
  ]);

  /**
   * Gets an array of currently active/selected items.
   * @return {VariableConcept[]} Array of active/selected items.
   */
  knockout.defineProperty(this, "activeItems", {
    get: function() {
      return this.items.filter(function(item) {
        return item.isActive;
      });
    }
  });
}
function ( name , options ) { const that = this ; name = defaultValue ( name , "Display Variable" ) ; options = defaultValue ( options , defaultValue . EMPTY_OBJECT ) ; VariableConcept . call ( this , name , options ) ; /**
   * Gets or sets a flag for whether more than one checkbox can be selected at a time.
   * Default false.
   * @type {Boolean}
   */ this . allowMultiple = defaultValue ( options . allowMultiple , false ) ; /**
   * Gets or sets a flag for whether at least one checkbox must be selected at all times.
   * Default false.
   * @type {Boolean}
   */ this . requireSomeActive = defaultValue ( options . requireSomeActive , false ) ; /**
   * Gets or sets a function with no arguments that returns a color for the VariableConcept. If undefined, no color is set (the default).
   * @type {Function}
   */ this . getColorCallback = options . getColorCallback ; /**
   * Gets or sets the array of concepts contained in this group.
   * If options.items is present, each item's parent property is overridden with `this`.
   * @type {Concept[]}
   */ this . items = defaultValue ( options . items , [ ] ) ; this . items . forEach ( function ( item ) { item . parent = that ; } ) ; /**
   * 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.
   * @type {Boolean}
   */ this . isOpen = defaultValue ( options . isOpen , true ) ; /**
   * Gets or sets a flag indicating whether this node is selectable.
   * @type {Boolean}
   */ this . isSelectable = defaultValue ( options . isSelectable , false ) ; /**
   * 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 "10" for 10 year olds, etc, plus "ALL" for all ages,
   * "U21" and "21PLUS" for under and over 21 year olds.
   * Then by specifying ["ALL", "U21", "21PLUS"], when the user selects one of these values, any other values will be unselected.
   * And when the user selects any other value (eg. "10"), if any of these values were selected, they will be unselected.
   * @type {String[]}
   */ this . exclusiveChildIds = defaultValue ( options . exclusiveChildIds , [ ] ) ; /**
   * Gets or sets a function which is called whenever a child item is successfully toggled.
   * Its sole argument is the toggled child item.
   * @type {Function}
   */ this . toggleActiveCallback = undefined ; knockout . track ( this , [ "items" , "isOpen" , "allowMultiple" , "requireSomeActive" ] ) ; /**
   * Gets an array of currently active/selected items.
   * @return {VariableConcept[]} Array of active/selected items.
   */ knockout . defineProperty ( this , "activeItems" , { get : function ( ) { return this . items . filter ( function ( item ) { return item . isActive ; } ) ; } } ) ; }
Represents a concept which contains a list of variables which can be used to change the appearance of data.
A DisplayVariablesConcept contains an items array of VariableConcepts.

@alias DisplayVariablesConcept
@constructor
@extends VariableConcept
@param {String} [name='Display Variable'] Display name of this concept.
@param {Boolean|Object} [options] Options; for backwards compatibility, if a boolean is passed, it is interpreted as options.allowMultiple. Also, VariableConcept options are passed through.
@param {Function} [getColorCallback] For backwards compatibility, a third argument is interpreted as options.getColorCallback. Use options.getColorCallback in preference.
@param {Boolean} [options.allowMultiple=false] Set to true if more than one checkbox can be selected at a time.
@param {Boolean} [options.requireSomeActive=false] Set to true if at least one checkbox must be selected at all times.
@param {Function} [options.getColorCallback] A function with no arguments that returns a color for the VariableConcept. If undefined, no color is set.
@param {Concept[]} [options.items] The array of concepts contained in this group. Each item's parent property is overridden with `this`.
@param {Boolean} [options.isOpen] Whether this concept item is currently open.
@param {Boolean} [options.isSelectable] Whether this node is selectable.
@param {String[]} [options.exclusiveChildIds] A list of child ids which cannot be selected at the same time as any other child. Default [].
Represents a concept which contains a list of variables which can be used to change the appearance of data . A DisplayVariablesConcept contains an items array of VariableConcepts .