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

Commit

Permalink
Merge pull request #466 from FormidableLabs/experiment/polar
Browse files Browse the repository at this point in the history
Polar Charts
  • Loading branch information
boygirl committed Jun 6, 2017
2 parents 259b3de + a9683c1 commit bc2906c
Show file tree
Hide file tree
Showing 42 changed files with 1,601 additions and 636 deletions.
40 changes: 40 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,45 @@
# VictoryChart Changelog

## 21.0.0 (2017-06-06)

[466](https://github.com/FormidableLabs/victory-chart/pull/466) Polar Charts
[475](https://github.com/FormidableLabs/victory-chart/pull/475) Brush and Zoom fixes
[476](https://github.com/FormidableLabs/victory-chart/pull/476) Zoom Improvements

*Breaking Changes*
- Changes how default widths are calculated for `VictoryBar` and groups of bars
- Removes default bar widths from themes

*Overview*
- Supports polar charts by adding the `polar` prop to charts.
- Polar charts are supported for `VictoryArea`, `VictoryChart`, `VictoryGroup`, `VictoryLine`, `VictoryScatter` `VictoryStack` and `VictoryVoronoi`
- Polar charts are supported for `VictoryBar`, but horizontal (radial) bars are not yet supported
- Polar charts work with `VictoryVoronoiContainer`
- Polar charts work with `VictorySelectionContainer`, but the dimension prop is not supported for polar selections
- Polar charts work with `VictoryZoomContainer`, but zooming is limited to centered radial zooming. Panning has no effect.
- Polar-specific default animations for `VictoryLine` and `VictoryArea`
- **horizontal polar charts are not yet supported**
- **`VictoryCandlestick` and `VictoryErrorBar` do not yet work with polar charts
- **`VictoryCursorContainer` does not yet work with polar charts
- **`VictoryBrushContainer` does not work with polar charts
- **`VictoryZoomContainer` has limitations for polar charts

*Planned additional work*
- Support for radial bars
- Support for spider charts (i.e. linear grid lines rather than arcs on polar charts)
- Support separate theming for polar charts (at least axes)
- Support for a polar version of `VictoryCursorContainer`
- Minimal support for polar versions of `VictoryCandleStick` and `VictoryErrorBar` (Elements will be correctly positioned and angled, but path elements will not be altered to reflect curvature, _i.e._ candles will still be `rects` rather than arc paths)
- Investigate hollow polar charts

*Details*
- Adds `VictoryPolarAxis` with new props: `axisAngle` `startAngle`, `endAngle`, and `labelPlacement`
- Adds `polar`, `startAngle`, `endAngle`, and `defaultPolarAxes` props for `VictoryChart`
- Adds `polar`, `origin`, and `range` props to all chart types.
- Adds `defaultPolarTransitions` static methods to `VictoryLine` and `VictoryArea`
- Uses `LabelHelpers` to simplify all `helper-methods`


## 20.0.0 (2017-05-24)

*Breaking Changes*
Expand Down
5 changes: 5 additions & 0 deletions demo/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import CreateContainerDemo from "./components/create-container-demo";
import BrushContainerDemo from "./components/victory-brush-container-demo";
import AnimationDemo from "./components/animation-demo";
import SelectionDemo from "./components/selection-demo";
import PolarDemo from "./components/victory-polar-chart-demo";
import DebugDemo from "./components/debug-demo";

class Home extends React.Component {
Expand Down Expand Up @@ -70,6 +71,7 @@ class App extends React.Component {
case "/animation": Child = AnimationDemo; break;
case "/selection-container": Child = SelectionDemo; break;
case "/create-container": Child = CreateContainerDemo; break;
case "/polar": Child = PolarDemo; break;
case "/debug": Child = DebugDemo; break;
default: Child = Home;
}
Expand Down Expand Up @@ -101,6 +103,7 @@ class App extends React.Component {
<li><a href="#/animation">Animation Demo</a></li>
<li><a href="#/selection-container">Victory Selection Container Demo</a></li>
<li><a href="#/create-container">createContainer Demo</a></li>
<li><a href="#/polar">Polar Demo</a></li>
</ul>
<Child/>
</div>
Expand All @@ -109,3 +112,5 @@ class App extends React.Component {
}

ReactDOM.render(<App/>, document.getElementById("content"));


1 change: 0 additions & 1 deletion demo/components/group-demo.js
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,6 @@ class App extends React.Component {
/>
</VictoryGroup>
</VictoryChart>

</div>
</div>
);
Expand Down
10 changes: 7 additions & 3 deletions demo/components/victory-bar-demo.js
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ export default class App extends React.Component {
theme={VictoryTheme.material}
>
<VictoryGroup
offset={15}
offset={12}
animate={{ duration: 1000 }}
colorScale={"warm"}
>
Expand All @@ -283,15 +283,19 @@ export default class App extends React.Component {
})}
</VictoryGroup>

<VictoryGroup horizontal style={{ parent: parentStyle }} offset={10}
<VictoryGroup horizontal style={{ parent: parentStyle }} offset={15}
colorScale={"cool"} animate={{ duration: 2000 }} labels={["a", "b", "c"]}
>
{this.getBarData().map((data, index) => {
return <VictoryBar key={index} data={data}/>;
})}
</VictoryGroup>

<VictoryGroup style={{ parent: parentStyle }} offset={15} animate={{ duration: 2000 }}>
<VictoryGroup
style={{ parent: parentStyle, data: { width: 20 } }}
offset={25}
animate={{ duration: 2000 }}
>
<VictoryStack colorScale={"red"}>
{this.getBarData().map((data, index) => {
return <VictoryBar key={index} data={data}/>;
Expand Down
6 changes: 3 additions & 3 deletions demo/components/victory-chart-demo.js
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ class App extends React.Component {
<VictoryChart style={chartStyle}>
<VictoryBar
groupComponent={<VictoryClipContainer/>}
style={{ data: { fill: "tomato", width: 20 } }}
style={{ data: { fill: "tomato" } }}
data={[
{ x: 1, y: 1 },
{ x: 2, y: 2 },
Expand Down Expand Up @@ -544,7 +544,7 @@ class App extends React.Component {
}]}
>
<VictoryBar name="bar"
style={{ data: { width: 15, fill: "green" } }}
style={{ data: { fill: "green" } }}
data={[
{ x: 1, y: 1 },
{ x: 2, y: 2 },
Expand All @@ -567,7 +567,7 @@ class App extends React.Component {
/>
</VictoryChart>
<VictoryChart style={chartStyle} domainPadding={{ x: 50 }} animate={{ duration: 2000 }}>
<VictoryGroup offset={15}>
<VictoryGroup offset={20} style={{ data: { width: 15 } }}>
<VictoryStack colorScale={"red"}>
{this.getBarData().map((data, index) => {
return <VictoryBar key={index} data={data}/>;
Expand Down
Loading

0 comments on commit bc2906c

Please sign in to comment.