diff --git a/LICENSE b/LICENSE index 027b881..94e4f4d 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2023 creativeLabs Łukasz Holeczek +Copyright (c) 2024 creativeLabs Łukasz Holeczek Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index 25a5d2e..a34a0f0 100644 --- a/README.md +++ b/README.md @@ -161,44 +161,44 @@ wrapper?: boolean class CoreUICharts extends Component { ... render() { - return ( - - ) + ], + }} + options={{ + aspectRatio: 1.5, + tooltips: { + enabled: true + } + }} + /> + ) } ... ``` \ No newline at end of file diff --git a/package.json b/package.json index b10e046..0ee3f5d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@coreui/react-chartjs", - "version": "2.1.3", + "version": "3.0.0", "description": "React wrapper component for Chart.js", "keywords": [ "coreui", @@ -28,41 +28,41 @@ "license": "MIT", "author": "The CoreUI Team (https://github.com/orgs/coreui/people)", "main": "dist/index.js", - "module": "dist/index.es.js", - "jsnext:main": "dist/index.es.js", + "module": "dist/index.esm.js", + "jsnext:main": "dist/index.esm.js", "files": [ "dist/", "src/" ], "scripts": { - "build": "rollup -c --bundleConfigAsCjs", + "build": "rollup --config", "test": "jest --coverage", "test:update": "jest --coverage --updateSnapshot" }, "dependencies": { - "@coreui/chartjs": "^3.1.1", - "chart.js": "3.9.1" + "@coreui/chartjs": "^4.0.0", + "chart.js": "^4.4.2" }, "devDependencies": { - "@rollup/plugin-commonjs": "^25.0.0", - "@rollup/plugin-node-resolve": "^15.0.2", - "@rollup/plugin-typescript": "^11.1.1", - "@testing-library/jest-dom": "^5.16.5", - "@testing-library/react": "^14.0.0", - "@types/lodash": "^4.14.194", - "@types/react": "18.2.6", - "@types/react-dom": "^18.2.4", - "classnames": "^2.3.2", - "jest": "^29.5.0", - "jest-canvas-mock": "^2.5.0", - "jest-environment-jsdom": "^29.5.0", + "@rollup/plugin-commonjs": "^25.0.7", + "@rollup/plugin-node-resolve": "^15.2.3", + "@rollup/plugin-typescript": "^11.1.6", + "@testing-library/jest-dom": "^6.4.2", + "@testing-library/react": "^14.2.2", + "@types/lodash": "^4.17.0", + "@types/react": "18.2.73", + "@types/react-dom": "^18.2.22", + "classnames": "^2.5.1", + "jest": "^29.7.0", + "jest-canvas-mock": "^2.5.2", + "jest-environment-jsdom": "^29.7.0", "lodash": "^4.17.21", "prop-types": "^15.8.1", "react": "^18.2.0", "react-dom": "^18.2.0", - "rollup": "^3.21.7", - "ts-jest": "^29.1.0", - "typescript": "^4.9.5" + "rollup": "^4.13.1", + "ts-jest": "^29.1.2", + "typescript": "^5.4.3" }, "peerDependencies": { "react": ">=17", diff --git a/rollup.config.js b/rollup.config.mjs similarity index 94% rename from rollup.config.js rename to rollup.config.mjs index 11e6ecd..60f0192 100644 --- a/rollup.config.js +++ b/rollup.config.mjs @@ -31,7 +31,7 @@ export default { }, }, ], - external: ['react', 'react-dom'], + external: ['@coreui/chartjs', 'chart.js', 'react', 'react-dom'], plugins: [ resolve(), typescript({ diff --git a/src/CChart.tsx b/src/CChart.tsx index e5a4776..0196ac4 100644 --- a/src/CChart.tsx +++ b/src/CChart.tsx @@ -17,7 +17,7 @@ import type { ChartTypeRegistry, InteractionItem, Plugin, - ScatterDataPoint, + Point, BubbleDataPoint, } from 'chart.js' import { customTooltips as cuiCustomTooltips } from '@coreui/chartjs' @@ -148,7 +148,7 @@ export const CChart = forwardRef( const chartRef = useRef< | ChartJS< keyof ChartTypeRegistry, - (number | ScatterDataPoint | BubbleDataPoint | null)[], + (number | [number, number] | Point | BubbleDataPoint | null)[], unknown > | undefined diff --git a/tsconfig.json b/tsconfig.json index ed928e2..7f4d467 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -15,7 +15,6 @@ "noImplicitThis": true, "noImplicitAny": true, "strictNullChecks": true, - "suppressImplicitAnyIndexErrors": true, "noUnusedLocals": true, "noUnusedParameters": true, "esModuleInterop": true pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy