Skip to content
This repository has been archived by the owner on Feb 19, 2022. It is now read-only.

Update changelog and victory core dep #590

Merged
merged 1 commit into from
Apr 22, 2018
Merged

Conversation

boygirl
Copy link
Contributor

@boygirl boygirl commented Apr 22, 2018

Breaking Changes

-587 Disable styles on 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.

-584 Check for labels prop before computing baseProps for labels

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

Other changes
-589 Audit lodash methods
-583 Perf improvement for VictorySelectionContainer

@boygirl boygirl merged commit 3ffa6c8 into master Apr 22, 2018
@boygirl boygirl deleted the update-victory-core branch April 22, 2018 00:17
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant