'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

var visualMapAction = require('./visualMapAction.js');
var visualEncoding = require('./visualEncoding.js');
var util = require('../../../../../../zrender@6.0.0/node_modules/zrender/lib/core/util.js');
var preprocessor = require('./preprocessor.js');

var installed = false;
function installCommon(registers) {
  if (installed) {
    return;
  }
  installed = true;
  registers.registerSubTypeDefaulter('visualMap', function (option) {
    // Compatible with ec2, when splitNumber === 0, continuous visualMap will be used.
    return !option.categories && (!(option.pieces ? option.pieces.length > 0 : option.splitNumber > 0) || option.calculable) ? 'continuous' : 'piecewise';
  });
  registers.registerAction(visualMapAction.visualMapActionInfo, visualMapAction.visualMapActionHander);
  util.each(visualEncoding.visualMapEncodingHandlers, function (handler) {
    registers.registerVisual(registers.PRIORITY.VISUAL.COMPONENT, handler);
  });
  registers.registerPreprocessor(preprocessor.default);
}

exports.default = installCommon;
