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

snappy, shared, and programmatically triggered tooltips #81

Merged
merged 12 commits into from
Dec 7, 2017

Conversation

williaster
Copy link
Owner

@williaster williaster commented Dec 6, 2017

This PR adds new functionality around tooltip behavior and customization 🎉

🏆 Enhancements
[xy-chart]

  • Ability to "snap" the tooltip to the x or y value of a datum, by setting snapTooltipToDataX and/or snapTooltipToDataY. fixes add support for snapping tooltips to values #77
  • Support for using the chart container for mouse events, instead of series or a voronoi. this is now set with the eventTrigger prop as 'series' [default], 'voronoi', or 'container'.
  • The addition of container events necessitates shared tooltips, i.e., tooltips that contain data for for all series for the hovered x value. fixes [xy-chart][tooltip] support finding closest data points without voronoi #78
  • Ability to programmatically trigger events using the eventTriggerRefs callback (see updated <LineSeriesExample /> for an example)
  • adds innerRef prop which is set on the inner svg

[shared]

  • the signature of onMouseMove in <WithTooltip /> now accepts an optional coords object of the shape { x: Number, y: Number }. If either or both of x or y is specified they will be used to set the the tooltips left and top instead of the event's coordinates.

[forms]

  • adds active prop to <Button />

💔 Breaking Changes

  • [xy-chart] the <XYChart /> useVoronoi prop is removed. instead use eventTrigger='voronoi

📜 Documentation

  • [xy-chart] documents the above enhancements

🏠 Internal
[xy-chart]

  • moves <XYChart /> static method to their own utils files
  • breaks out several functions in chartUtils into their own files
  • adds and uses sharedSeriesProps

TODO

  • refactor shared tooltip series keys to use <*Series />-level seriesKey prop instead of label
  • update readme
  • add tests

@coveralls
Copy link

coveralls commented Dec 6, 2017

Coverage Status

Coverage decreased (-3.7%) to 80.736% when pulling 8b02ffe on chris--customize-tooltip-behavior into 4bb987d on master.

2 similar comments
@coveralls
Copy link

coveralls commented Dec 6, 2017

Coverage Status

Coverage decreased (-3.7%) to 80.736% when pulling 8b02ffe on chris--customize-tooltip-behavior into 4bb987d on master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-3.7%) to 80.736% when pulling 8b02ffe on chris--customize-tooltip-behavior into 4bb987d on master.

@coveralls
Copy link

coveralls commented Dec 6, 2017

Coverage Status

Coverage decreased (-3.6%) to 80.788% when pulling cf0245c on chris--customize-tooltip-behavior into 4bb987d on master.

…eventTrigger, eventTriggerRefs, and new utils
@coveralls
Copy link

Coverage Status

Coverage decreased (-1.8%) to 82.619% when pulling 0438f97 on chris--customize-tooltip-behavior into 4bb987d on master.

2 similar comments
@coveralls
Copy link

Coverage Status

Coverage decreased (-1.8%) to 82.619% when pulling 0438f97 on chris--customize-tooltip-behavior into 4bb987d on master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-1.8%) to 82.619% when pulling 0438f97 on chris--customize-tooltip-behavior into 4bb987d on master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-1.9%) to 82.527% when pulling 0438f97 on chris--customize-tooltip-behavior into 4bb987d on master.

2 similar comments
@coveralls
Copy link

Coverage Status

Coverage decreased (-1.9%) to 82.527% when pulling 0438f97 on chris--customize-tooltip-behavior into 4bb987d on master.

@coveralls
Copy link

coveralls commented Dec 6, 2017

Coverage Status

Coverage decreased (-1.9%) to 82.527% when pulling 0438f97 on chris--customize-tooltip-behavior into 4bb987d on master.

…children updates, fix some examples, add more to readme for new functionality
@coveralls
Copy link

coveralls commented Dec 6, 2017

Coverage Status

Coverage decreased (-2.01%) to 82.395% when pulling cdcb43f on chris--customize-tooltip-behavior into 4bb987d on master.

@coveralls
Copy link

coveralls commented Dec 6, 2017

Coverage Status

Coverage decreased (-1.05%) to 83.355% when pulling 6828e96 on chris--customize-tooltip-behavior into 4bb987d on master.

@coveralls
Copy link

coveralls commented Dec 6, 2017

Coverage Status

Coverage increased (+0.01%) to 84.419% when pulling 4e3f04e on chris--customize-tooltip-behavior into 4bb987d on master.

@williaster williaster merged commit 2a72bc7 into master Dec 7, 2017
@williaster williaster deleted the chris--customize-tooltip-behavior branch December 7, 2017 00:34
@williaster williaster added this to the v0.0.50 milestone Dec 8, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants