Skip to content

Commit

Permalink
feat(components):add showLabel props into FishEye
Browse files Browse the repository at this point in the history
  • Loading branch information
pomelo-nwu committed Jan 7, 2021
1 parent c9ec56a commit db66207
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion packages/graphin-components/src/FishEye/index.tsx
Expand Up @@ -17,7 +17,7 @@ const defaultOptions = {
fillOpacity: 0.1,
fill: '#ccc',
},
// showLabel: true,
showLabel: false,
};
export interface FishEyeProps {
/**
Expand Down Expand Up @@ -46,6 +46,19 @@ const FishEye: React.FunctionComponent<FishEyeProps> = (props) => {
...defaultOptions,
...options,
};

if (FishEyeOptions.showLabel) {
// 先将图上的label全部隐藏

graph.getNodes().forEach((node) => {
node
.getContainer()
.getChildren()
.forEach((shape) => {
if (shape.get('type') === 'text') shape.hide();
});
});
}
const fishEye = new G6.Fisheye(FishEyeOptions);
const escListener = (e) => {
if (e.keyCode === 27) {
Expand Down

0 comments on commit db66207

Please sign in to comment.