docs: function applyPresets(model, defaults, presets) {
      if (!model || !presets) { return; }
  
      var opts = model.presets || presets[model.preset] ||
          (model.preset && presets[model.type + '.' + model.preset]) || presets[model.type];
      if (!opts) { return; }
  
      for (var name in opts) {
          if (opts.hasOwnProperty(name)) {
              if (!defaults || defaults[name] === undefined) {
                  throw new Error('No defaults value for ' + name + ' but in presets.' + model.preset);
              }
              else {
                  model[name] = opts[name];
              }
          }
      }
  }