);
diff --git a/packages/plexus/src/zoom/ZoomManager.tsx b/packages/plexus/src/zoom/ZoomManager.tsx
index b8b1a6de6d..b9ec763499 100644
--- a/packages/plexus/src/zoom/ZoomManager.tsx
+++ b/packages/plexus/src/zoom/ZoomManager.tsx
@@ -45,6 +45,8 @@ type TZoomProps = {
contentHeight: number;
contentWidth: number;
viewAll: () => void;
+ zoomIn: () => void;
+ zoomOut: () => void;
viewportHeight: number;
viewportWidth: number;
};
@@ -96,6 +98,24 @@ export default class ZoomManager {
this.resetZoom();
}
+ public zoomIn = () => {
+ const selection = this.selection;
+ if (!selection) {
+ this.updateCallback(zoomIdentity);
+ return;
+ }
+ this.zoom.scaleBy(selection, 1.2);
+ };
+
+ public zoomOut = () => {
+ const selection = this.selection;
+ if (!selection) {
+ this.updateCallback(zoomIdentity);
+ return;
+ }
+ this.zoom.scaleBy(selection, 0.8);
+ };
+
public resetZoom = () => {
const elem = this.elem;
const selection = this.selection;
@@ -123,6 +143,8 @@ export default class ZoomManager {
x,
y,
viewAll: this.resetZoom,
+ zoomIn: this.zoomIn,
+ zoomOut: this.zoomOut,
};
}
diff --git a/packages/plexus/src/zoom/resetZoomIcon.tsx b/packages/plexus/src/zoom/resetZoomIcon.tsx
deleted file mode 100644
index c9b9f1107c..0000000000
--- a/packages/plexus/src/zoom/resetZoomIcon.tsx
+++ /dev/null
@@ -1,27 +0,0 @@
-// Copyright (c) 2018 Uber Technologies, Inc.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-import * as React from 'react';
-
-// SVG is from React Icons:
-// https://github.com/react-icons/react-icons/blob/396b4d9241a61b6d22f3907273158b6a91aea2fd/md/zoom-out-map.js
-// LICENSE: MIT
-// https://github.com/react-icons/react-icons/blob/396b4d9241a61b6d22f3907273158b6a91aea2fd/package.json#L26
-export default (
-
-);