Skip to content

Commit 964d1cb

Browse files
authored
docs: fix props types docs in readme (#783)
1 parent 3fb67e5 commit 964d1cb

File tree

3 files changed

+10
-41
lines changed

3 files changed

+10
-41
lines changed

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,10 @@ See [these examples](example) for more information
4949
data: Chart.ChartData | (canvas: HTMLCanvasElement | null) => Chart.ChartData;
5050
options?: Chart.ChartOptions;
5151
fallbackContent?: React.ReactNode;
52-
plugins?: Chart.PluginServiceRegistrationOptions[];
53-
getDatasetAtEvent?: (dataset: Array<{}>, event: React.MouseEvent<HTMLCanvasElement>) => void;
54-
getElementAtEvent?: (element: [{}], event: React.MouseEvent<HTMLCanvasElement>) => void;
55-
getElementsAtEvent?: (elements: Array<{}>, event: React.MouseEvent<HTMLCanvasElement>) => void;
52+
plugins?: Chart.Plugin[];
53+
getDatasetAtEvent?: (dataset: Chart.InteractionItem[], event: React.MouseEvent<HTMLCanvasElement>) => void;
54+
getElementAtEvent?: (element: Chart.InteractionItem[], event: React.MouseEvent<HTMLCanvasElement>) => void;
55+
getElementsAtEvent?: (elements: Chart.InteractionItem[], event: React.MouseEvent<HTMLCanvasElement>) => void;
5656
```
5757

5858
#### id
@@ -92,7 +92,7 @@ If true, will tear down and redraw chart on all updates
9292

9393
#### type
9494

95-
Type: `'line' | 'bar' | 'horizontalBar' | 'radar' | 'doughnut' | 'polarArea' | 'bubble' | 'pie' | 'scatter'`
95+
Type: `'bar' | 'line' | 'scatter' | 'bubble' | 'pie' | 'doughnut' | 'polarArea' | 'radar'`
9696

9797
Chart.js chart type (required only on ChartComponent)
9898

src/types.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ export interface Props<
2727
options?: ChartOptions<TOtherType>;
2828
plugins?: Plugin<TOtherType>[];
2929
redraw?: boolean;
30+
/**
31+
* @todo Replace with `children` prop.
32+
*/
3033
fallbackContent?: ReactNode;
3134
getDatasetAtEvent?: (
3235
dataset: InteractionItem[],

yarn.lock

Lines changed: 2 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -3209,14 +3209,6 @@
32093209
"@typescript-eslint/typescript-estree" "5.1.0"
32103210
debug "^4.3.2"
32113211

3212-
"@typescript-eslint/[email protected]":
3213-
version "5.0.0"
3214-
resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.0.0.tgz#aea0fb0e2480c1169a02e89d9005ac3f2835713f"
3215-
integrity sha512-5RFjdA/ain/MDUHYXdF173btOKncIrLuBmA9s6FJhzDrRAyVSA+70BHg0/MW6TE+UiKVyRtX91XpVS0gVNwVDQ==
3216-
dependencies:
3217-
"@typescript-eslint/types" "5.0.0"
3218-
"@typescript-eslint/visitor-keys" "5.0.0"
3219-
32203212
"@typescript-eslint/[email protected]":
32213213
version "5.1.0"
32223214
resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.1.0.tgz#6f1f26ad66a8f71bbb33b635e74fec43f76b44df"
@@ -3225,29 +3217,11 @@
32253217
"@typescript-eslint/types" "5.1.0"
32263218
"@typescript-eslint/visitor-keys" "5.1.0"
32273219

3228-
"@typescript-eslint/[email protected]":
3229-
version "5.0.0"
3230-
resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.0.0.tgz#25d93f6d269b2d25fdc51a0407eb81ccba60eb0f"
3231-
integrity sha512-dU/pKBUpehdEqYuvkojmlv0FtHuZnLXFBn16zsDmlFF3LXkOpkAQ2vrKc3BidIIve9EMH2zfTlxqw9XM0fFN5w==
3232-
32333220
"@typescript-eslint/[email protected]":
32343221
version "5.1.0"
32353222
resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.1.0.tgz#a8a75ddfc611660de6be17d3ad950302385607a9"
32363223
integrity sha512-sEwNINVxcB4ZgC6Fe6rUyMlvsB2jvVdgxjZEjQUQVlaSPMNamDOwO6/TB98kFt4sYYfNhdhTPBEQqNQZjMMswA==
32373224

3238-
"@typescript-eslint/[email protected]":
3239-
version "5.0.0"
3240-
resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.0.0.tgz#bc20f413c6e572c7309dbe5fa3be027984952af3"
3241-
integrity sha512-V/6w+PPQMhinWKSn+fCiX5jwvd1vRBm7AX7SJQXEGQtwtBvjMPjaU3YTQ1ik2UF1u96X7tsB96HMnulG3eLi9Q==
3242-
dependencies:
3243-
"@typescript-eslint/types" "5.0.0"
3244-
"@typescript-eslint/visitor-keys" "5.0.0"
3245-
debug "^4.3.1"
3246-
globby "^11.0.3"
3247-
is-glob "^4.0.1"
3248-
semver "^7.3.5"
3249-
tsutils "^3.21.0"
3250-
32513225
"@typescript-eslint/[email protected]":
32523226
version "5.1.0"
32533227
resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.1.0.tgz#132aea34372df09decda961cb42457433aa6e83d"
@@ -3261,14 +3235,6 @@
32613235
semver "^7.3.5"
32623236
tsutils "^3.21.0"
32633237

3264-
"@typescript-eslint/[email protected]":
3265-
version "5.0.0"
3266-
resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.0.0.tgz#b789f7cd105e59bee5c0983a353942a5a48f56df"
3267-
integrity sha512-yRyd2++o/IrJdyHuYMxyFyBhU762MRHQ/bAGQeTnN3pGikfh+nEmM61XTqaDH1XDp53afZ+waXrk0ZvenoZ6xw==
3268-
dependencies:
3269-
"@typescript-eslint/types" "5.0.0"
3270-
eslint-visitor-keys "^3.0.0"
3271-
32723238
"@typescript-eslint/[email protected]":
32733239
version "5.1.0"
32743240
resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.1.0.tgz#e01a01b27eb173092705ae983aa1451bd1842630"
@@ -5745,7 +5711,7 @@ [email protected], debug@^2.2.0, debug@^2.3.3, debug@^2.6.0, debug@^2.6.9:
57455711
dependencies:
57465712
ms "2.0.0"
57475713

5748-
debug@4, debug@^4.0.1, debug@^4.1.0, debug@^4.1.1, debug@^4.3.1, debug@^4.3.2:
5714+
debug@4, debug@^4.0.1, debug@^4.1.0, debug@^4.1.1, debug@^4.3.2:
57495715
version "4.3.2"
57505716
resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.2.tgz#f0a49c18ac8779e31d4a0c6029dfb76873c7428b"
57515717
integrity sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==
@@ -7567,7 +7533,7 @@ [email protected]:
75677533
merge2 "^1.3.0"
75687534
slash "^3.0.0"
75697535

7570-
globby@^11.0.1, globby@^11.0.2, globby@^11.0.3, globby@^11.0.4:
7536+
globby@^11.0.1, globby@^11.0.2, globby@^11.0.4:
75717537
version "11.0.4"
75727538
resolved "https://registry.yarnpkg.com/globby/-/globby-11.0.4.tgz#2cbaff77c2f2a62e71e9b2813a67b97a3a3001a5"
75737539
integrity sha512-9O4MVG9ioZJ08ffbcyVYyLOJLk5JQ688pJ4eMGLpdWLHq/Wr1D9BlriLQyL0E+jbkuePVZXYFj47QM/v093wHg==

0 commit comments

Comments
 (0)