import categoryFilter from "./categoryFilter.mjs";
import categoryVisual from "./categoryVisual.mjs";
import graphEdgeVisual from "./edgeVisual.mjs";
import graphSimpleLayout from "./simpleLayout.mjs";
import graphCircularLayout from "./circularLayout.mjs";
import graphForceLayout from "./forceLayout.mjs";
import createViewCoordSys from "./createView.mjs";
import View from "../../coord/View.mjs";
import GraphView from "./GraphView.mjs";
import GraphSeriesModel from "./GraphSeries.mjs";
import { updateCenterAndZoom } from "../../action/roamHelper.mjs";
import { noop } from "../../../../../../zrender@5.4.4/node_modules/zrender/lib/core/util.mjs";
var actionInfo = {
  type: "graphRoam",
  event: "graphRoam",
  update: "none"
};
function install(registers) {
  registers.registerChartView(GraphView);
  registers.registerSeriesModel(GraphSeriesModel);
  registers.registerProcessor(categoryFilter);
  registers.registerVisual(categoryVisual);
  registers.registerVisual(graphEdgeVisual);
  registers.registerLayout(graphSimpleLayout);
  registers.registerLayout(registers.PRIORITY.VISUAL.POST_CHART_LAYOUT, graphCircularLayout);
  registers.registerLayout(graphForceLayout);
  registers.registerCoordinateSystem("graphView", {
    dimensions: View.dimensions,
    create: createViewCoordSys
  });
  registers.registerAction({
    type: "focusNodeAdjacency",
    event: "focusNodeAdjacency",
    update: "series:focusNodeAdjacency"
  }, noop);
  registers.registerAction({
    type: "unfocusNodeAdjacency",
    event: "unfocusNodeAdjacency",
    update: "series:unfocusNodeAdjacency"
  }, noop);
  registers.registerAction(actionInfo, function(payload, ecModel, api) {
    ecModel.eachComponent({
      mainType: "series",
      query: payload
    }, function(seriesModel) {
      var coordSys = seriesModel.coordinateSystem;
      var res = updateCenterAndZoom(coordSys, payload, void 0, api);
      seriesModel.setCenter && seriesModel.setCenter(res.center);
      seriesModel.setZoom && seriesModel.setZoom(res.zoom);
    });
  });
}
export {
  install
};
