How to use the base/utils.deepExtend function in base

To help you get started, we’ve selected a few base examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github vizabi / vizabi / src / readers / waffle.js View on Github external
_encodeQuery: function (params) {
    var _params = utils.deepExtend({}, params.where);
    _params.select = params.select;
    _params.gapfilling = params.gapfilling;

    // todo: WS doesn't support value `*` for geo parameter
    // remove this condition when geo will be removed from params.where (when you need all geo props)
    if (_params.geo && _params.geo.length === 1 && _params.geo[0] === '*') {
      delete _params.geo;
    }

    // todo: formatting date according to precision (year, month, etc)
    if (_params.time) {
      _params.time[0] = _params.time[0].map(function (year) {
        return typeof year === 'object' ? year.getFullYear() : year;
      });
    }
github vizabi / vizabi / src / base / component.js View on Github external
getActiveProfile(profiles, presentationProfileChanges) {
    // get layout values
    const layoutProfile = this.getLayoutProfile();
    const presentationMode = this.getPresentationMode();
    const activeProfile = utils.deepClone(profiles[layoutProfile]); // clone so it can be extended without changing the original profile

    // extend the profile with presentation mode values
    if (presentationMode && (presentationProfileChanges || {})[layoutProfile]) {
      utils.deepExtend(activeProfile, presentationProfileChanges[layoutProfile]);
    }

    return activeProfile;
  },
github vizabi / vizabi / src / readers / waffle / waffle.js View on Github external
_encodeQuery: function (params) {
    var _params = utils.deepExtend({}, params.where);
    _params.select = params.select;
    _params.gapfilling = params.gapfilling;

    // todo: WS doesn't support value `*` for geo parameter
    // remove this condition when geo will be removed from params.where (when you need all geo props)
    if (_params.geo && _params.geo.length === 1 && _params.geo[0] === '*') {
      delete _params.geo;
    }

    var result = [];

    // create `key=value` pairs for url query string
    Object.keys(_params).map(function (key) {
      var value = QueryEncoder.encodeQuery(_params[key]);
      if (value) {
        result.push(key + '=' + value);
github vizabi / vizabi / src / models / label.js View on Github external
getClassDefaults() {
    const defaults = {
      use: null,
      which: null
    };
    return utils.deepExtend(this._super(), defaults);
  },
github vizabi / vizabi / src / models / entities.js View on Github external
getClassDefaults() {
    const defaults = {
      show: {},
      showFallback: {},
      showItemsMaxCount: null,
      filter: {},
      dim: null,
      skipFilter: false
    };
    return utils.deepExtend(this._super(), defaults);
  },
github vizabi / vizabi / src / base / tool.js View on Github external
getPersistentMinimalModel(diffModel) {
    const defaultModel = this.model.getDefaults();
    const currentPersistentModel = this.getPersistentModel();
    const redundantModel = utils.deepExtend(defaultModel, diffModel);
    return utils.diffObject(currentPersistentModel, redundantModel);
  },
github vizabi / vizabi / src / models / data.js View on Github external
getClassDefaults() {
    const defaults = {
      reader: "csv"
    };
    return utils.deepExtend(this._super(), defaults);
  },
github vizabi / vizabi / src / components / treemenu / treemenu.js View on Github external
utils.forEach(this.model.marker._root._data, m => {
      if (m._type === "data") utils.deepExtend(indicatorsDB, m.getConceptprops());
    });
github vizabi / vizabi / src / models / size.js View on Github external
getClassDefaults() {
    const defaults = {
      use: null,
      which: null,
      domainMin: null,
      domainMax: null,
      zoomedMin: null,
      zoomedMax: null,
      extent: [0, 0.85],
      scaleType: null,
      allow: {
        scales: ["ordinal", "linear", "log", "genericLog", "pow"]
      }
    };
    return utils.deepExtend(this._super(), defaults);
  },
github vizabi / vizabi / src / base / model.js View on Github external
getDefaults() {
    return utils.deepExtend({}, this.getClassDefaults(), this.getSubmodelDefaults());
  },