code: function(terria) {
    if (!defined(terria)) {
      throw new DeveloperError("terria is required");
    }
  
    this._terria = terria;
    this._shareKeyIndex = {};
  
    this._group = new CatalogGroup(terria);
    this._group.name = "Root Group";
    this._group.preserveOrder = true;
  
    /**
     * Gets or sets a flag indicating whether the catalog is currently loading.
     * @type {Boolean}
     */
    this.isLoading = false;
  
    this._chartableItems = [];
  
    knockout.track(this, ["isLoading", "_chartableItems"]);
  
    knockout.defineProperty(this, "userAddedDataGroup", {
      get: this.upsertCatalogGroup.bind(
        this,
        CatalogGroup,
        USER_ADDED_CATEGORY_NAME,
        "The group for data that was added by the user via the Add Data panel."
      )
    });
  
    /**
     * Array of the items that should be shown as a chart.
     */
    knockout.defineProperty(this, "chartableItems", {
      get: function() {
        return this._chartableItems;
      }
    });
  }
docs: The view model for the data catalog.
  
  @param {Terria} terria The Terria instance.
  
  @alias Catalog
  @constructor