Skip to content

Commit

Permalink
Vertify ticks is an array and update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
kurkle committed Jan 10, 2019
1 parent 51ad052 commit 3abbaff
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion docs/axes/README.md
Expand Up @@ -31,7 +31,7 @@ There are a number of config callbacks that can be used to change parameters in
| `beforeDataLimits` | `axis` | Callback that runs before data limits are determined.
| `afterDataLimits` | `axis` | Callback that runs after data limits are determined.
| `beforeBuildTicks` | `axis` | Callback that runs before ticks are created.
| `afterBuildTicks` | `axis`, `ticks` | Callback that runs after ticks are created. Useful for filtering ticks (*Should return the filtered ticks*).
| `afterBuildTicks` | `axis`, `ticks` | Callback that runs after ticks are created. Useful for filtering ticks. Should return the filtered ticks.
| `beforeTickToLabelConversion` | `axis` | Callback that runs before ticks are converted into strings.
| `afterTickToLabelConversion` | `axis` | Callback that runs after ticks are converted into strings.
| `beforeCalculateTickRotation` | `axis` | Callback that runs before tick rotation is determined.
Expand Down
2 changes: 1 addition & 1 deletion src/core/core.scale.js
Expand Up @@ -291,7 +291,7 @@ module.exports = Element.extend({
afterBuildTicks: function(ticks) {
var me = this;
// ticks is empty for old axis implementations here
if (ticks.length) {
if (helpers.isArray(ticks) && ticks.length) {
return helpers.callback(me.options.afterBuildTicks, [me, ticks]);
}
// Support old implementatios (that modified `this.ticks` directly in buildTicks)
Expand Down

0 comments on commit 3abbaff

Please sign in to comment.