-
Notifications
You must be signed in to change notification settings - Fork 64
Conversation
## Sorting data | ||
|
||
|
||
Sorting can be applied to the final data via the dataSort prop. This prop must |
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.
Change this to reflect the lodash sortBy param
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.
link to the sortBy docs too
]} | ||
x="experiment" | ||
y={(d) => (d.actual / d.expected) * 100} | ||
dataSort={(a, b) => (a.experiment - b.experiment)} |
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.
Here's a cool example that demonstrates why you would want to use this feature https://github.com/FormidableLabs/victory-chart/blob/master/demo/components/victory-line-demo.js#L304
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.
In general docs examples should be as minimal as possible so that it is clear what is being explained
docs/victory-area/docs.md
Outdated
### sortKey | ||
|
||
Use the `sortKey` prop to indicate how data should be sorted. This prop is | ||
given directly to the lodash `sortBy` function to be executed on the final |
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.
Please include a link to the sortKey
documentation.
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.
You should also briefly describe what this prop can be given as i.e. string, array etc
docs/victory-area/docs.md
Outdated
given directly to the lodash `sortBy` function to be executed on the final | ||
dataset. | ||
|
||
*examples*: `sortKey="x"`, `sortKey="y"` |
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.
It would be more useful to give examples with different prop types, like
sortKey="x", sortKey={["age", "height"]}
@@ -40,6 +40,12 @@ Use the `x` and `y` data accessor props to determine how the component defines d | |||
|
|||
*examples:* `y="employees.salary"`, `y={["employees", "salary"]}` | |||
|
|||
### sortKey | |||
|
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.
Should be the same as the other sortKey descriptions
Ready for re-review |
docs/victory-area/docs.md
Outdated
|
||
Use the `sortKey` prop to indicate how data should be sorted. This prop is | ||
given directly to the lodash `sortBy` function to be executed on the final | ||
dataset: https://lodash.com/docs/4.17.4#sortBy |
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.
As a markdown link, please. Maybe like
This prop is given directly to [the lodash
sortBy function]...
with the link at the bottom on the file like
[the lodash
sortBy function]: https://lodash.com/docs/4.17.4#sortBy
@DerekMaffett approved pending markdown links. |
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.
👍
Documents: FormidableLabs/victory-core#201