@@ -130,16 +130,10 @@ Two main types of axes supported by default include:
130
130
131
131
User-defined axis types can be added along with custom indexing
132
132
behaviors. To add add a custom type as a Categorical or Dimensional
133
- axis, add a trait using `AxisArrays.axistrait`. Here is the example of
134
- adding a custom Dimensional axis:
135
-
136
- ```julia
137
- AxisArrays.axistrait(v::MyCustomAxis) = AxisArrays.Dimensional
138
- ```
133
+ axis, add a trait using [`AxisArrays.axistrait`](@ref).
139
134
140
135
For more advanced indexing, you can define custom methods for
141
- `AxisArrays.axisindexes`.
142
-
136
+ [`AxisArrays.axisindexes`](@ref).
143
137
144
138
### Examples
145
139
@@ -520,6 +514,23 @@ immutable Dimensional <: AxisTrait end
520
514
immutable Categorical <: AxisTrait end
521
515
immutable Unsupported <: AxisTrait end
522
516
517
+ """
518
+ axistrait(ax::Axis) -> Type{<:AxisTrait}
519
+
520
+ Returns the indexing type of an `Axis`, any subtype of `AxisTrait`.
521
+ The default is `Unsupported`, meaning there is no special indexing behaviour for this axis
522
+ and indexes into this axis are passed directly to the underlying array.
523
+
524
+ Two main types of axes supported by default are `Categorical` and `Dimensional`; see
525
+ [Indexing](@ref) for more information on these types.
526
+
527
+ User-defined axis types can be added along with custom indexing behaviors by defining new
528
+ methods of this function. Here is the example of adding a custom Dimensional axis:
529
+
530
+ ```julia
531
+ AxisArrays.axistrait(v::MyCustomAxis) = AxisArrays.Dimensional
532
+ ```
533
+ """
523
534
axistrait (:: Any ) = Unsupported
524
535
axistrait (ax:: Axis ) = axistrait (ax. val)
525
536
axistrait {T<:Union{Number, Dates.AbstractTime}} (:: AbstractVector{T} ) = Dimensional
0 commit comments