Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(swarmplot): add support for log axis and legends #2031

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

tkonopka
Copy link
Contributor

@tkonopka tkonopka commented Jun 3, 2022

Addresses themes raised in #1939 and #1992

Adds features to the swarmplot:

  • support for log scales along the value axis
  • support for legends

Example

2022-06-03-swarmplot-legends

Implementation

Support for log scales required tweaks to the typescript definition for the valueScale prop. This was simple conceptually, but also required propagating the changes to functions that process coordinates. In practice, this is achieved by defining new types for the value-scale spec and the scale object. (Using dedicated types seemed more robust that extending the existing approach of joining primitive types using 'or'). Propoagating these changes introduces several code edits. However, the edits do not introduce any new real features. (It was already possible to use a log scale before). The advantage of the changes is that typescript users will be able to use log scales without seeing warnings.

Support for legends required addition of new props legendLabel and legends to the SwarmPlot and SwarmPlotCanvas components. These follow the nomenclature and formats from other nivo packages.

Two new stories have examples for how to use log scales and legends.

Can make further changes and improvements if needed.

@tkonopka tkonopka changed the title Feat swarmplot legend feat(swarmplot) - add support for log axis and legends Jun 3, 2022
@tkonopka tkonopka changed the title feat(swarmplot) - add support for log axis and legends feat(swarmplot): add support for log axis and legends Jun 3, 2022
@codesandbox-ci
Copy link

codesandbox-ci bot commented Jun 3, 2022

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 124ac73:

Sandbox Source
nivo Configuration

@stale stale bot added the stale label Sep 8, 2022
Repository owner deleted a comment from stale bot Sep 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants