-
Notifications
You must be signed in to change notification settings - Fork 377
fix(types): Update @types/victory, victory, victory-core, and hoist-non-react-statics packages to latest #1899
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
Conversation
|
PatternFly-React preview: https://1899-pr-patternfly-react-patternfly.surge.sh |
Codecov Report
@@ Coverage Diff @@
## master #1899 +/- ##
=======================================
Coverage 82.62% 82.62%
=======================================
Files 623 623
Lines 6870 6870
Branches 93 93
=======================================
Hits 5676 5676
Misses 1154 1154
Partials 40 40
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm seeing a bunch of build errors in Cost Management with these changes, specifically around VictoryStyleInterface references. I suspect the VictoryStyleInterface property types have changed?
If we're going to take the latest @types/victory, we should probably take the latest victory and victory-core packages to ensure compatibility?
When I update all three packages, and/or remove my VictoryStyleInterface references, Cost Management builds successfully.
dlabaj
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure we can remove title ... also looks like this a breaking change for Dan.
|
The title prop can be removed, but believe we need to update all 3 victory packages to ensure types are is in sync. |
See the following in the changelog for v32.0.0: Breaking ChangesMost Horizontal Charts The change in how props with x and y values are treated (i.e. scale, domain, etc) will be a breaking change for most horizontal charts. In most cases, reversing the x and y values of props you are providing to your horizontal chart will be sufficient to correct the change. For example: <VictoryChart horizontal scale={{ x: "log" }} domain={{ y: [4, 9] }}>
<VictoryBar
data={[
{ x: 5, y: 0.1 },
{ x: 6, y: 1 },
{ x: 7, y: 10 },
{ x: 8, y: 100 }
]}
/>
</VictoryChart>Should be changed to: <VictoryChart horizontal scale={{ y: "log" }} domain={{ x: [4, 9] }}>
<VictoryBar
data={[
{ x: 5, y: 0.1 },
{ x: 6, y: 1 },
{ x: 7, y: 10 },
{ x: 8, y: 100 }
]}
/>
</VictoryChart>Props affected by this change are: scale, domain, maxDomain, minDomain, domainPadding, and categories Horizontal Charts with Event Containers Dimension props such as brushDimension have changed so that they always refer to the dimension of the target variable (x for the independent variable, and y for the dependent variable). For example, a VictoryBrushContainer component with brushDimension="x" will move and expand only in the independent dimension regardless of whether the chart is horizontal. Props affected by this change are: brushDimension, cursorDimension, selectionDimension, voronoiDimension, and zoomDimension Horizontal Charts with Custom dataComponents The position values (i.e. x, y, x0, y0) supplied to custom dataComponents from components like VictoryChart will be scaled for the layout of the horizontal chart. Users who rely on these values may need to flip them or adjust them depending on their use case Horizontal VictoryBoxPlot Previously VictoryBoxPlot required data to be flipped (x values flipped with y values) in order to plot horizontal charts. This is no longer required, and providing data in this format will no longer work correctly. To correct for this change, it should be sufficient to flip the data used in horizontal charts |
@types/victory, victory, victory-core, and hoist-non-react-statics packages to latest
@types/victory, victory, victory-core, and hoist-non-react-statics packages to latestThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @TheRealJon. Although, it turned out to be a little more than just swapping the x & y coordinates.
Certain style properties no longer work for bars (e.g., width). And we can no longer render VictoryBar on both the horizontal and vertical axes. Don't know if that's by design, but it forces all bars to be on the same axis. As a result, our bullet chart cannot render thresholds properly.
We can use a vertical VictoryLine (i.e., PD ChartLine) to represent the threshold instead, but lose the ability to have a tooltip for that component.
That said, we will find a workaround or just omit the thershold tooltip.
Update: Found a workaround for the tooltip -- should be ok.
tlabaj
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM


fixes #1898
What:
Update
@types/victory,victory,victory-core, andhoist-non-react-staticsto latest and remove extra type definition for thetitleprop inChartLegend. The latest victory types include an accurate definition for this prop.Victory changelog for reference:
https://github.com/FormidableLabs/victory/blob/master/CHANGELOG.md