Init
This commit is contained in:
7
node_modules/react-chartjs-2/LICENSE
generated
vendored
Normal file
7
node_modules/react-chartjs-2/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
Copyright 2020 Jeremy Ayerst
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
21
node_modules/react-chartjs-2/LICENSE.md
generated
vendored
Normal file
21
node_modules/react-chartjs-2/LICENSE.md
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2017 Jeremy Ayerst
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
73
node_modules/react-chartjs-2/README.md
generated
vendored
Normal file
73
node_modules/react-chartjs-2/README.md
generated
vendored
Normal file
@@ -0,0 +1,73 @@
|
||||
# react-chartjs-2
|
||||
|
||||
<img align="right" width="150" height="150" alt="Logo" src="website/static/img/logo.svg">
|
||||
|
||||
React components for <a href="https://www.chartjs.org">Chart.js</a>, the most popular charting library.
|
||||
|
||||
Supports Chart.js v4 and v3.
|
||||
|
||||
[![NPM version][npm]][npm-url]
|
||||
[![Downloads][downloads]][downloads-url]
|
||||
[![Build status][build]][build-url]
|
||||
[![Coverage status][coverage]][coverage-url]
|
||||
[![Bundle size][size]][size-url]
|
||||
|
||||
[npm]: https://img.shields.io/npm/v/react-chartjs-2.svg
|
||||
[npm-url]: https://www.npmjs.com/package/react-chartjs-2
|
||||
|
||||
[downloads]: https://img.shields.io/npm/dm/react-chartjs-2.svg
|
||||
[downloads-url]: https://www.npmjs.com/package/react-chartjs-2
|
||||
|
||||
[build]: https://img.shields.io/github/actions/workflow/status/reactchartjs/react-chartjs-2/ci.yml?branch=master
|
||||
[build-url]: https://github.com/reactchartjs/react-chartjs-2/actions
|
||||
|
||||
[coverage]: https://img.shields.io/codecov/c/github/reactchartjs/react-chartjs-2.svg
|
||||
[coverage-url]: https://app.codecov.io/gh/reactchartjs/react-chartjs-2
|
||||
|
||||
[size]: https://img.shields.io/bundlephobia/minzip/react-chartjs-2
|
||||
[size-url]: https://bundlephobia.com/package/react-chartjs-2
|
||||
|
||||
<br />
|
||||
<a href="#quickstart">Quickstart</a>
|
||||
<span> • </span>
|
||||
<a href="#docs">Docs</a>
|
||||
<span> • </span>
|
||||
<a href="https://stackoverflow.com/questions/tagged/react-chartjs-2">Stack Overflow</a>
|
||||
<br />
|
||||
<hr />
|
||||
|
||||
## Quickstart
|
||||
|
||||
Install this library with peer dependencies:
|
||||
|
||||
```bash
|
||||
pnpm add react-chartjs-2 chart.js
|
||||
# or
|
||||
yarn add react-chartjs-2 chart.js
|
||||
# or
|
||||
npm i react-chartjs-2 chart.js
|
||||
```
|
||||
|
||||
We recommend using `chart.js@^4.0.0`.
|
||||
|
||||
Then, import and use individual components:
|
||||
|
||||
```jsx
|
||||
import { Doughnut } from 'react-chartjs-2';
|
||||
|
||||
<Doughnut data={...} />
|
||||
```
|
||||
|
||||
## Docs
|
||||
|
||||
- [Migration to v4](https://react-chartjs-2.js.org/docs/migration-to-v4)
|
||||
- [Working with datasets](https://react-chartjs-2.js.org/docs/working-with-datasets)
|
||||
- [Working with events](https://react-chartjs-2.js.org/docs/working-with-events)
|
||||
- [FAQ](https://react-chartjs-2.js.org/faq)
|
||||
- [Components](https://react-chartjs-2.js.org/components)
|
||||
- [Examples](https://react-chartjs-2.js.org/examples)
|
||||
|
||||
## License
|
||||
|
||||
[MIT Licensed](LICENSE)
|
||||
Copyright (c) 2020 Jeremy Ayerst
|
3
node_modules/react-chartjs-2/dist/chart.d.ts
generated
vendored
Normal file
3
node_modules/react-chartjs-2/dist/chart.d.ts
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
import type { BaseChartComponent } from './types.js';
|
||||
export declare const Chart: BaseChartComponent;
|
||||
//# sourceMappingURL=chart.d.ts.map
|
1
node_modules/react-chartjs-2/dist/chart.d.ts.map
generated
vendored
Normal file
1
node_modules/react-chartjs-2/dist/chart.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"chart.d.ts","sourceRoot":"","sources":["../src/chart.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAA4B,kBAAkB,EAAE,MAAM,YAAY,CAAC;AA8G/E,eAAO,MAAM,KAAK,EAAiC,kBAAkB,CAAC"}
|
193
node_modules/react-chartjs-2/dist/index.cjs
generated
vendored
Normal file
193
node_modules/react-chartjs-2/dist/index.cjs
generated
vendored
Normal file
@@ -0,0 +1,193 @@
|
||||
'use strict';
|
||||
|
||||
var React = require('react');
|
||||
var chart_js = require('chart.js');
|
||||
|
||||
const defaultDatasetIdKey = 'label';
|
||||
function reforwardRef(ref, value) {
|
||||
if (typeof ref === 'function') {
|
||||
ref(value);
|
||||
} else if (ref) {
|
||||
ref.current = value;
|
||||
}
|
||||
}
|
||||
function setOptions(chart, nextOptions) {
|
||||
const options = chart.options;
|
||||
if (options && nextOptions) {
|
||||
Object.assign(options, nextOptions);
|
||||
}
|
||||
}
|
||||
function setLabels(currentData, nextLabels) {
|
||||
currentData.labels = nextLabels;
|
||||
}
|
||||
function setDatasets(currentData, nextDatasets) {
|
||||
let datasetIdKey = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : defaultDatasetIdKey;
|
||||
const addedDatasets = [];
|
||||
currentData.datasets = nextDatasets.map((nextDataset)=>{
|
||||
// given the new set, find it's current match
|
||||
const currentDataset = currentData.datasets.find((dataset)=>dataset[datasetIdKey] === nextDataset[datasetIdKey]);
|
||||
// There is no original to update, so simply add new one
|
||||
if (!currentDataset || !nextDataset.data || addedDatasets.includes(currentDataset)) {
|
||||
return {
|
||||
...nextDataset
|
||||
};
|
||||
}
|
||||
addedDatasets.push(currentDataset);
|
||||
Object.assign(currentDataset, nextDataset);
|
||||
return currentDataset;
|
||||
});
|
||||
}
|
||||
function cloneData(data) {
|
||||
let datasetIdKey = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : defaultDatasetIdKey;
|
||||
const nextData = {
|
||||
labels: [],
|
||||
datasets: []
|
||||
};
|
||||
setLabels(nextData, data.labels);
|
||||
setDatasets(nextData, data.datasets, datasetIdKey);
|
||||
return nextData;
|
||||
}
|
||||
/**
|
||||
* Get dataset from mouse click event
|
||||
* @param chart - Chart.js instance
|
||||
* @param event - Mouse click event
|
||||
* @returns Dataset
|
||||
*/ function getDatasetAtEvent(chart, event) {
|
||||
return chart.getElementsAtEventForMode(event.nativeEvent, 'dataset', {
|
||||
intersect: true
|
||||
}, false);
|
||||
}
|
||||
/**
|
||||
* Get single dataset element from mouse click event
|
||||
* @param chart - Chart.js instance
|
||||
* @param event - Mouse click event
|
||||
* @returns Dataset
|
||||
*/ function getElementAtEvent(chart, event) {
|
||||
return chart.getElementsAtEventForMode(event.nativeEvent, 'nearest', {
|
||||
intersect: true
|
||||
}, false);
|
||||
}
|
||||
/**
|
||||
* Get all dataset elements from mouse click event
|
||||
* @param chart - Chart.js instance
|
||||
* @param event - Mouse click event
|
||||
* @returns Dataset
|
||||
*/ function getElementsAtEvent(chart, event) {
|
||||
return chart.getElementsAtEventForMode(event.nativeEvent, 'index', {
|
||||
intersect: true
|
||||
}, false);
|
||||
}
|
||||
|
||||
function ChartComponent(props, ref) {
|
||||
const { height = 150, width = 300, redraw = false, datasetIdKey, type, data, options, plugins = [], fallbackContent, updateMode, ...canvasProps } = props;
|
||||
const canvasRef = React.useRef(null);
|
||||
const chartRef = React.useRef(null);
|
||||
const renderChart = ()=>{
|
||||
if (!canvasRef.current) return;
|
||||
chartRef.current = new chart_js.Chart(canvasRef.current, {
|
||||
type,
|
||||
data: cloneData(data, datasetIdKey),
|
||||
options: options && {
|
||||
...options
|
||||
},
|
||||
plugins
|
||||
});
|
||||
reforwardRef(ref, chartRef.current);
|
||||
};
|
||||
const destroyChart = ()=>{
|
||||
reforwardRef(ref, null);
|
||||
if (chartRef.current) {
|
||||
chartRef.current.destroy();
|
||||
chartRef.current = null;
|
||||
}
|
||||
};
|
||||
React.useEffect(()=>{
|
||||
if (!redraw && chartRef.current && options) {
|
||||
setOptions(chartRef.current, options);
|
||||
}
|
||||
}, [
|
||||
redraw,
|
||||
options
|
||||
]);
|
||||
React.useEffect(()=>{
|
||||
if (!redraw && chartRef.current) {
|
||||
setLabels(chartRef.current.config.data, data.labels);
|
||||
}
|
||||
}, [
|
||||
redraw,
|
||||
data.labels
|
||||
]);
|
||||
React.useEffect(()=>{
|
||||
if (!redraw && chartRef.current && data.datasets) {
|
||||
setDatasets(chartRef.current.config.data, data.datasets, datasetIdKey);
|
||||
}
|
||||
}, [
|
||||
redraw,
|
||||
data.datasets
|
||||
]);
|
||||
React.useEffect(()=>{
|
||||
if (!chartRef.current) return;
|
||||
if (redraw) {
|
||||
destroyChart();
|
||||
setTimeout(renderChart);
|
||||
} else {
|
||||
chartRef.current.update(updateMode);
|
||||
}
|
||||
}, [
|
||||
redraw,
|
||||
options,
|
||||
data.labels,
|
||||
data.datasets,
|
||||
updateMode
|
||||
]);
|
||||
React.useEffect(()=>{
|
||||
if (!chartRef.current) return;
|
||||
destroyChart();
|
||||
setTimeout(renderChart);
|
||||
}, [
|
||||
type
|
||||
]);
|
||||
React.useEffect(()=>{
|
||||
renderChart();
|
||||
return ()=>destroyChart();
|
||||
}, []);
|
||||
return /*#__PURE__*/ React.createElement("canvas", {
|
||||
ref: canvasRef,
|
||||
role: "img",
|
||||
height: height,
|
||||
width: width,
|
||||
...canvasProps
|
||||
}, fallbackContent);
|
||||
}
|
||||
const Chart = /*#__PURE__*/ React.forwardRef(ChartComponent);
|
||||
|
||||
function createTypedChart(type, registerables) {
|
||||
chart_js.Chart.register(registerables);
|
||||
return /*#__PURE__*/ React.forwardRef((props, ref)=>/*#__PURE__*/ React.createElement(Chart, {
|
||||
...props,
|
||||
ref: ref,
|
||||
type: type
|
||||
}));
|
||||
}
|
||||
const Line = /* #__PURE__ */ createTypedChart('line', chart_js.LineController);
|
||||
const Bar = /* #__PURE__ */ createTypedChart('bar', chart_js.BarController);
|
||||
const Radar = /* #__PURE__ */ createTypedChart('radar', chart_js.RadarController);
|
||||
const Doughnut = /* #__PURE__ */ createTypedChart('doughnut', chart_js.DoughnutController);
|
||||
const PolarArea = /* #__PURE__ */ createTypedChart('polarArea', chart_js.PolarAreaController);
|
||||
const Bubble = /* #__PURE__ */ createTypedChart('bubble', chart_js.BubbleController);
|
||||
const Pie = /* #__PURE__ */ createTypedChart('pie', chart_js.PieController);
|
||||
const Scatter = /* #__PURE__ */ createTypedChart('scatter', chart_js.ScatterController);
|
||||
|
||||
exports.Bar = Bar;
|
||||
exports.Bubble = Bubble;
|
||||
exports.Chart = Chart;
|
||||
exports.Doughnut = Doughnut;
|
||||
exports.Line = Line;
|
||||
exports.Pie = Pie;
|
||||
exports.PolarArea = PolarArea;
|
||||
exports.Radar = Radar;
|
||||
exports.Scatter = Scatter;
|
||||
exports.getDatasetAtEvent = getDatasetAtEvent;
|
||||
exports.getElementAtEvent = getElementAtEvent;
|
||||
exports.getElementsAtEvent = getElementsAtEvent;
|
||||
//# sourceMappingURL=index.cjs.map
|
1
node_modules/react-chartjs-2/dist/index.cjs.map
generated
vendored
Normal file
1
node_modules/react-chartjs-2/dist/index.cjs.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
5
node_modules/react-chartjs-2/dist/index.d.ts
generated
vendored
Normal file
5
node_modules/react-chartjs-2/dist/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
export type { ChartProps } from './types.js';
|
||||
export * from './chart.js';
|
||||
export * from './typedCharts.js';
|
||||
export { getDatasetAtEvent, getElementAtEvent, getElementsAtEvent, } from './utils.js';
|
||||
//# sourceMappingURL=index.d.ts.map
|
1
node_modules/react-chartjs-2/dist/index.d.ts.map
generated
vendored
Normal file
1
node_modules/react-chartjs-2/dist/index.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAC7C,cAAc,YAAY,CAAC;AAC3B,cAAc,kBAAkB,CAAC;AACjC,OAAO,EACL,iBAAiB,EACjB,iBAAiB,EACjB,kBAAkB,GACnB,MAAM,YAAY,CAAC"}
|
180
node_modules/react-chartjs-2/dist/index.js
generated
vendored
Normal file
180
node_modules/react-chartjs-2/dist/index.js
generated
vendored
Normal file
@@ -0,0 +1,180 @@
|
||||
import React, { forwardRef, useRef, useEffect } from 'react';
|
||||
import { Chart as Chart$1, LineController, BarController, RadarController, DoughnutController, PolarAreaController, BubbleController, PieController, ScatterController } from 'chart.js';
|
||||
|
||||
const defaultDatasetIdKey = 'label';
|
||||
function reforwardRef(ref, value) {
|
||||
if (typeof ref === 'function') {
|
||||
ref(value);
|
||||
} else if (ref) {
|
||||
ref.current = value;
|
||||
}
|
||||
}
|
||||
function setOptions(chart, nextOptions) {
|
||||
const options = chart.options;
|
||||
if (options && nextOptions) {
|
||||
Object.assign(options, nextOptions);
|
||||
}
|
||||
}
|
||||
function setLabels(currentData, nextLabels) {
|
||||
currentData.labels = nextLabels;
|
||||
}
|
||||
function setDatasets(currentData, nextDatasets) {
|
||||
let datasetIdKey = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : defaultDatasetIdKey;
|
||||
const addedDatasets = [];
|
||||
currentData.datasets = nextDatasets.map((nextDataset)=>{
|
||||
// given the new set, find it's current match
|
||||
const currentDataset = currentData.datasets.find((dataset)=>dataset[datasetIdKey] === nextDataset[datasetIdKey]);
|
||||
// There is no original to update, so simply add new one
|
||||
if (!currentDataset || !nextDataset.data || addedDatasets.includes(currentDataset)) {
|
||||
return {
|
||||
...nextDataset
|
||||
};
|
||||
}
|
||||
addedDatasets.push(currentDataset);
|
||||
Object.assign(currentDataset, nextDataset);
|
||||
return currentDataset;
|
||||
});
|
||||
}
|
||||
function cloneData(data) {
|
||||
let datasetIdKey = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : defaultDatasetIdKey;
|
||||
const nextData = {
|
||||
labels: [],
|
||||
datasets: []
|
||||
};
|
||||
setLabels(nextData, data.labels);
|
||||
setDatasets(nextData, data.datasets, datasetIdKey);
|
||||
return nextData;
|
||||
}
|
||||
/**
|
||||
* Get dataset from mouse click event
|
||||
* @param chart - Chart.js instance
|
||||
* @param event - Mouse click event
|
||||
* @returns Dataset
|
||||
*/ function getDatasetAtEvent(chart, event) {
|
||||
return chart.getElementsAtEventForMode(event.nativeEvent, 'dataset', {
|
||||
intersect: true
|
||||
}, false);
|
||||
}
|
||||
/**
|
||||
* Get single dataset element from mouse click event
|
||||
* @param chart - Chart.js instance
|
||||
* @param event - Mouse click event
|
||||
* @returns Dataset
|
||||
*/ function getElementAtEvent(chart, event) {
|
||||
return chart.getElementsAtEventForMode(event.nativeEvent, 'nearest', {
|
||||
intersect: true
|
||||
}, false);
|
||||
}
|
||||
/**
|
||||
* Get all dataset elements from mouse click event
|
||||
* @param chart - Chart.js instance
|
||||
* @param event - Mouse click event
|
||||
* @returns Dataset
|
||||
*/ function getElementsAtEvent(chart, event) {
|
||||
return chart.getElementsAtEventForMode(event.nativeEvent, 'index', {
|
||||
intersect: true
|
||||
}, false);
|
||||
}
|
||||
|
||||
function ChartComponent(props, ref) {
|
||||
const { height = 150, width = 300, redraw = false, datasetIdKey, type, data, options, plugins = [], fallbackContent, updateMode, ...canvasProps } = props;
|
||||
const canvasRef = useRef(null);
|
||||
const chartRef = useRef(null);
|
||||
const renderChart = ()=>{
|
||||
if (!canvasRef.current) return;
|
||||
chartRef.current = new Chart$1(canvasRef.current, {
|
||||
type,
|
||||
data: cloneData(data, datasetIdKey),
|
||||
options: options && {
|
||||
...options
|
||||
},
|
||||
plugins
|
||||
});
|
||||
reforwardRef(ref, chartRef.current);
|
||||
};
|
||||
const destroyChart = ()=>{
|
||||
reforwardRef(ref, null);
|
||||
if (chartRef.current) {
|
||||
chartRef.current.destroy();
|
||||
chartRef.current = null;
|
||||
}
|
||||
};
|
||||
useEffect(()=>{
|
||||
if (!redraw && chartRef.current && options) {
|
||||
setOptions(chartRef.current, options);
|
||||
}
|
||||
}, [
|
||||
redraw,
|
||||
options
|
||||
]);
|
||||
useEffect(()=>{
|
||||
if (!redraw && chartRef.current) {
|
||||
setLabels(chartRef.current.config.data, data.labels);
|
||||
}
|
||||
}, [
|
||||
redraw,
|
||||
data.labels
|
||||
]);
|
||||
useEffect(()=>{
|
||||
if (!redraw && chartRef.current && data.datasets) {
|
||||
setDatasets(chartRef.current.config.data, data.datasets, datasetIdKey);
|
||||
}
|
||||
}, [
|
||||
redraw,
|
||||
data.datasets
|
||||
]);
|
||||
useEffect(()=>{
|
||||
if (!chartRef.current) return;
|
||||
if (redraw) {
|
||||
destroyChart();
|
||||
setTimeout(renderChart);
|
||||
} else {
|
||||
chartRef.current.update(updateMode);
|
||||
}
|
||||
}, [
|
||||
redraw,
|
||||
options,
|
||||
data.labels,
|
||||
data.datasets,
|
||||
updateMode
|
||||
]);
|
||||
useEffect(()=>{
|
||||
if (!chartRef.current) return;
|
||||
destroyChart();
|
||||
setTimeout(renderChart);
|
||||
}, [
|
||||
type
|
||||
]);
|
||||
useEffect(()=>{
|
||||
renderChart();
|
||||
return ()=>destroyChart();
|
||||
}, []);
|
||||
return /*#__PURE__*/ React.createElement("canvas", {
|
||||
ref: canvasRef,
|
||||
role: "img",
|
||||
height: height,
|
||||
width: width,
|
||||
...canvasProps
|
||||
}, fallbackContent);
|
||||
}
|
||||
const Chart = /*#__PURE__*/ forwardRef(ChartComponent);
|
||||
|
||||
function createTypedChart(type, registerables) {
|
||||
Chart$1.register(registerables);
|
||||
return /*#__PURE__*/ forwardRef((props, ref)=>/*#__PURE__*/ React.createElement(Chart, {
|
||||
...props,
|
||||
ref: ref,
|
||||
type: type
|
||||
}));
|
||||
}
|
||||
const Line = /* #__PURE__ */ createTypedChart('line', LineController);
|
||||
const Bar = /* #__PURE__ */ createTypedChart('bar', BarController);
|
||||
const Radar = /* #__PURE__ */ createTypedChart('radar', RadarController);
|
||||
const Doughnut = /* #__PURE__ */ createTypedChart('doughnut', DoughnutController);
|
||||
const PolarArea = /* #__PURE__ */ createTypedChart('polarArea', PolarAreaController);
|
||||
const Bubble = /* #__PURE__ */ createTypedChart('bubble', BubbleController);
|
||||
const Pie = /* #__PURE__ */ createTypedChart('pie', PieController);
|
||||
const Scatter = /* #__PURE__ */ createTypedChart('scatter', ScatterController);
|
||||
|
||||
export { Bar, Bubble, Chart, Doughnut, Line, Pie, PolarArea, Radar, Scatter, getDatasetAtEvent, getElementAtEvent, getElementsAtEvent };
|
||||
//# sourceMappingURL=index.js.map
|
1
node_modules/react-chartjs-2/dist/index.js.map
generated
vendored
Normal file
1
node_modules/react-chartjs-2/dist/index.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
10
node_modules/react-chartjs-2/dist/typedCharts.d.ts
generated
vendored
Normal file
10
node_modules/react-chartjs-2/dist/typedCharts.d.ts
generated
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
import type { TypedChartComponent } from './types.js';
|
||||
export declare const Line: TypedChartComponent<"line">;
|
||||
export declare const Bar: TypedChartComponent<"bar">;
|
||||
export declare const Radar: TypedChartComponent<"radar">;
|
||||
export declare const Doughnut: TypedChartComponent<"doughnut">;
|
||||
export declare const PolarArea: TypedChartComponent<"polarArea">;
|
||||
export declare const Bubble: TypedChartComponent<"bubble">;
|
||||
export declare const Pie: TypedChartComponent<"pie">;
|
||||
export declare const Scatter: TypedChartComponent<"scatter">;
|
||||
//# sourceMappingURL=typedCharts.d.ts.map
|
1
node_modules/react-chartjs-2/dist/typedCharts.d.ts.map
generated
vendored
Normal file
1
node_modules/react-chartjs-2/dist/typedCharts.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"typedCharts.d.ts","sourceRoot":"","sources":["../src/typedCharts.tsx"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAGV,mBAAmB,EACpB,MAAM,YAAY,CAAC;AAcpB,eAAO,MAAM,IAAI,6BAA2D,CAAC;AAE7E,eAAO,MAAM,GAAG,4BAAyD,CAAC;AAE1E,eAAO,MAAM,KAAK,8BAA6D,CAAC;AAEhF,eAAO,MAAM,QAAQ,iCAGpB,CAAC;AAEF,eAAO,MAAM,SAAS,kCAGrB,CAAC;AAEF,eAAO,MAAM,MAAM,+BAGlB,CAAC;AAEF,eAAO,MAAM,GAAG,4BAAyD,CAAC;AAE1E,eAAO,MAAM,OAAO,gCAGnB,CAAC"}
|
59
node_modules/react-chartjs-2/dist/types.d.ts
generated
vendored
Normal file
59
node_modules/react-chartjs-2/dist/types.d.ts
generated
vendored
Normal file
@@ -0,0 +1,59 @@
|
||||
import type { CanvasHTMLAttributes, MutableRefObject, ReactNode, JSX } from 'react';
|
||||
import type { Chart, ChartType, ChartData, ChartOptions, DefaultDataPoint, Plugin, UpdateMode } from 'chart.js';
|
||||
export type ForwardedRef<T> = ((instance: T | null) => void) | MutableRefObject<T | null> | null;
|
||||
export interface ChartProps<TType extends ChartType = ChartType, TData = DefaultDataPoint<TType>, TLabel = unknown> extends CanvasHTMLAttributes<HTMLCanvasElement> {
|
||||
/**
|
||||
* Chart.js chart type
|
||||
*/
|
||||
type: TType;
|
||||
/**
|
||||
* The data object that is passed into the Chart.js chart
|
||||
* @see https://www.chartjs.org/docs/latest/getting-started/
|
||||
*/
|
||||
data: ChartData<TType, TData, TLabel>;
|
||||
/**
|
||||
* The options object that is passed into the Chart.js chart
|
||||
* @see https://www.chartjs.org/docs/latest/general/options.html
|
||||
* @default {}
|
||||
*/
|
||||
options?: ChartOptions<TType>;
|
||||
/**
|
||||
* The plugins array that is passed into the Chart.js chart
|
||||
* @see https://www.chartjs.org/docs/latest/developers/plugins.html
|
||||
* @default []
|
||||
*/
|
||||
plugins?: Plugin<TType>[];
|
||||
/**
|
||||
* Teardown and redraw chart on every update
|
||||
* @default false
|
||||
*/
|
||||
redraw?: boolean;
|
||||
/**
|
||||
* Key name to identificate dataset
|
||||
* @default 'label'
|
||||
*/
|
||||
datasetIdKey?: string;
|
||||
/**
|
||||
* A fallback for when the canvas cannot be rendered. Can be used for accessible chart descriptions
|
||||
* @see https://www.chartjs.org/docs/latest/general/accessibility.html
|
||||
* @default null
|
||||
* @todo Replace with `children` prop.
|
||||
*/
|
||||
fallbackContent?: ReactNode;
|
||||
/**
|
||||
* A mode string to indicate transition configuration should be used.
|
||||
* @see https://www.chartjs.org/docs/latest/developers/api.html#update-mode
|
||||
*/
|
||||
updateMode?: UpdateMode;
|
||||
}
|
||||
/**
|
||||
* @todo Replace `undefined` with `null`
|
||||
*/
|
||||
export type ChartJSOrUndefined<TType extends ChartType = ChartType, TData = DefaultDataPoint<TType>, TLabel = unknown> = Chart<TType, TData, TLabel> | undefined;
|
||||
export type BaseChartComponent = <TType extends ChartType = ChartType, TData = DefaultDataPoint<TType>, TLabel = unknown>(props: ChartProps<TType, TData, TLabel> & {
|
||||
ref?: ForwardedRef<ChartJSOrUndefined<TType, TData, TLabel>>;
|
||||
}) => JSX.Element;
|
||||
export type TypedChartComponent<TDefaultType extends ChartType> = <TData = DefaultDataPoint<TDefaultType>, TLabel = unknown>(props: Omit<ChartProps<TDefaultType, TData, TLabel>, 'type'> & {
|
||||
ref?: ForwardedRef<ChartJSOrUndefined<TDefaultType, TData, TLabel>>;
|
||||
}) => JSX.Element;
|
||||
//# sourceMappingURL=types.d.ts.map
|
1
node_modules/react-chartjs-2/dist/types.d.ts.map
generated
vendored
Normal file
1
node_modules/react-chartjs-2/dist/types.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,oBAAoB,EACpB,gBAAgB,EAChB,SAAS,EACT,GAAG,EACJ,MAAM,OAAO,CAAC;AACf,OAAO,KAAK,EACV,KAAK,EACL,SAAS,EACT,SAAS,EACT,YAAY,EACZ,gBAAgB,EAChB,MAAM,EACN,UAAU,EACX,MAAM,UAAU,CAAC;AAElB,MAAM,MAAM,YAAY,CAAC,CAAC,I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AAE,YAAY,CAAC,kBAAkB,CAAC,KAAK,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC;CAC9D,KACE,GAAG,CAAC,OAAO,CAAC;AAEjB,MAAM,MAAM,mBAAmB,CAAC,YAAY,SAAS,SAAS,IAAI,CAChE,KAAK,GAAG,gBAAgB,CAAC,YAAY,CAAC,EACtC,MAAM,GAAG,OAAO,EAEhB,KAAK,EAAE,IAAI,CAAC,UAAU,CAAC,YAAY,EAAE,KAAK,EAAE,MAAM,CAAC,EAAE,MAAM,CAAC,GAAG;IAC7D,GAAG,CAAC,EAAE,YAAY,CAAC,kBAAkB,CAAC,YAAY,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC;CACrE,KACE,GAAG,CAAC,OAAO,CAAC"}
|
30
node_modules/react-chartjs-2/dist/utils.d.ts
generated
vendored
Normal file
30
node_modules/react-chartjs-2/dist/utils.d.ts
generated
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
import type { MouseEvent } from 'react';
|
||||
import type { ChartType, ChartData, DefaultDataPoint, ChartDataset, ChartOptions, Chart } from 'chart.js';
|
||||
import type { ForwardedRef } from './types.js';
|
||||
export declare function reforwardRef<T>(ref: ForwardedRef<T>, value: T): void;
|
||||
export declare function setOptions<TType extends ChartType = ChartType, TData = DefaultDataPoint<TType>, TLabel = unknown>(chart: Chart<TType, TData, TLabel>, nextOptions: ChartOptions<TType>): void;
|
||||
export declare function setLabels<TType extends ChartType = ChartType, TData = DefaultDataPoint<TType>, TLabel = unknown>(currentData: ChartData<TType, TData, TLabel>, nextLabels: TLabel[] | undefined): void;
|
||||
export declare function setDatasets<TType extends ChartType = ChartType, TData = DefaultDataPoint<TType>, TLabel = unknown>(currentData: ChartData<TType, TData, TLabel>, nextDatasets: ChartDataset<TType, TData>[], datasetIdKey?: string): void;
|
||||
export declare function cloneData<TType extends ChartType = ChartType, TData = DefaultDataPoint<TType>, TLabel = unknown>(data: ChartData<TType, TData, TLabel>, datasetIdKey?: string): ChartData<TType, TData, TLabel>;
|
||||
/**
|
||||
* Get dataset from mouse click event
|
||||
* @param chart - Chart.js instance
|
||||
* @param event - Mouse click event
|
||||
* @returns Dataset
|
||||
*/
|
||||
export declare function getDatasetAtEvent(chart: Chart, event: MouseEvent<HTMLCanvasElement>): import("chart.js").InteractionItem[];
|
||||
/**
|
||||
* Get single dataset element from mouse click event
|
||||
* @param chart - Chart.js instance
|
||||
* @param event - Mouse click event
|
||||
* @returns Dataset
|
||||
*/
|
||||
export declare function getElementAtEvent(chart: Chart, event: MouseEvent<HTMLCanvasElement>): import("chart.js").InteractionItem[];
|
||||
/**
|
||||
* Get all dataset elements from mouse click event
|
||||
* @param chart - Chart.js instance
|
||||
* @param event - Mouse click event
|
||||
* @returns Dataset
|
||||
*/
|
||||
export declare function getElementsAtEvent(chart: Chart, event: MouseEvent<HTMLCanvasElement>): import("chart.js").InteractionItem[];
|
||||
//# sourceMappingURL=utils.d.ts.map
|
1
node_modules/react-chartjs-2/dist/utils.d.ts.map
generated
vendored
Normal file
1
node_modules/react-chartjs-2/dist/utils.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,KAAK,EACV,SAAS,EACT,SAAS,EACT,gBAAgB,EAChB,YAAY,EACZ,YAAY,EACZ,KAAK,EACN,MAAM,UAAU,CAAC;AAElB,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAI/C,wBAAgB,YAAY,CAAC,CAAC,EAAE,GAAG,EAAE,YAAY,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,QAM7D;AAED,wBAAgB,UAAU,CACxB,KAAK,SAAS,SAAS,GAAG,SAAS,EACnC,KAAK,GAAG,gBAAgB,CAAC,KAAK,CAAC,EAC/B,MAAM,GAAG,OAAO,EACh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ated
vendored
Normal file
44
node_modules/react-chartjs-2/package.json
generated
vendored
Normal file
@@ -0,0 +1,44 @@
|
||||
{
|
||||
"name": "react-chartjs-2",
|
||||
"type": "module",
|
||||
"version": "5.3.0",
|
||||
"description": "React components for Chart.js",
|
||||
"author": "Jeremy Ayerst",
|
||||
"homepage": "https://github.com/reactchartjs/react-chartjs-2",
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/reactchartjs/react-chartjs-2.git"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/reactchartjs/react-chartjs-2/issues"
|
||||
},
|
||||
"keywords": [
|
||||
"chart",
|
||||
"chart-js",
|
||||
"chart.js",
|
||||
"react-chartjs-2",
|
||||
"react chart.js",
|
||||
"react-chart.js"
|
||||
],
|
||||
"sideEffects": false,
|
||||
"types": "./dist/index.d.ts",
|
||||
"exports": {
|
||||
"types": "./dist/index.d.ts",
|
||||
"import": "./dist/index.js",
|
||||
"require": "./dist/index.cjs"
|
||||
},
|
||||
"publishConfig": {
|
||||
"directory": "package"
|
||||
},
|
||||
"files": [
|
||||
"dist"
|
||||
],
|
||||
"peerDependencies": {
|
||||
"chart.js": "^4.1.1",
|
||||
"react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0"
|
||||
},
|
||||
"main": "./dist/index.cjs",
|
||||
"module": "./dist/index.js",
|
||||
"scripts": {}
|
||||
}
|
Reference in New Issue
Block a user