diff --git a/ui/lib/apps/ClusterInfo/components/StoreLocationTree/index.tsx b/ui/lib/apps/ClusterInfo/components/StoreLocationTree/index.tsx index 11e7002a9b..8ea599ad72 100644 --- a/ui/lib/apps/ClusterInfo/components/StoreLocationTree/index.tsx +++ b/ui/lib/apps/ClusterInfo/components/StoreLocationTree/index.tsx @@ -4,8 +4,9 @@ import { ZoomInOutlined, ZoomOutOutlined, ReloadOutlined, + QuestionCircleOutlined, } from '@ant-design/icons' -import { Space } from 'antd' +import { Space, Tooltip } from 'antd' export interface IStoreLocationProps { dataSource: any @@ -72,6 +73,12 @@ export default function StoreLocationTree({ dataSource }: IStoreLocationProps) { const zoom = d3 .zoom() .scaleExtent([0.1, 5]) + .filter(function () { + // ref: https://godbasin.github.io/2018/02/07/d3-tree-notes-4-zoom-amd-drag/ + // only zoom when pressing CTRL + const isWheelEvent = d3.event instanceof WheelEvent + return !isWheelEvent || (isWheelEvent && d3.event.ctrlKey) + }) .on('zoom', () => { const t = d3.event.transform bound.attr( @@ -224,10 +231,13 @@ export default function StoreLocationTree({ dataSource }: IStoreLocationProps) { return (
- - - - + + + + + + +
)