You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/src/pages/docs/api.md
+19-96Lines changed: 19 additions & 96 deletions
Original file line number
Diff line number
Diff line change
@@ -5,76 +5,6 @@ title: API
5
5
6
6
> Complete documentation is **coming soon**. For now, please refer to the examples for any missing documentation.
7
7
8
-
React Charts exposes these top-level exports:
9
-
10
-
-`Chart` - The Chart component used to render charts
11
-
- Series Type Components
12
-
-`Line`
13
-
-`Bar`
14
-
-`Bubble`
15
-
-`Area`
16
-
- Curve Functions
17
-
-`curveBasisClosed`
18
-
-`curveBasisOpen`
19
-
-`curveBasis`
20
-
-`curveBundle`
21
-
-`curveCardinalClosed`
22
-
-`curveCardinalOpen`
23
-
-`curveCardinal`
24
-
-`curveCatmullRomClosed`
25
-
-`curveCatmullRomOpen`
26
-
-`curveCatmullRom`
27
-
-`curveLinearClosed`
28
-
-`curveLinear`
29
-
-`curveMonotoneX`
30
-
-`curveMonotoneY`
31
-
-`curveNatural`
32
-
-`curveStep`
33
-
-`curveStepAfter`
34
-
-`curveStepBefore`
35
-
- Position Constants
36
-
-`positionTop`
37
-
-`positionRight`
38
-
-`positionBottom`
39
-
-`positionLeft`
40
-
- Grouping Constants
41
-
-`groupingSingle`
42
-
-`groupingSeries`
43
-
-`groupingPrimary`
44
-
-`groupingSecondary`
45
-
- Tooltip Alignment Constants
46
-
-`alignAuto`
47
-
-`alignRight`
48
-
-`alignTopRight`
49
-
-`alignBottomRight`
50
-
-`alignLeft`
51
-
-`alignTopLeft`
52
-
-`alignBottomLeft`
53
-
-`alignTop`
54
-
-`alignBottom`
55
-
- Axis Type Constants
56
-
-`axisTypeOrdinal`
57
-
-`axisTypeTime`
58
-
-`axisTypeUtc`
59
-
-`axisTypeLinear`
60
-
-`axisTypeLog`
61
-
- Tooltip Anchor Constants
62
-
-`anchorPointer`
63
-
-`anchorClosest`
64
-
-`anchorCenter`
65
-
-`anchorTop`
66
-
-`anchorBottom`
67
-
-`anchorLeft`
68
-
-`anchorRight`
69
-
-`anchorGridTop`
70
-
-`anchorGridBottom`
71
-
-`anchorGridLeft`
72
-
-`anchorGridRight`
73
-
- Focus Mode Constants
74
-
-`focusAuto`
75
-
-`focusClosest`
76
-
-`focusElement`
77
-
78
8
## Memoize your Props!
79
9
80
10
As you'll see in every example, the React Charts `<Chart>` component expects all props and options to be memoized using either `React.useMemo` or `React.useCallback`. While passing an unmemoized option/prop to the `<Chart>` component won't severly break any visible functionality, your charts will be severly non-performant. Internally, React Charts uses the immutable nature of thes options/props to detect changes to the configuration and update accordingly.
@@ -158,16 +88,17 @@ function MyChart() {
158
88
}
159
89
```
160
90
161
-
## Axes & Scales
91
+
## Axes
162
92
163
-
React Charts supports an `axes` prop that handles both the underlying scale and visual rendering. These axes can be combined and configured to plot data in many ways. To date, we have the following scale types available:
93
+
React Charts supports an `axes` prop that handles both the underlying scale and visual rendering of all axes. Multiple axes can be combined and configured to plot data however you'd like.
164
94
165
-
- Cartesian
166
-
-`linear` - A continuous axis used for plotting numerical data on an evenly distributed scale. Works well both as a **primary and secondary** axis.
167
-
-`ordinal` - A banded axis commonly used to plot categories or ordinal information. Works well as the **primary** axis for bar charts.
168
-
-`time` - A continuous axis used for plotting localized times and dates on an evenly distributed scale. Works well as a **primary** axis.
169
-
-`utc` - Similar to the `time` scale, but supports UTC datetimes instead of localized datetimes. Works well as a **primary** axis.
170
-
-`log` - A continuous axis used for plotting numerical data on a logarithmically distributed scale. Works well as a **secondary** axis
95
+
To date, we have the following scale types available:
96
+
97
+
-`linear` - A continuous axis used for plotting numerical data on an evenly distributed scale. Works well both as a **primary and secondary** axis.
98
+
-`ordinal` - A banded axis commonly used to plot categories or ordinal information. Works well as the **primary** axis for bar charts.
99
+
-`time` - A continuous axis used for plotting localized times and dates on an evenly distributed scale. Works well as a **primary** axis.
100
+
-`utc` - Similar to the `time` scale, but supports UTC datetimes instead of localized datetimes. Works well as a **primary** axis.
101
+
-`log` - A continuous axis used for plotting numerical data on a logarithmically distributed scale. Works well as a **secondary** axis
171
102
172
103
Axes are a required component of a React Chart and can used like so:
173
104
@@ -196,8 +127,6 @@ function MyChart() {
196
127
}
197
128
```
198
129
199
-
For more information on usage and API, see the [`axes` prop](#axes)
200
-
201
130
## Series Types
202
131
203
132
- Cartesian
@@ -222,12 +151,6 @@ function MyChart() {
222
151
223
152
**`<Chart />` Props**
224
153
225
-
-`getLabel` - A `memoized` function that returns the series label
226
-
-`getSeriesId` - A `memoized` function that returns the series ID
227
-
-`getDatums` - A `memoized` function that returns the series' datums array
228
-
-`getPrimary` - A `memoized` function that returns the datum's primary value
229
-
-`getSecondary` - A `memoized` function that returns the datum's secondary value
230
-
-`getR` - A `memoized` function that returns the datum's radius value (where applicable)
231
154
-`series({} or function)` - A `memoized` object (or function that returns an object) of series options that correspond to all or each of the series in the dataset.
232
155
`type` - **string** - The series type (Line, Bar, Bubble, Area, etc)
233
156
`showPoints` - **bool** - If true, will show points for datums where applicable
@@ -237,18 +160,18 @@ function MyChart() {
237
160
-`axis{}` - An axis object
238
161
-`primary`**bool** - Denotes whether this axis is the primary axis
239
162
-`type`**oneOf, required** - The type of scale for this axis
240
-
-`axisTypeOrdinal`
241
-
-`axisTypeTime`
242
-
-`axisTypeUtc`
243
-
-`axisTypeLinear`
244
-
-`axisTypeLog`
163
+
-`ordinal`
164
+
-`time`
165
+
-`utc`
166
+
-`linear`
167
+
-`log`
245
168
-`position`**oneOf, required** - The cartesian position of this axis
246
-
-`positionTop`
247
-
-`positionRight`
248
-
-`positionBottom`
249
-
-`positionLeft`
169
+
-`top`
170
+
-`right`
171
+
-`bottom`
172
+
-`left`
250
173
-`invert`**bool** - Whether this axis's scale should be inverted
251
-
-`primaryAxisID`**string** - If multiple secondary axes are used, which primary axis ID does this axis refer to?
174
+
-`primaryAxisID`**string** - If multiple primary axes are used, which primary axis ID does this axis refer to?
252
175
-`min`**number** - The suggested minimum for this axis
253
176
-`max`**number** - The suggested maximum for this axis
254
177
-`hardMin`**number** - The hard/forced minimum for this axis
0 commit comments