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

update deps and changelog #983

Merged
merged 1 commit into from
Apr 22, 2018
Merged

update deps and changelog #983

merged 1 commit into from
Apr 22, 2018

Conversation

boygirl
Copy link
Contributor

@boygirl boygirl commented Apr 22, 2018

BREAKING CHANGES

Disable arbitrary styles from data
This change deprecates Victory's ability to automatically pick up style attributes from the data object. This change will improve performance, but will be a breaking change for many users. Fortunately the upgrade path is simple:

If your data object looks like

data={[
  { x: 1, y: 1, fill: "red", opacity: 0.2 },
  ...
]}

Add the following functional styles:

style={{ data:  { fill: (d) => d.fill, opacity: (d) => d.opacity } }}

and everything will work as before.

Limit Pre-calculating label props
Base props for labels will no longer be pre-calculated unless a labels prop exists. This change improves performance, but it will be a breaking change for users who were using events for adding labels to elements that did not already have them using an event mutation like:

events={[{
  target: "data",
  eventHandlers: {
    onClick: () => {
      return [{ target: "labels", mutation: () => ({ text: "clicked" }) }];
    }
  }
}]}

If you are using this pattern, you can make labels work as expected by adding a dummy labels prop like: labels={() => null}

Note: This change does not affect tooltips, which exist, but are invisible until they receive the active prop

All Changes
VictoryCore
-364 Perf: Remove style whitelist filter.
-369 Ensure state
-368 Audit lodash methods
-367 Simplify state filtering
-365 Perf: Return early when label content is null or undefined
-362 Perf: Filter falsey mutations from state

VictoryChart
-587 Disable styles on data
-584 Check for labels prop before computing baseProps for labels
-589 Audit lodash methods
-583 Perf improvement for VictorySelectionContainer

VictoryPie
-176 Disable styles on data
-177 Audit lodash methods

@boygirl boygirl merged commit a1f465b into master Apr 22, 2018
@boygirl boygirl deleted the update-0.26.0 branch April 22, 2018 00:58
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.

1 participant