Skip to content

Commit

Permalink
Feature/chart children (#112)
Browse files Browse the repository at this point in the history
* updated all charts to support `children`. Deprecated the use of `Decorators`, `Extras` and the `renderGrid` prop

* migrate ProgressCircle to new children api

* migrate piechart to new api

* update changelog

* update readme

* cleanup

* update readme

* update readme

* fix piechart and progress circle.
fix #110

* bump version to 5.0.0

* lint fixes
  • Loading branch information
JesperLekland authored Apr 15, 2018
1 parent fb29199 commit 30026e5
Show file tree
Hide file tree
Showing 42 changed files with 600 additions and 362 deletions.
46 changes: 40 additions & 6 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,46 @@

* **Support for horizontal StackedBarChart**
Version 5.0 is a major overhaul to the "decorator" and "extras" pattern.
We've simplified the API, made it declarative and added support for
rendering order.

StackedBarChart now supports the prop `horizontal`
just as a regular BarChart
All charts and axes now support React children. Meaning that your decorators
and extras should now be placed as direct children to the chart in question.
This is a breaking change but a very easy one to migrate (I migrated all storybooks in a matter of minutes),
see the [examples repo](https://github.com/JesperLekland/react-native-svg-charts-examples)
and read the [docs](https://github.com/JesperLekland/react-native-svg-charts#react-native-svg-charts) for inspiration.

I want to thank everyone who is contributing by submitting issues and joining
in on discussions. A special thanks to @narciero, @Sprit3Dan and @RoarRain for
contributing with PRs.

* **StackedBar/AreaChart adheres to new `extras` api**
## Breaking Changes
* **Extras and Decorators have been removed**

Extras and decorators should now be passed in as children to the chart in question.
Each child will be called with similar arguments as before. See
[README](https://github.com/JesperLekland/react-native-svg-charts#react-native-svg-charts)
for more info.

Migrating an extra is as simple as just moving it from the `extras` array to a child of the chart.
The `decorators` are nearly as easy to migrate. Create a wrapper component around
your decorator that accepts the `data` prop, now you yourself can map this array and return as many decorators as you want.


* **renderGrid and gridProps have been removed**

A grid show now be rendered through as a child. We still expose a default `Grid`
component as part of the API but this must no manually be added to all charts that want to display a grid.

As a result of this the following props are deprecated:
* `showGrid`
* `gridProps`
* `renderGrid`


* **Grids are consolidate into one**

Before we hade `Grid.Vertical`,`Grid.Horizontal` and `Grid.Both`,
now we simply have `Grid` with a `direction` property. See [README](https://github.com/JesperLekland/react-native-svg-charts#react-native-svg-charts)
for more info

StackedBarChart and StackedAreaChart was still on the legacy `renderExtras`
pattern. It has now been migrated to the single `extras` prop api.

Loading

0 comments on commit 30026e5

Please sign in to comment.