Skip to content

Conversation

Chalks
Copy link
Contributor

@Chalks Chalks commented Oct 14, 2025

Description

  • Update sparklines to manage a synced state without requiring their parent to manage scaling parameters (i.e. min/max on x/y axes)
  • Update vertical line plugin to support basic link brushing effects

Previously I exposed a @max event which was supposed to communicate the local manipulation of the passed in data. With that event the parent was supposed to feed that value back in given a maximum 'max' value across all sparklines rendered. This required the developer to understand and think about how sparklines work far more than was useful. This change allows users to render sparklines at any scale and by simply providing a groupKey and a chartKey the sparkline itself can manage keeping scales in sync. Simpler development and more consistent usage should be the result.

Along those same lines, link brushing is fairly trivial to support in sparklines for two reasons. First, they are generally displayed at the same scale, so the X axis is consistent for each one which allows us to just take the raw x position of the mouse relative to the chart and apply it across all sparklines. Second, this implementation of sparklines forces all the data to be a certain type (lists of timestamps) and therefore we don't have to take any guesses on what will be displayed or how it will convey information. A simple vertical line is sufficient.

WIP

Work in progress, adding in some unit tests

@Chalks Chalks changed the title Feat/better sparklines feat (analytics): better sparkline management + link brushing Oct 14, 2025
@Chalks Chalks force-pushed the feat/better-sparklines branch from 02221e6 to 87583a5 Compare October 15, 2025 21:25
@kongponents-bot
Copy link
Collaborator

Preview components from this PR in consuming application

In consuming application project install preview versions of shared packages generated by this PR:

@kong-ui-public/analytics-chart@pr-2561
@kong-ui-public/dashboard-renderer@pr-2561

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants