@coinbase/cds-mcp-server 8.47.1 → 8.47.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/mcp-docs/mobile/components/BarChart.txt +8 -8
- package/mcp-docs/mobile/components/CartesianChart.txt +85 -30
- package/mcp-docs/mobile/components/LineChart.txt +16 -16
- package/mcp-docs/mobile/components/MessagingCard.txt +18 -11
- package/mcp-docs/mobile/components/Numpad.txt +2 -2
- package/mcp-docs/mobile/components/Point.txt +2 -2
- package/mcp-docs/mobile/components/ReferenceLine.txt +151 -65
- package/mcp-docs/mobile/components/Scrubber.txt +12 -19
- package/mcp-docs/mobile/components/Select.txt +1 -1
- package/mcp-docs/mobile/components/SelectAlpha.txt +1 -1
- package/mcp-docs/mobile/components/SelectOption.txt +1 -1
- package/mcp-docs/mobile/components/SlideButton.txt +1 -1
- package/mcp-docs/mobile/components/SparklineInteractive.txt +239 -46
- package/mcp-docs/mobile/components/SparklineInteractiveHeader.txt +55 -13
- package/mcp-docs/mobile/components/XAxis.txt +4 -5
- package/mcp-docs/mobile/components/YAxis.txt +2 -2
- package/mcp-docs/mobile/getting-started/theming.txt +1 -1
- package/mcp-docs/web/components/BarChart.txt +40 -48
- package/mcp-docs/web/components/Carousel.txt +2 -2
- package/mcp-docs/web/components/CartesianChart.txt +82 -45
- package/mcp-docs/web/components/Combobox.txt +61 -61
- package/mcp-docs/web/components/LineChart.txt +87 -110
- package/mcp-docs/web/components/MediaQueryProvider.txt +10 -2
- package/mcp-docs/web/components/MessagingCard.txt +21 -12
- package/mcp-docs/web/components/PeriodSelector.txt +57 -39
- package/mcp-docs/web/components/Point.txt +3 -3
- package/mcp-docs/web/components/ReferenceLine.txt +341 -279
- package/mcp-docs/web/components/Scrubber.txt +48 -52
- package/mcp-docs/web/components/SelectChipAlpha.txt +1 -1
- package/mcp-docs/web/components/SparklineInteractive.txt +399 -54
- package/mcp-docs/web/components/SparklineInteractiveHeader.txt +368 -28
- package/mcp-docs/web/components/TabbedChipsAlpha.txt +1 -1
- package/mcp-docs/web/components/XAxis.txt +5 -6
- package/mcp-docs/web/components/YAxis.txt +2 -2
- package/mcp-docs/web/getting-started/theming.txt +1 -1
- package/mcp-docs/web/hooks/useBreakpoints.txt +5 -4
- package/mcp-docs/web/hooks/useMediaQuery.txt +10 -2
- package/package.json +1 -1
|
@@ -13,9 +13,36 @@ import { SparklineInteractive } from '@coinbase/cds-mobile-visualization'
|
|
|
13
13
|
### Default usage
|
|
14
14
|
|
|
15
15
|
```jsx
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
16
|
+
() => {
|
|
17
|
+
const periods = [
|
|
18
|
+
{ label: '1H', value: 'hour' },
|
|
19
|
+
{ label: '1D', value: 'day' },
|
|
20
|
+
{ label: '1W', value: 'week' },
|
|
21
|
+
{ label: '1M', value: 'month' },
|
|
22
|
+
{ label: '1Y', value: 'year' },
|
|
23
|
+
{ label: 'All', value: 'all' },
|
|
24
|
+
];
|
|
25
|
+
|
|
26
|
+
const formatDate = useCallback((value, period) => {
|
|
27
|
+
if (period === 'hour' || period === 'day')
|
|
28
|
+
return value.toLocaleTimeString('en-US', { hour: 'numeric', minute: 'numeric' });
|
|
29
|
+
if (period === 'week' || period === 'month')
|
|
30
|
+
return value.toLocaleDateString('en-US', { month: 'numeric', day: 'numeric' });
|
|
31
|
+
return value.toLocaleDateString('en-US', { month: 'numeric', year: 'numeric' });
|
|
32
|
+
}, []);
|
|
33
|
+
|
|
34
|
+
return (
|
|
35
|
+
<Box padding={3} width="100%">
|
|
36
|
+
<SparklineInteractive
|
|
37
|
+
data={sparklineInteractiveData}
|
|
38
|
+
defaultPeriod="day"
|
|
39
|
+
formatDate={formatDate}
|
|
40
|
+
periods={periods}
|
|
41
|
+
strokeColor="#F7931A"
|
|
42
|
+
/>
|
|
43
|
+
</Box>
|
|
44
|
+
);
|
|
45
|
+
};
|
|
19
46
|
```
|
|
20
47
|
|
|
21
48
|
### Fill Type
|
|
@@ -23,34 +50,110 @@ import { SparklineInteractive } from '@coinbase/cds-mobile-visualization'
|
|
|
23
50
|
The fill will be added by default with a gradient style. You can set `fillType="dotted"` to get a dotted gradient fill.
|
|
24
51
|
|
|
25
52
|
```jsx
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
53
|
+
() => {
|
|
54
|
+
const periods = [
|
|
55
|
+
{ label: '1H', value: 'hour' },
|
|
56
|
+
{ label: '1D', value: 'day' },
|
|
57
|
+
{ label: '1W', value: 'week' },
|
|
58
|
+
{ label: '1M', value: 'month' },
|
|
59
|
+
{ label: '1Y', value: 'year' },
|
|
60
|
+
{ label: 'All', value: 'all' },
|
|
61
|
+
];
|
|
62
|
+
|
|
63
|
+
const formatDate = useCallback((value, period) => {
|
|
64
|
+
if (period === 'hour' || period === 'day')
|
|
65
|
+
return value.toLocaleTimeString('en-US', { hour: 'numeric', minute: 'numeric' });
|
|
66
|
+
if (period === 'week' || period === 'month')
|
|
67
|
+
return value.toLocaleDateString('en-US', { month: 'numeric', day: 'numeric' });
|
|
68
|
+
return value.toLocaleDateString('en-US', { month: 'numeric', year: 'numeric' });
|
|
69
|
+
}, []);
|
|
70
|
+
|
|
71
|
+
return (
|
|
72
|
+
<Box padding={3} width="100%">
|
|
73
|
+
<SparklineInteractive
|
|
74
|
+
fill
|
|
75
|
+
data={sparklineInteractiveData}
|
|
76
|
+
defaultPeriod="day"
|
|
77
|
+
fillType="dotted"
|
|
78
|
+
formatDate={formatDate}
|
|
79
|
+
periods={periods}
|
|
80
|
+
strokeColor="#F7931A"
|
|
81
|
+
/>
|
|
82
|
+
</Box>
|
|
83
|
+
);
|
|
84
|
+
};
|
|
34
85
|
```
|
|
35
86
|
|
|
36
87
|
### Compact
|
|
37
88
|
|
|
38
89
|
```jsx
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
90
|
+
() => {
|
|
91
|
+
const periods = [
|
|
92
|
+
{ label: '1H', value: 'hour' },
|
|
93
|
+
{ label: '1D', value: 'day' },
|
|
94
|
+
{ label: '1W', value: 'week' },
|
|
95
|
+
{ label: '1M', value: 'month' },
|
|
96
|
+
{ label: '1Y', value: 'year' },
|
|
97
|
+
{ label: 'All', value: 'all' },
|
|
98
|
+
];
|
|
99
|
+
|
|
100
|
+
const formatDate = useCallback((value, period) => {
|
|
101
|
+
if (period === 'hour' || period === 'day')
|
|
102
|
+
return value.toLocaleTimeString('en-US', { hour: 'numeric', minute: 'numeric' });
|
|
103
|
+
if (period === 'week' || period === 'month')
|
|
104
|
+
return value.toLocaleDateString('en-US', { month: 'numeric', day: 'numeric' });
|
|
105
|
+
return value.toLocaleDateString('en-US', { month: 'numeric', year: 'numeric' });
|
|
106
|
+
}, []);
|
|
107
|
+
|
|
108
|
+
return (
|
|
109
|
+
<Box padding={3} width="100%">
|
|
110
|
+
<SparklineInteractive
|
|
111
|
+
compact
|
|
112
|
+
data={sparklineInteractiveData}
|
|
113
|
+
defaultPeriod="day"
|
|
114
|
+
formatDate={formatDate}
|
|
115
|
+
periods={periods}
|
|
116
|
+
strokeColor="#F7931A"
|
|
117
|
+
/>
|
|
118
|
+
</Box>
|
|
119
|
+
);
|
|
120
|
+
};
|
|
42
121
|
```
|
|
43
122
|
|
|
44
123
|
### Hide period selector
|
|
45
124
|
|
|
46
125
|
```jsx
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
126
|
+
() => {
|
|
127
|
+
const periods = [
|
|
128
|
+
{ label: '1H', value: 'hour' },
|
|
129
|
+
{ label: '1D', value: 'day' },
|
|
130
|
+
{ label: '1W', value: 'week' },
|
|
131
|
+
{ label: '1M', value: 'month' },
|
|
132
|
+
{ label: '1Y', value: 'year' },
|
|
133
|
+
{ label: 'All', value: 'all' },
|
|
134
|
+
];
|
|
135
|
+
|
|
136
|
+
const formatDate = useCallback((value, period) => {
|
|
137
|
+
if (period === 'hour' || period === 'day')
|
|
138
|
+
return value.toLocaleTimeString('en-US', { hour: 'numeric', minute: 'numeric' });
|
|
139
|
+
if (period === 'week' || period === 'month')
|
|
140
|
+
return value.toLocaleDateString('en-US', { month: 'numeric', day: 'numeric' });
|
|
141
|
+
return value.toLocaleDateString('en-US', { month: 'numeric', year: 'numeric' });
|
|
142
|
+
}, []);
|
|
143
|
+
|
|
144
|
+
return (
|
|
145
|
+
<Box padding={3} width="100%">
|
|
146
|
+
<SparklineInteractive
|
|
147
|
+
data={sparklineInteractiveData}
|
|
148
|
+
defaultPeriod="day"
|
|
149
|
+
formatDate={formatDate}
|
|
150
|
+
hidePeriodSelector
|
|
151
|
+
periods={periods}
|
|
152
|
+
strokeColor="#F7931A"
|
|
153
|
+
/>
|
|
154
|
+
</Box>
|
|
155
|
+
);
|
|
156
|
+
};
|
|
54
157
|
```
|
|
55
158
|
|
|
56
159
|
### Scaling Factor
|
|
@@ -58,48 +161,131 @@ The fill will be added by default with a gradient style. You can set `fillType="
|
|
|
58
161
|
The scaling factor is usually used when you want to show less variance in the chart. An example of this is a stable coin that doesn't change price by more than a few cents.
|
|
59
162
|
|
|
60
163
|
```jsx
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
164
|
+
() => {
|
|
165
|
+
const periods = [
|
|
166
|
+
{ label: '1H', value: 'hour' },
|
|
167
|
+
{ label: '1D', value: 'day' },
|
|
168
|
+
{ label: '1W', value: 'week' },
|
|
169
|
+
{ label: '1M', value: 'month' },
|
|
170
|
+
{ label: '1Y', value: 'year' },
|
|
171
|
+
{ label: 'All', value: 'all' },
|
|
172
|
+
];
|
|
69
173
|
|
|
70
|
-
|
|
174
|
+
const formatDate = useCallback((value, period) => {
|
|
175
|
+
if (period === 'hour' || period === 'day')
|
|
176
|
+
return value.toLocaleTimeString('en-US', { hour: 'numeric', minute: 'numeric' });
|
|
177
|
+
if (period === 'week' || period === 'month')
|
|
178
|
+
return value.toLocaleDateString('en-US', { month: 'numeric', day: 'numeric' });
|
|
179
|
+
return value.toLocaleDateString('en-US', { month: 'numeric', year: 'numeric' });
|
|
180
|
+
}, []);
|
|
71
181
|
|
|
72
|
-
|
|
73
|
-
<Box padding={3} width="100%">
|
|
74
|
-
|
|
75
|
-
|
|
182
|
+
return (
|
|
183
|
+
<Box padding={3} width="100%">
|
|
184
|
+
<SparklineInteractive
|
|
185
|
+
data={sparklineInteractiveData}
|
|
186
|
+
defaultPeriod="day"
|
|
187
|
+
formatDate={formatDate}
|
|
188
|
+
periods={periods}
|
|
189
|
+
strokeColor="#F7931A"
|
|
190
|
+
yAxisScalingFactor={0.1}
|
|
191
|
+
/>
|
|
192
|
+
</Box>
|
|
193
|
+
);
|
|
194
|
+
};
|
|
76
195
|
```
|
|
77
196
|
|
|
78
|
-
###
|
|
197
|
+
### With header
|
|
79
198
|
|
|
80
199
|
```jsx
|
|
81
200
|
<Box padding={3} width="100%">
|
|
82
|
-
<
|
|
201
|
+
<SparklineInteractive
|
|
83
202
|
fill
|
|
84
203
|
data={sparklineInteractiveData}
|
|
85
|
-
|
|
204
|
+
defaultPeriod="day"
|
|
205
|
+
formatDate={formatDate}
|
|
206
|
+
headerNode={<SparklineInteractiveHeader ref={headerRef} defaultLabel="Bitcoin Price" ... />}
|
|
207
|
+
onPeriodChanged={handlePeriodChanged}
|
|
208
|
+
onScrub={handleScrub}
|
|
209
|
+
onScrubEnd={handleScrubEnd}
|
|
210
|
+
periods={periods}
|
|
86
211
|
strokeColor="#F7931A"
|
|
87
212
|
/>
|
|
88
213
|
</Box>
|
|
89
214
|
```
|
|
90
215
|
|
|
216
|
+
### Custom hover data
|
|
217
|
+
|
|
218
|
+
```jsx
|
|
219
|
+
() => {
|
|
220
|
+
const periods = [
|
|
221
|
+
{ label: '1H', value: 'hour' },
|
|
222
|
+
{ label: '1D', value: 'day' },
|
|
223
|
+
{ label: '1W', value: 'week' },
|
|
224
|
+
{ label: '1M', value: 'month' },
|
|
225
|
+
{ label: '1Y', value: 'year' },
|
|
226
|
+
{ label: 'All', value: 'all' },
|
|
227
|
+
];
|
|
228
|
+
|
|
229
|
+
const formatDate = useCallback((value, period) => {
|
|
230
|
+
if (period === 'hour' || period === 'day')
|
|
231
|
+
return value.toLocaleTimeString('en-US', { hour: 'numeric', minute: 'numeric' });
|
|
232
|
+
if (period === 'week' || period === 'month')
|
|
233
|
+
return value.toLocaleDateString('en-US', { month: 'numeric', day: 'numeric' });
|
|
234
|
+
return value.toLocaleDateString('en-US', { month: 'numeric', year: 'numeric' });
|
|
235
|
+
}, []);
|
|
236
|
+
|
|
237
|
+
return (
|
|
238
|
+
<Box padding={3} width="100%">
|
|
239
|
+
<SparklineInteractive
|
|
240
|
+
fill
|
|
241
|
+
data={sparklineInteractiveData}
|
|
242
|
+
defaultPeriod="day"
|
|
243
|
+
formatDate={formatDate}
|
|
244
|
+
hoverData={sparklineInteractiveHoverData}
|
|
245
|
+
periods={periods}
|
|
246
|
+
strokeColor="#F7931A"
|
|
247
|
+
/>
|
|
248
|
+
</Box>
|
|
249
|
+
);
|
|
250
|
+
};
|
|
251
|
+
```
|
|
252
|
+
|
|
91
253
|
### Period selector placement
|
|
92
254
|
|
|
93
255
|
`periodSelectorPlacement` can be used to place the period selector in different positions (`above` or `below`).
|
|
94
256
|
|
|
95
257
|
```jsx
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
258
|
+
() => {
|
|
259
|
+
const periods = [
|
|
260
|
+
{ label: '1H', value: 'hour' },
|
|
261
|
+
{ label: '1D', value: 'day' },
|
|
262
|
+
{ label: '1W', value: 'week' },
|
|
263
|
+
{ label: '1M', value: 'month' },
|
|
264
|
+
{ label: '1Y', value: 'year' },
|
|
265
|
+
{ label: 'All', value: 'all' },
|
|
266
|
+
];
|
|
267
|
+
|
|
268
|
+
const formatDate = useCallback((value, period) => {
|
|
269
|
+
if (period === 'hour' || period === 'day')
|
|
270
|
+
return value.toLocaleTimeString('en-US', { hour: 'numeric', minute: 'numeric' });
|
|
271
|
+
if (period === 'week' || period === 'month')
|
|
272
|
+
return value.toLocaleDateString('en-US', { month: 'numeric', day: 'numeric' });
|
|
273
|
+
return value.toLocaleDateString('en-US', { month: 'numeric', year: 'numeric' });
|
|
274
|
+
}, []);
|
|
275
|
+
|
|
276
|
+
return (
|
|
277
|
+
<Box padding={3} width="100%">
|
|
278
|
+
<SparklineInteractive
|
|
279
|
+
data={sparklineInteractiveData}
|
|
280
|
+
defaultPeriod="day"
|
|
281
|
+
formatDate={formatDate}
|
|
282
|
+
periodSelectorPlacement="below"
|
|
283
|
+
periods={periods}
|
|
284
|
+
strokeColor="#F7931A"
|
|
285
|
+
/>
|
|
286
|
+
</Box>
|
|
287
|
+
);
|
|
288
|
+
};
|
|
103
289
|
```
|
|
104
290
|
|
|
105
291
|
### Custom styles
|
|
@@ -108,9 +294,16 @@ You can also provide custom styles, such as to remove bottom padding from the he
|
|
|
108
294
|
|
|
109
295
|
```jsx
|
|
110
296
|
<Box padding={3} width="100%">
|
|
111
|
-
<
|
|
112
|
-
data={sparklineInteractiveData}
|
|
297
|
+
<SparklineInteractive
|
|
113
298
|
fill
|
|
299
|
+
data={sparklineInteractiveData}
|
|
300
|
+
defaultPeriod="day"
|
|
301
|
+
formatDate={formatDate}
|
|
302
|
+
headerNode={<SparklineInteractiveHeader ref={headerRef} defaultLabel="Bitcoin Price" ... />}
|
|
303
|
+
onPeriodChanged={handlePeriodChanged}
|
|
304
|
+
onScrub={handleScrub}
|
|
305
|
+
onScrubEnd={handleScrubEnd}
|
|
306
|
+
periods={periods}
|
|
114
307
|
strokeColor="#F7931A"
|
|
115
308
|
styles={{ header: { paddingBottom: 0 } }}
|
|
116
309
|
/>
|
|
@@ -14,7 +14,17 @@ import { SparklineInteractiveHeader } from '@coinbase/cds-mobile-visualization'
|
|
|
14
14
|
|
|
15
15
|
```jsx
|
|
16
16
|
<Box padding={3} width="100%">
|
|
17
|
-
<
|
|
17
|
+
<SparklineInteractive
|
|
18
|
+
data={sparklineInteractiveData}
|
|
19
|
+
defaultPeriod="day"
|
|
20
|
+
formatDate={formatDate}
|
|
21
|
+
headerNode={<SparklineInteractiveHeader ref={headerRef} defaultLabel="Bitcoin Price" ... />}
|
|
22
|
+
onPeriodChanged={handlePeriodChanged}
|
|
23
|
+
onScrub={handleScrub}
|
|
24
|
+
onScrubEnd={handleScrubEnd}
|
|
25
|
+
periods={periods}
|
|
26
|
+
strokeColor="#F7931A"
|
|
27
|
+
/>
|
|
18
28
|
</Box>
|
|
19
29
|
```
|
|
20
30
|
|
|
@@ -24,7 +34,18 @@ The fill will be added by default
|
|
|
24
34
|
|
|
25
35
|
```jsx
|
|
26
36
|
<Box padding={3} width="100%">
|
|
27
|
-
<
|
|
37
|
+
<SparklineInteractive
|
|
38
|
+
fill
|
|
39
|
+
data={sparklineInteractiveData}
|
|
40
|
+
defaultPeriod="day"
|
|
41
|
+
formatDate={formatDate}
|
|
42
|
+
headerNode={<SparklineInteractiveHeader ref={headerRef} defaultLabel="Bitcoin Price" ... />}
|
|
43
|
+
onPeriodChanged={handlePeriodChanged}
|
|
44
|
+
onScrub={handleScrub}
|
|
45
|
+
onScrubEnd={handleScrubEnd}
|
|
46
|
+
periods={periods}
|
|
47
|
+
strokeColor="#F7931A"
|
|
48
|
+
/>
|
|
28
49
|
</Box>
|
|
29
50
|
```
|
|
30
51
|
|
|
@@ -32,11 +53,18 @@ The fill will be added by default
|
|
|
32
53
|
|
|
33
54
|
```jsx
|
|
34
55
|
<Box padding={3} width="100%">
|
|
35
|
-
<
|
|
56
|
+
<SparklineInteractive
|
|
36
57
|
compact
|
|
37
58
|
fill
|
|
38
|
-
strokeColor="#F7931A"
|
|
39
59
|
data={sparklineInteractiveData}
|
|
60
|
+
defaultPeriod="day"
|
|
61
|
+
formatDate={formatDate}
|
|
62
|
+
headerNode={<SparklineInteractiveHeader ref={headerRef} compact defaultLabel="Bitcoin Price" ... />}
|
|
63
|
+
onPeriodChanged={handlePeriodChanged}
|
|
64
|
+
onScrub={handleScrub}
|
|
65
|
+
onScrubEnd={handleScrubEnd}
|
|
66
|
+
periods={periods}
|
|
67
|
+
strokeColor="#F7931A"
|
|
40
68
|
/>
|
|
41
69
|
</Box>
|
|
42
70
|
```
|
|
@@ -45,17 +73,31 @@ The fill will be added by default
|
|
|
45
73
|
|
|
46
74
|
```jsx
|
|
47
75
|
<Box padding={3} width="100%">
|
|
48
|
-
<
|
|
76
|
+
<SparklineInteractive
|
|
49
77
|
data={sparklineInteractiveData}
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
78
|
+
defaultPeriod="day"
|
|
79
|
+
formatDate={formatDate}
|
|
80
|
+
headerNode={
|
|
81
|
+
<SparklineInteractiveHeader
|
|
82
|
+
ref={headerRef}
|
|
83
|
+
defaultLabel="CustomHeader"
|
|
84
|
+
defaultSubHead={generateSubHead(lastPoint, currentPeriod)}
|
|
85
|
+
defaultTitle={`$${formatPrice(lastPoint.value)}`}
|
|
86
|
+
labelNode={
|
|
87
|
+
<HStack gap={1} alignItems="center" paddingBottom={0}>
|
|
88
|
+
<Icon active name="wallet" size="s" />
|
|
89
|
+
<Text as="span" font="title3">
|
|
90
|
+
CustomHeader
|
|
91
|
+
</Text>
|
|
92
|
+
</HStack>
|
|
93
|
+
}
|
|
94
|
+
/>
|
|
58
95
|
}
|
|
96
|
+
onPeriodChanged={handlePeriodChanged}
|
|
97
|
+
onScrub={handleScrub}
|
|
98
|
+
onScrubEnd={handleScrubEnd}
|
|
99
|
+
periods={periods}
|
|
100
|
+
strokeColor="#F7931A"
|
|
59
101
|
/>
|
|
60
102
|
</Box>
|
|
61
103
|
```
|
|
@@ -201,7 +201,7 @@ Properties related to the visual appearance of the XAxis are set on the componen
|
|
|
201
201
|
|
|
202
202
|
You can set the position of an axis to `top` or `bottom` (default).
|
|
203
203
|
|
|
204
|
-
```
|
|
204
|
+
```tsx
|
|
205
205
|
function XAxisPositionExample() {
|
|
206
206
|
const theme = useTheme();
|
|
207
207
|
const lineA = [5, 5, 10, 90, 85, 70, 30, 25, 25];
|
|
@@ -253,7 +253,6 @@ function XAxisPositionExample() {
|
|
|
253
253
|
return (
|
|
254
254
|
<LineChart
|
|
255
255
|
enableScrubbing
|
|
256
|
-
|
|
257
256
|
height={400}
|
|
258
257
|
series={[
|
|
259
258
|
{
|
|
@@ -288,7 +287,7 @@ function XAxisPositionExample() {
|
|
|
288
287
|
<Scrubber />
|
|
289
288
|
</LineChart>
|
|
290
289
|
);
|
|
291
|
-
}
|
|
290
|
+
}
|
|
292
291
|
```
|
|
293
292
|
|
|
294
293
|
#### Grid
|
|
@@ -329,7 +328,7 @@ function XAxisGridExample() {
|
|
|
329
328
|
|
|
330
329
|
You can also customize the grid lines using the `GridLineComponent` prop.
|
|
331
330
|
|
|
332
|
-
```
|
|
331
|
+
```tsx
|
|
333
332
|
function CustomGridLineExample() {
|
|
334
333
|
const ThinSolidLine = memo((props: SolidLineProps) => <SolidLine {...props} strokeWidth={1} />);
|
|
335
334
|
|
|
@@ -348,7 +347,7 @@ function CustomGridLineExample() {
|
|
|
348
347
|
}}
|
|
349
348
|
>
|
|
350
349
|
<XAxis showLine showTickMarks showGrid GridLineComponent={ThinSolidLine} />
|
|
351
|
-
<Line seriesId="prices"
|
|
350
|
+
<Line seriesId="prices" showArea />
|
|
352
351
|
<Scrubber />
|
|
353
352
|
</CartesianChart>
|
|
354
353
|
);
|
|
@@ -193,7 +193,7 @@ function YAxisGridExample() {
|
|
|
193
193
|
|
|
194
194
|
You can also customize the grid lines using the `GridLineComponent` prop.
|
|
195
195
|
|
|
196
|
-
```
|
|
196
|
+
```tsx
|
|
197
197
|
function CustomGridLineExample() {
|
|
198
198
|
const theme = useTheme();
|
|
199
199
|
const ThinSolidLine = memo((props: SolidLineProps) => <SolidLine {...props} strokeWidth={1} />);
|
|
@@ -229,7 +229,7 @@ function CustomGridLineExample() {
|
|
|
229
229
|
<ReferenceLine LineComponent={SolidLine} dataY={0} />
|
|
230
230
|
</CartesianChart>
|
|
231
231
|
);
|
|
232
|
-
}
|
|
232
|
+
}
|
|
233
233
|
```
|
|
234
234
|
|
|
235
235
|
#### Line
|
|
@@ -270,7 +270,7 @@ You can extend the theme by adding custom theme variables. In this example we'll
|
|
|
270
270
|
|
|
271
271
|
Start by overriding interfaces in the `ThemeVarsExtended` namespace to add new theme variables. Only the key names are used, the `void` type is just a necessary placeholder.
|
|
272
272
|
|
|
273
|
-
```
|
|
273
|
+
```tsx
|
|
274
274
|
declare module '@coinbase/cds-common/core/theme' {
|
|
275
275
|
export namespace ThemeVarsExtended {
|
|
276
276
|
export interface Color {
|