lib/Models/SdmxJsonCatalogItem.js
function buildConcepts(item, fullDimensions) {
  function isInitiallyActive(dimensionId, value, index) {
    if (!defined(item.selectedInitially)) {
      return index === 0;
    }
    var dimensionSelectedInitially = item.selectedInitially[dimensionId];
    if (!defined(dimensionSelectedInitially)) {
      return index === 0;
    }
    return dimensionSelectedInitially.indexOf(value.id) >= 0;
  }

  var conceptDimensions = getShownDimensions(
    item,
    fullDimensions,
    fullDimensions
  );
  fixSelectedInitially(item, conceptDimensions); // Note side-effect.
  var concepts = conceptDimensions.map(function(dimension, i) {
    var allowMultiple =
      item.allSingleValuedDimensionIds.indexOf(dimension.id) === -1;
    var concept = new DisplayVariablesConcept(dimension.name, {
      isOpen: false,
      allowMultiple: allowMultiple,
      requireSomeActive: true,
      exclusiveChildIds: getTotalValueIdsForDimensionId(item, dimension.id)
    });
    concept.id = dimension.id;
    concept.items = dimension.values.map(function(value, index) {
      return new VariableConcept(renameValue(item, value.name), {
        parent: concept,
        id: value.id,
        active: isInitiallyActive(concept.id, value, index)
      });
    });
    return concept;
  });
  if (concepts.length > 0) {
    return [new SummaryConcept(undefined, { items: concepts, isOpen: false })];
  }
  return [];
}
function buildConcepts(item, fullDimensions) {
  function isInitiallyActive(dimensionId, value, index) {
    if (!defined(item.selectedInitially)) {
      return index === 0;
    }
    var dimensionSelectedInitially = item.selectedInitially[dimensionId];
    if (!defined(dimensionSelectedInitially)) {
      return index === 0;
    }
    return dimensionSelectedInitially.indexOf(value.id) >= 0;
  }

  var conceptDimensions = getShownDimensions(
    item,
    fullDimensions,
    fullDimensions
  );
  fixSelectedInitially(item, conceptDimensions); // Note side-effect.
  var concepts = conceptDimensions.map(function(dimension, i) {
    var allowMultiple =
      item.allSingleValuedDimensionIds.indexOf(dimension.id) === -1;
    var concept = new DisplayVariablesConcept(dimension.name, {
      isOpen: false,
      allowMultiple: allowMultiple,
      requireSomeActive: true,
      exclusiveChildIds: getTotalValueIdsForDimensionId(item, dimension.id)
    });
    concept.id = dimension.id;
    concept.items = dimension.values.map(function(value, index) {
      return new VariableConcept(renameValue(item, value.name), {
        parent: concept,
        id: value.id,
        active: isInitiallyActive(concept.id, value, index)
      });
    });
    return concept;
  });
  if (concepts.length > 0) {
    return [new SummaryConcept(undefined, { items: concepts, isOpen: false })];
  }
  return [];
}
function buildConcepts ( item , fullDimensions ) { function isInitiallyActive ( dimensionId , value , index ) { if ( ! defined ( item . selectedInitially ) ) { return index === 0 ; } var dimensionSelectedInitially = item . selectedInitially [ dimensionId ] ; if ( ! defined ( dimensionSelectedInitially ) ) { return index === 0 ; } return dimensionSelectedInitially . indexOf ( value . id ) >= 0 ; } var conceptDimensions = getShownDimensions ( item , fullDimensions , fullDimensions ) ; fixSelectedInitially ( item , conceptDimensions ) ; // Note side-effect. var concepts = conceptDimensions . map ( function ( dimension , i ) { var allowMultiple = item . allSingleValuedDimensionIds . indexOf ( dimension . id ) === - 1 ; var concept = new DisplayVariablesConcept ( dimension . name , { isOpen : false , allowMultiple : allowMultiple , requireSomeActive : true , exclusiveChildIds : getTotalValueIdsForDimensionId ( item , dimension . id ) } ) ; concept . id = dimension . id ; concept . items = dimension . values . map ( function ( value , index ) { return new VariableConcept ( renameValue ( item , value . name ) , { parent : concept , id : value . id , active : isInitiallyActive ( concept . id , value , index ) } ) ; } ) ; return concept ; } ) ; if ( concepts . length > 0 ) { return [ new SummaryConcept ( undefined , { items : concepts , isOpen : false } ) ] ; } return [ ] ; }
Build out the concepts displayed in the NowViewing panel. Also fixes selectedInitially, if broken.
Build out the concepts displayed in the NowViewing panel . Also fixes selectedInitially if broken .