Skip to content

Code Insights Limit number of maximum items within the tooltip layout

Administrator requested to merge vk/fix-tooltip-items-rendering into main

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.

Screenshot 2021-12-16 at 02 27 35

Examples

Case Result
Too many items at the top

image

Too many items at the end

image

Too many items at both sides

image

Merge request reports

Loading