Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
^0.25.6
->^36.0.0
By merging this PR, the below vulnerabilities will be automatically resolved:
Release Notes
FormidableLabs/victory (victory)
v36.0.0
Compare Source
VictoryChart
,VictoryGroup
andVictoryStack
to take advantage ofReact.memo
.v35.11.4
Compare Source
v35.11.3
Compare Source
d3-interpolate
VictoryThemeDefinition
to includehistogram
. Thanks @2metres!v35.11.2
Compare Source
victory-native
v35.11.0
Compare Source
VictoryChart
,VictoryGroup
andVictoryStack
to take advantage ofReact.memo
.v35.10.1
Compare Source
this
referencesv35.10.0
Compare Source
peerDependency
for all Victory packagesrx
andry
types to the primitive props interface. Thanks @Wesleyzxc!v35.9.3
Compare Source
barWidth
for grouped / stacked charts. Thanks @WaysToGo!v35.9.2
Compare Source
barWidth
calculation for stacked / grouped bar charts.v35.9.1
Compare Source
VictoryTooltip
. Thanks @beccanelson!v35.9.0
Compare Source
Adds a new
disableInlineStyles
prop to components and primitives to support users who want to style their components by class, or use a CSS in JS solution likestyled-components
When the new
disableInlineStyles
prop is supplied to a component likeVictoryBar
no styles will be supplied to either data or label components that it renders:The
disableInlineStyles
prop may also be supplied to primitive components for more granular control:Related PRs
v35.8.6
Compare Source
d3-array
dependency to correct for babel issuev35.8.5
Compare Source
allowDraw
type definition forVictoryBrushContainer
. Thanks @justindomingue!v35.8.4
Compare Source
VictoryVoronoiContainer
withvoronoiDimension
.v35.8.3
Compare Source
offsetX
andoffsetY
props for multi-quadrant chartsv35.8.2
Compare Source
interpolation
type definition forVictoryArea
. Thanks @pmilic021!v35.8.1
Compare Source
minDomain
introduced in35.6.0
.v35.8.0
Compare Source
domainPadding
updatesupdates how
domainPadding
is applied to charts when 1) the additional padding would not result new quadradants being added, or 2) the user has setsingleQuadrantDomainPadding={false}
. In these cases,domainPadding
is applied by calculating a new, smaller range that takes the desired, pixel-based padding into account, and then adding domain padding such that the previous domain fits entirely within the new, smaller range. In most cases, this change will make it much easier to do things like create bar charts where the first bar starts cleanly at the edge of the chart, by settingdomainPadding={{ x: myBarWidth / 2 }}
This may cause visual changes for charts that use very large values for
domainPadding
. ThedomainPadding
prop may need to be adjustedcalculates a more exact
defaultDomainPadding
for grouped bar charts based on theoffset
, number of bars, and the width of each bar (either from thebarWidth
prop or from a defaultbarWidth
based on the number of bars and the range). Previously,defaultDomainPadding
was approximated based only onoffset
and number of bars.v35.7.2
Compare Source
tickFormat
is given as an array. Thanks @jhumbug!v35.7.1
Compare Source
v35.7.0
Compare Source
VictoryAxis
responsible for calculating its own defaultxOffset
,yOffset
,orientation
, andcrossAxis
values rather than relying onVictoryChart
to determine these values. This change corrects several bugs related to how axes update on charts that useVictoryZoomContainer
. We don't anticipate breaking changes with this update, but axis positioning will update differently (more correctly) when zooming. Thanks @jhumbug!v35.6.4
Compare Source
VictoryTheme
type definition to allow adding an optional style prop toVictoryGroup
via theme. Thanks @hknowlton!v35.6.3
Compare Source
VictoryAccessibleGroup
from the mainvictory
packagev35.6.2
Compare Source
v35.6.0
impacting inverted domain charts. Thanks @jhumbug!v35.6.1
Compare Source
VictoryStack
. Thanks @jhumbug!v35.6.0
Compare Source
VictoryArea
andVictoryLine
. This PR also includes a fix for animations so that animating data always reaches its final state before a new animation begins. Thanks @jhumbug!v35.5.1
Compare Source
dist
outputv35.5.0
Compare Source
VictoryBrushContainer
withallowResize
set to false, and usedefaultBrushArea="move"
by default whenallowResize
is set to false.v35.4.13
Compare Source
VictoryTooltip
types to allow users to set single dimensions for thecenter
propv35.4.12
Compare Source
handleWidth
type toVictoryBrushContainer
interface. Thanks @aknaut!v35.4.11
Compare Source
id
prop toVictoryLabelProps
interface. Thanks @nielsboecker!v35.4.10
Compare Source
v35.4.9
Compare Source
VictorySharedEvents
. Thanks @the-kwisatz-haderach!v35.4.8
Compare Source
-#1784 - - Add more font widths for the textsize util. Thanks @eatyourpeas!
v35.4.7
Compare Source
type
prop from primitive components used byVictoryAxis
andVictoryPolarAxis
getPath
prop used by thePoint
primitive. Thanks @ASmartLynx!v35.4.6
Compare Source
-#1767 - Adds support for
rx
andry
props on theBackground
primitive component. Thanks @NgoKnows!v35.4.5
Compare Source
#1765 - Adds "cross" symbol for
VictoryScatter
and thePoint
primitive.#1766 - Allows the
bin
prop onVictoryHistogram
to accept arrays of negative numbers. Thanks @NgoKnows!v35.4.4
Compare Source
v35.4.3
Compare Source
Portal
typev35.4.2
Compare Source
defaultEvents
toVictoryTooltip
types. Thanks @beccanelson!v35.4.1
Compare Source
VictoryTooltip
types to allow users to set single dimensions for thecenter
propv35.4.0
Compare Source
Support for Global Events
This release adds a concept of global events that are attached to
window
rather than to any of the elements rendered by Victory components. Global events are only supported for "parent" events that would normally be attached tosvg
elements rendered by Victory's containerComponents. Events that should be global can be flagged by includingonGlobal
in the name of the event handler. So, for example, useonGlobalMouseUp
rather thanonMouseUp
to create a global mouse up handler.VictoryBrushContainer uses Global Events
VictoryBrushContainer
now uses global events in itsdefaultEvents
so that brushing continues even as the user's mouse moves outside of the chart area.v35.3.5
Compare Source
role
prop forVictoryContainer
v35.3.4
Compare Source
VictoryAnimation
when there are no active subscriptions. Thanks @noVerity!Object.keys
with lodashkeys
for consistency.v35.3.3
Compare Source
v35.3.2
Compare Source
VictoryCursorContainer
for smoother movement. Thanks @Alexander-AJ-Berman!v35.3.1
Compare Source
#1724 Fixes a regression introduced in
35.3.0
affecting charts whose dimensions are updated via auseEffect
hook#1723 - Avoids unnecessary re-renders caused by empty events. Thanks @Hypnosphi!
v35.3.0
Compare Source
json-safe-stringify
inVictorySharedEvents
v35.2.0
Compare Source
Accessibility Improvements
#1708 - This PR adds
ariaLabel
to Victory's primitive components (VictoryLabel
,Area
,Bar
etc.). This new prop can take a string or a function that expected to return a string, and addsaria-label
attributes to svg elements Victory renders. This PR also addstabIndex
andaria-label
props toVictoryClipContainer
, and creates a newgroupContainer
,VictoryAccessibleGroup
, which renders ag
tag and an optionaldesc
tag along with its other children.VictoryAccessibleGroup
also takesaria-label
andaria-describedby
props. Thanks @ljones87 for all the hard work on this new feature!#1709 - Adds default
onFocus
andonBlur
event handlers toVictoryTooltip
so that users can trigger tooltips by tabbing through the chart elements whentabIndex
is set.Bug fixes for labels and tooltips
VictoryVoronoiContainer
renders, includingtext
,style
,flyoutStyle
,width
andheight
angle
prop onVictoryLabel
datum
rather than coordinate.v35.1.1
Compare Source
aria-labelledby
andaria-describedby
props toVictoryContainer
. Thanks @elliotdickison!v35.1.0
Compare Source
preserveAspectRatio
prop toVictoryContainer
, and usesheight: "100%"
rather thanheight: "auto"
, giving users finer control over how Victory's svgs are positioned and scaled within their containers.v35.0.9
Compare Source
v35.0.8
Compare Source
ouiaSafe
prop onVictoryContainer
v35.0.7
Compare Source
VictoryContainer
. Thanks @dlabrecq!v35.0.6
Compare Source
v35.0.5
Compare Source
#1648 - Fix a bug effecting
backgroundStyles
when using functional styles. Thanks @chacestew!#1649 - update lodash dependency
v35.0.4
Compare Source
v35.0.3
Compare Source
v35.0.2
Compare Source
TextSize
utility. Thanks @jlismore!v35.0.1
Compare Source
v35.0.0
Compare Source
Label and Theme Improvements!
This release introduces new label features and makes improvements to themes. This release includes breaking style changes. Please double check your label and tooltip styles when upgrading. Polar axes and pie charts may be particularly impacted.
New Features!
VictoryLabel
now supports label backgrounds, which are rendered asrect
elements behind your labels. Backgrounds are styled via the newbackgroundStyle
prop onVictoryLabel
. This prop may be given as a style object, or an array of objects for styling multi-line labels. Background elements are sized for their corresponding text elements, but padding may also be added with thebackgroundPadding
prop, which accepts a single number, an object with values for "top", "bottom", "left" and "right", or an array of either of these for adding background padding to multi-line labels.VictoryTooltip
has a newflyoutPadding
prop that may be used to add padding between the edge of the flyout and the label within it. TheflyoutPadding
prop may be given as a single number of as an object with values for "top", "bottom", "left" and "right". This is a breaking change, asstyle.padding
no longer adds padding between the flyout and its label. Both of Victory's built-in themes have been altered so that tooltips getflyoutPadding={5}
by default.VictoryPie
now supports thelabelPlacement
prop used in polar charts. Possible values are "vertical" "parallel" and "perpendicular". When not given, vertical labels are rendered as before.Themes now support
polarAxis
,polarDependentAxis
, andpolarIndependentAxis
namespaces that are merges with the less specificaxis
,dependentAxis
, andindependentAxis
themes as appropriate.Improvements
Changes Victory's default branch from
master
tomain
🖤Textsize
approximations have changed, and are much more accurate in most cases. This may be a breaking change for layouts that depended on approximated text sizeTooltip themes are now correctly merged with label styles and props.
VictoryPolarAxis
elements are now rendered relative to the origin independently, rather than being translated as a group. This allows for correct positioning of elements withinVictoryPortal
This may be a breaking change for custom components inVictoryPolarAxis
Corrects the
labelPosition
prop onVictoryPie
(previouslystartAngle
andendAngle
were inverted) This is a breaking changeAlters
material
andgreyscale
themes. The following theme updates may cause breaking style changesboxplot
andcandlestick
polarDependentAxis
settings to thematerial
themetooltip
styles override label styles on all other theme namespaces. This means that tooltips pointers will now all start exactly at the data element they correspond to by default. To alter this behavior, either 1) provide a different theme, 2) alter padding in via label styles like so:<VictoryBar
style={{ labels: { padding: 5 } }}
labelComponent={}
/>
or
<VictoryBar
labelComponent={
<VictoryTooltip style={{ padding: 5 }} />
}
/>
Associated PRs
v34.3.12
Compare Source
-#1620 - Allow granular
voronoiPadding
. Thanks @dlabrecq!-#1607 - Add missing containerRef type. Thanks @NgoKnows!
v34.3.11
Compare Source
v34.3.10
Compare Source
#1604 - Fixes offsets for groups of stacked bars. Thanks @cneltyn!
#1599 - Fixes a bug causing incorrect cursor behavior
onMouseLeave
. Thanks @NgoKnows!v34.3.9
Compare Source
sharedEvents
to improve performance in evented containers. Thanks @NgoKnows!v34.3.8
Compare Source
v34.3.7
Compare Source
v34.3.6
Compare Source
VictoryVoronoiContainer
VictoryVoronoiContainer
from rendering tooltips with empty textv34.3.5
Compare Source
-#1575 - Allow the
id
prop forVictoryLabel
to be given as a function. Thanks @amyboyd!v34.3.4
Compare Source
d3-scale
andreact-fast-compare
forvictory-histogram
. Thanks @Mike-Dax!v34.3.3
Compare Source
backgroundComponent
typev34.3.2
Compare Source
victory-histogram
dependencyv34.3.1
Compare Source
-#1620 - Allow granular
voronoiPadding
. Thanks @dlabrecq!-#1607 - Add missing containerRef type. Thanks @NgoKnows!
v34.3.0
Compare Source
VictoryHistogram
component. Huge thanks to @NgoKnows for this new feature!Histogram bins may be defined with the
bin
prop, which takes either an array of bin edges, or a single number which corresponds to an approximate number of bins.VictoryHistogram
is meant to work with continuous data, and expects a data prop as an array of objects with x values. By default, histogram bins will be laid out with no spaces between bins, but the optionalbinSpacing
prop may be provided to change this behavior. Additional documentation and examples will be coming soon.v34.2.2
Compare Source
backgroundComponent
forVictoryChart
that will be rendered ifVictoryChart
'sstyle
component includesbackground
styles. TheBackground
component renders arect
for cartesian charts and acircle
for polar charts that is correctly sized and positioned to fill the entire range of the chart. Thanks @maddles and @wparsons!v34.2.1
Compare Source
domain
prop defined for a single dimension.domainPadding
to not be applied to stacked and grouped charts withdomain
props defined.v34.2.0
Compare Source
Update typescript types for all Victory components. A huge thanks to @maddles @wparsons and @kale-stew for this work. This release includes the following PRs
#1557, #1556, #1554, #1552, #1551, #1550, #1547, #1546, #1543, #1538, #1536, #1535, #1534, #1533, #1532, #1530,#1529, #1528, #1527, #1526, #1525, #1524, #1522, #1521, #1520, #1519, #1515, #1514, #1512, #1510, #1508
v34.1.3
Compare Source
v34.1.2
Compare Source
v34.1.1
Compare Source
VictoryChart
typesv34.1.0
Compare Source
definitely-typed
project so that we can maintain them more easily going forwardv34.0.1
Compare Source
activePoints
prop toVictoryTooltip
whichVictoryVoronoiContainer
supplies to itslabelComponent
. Thanks @jotak!v34.0.0
Compare Source
Breaking Changes
This version uses the context API introduced in
react@16.3.0
v33.1.7
Compare Source
v33.1.6
Compare Source
stringMap
computation when data is preformatted (i.e. data uses has_x
and_y
values and accessors). Thanks @na9da!v33.1.5
Compare Source
mouseMoveThreshold
prop forVictoryBrushContainer
to prevent accidental redraws. Thanks @Hypnosphi!VictoryBrushContainer
onMouseLeave
v33.1.4
Compare Source
labelPosition
prop onVictoryPie
v33.1.3
Compare Source
VictoryBrushArea
when axes are inverted. Thanks @Hypnosphi!defaultBrushArea
prop inVictoryBrushContainer
. When this option is selected, clicking outside of the brush area will pan the brush to a the area the user clicked without resizing the brush. Thanks @Hypnosphi!v33.1.2
Compare Source
VictoryChart
does not override axis orientations defined in themes.onBrushEnd
domain callback.allowZoom
prop. Thanks @Hypnosphi!v33.1.1
Compare Source
delaunay-find
to0.0.4
to correct incorrect nearest values for sets of points with collinear values. Corrects bugs inVictoryVoronoiContainer
v33.1.0
Compare Source
v33.0.6
Compare Source
#1401 - Fixes a bug affecting automatic candle coloring
#1402 - Fixes a bug affecting user-provided
containerRef
callbacksv33.0.5
Compare Source
interpolation
prop. Thanks @sanniassin!v33.0.4
Compare Source
1384 - Fixes a bug affecting functional
cornerRadius
onVictoryTooltip
1385 - Adds
pointerOrientation
prop onVictoryTooltip
to make it possible to control which side of the tooltip the pointer extends from independent of which side of the data point the entire flyout is oriented towards. This prop only became sensible with the addition ofcenter
andcenterOffset
props added invictory@33.0.0
v33.0.3
Compare Source
padAngle
prop inVictoryPie
v33.0.2
Compare Source
VictoryPie
v33.0.1
Compare Source
text
is evaluated before any other functional props forVictoryLabel
so it may be used to determine things like style, etc.v33.0.0
Compare Source
Breaking Changes
Changes for functional props and styles:
Related PR: #1360
Functional props like
labels
and functional styles will now be called with a single argument instead ofdatum
andactive
. The argument passed to functional props and styles will be an object containing all the props that control the rendering of the the target the prop applies to. Including things likedatum
,active
,index
,data
,scale
, etc. We hope this will give users a lot more flexibility and control. In most cases, this change should be very straightforward to applyold:
new
Gotchas:
cornerRadius
function that depends onbarWidth
, do not also makebarWidth
a function of some other prop.y
andx
, andtickFormat
. The arguments for these props have not changed.Changes for
VictoryCandlestick
labelsRelated PR: #1295
VictoryCandlestick
now has granular support for labels corresponding to each portion of the candle. The currentlabels
andlabelComponent
props will be joined by new props corresponding to each part of the candle.New props
lowLabels
lowLabelComponent
highLabels
highLabelComponent
openLabels
openLabelComponent
closeLabels
closeLabelComponent
This will be a breaking change affecting the positioning of the default
label
. In earlier versions, the default label was positioned above the candle, it will now be positioned next to the center of the candle.To use older label positioning, use
highLabels
/highLabelComponent
rather thanlabel
/labelComponent
. If you are using tooltips withVictoryCandlestick
, you will need to register a custom event to trigger yourhighLabels
tooltip:example:
The
style
prop forVictoryCandlestick
now also has namespaces for the new labels in addition to the currentlabels
namespace. When bothlabels
and specific label styles (e.g.highLabels
) are provided, the styles will be mergedChanges for
VictoryVoronoiContainer
Related PR: #1371
Before this version
VictoryVoronoiContainer
had limited functionality for mouse-following tooltips, and for constraining a tooltip to the chart area, but it was only usable for multi-point tooltips (withvoronoiDimension
), and was not user configurable. This version aims to correct these limitations:mouseFollowTooltips
: This new boolean prop onVictoryVoronoiContainer
determines whether the labels should follow the mouse position or snap into place. (Note that in charts usingvoronoiDimension
, the tooltip still follows the mouse in the non-voronoiDimension
, as demonstrated in the charts below (both withvoronoiDimension="x"
)mouseFollowLabels={true}
mouseFollowTooltips={false}
VictoryVoronoiContainer
will no longer be constrained to the chart area by default. Instead, add theconstrainToVisibleArea
prop toVictoryTooltip
to enable this behavior for both multi-point and single point tooltips:example:
Changes for
VictoryTooltip
andVictoryLabel
Related PR:#1371
The changes we wanted to make to support new behaviors in
VictoryVoronoiContainer
required some changes toVictoryTooltip
andVictoryLabel
New props for
VictoryTooltip
:constrainToVisibleArea
is a boolean prop that, when true, will alter the position of the tooltip so that it exactly fits within the svg Victory renders. The tooltip's center will be moved, but the pointer wi