This repository has been archived by the owner on Feb 19, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 88
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This reverts commit 691eca0.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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 is the beginning of a polar chart implementation. See supporting work in https://github.com/FormidableLabs/victory-core/pull/240/files
To run the demo:
npm install
(this branch has a temporary git dependency onvictory-core#experiment/polar
npm start
localhost:3000/#/polar
#Notes:
VictoryPolarAxis
VictoryPolarAxis
differs pretty significantly fromVictoryAxis
. Here is a list of new props, and removed props. The internal calculations for laying out gridlines, ticks, and labels are also quite different from inVictoryAxis
.New Props
circularAxisComponent
andcircularGridComponent
(component)These props define the component that will be used for radial grid and axis components. This components default to the new primitive
<Arc/>
defined invictory-core
which renders a path component that can render either an open or closed arc segment. I chose to render an arc path rather than a circle, so that partial polar charts could be renderedstartAngle
andendAngle
(number)These props are analogous to the
startAngle
andendAngle
props inVictoryPie
. They may be used for creating partial polar charts (as seen above) or for rotating the angles of the polar chart. These props also control the angular range in the independent axislabelPlacement
("parallel", "perpendicular" or "vertical")This prop is a convenience prop for laying out axis labels. It controls the internal calculation of label angle, vertical anchor, and text anchor defaults based on the angle of the tick. As always, these props may be overridden via styles, or directly on the
tickLabelComponent
. This prop could probably use better naming (both the prop name and the options). I would be grateful for any suggestions"perpendicular"
"parallel"
"vertical"
radius
This prop may be used to set the range in the dependent axis. When this prop is not set, it will be calculated based on width / height / padding as in other components. I am thinking of removing this prop, and just using the default calculated value for consistency.
Removed Props
label
,offsetX
,offsetY
orientation
TODOS:
VictoryPolarChart
This component is probably temporary. I think I can get away with adding a few props to
VictoryChart
rather than authoring an entirely new component. I'm going to keep developing the separate component and see how much the two diverge, but my plan is to reconcile the changes if possible.Differences from
VictoryChart
polar: true
on all of it's childrenVictoryPolarAxis
for default axesgroupComponent
of all children to shift the polar coordinates to a calculated originrange
prop to all children rather than letting them calculate their own.TODOS:
VictoryChart
startAngle
andendAngle
propsComponents that already ~work with polar charts
Gotchas
VictoryClipContainer
(used byVictoryArea
,VictoryLine
, andVictoryZoomContainer
) does not work with polar charts. It will need a polar implementation.