antvis / antvis/Graphin

Minimap is not attached/relative to the graph

Open
#470 1 comment 0 reactions 1 assignee Claimed by @Yanyan-Wang View on GitHub
bug
Dominant language
TypeScript
Stars
1.1k
Forks
275
PR merge metrics
No merged PRs in 30d

Description

### Describe the bug

Whenever rendering multiple graphs and using minimaps for each one of them, the minimaps gets "lost", specially if passing options props to it because that would trigger the useEffect inside the component to render which destroys and re-renders the minimap, and what that causes is that both minimaps are rendered together instead of each minimap being "inside" its own graph.

### Your Example Website or App

https://codesandbox.io/s/funny-montalcini-v89qno?file=/App.tsx

### Steps to Reproduce the Bug or Issue

This is a very small example of what I'm talking about because I couldn't reproduce everything but you can get the sense of it from that code pen.

### Expected behavior

Each minimap would be "attached" to its own graph

### Screenshots or Videos

Expected Behavior, happens before I update the component props, as including another view.
![Expected Behavior](https://user-images.githubusercontent.com/80011318/219498885-46d3a028-800f-4693-85c8-cb2069784df7.png)

Bug after updating props to include another view.
![Buggy after component update props](https://user-images.githubusercontent.com/80011318/219498974-8ef14dae-6941-499e-a765-ffa37e285664.png)

### Platform

- OS: [Linux]
- Browser: [Chrome, Edge]

### Additional context

It happens after a component update props but since I can render from 1 to 4 charts in the same component, this should happen and the minimap should still recognize its parent graph and stick to it.

I'm not sure yet how to handle / solve this so I'd appreciate any help here, thanks in advance!!

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.