Code Insights Limit number of maximum items within the tooltip layout
Created by: vovakulikov
Context
Prior to this PR, we had a problem with the chart tooltip position. This happened because the tooltip has a lot of items within and visx tooltip flips the position of the tooltip to the right top corner of a cursor. Unfortunately, visx tooltip doesn't have shift logic based on the closest scrollable area. We probably should use here something else for the tooltip component but as a temporary fix, this PR limits the number of elements within the tooltip to 10 items and renders "add more N" placements in case if we cut off some items at the beginning or/and at the end of the list.
Examples
Case | Result |
---|---|
Too many items at the top | |
Too many items at the end | |
Too many items at both sides |