Skip to content

Commit 26ef344

Browse files
committed
chore: temporary move folder
1 parent 7c503bf commit 26ef344

File tree

10 files changed

+1174
-0
lines changed

10 files changed

+1174
-0
lines changed

_coreui-react-chartjs/CHANGELOG.md

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
### [@coreui/react-chartjs](https://coreui.io/) changelog
2+
3+
##### `1.1.0`
4+
- chore: update to React 17
5+
- fix(typings): add ChartDataSets, ChartOptions - closes #1
6+
7+
##### `1.0.1`
8+
- chore: fix typings, add typings to "files" in package.json
9+
10+
##### `1.0.0-alpha.4`
11+
BREAKING CHANGE:
12+
- `<CCharts>` component has been deprecated and will be removed in v1.0.0
13+
- use `<CChart type="...">` instead
14+
or one of following types:
15+
`<CChartBar>`
16+
`<CChartHorizontalBar>`
17+
`<CChartLine>`
18+
`<CChartDoughnut>`
19+
`<CChartRadar>`
20+
`<CChartPie>`
21+
`<CChartPolarArea>`
22+
23+
sample import:
24+
```jsx
25+
import {
26+
CChart,
27+
CChartBar,
28+
CChartHorizontalBar,
29+
CChartLine,
30+
CChartDoughnut,
31+
CChartRadar,
32+
CChartPie,
33+
CChartPolarArea
34+
} from '@coreui/react-chartjs';
35+
```
36+
37+
38+
##### `1.0.0-alpha.0`
39+
- initial version
40+
41+
install:
42+
```bash
43+
npm install @coreui/react
44+
npm install @coreui/react-chartjs
45+
```
46+

_coreui-react-chartjs/LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2021 creativeLabs Łukasz Holeczek
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

_coreui-react-chartjs/README.md

+204
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,204 @@
1+
<p align="center">
2+
<a href="https://coreui.io/">
3+
<img
4+
src="https://coreui.io/images/brand/coreui-signet.svg"
5+
alt="CoreUI logo"
6+
width="200"
7+
/>
8+
</a>
9+
</p>
10+
11+
<h3 align="center">CoreUI React.js wrapper for Chart.js</h3>
12+
13+
<p align="center">
14+
<a href="https://coreui.io/react/docs/components/chart/"><strong>Explore @coreui/react-chartjs docs & examples »</strong></a>
15+
<br>
16+
<br>
17+
<a href="https://github.com/coreui/coreui-react/issues/new?template=bug_report.md">Report bug</a>
18+
·
19+
<a href="https://github.com/coreui/coreui-react/issues/new?template=feature_request.md">Request feature</a>
20+
·
21+
<a href="https://blog.coreui.io/">Blog</a>
22+
</p>
23+
24+
## Status
25+
26+
[![npm package][npm-badge]][npm]
27+
[![NPM downloads][npm-download]][npm]
28+
29+
[npm-badge]: https://img.shields.io/npm/v/@coreui/react-chartjs/latest?style=flat-square
30+
[npm]: https://www.npmjs.com/package/@coreui/react-chartjs
31+
[npm-download]: https://img.shields.io/npm/dm/@coreui/react-chartjs.svg?style=flat-square
32+
33+
##### install:
34+
35+
```bash
36+
npm install @coreui/react-chartjs
37+
38+
# or
39+
40+
yarn add @coreui/react-chartjs
41+
```
42+
43+
##### import:
44+
45+
```jsx
46+
import { CChart } from '@coreui/react-chartjs'
47+
```
48+
49+
or
50+
51+
```js
52+
import {
53+
CChart,
54+
CChartBar,
55+
CChartHorizontalBar,
56+
CChartLine,
57+
CChartDoughnut,
58+
CChartRadar,
59+
CChartPie,
60+
CChartPolarArea,
61+
} from '@coreui/react-chartjs'
62+
```
63+
64+
##### props:
65+
66+
```js
67+
68+
/**
69+
* A string of all className you want applied to the base component.
70+
*/
71+
className?: string
72+
/**
73+
* Enables custom html based tooltips instead of standard tooltips.
74+
*
75+
* @default true
76+
*/
77+
customTooltips?: boolean
78+
/**
79+
* The data object that is passed into the Chart.js chart (more info).
80+
*/
81+
data: ChartData | ((canvas: HTMLCanvasElement) => ChartData)
82+
/**
83+
* A fallback for when the canvas cannot be rendered. Can be used for accessible chart descriptions.
84+
*
85+
* {@link https://www.chartjs.org/docs/latest/general/accessibility.html More Info}
86+
*/
87+
fallbackContent?: React.ReactNode
88+
/**
89+
* Proxy for Chart.js getDatasetAtEvent. Calls with dataset and triggering event.
90+
*/
91+
getDatasetAtEvent?: (
92+
dataset: InteractionItem[],
93+
event: React.MouseEvent<HTMLCanvasElement>,
94+
) => void
95+
/**
96+
* Proxy for Chart.js getElementAtEvent. Calls with single element array and triggering event.
97+
*/
98+
getElementAtEvent?: (
99+
element: InteractionItem[],
100+
event: React.MouseEvent<HTMLCanvasElement>,
101+
) => void
102+
/**
103+
* Proxy for Chart.js getElementsAtEvent. Calls with element array and triggering event.
104+
*/
105+
getElementsAtEvent?: (
106+
elements: InteractionItem[],
107+
event: React.MouseEvent<HTMLCanvasElement>,
108+
) => void
109+
/**
110+
* Height attribute applied to the rendered canvas.
111+
*
112+
* @default 150
113+
*/
114+
height?: number
115+
/**
116+
* ID attribute applied to the rendered canvas.
117+
*/
118+
id?: string
119+
/**
120+
* The options object that is passed into the Chart.js chart.
121+
*
122+
* {@link https://www.chartjs.org/docs/latest/general/options.html More Info}
123+
*/
124+
options?: ChartOptions
125+
/**
126+
* The plugins array that is passed into the Chart.js chart (more info)
127+
*
128+
* {@link https://www.chartjs.org/docs/latest/developers/plugins.html More Info}
129+
*/
130+
plugins?: Plugin[]
131+
/**
132+
* If true, will tear down and redraw chart on all updates.
133+
*
134+
* @default false
135+
*/
136+
redraw?: boolean
137+
/**
138+
* Chart.js chart type.
139+
*
140+
* @type {'line' | 'bar' | 'radar' | 'doughnut' | 'polarArea' | 'bubble' | 'pie' | 'scatter'}
141+
*/
142+
type: ChartType
143+
/**
144+
* Width attribute applied to the rendered canvas.
145+
*
146+
* @default 300
147+
*/
148+
width?: number
149+
/**
150+
* Put the chart into the wrapper div element.
151+
*
152+
* @default true
153+
*/
154+
wrapper?: boolean
155+
```
156+
157+
##### usage:
158+
159+
```jsx
160+
...
161+
class CoreUICharts extends Component {
162+
...
163+
render() {
164+
return (
165+
<CChart
166+
type='line'
167+
data={{
168+
labels: ['January', 'February', 'March', 'April', 'May', 'June', 'July'],
169+
datasets: [
170+
{
171+
label: '2019',
172+
backgroundColor: 'rgba(179,181,198,0.2)',
173+
borderColor: 'rgba(179,181,198,1)',
174+
pointBackgroundColor: 'rgba(179,181,198,1)',
175+
pointBorderColor: '#fff',
176+
pointHoverBackgroundColor: '#fff',
177+
pointHoverBorderColor: 'rgba(179,181,198,1)',
178+
tooltipLabelColor: 'rgba(179,181,198,1)',
179+
data: [65, 59, 90, 81, 56, 55, 40]
180+
},
181+
{
182+
label: '2020',
183+
backgroundColor: 'rgba(255,99,132,0.2)',
184+
borderColor: 'rgba(255,99,132,1)',
185+
pointBackgroundColor: 'rgba(255,99,132,1)',
186+
pointBorderColor: '#fff',
187+
pointHoverBackgroundColor: '#fff',
188+
pointHoverBorderColor: 'rgba(255,99,132,1)',
189+
tooltipLabelColor: 'rgba(255,99,132,1)',
190+
data: [28, 48, 40, 19, 96, 27, 100]
191+
}
192+
],
193+
}}
194+
options={{
195+
aspectRatio: 1.5,
196+
tooltips: {
197+
enabled: true
198+
}
199+
}}
200+
/>
201+
)
202+
}
203+
...
204+
```

_coreui-react-chartjs/package.json

+65
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
{
2+
"name": "@coreui/react-chartjs",
3+
"version": "2.1.2",
4+
"description": "React wrapper component for Chart.js",
5+
"keywords": [
6+
"coreui",
7+
"chart.js",
8+
"charts",
9+
"react chart.js",
10+
"coreui-react",
11+
"react charts",
12+
"react chart components",
13+
"react chart.js implementation",
14+
"layout",
15+
"component",
16+
"react",
17+
"react-component",
18+
"react component"
19+
],
20+
"homepage": "https://coreui.io/react/docs/components/chart/",
21+
"bugs": {
22+
"url": "https://github.com/coreui/coreui-react/issues"
23+
},
24+
"repository": {
25+
"type": "git",
26+
"url": "git+https://github.com/coreui/coreui-react.git"
27+
},
28+
"license": "MIT",
29+
"author": "The CoreUI Team (https://github.com/orgs/coreui/people)",
30+
"main": "dist/index.js",
31+
"module": "dist/index.es.js",
32+
"jsnext:main": "dist/index.es.js",
33+
"files": [
34+
"dist/",
35+
"src/"
36+
],
37+
"scripts": {
38+
"build": "rollup -c --bundleConfigAsCjs"
39+
},
40+
"dependencies": {
41+
"@coreui/chartjs": "^3.0.0",
42+
"chart.js": "3.9.1"
43+
},
44+
"devDependencies": {
45+
"@rollup/plugin-commonjs": "^24.0.1",
46+
"@rollup/plugin-node-resolve": "^15.0.1",
47+
"@rollup/plugin-typescript": "^11.0.0",
48+
"@testing-library/jest-dom": "^5.16.5",
49+
"@testing-library/react": "^13.4.0",
50+
"@types/lodash": "^4.14.191",
51+
"@types/react": "18.0.27",
52+
"@types/react-dom": "^18.0.6",
53+
"classnames": "^2.3.2",
54+
"lodash": "^4.17.21",
55+
"prop-types": "^15.8.1",
56+
"react": "^18.2.0",
57+
"react-dom": "^18.2.0",
58+
"rollup": "^3.14.0",
59+
"typescript": "^4.9.5"
60+
},
61+
"peerDependencies": {
62+
"react": ">=17",
63+
"react-dom": ">=17"
64+
}
65+
}
+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
import commonjs from '@rollup/plugin-commonjs'
2+
import resolve from '@rollup/plugin-node-resolve'
3+
import typescript from '@rollup/plugin-typescript'
4+
import { readFileSync } from 'node:fs'
5+
6+
const pkg = JSON.parse(readFileSync(new URL('./package.json', import.meta.url)))
7+
8+
export default {
9+
input: 'src/index.ts',
10+
output: [
11+
{
12+
file: pkg.main,
13+
format: 'cjs',
14+
exports: 'named',
15+
sourcemap: true,
16+
sourcemapPathTransform: (relativeSourcePath) => {
17+
return relativeSourcePath
18+
.replace('../../node_modules/', '../')
19+
.replace('../packages/coreui-react-chartjs', '..')
20+
},
21+
},
22+
{
23+
file: pkg.module,
24+
format: 'es',
25+
exports: 'named',
26+
sourcemap: true,
27+
sourcemapPathTransform: (relativeSourcePath) => {
28+
return relativeSourcePath
29+
.replace('../../node_modules/', '../')
30+
.replace('../packages/coreui-react-chartjs', '..')
31+
},
32+
},
33+
],
34+
external: ['react', 'react-dom'],
35+
plugins: [
36+
resolve(),
37+
typescript({
38+
exclude: ['**/__tests__/**'],
39+
tsconfig: './tsconfig.json',
40+
}),
41+
commonjs({
42+
include: ['../../node_modules/**'],
43+
}),
44+
],
45+
}

0 commit comments

Comments
 (0)