diff --git a/notNeededPackages.json b/notNeededPackages.json index 0f92b3f3ac..29da78aae5 100644 --- a/notNeededPackages.json +++ b/notNeededPackages.json @@ -654,6 +654,12 @@ "sourceRepoURL": "https://github.com/stream-utils/raw-body", "asOfVersion": "2.3.0" }, + { + "libraryName": "react-chartjs-2", + "typingsPackageName": "react-chartjs-2", + "sourceRepoURL": "https://github.com/gor181/react-chartjs-2", + "asOfVersion": "2.5.7" + }, { "libraryName": "react-day-picker", "typingsPackageName": "react-day-picker", diff --git a/types/react-chartjs-2/index.d.ts b/types/react-chartjs-2/index.d.ts deleted file mode 100644 index d6b0fe41c4..0000000000 --- a/types/react-chartjs-2/index.d.ts +++ /dev/null @@ -1,58 +0,0 @@ -// Type definitions for react-chartjs-2 2.0 -// Project: https://github.com/gor181/react-chartjs-2 -// Definitions by: Alexandre Paré -// Fabien Lavocat -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 - -import * as React from "react"; -import * as chartjs from "chart.js"; - -export type ChartDataFunction = (element: HTMLElement) => T; -export type ChartData = ChartDataFunction| T; - -export interface ChartComponentProps { - data: ChartData; - type?: chartjs.ChartType; - getDatasetAtEvent?(e: any): void; - getElementAtEvent?(e: any): void; - getElementsAtEvent?(e: any): void; - height?: number; - legend?: chartjs.ChartLegendOptions; - onElementsClick?(e: any): void; // alias for getElementsAtEvent (backward compatibility) - options?: chartjs.ChartOptions; - redraw?: boolean; - width?: number; -} - -export interface LinearComponentProps extends ChartComponentProps { - data: ChartData; -} - -export default class ChartComponent

extends React.Component

{ - chart_instance: chartjs; -} - -export class Doughnut extends ChartComponent { -} - -export class Pie extends ChartComponent { -} - -export class Line extends ChartComponent { -} - -export class Bar extends ChartComponent { -} - -export class HorizontalBar extends ChartComponent { -} - -export class Radar extends ChartComponent { -} - -export class Polar extends ChartComponent { -} - -export class Bubble extends ChartComponent { -} diff --git a/types/react-chartjs-2/test/bar.tsx b/types/react-chartjs-2/test/bar.tsx deleted file mode 100644 index 7f05c9925b..0000000000 --- a/types/react-chartjs-2/test/bar.tsx +++ /dev/null @@ -1,35 +0,0 @@ -import * as React from 'react'; -import { Bar } from 'react-chartjs-2'; - -const data = { - labels: ['January', 'February', 'March', 'April', 'May', 'June', 'July'], - datasets: [ - { - label: 'My First dataset', - backgroundColor: 'rgba(255,99,132,0.2)', - borderColor: 'rgba(255,99,132,1)', - borderWidth: 1, - hoverBackgroundColor: 'rgba(255,99,132,0.4)', - hoverBorderColor: 'rgba(255,99,132,1)', - data: [65, 59, 80, 81, 56, 55, 40] - } - ] -}; - -export default class BarExample extends React.Component { - render() { - return ( -

-

Bar Example (custom size)

- -
- ); - } -} diff --git a/types/react-chartjs-2/test/bubble.tsx b/types/react-chartjs-2/test/bubble.tsx deleted file mode 100755 index 726113c1ea..0000000000 --- a/types/react-chartjs-2/test/bubble.tsx +++ /dev/null @@ -1,40 +0,0 @@ -import * as React from 'react'; -import { Bubble } from 'react-chartjs-2'; - -const data = { - labels: ['January'], - datasets: [ - { - label: 'My First dataset', - fill: false, - lineTension: 0.1, - backgroundColor: 'rgba(75,192,192,0.4)', - borderColor: 'rgba(75,192,192,1)', - borderCapStyle: 'butt', - borderDash: [] as any[], - borderDashOffset: 0.0, - borderJoinStyle: 'miter', - pointBorderColor: 'rgba(75,192,192,1)', - pointBackgroundColor: '#fff', - pointBorderWidth: 1, - pointHoverRadius: 5, - pointHoverBackgroundColor: 'rgba(75,192,192,1)', - pointHoverBorderColor: 'rgba(220,220,220,1)', - pointHoverBorderWidth: 2, - pointRadius: 1, - pointHitRadius: 10, - data: [{ x: 10, y: 20, r: 5 }] - } - ] -}; - -export default class BubbleExample extends React.Component { - render() { - return ( -
-

Bubble Example

- -
- ); - } -} diff --git a/types/react-chartjs-2/test/doughnut.tsx b/types/react-chartjs-2/test/doughnut.tsx deleted file mode 100755 index 0743ee448b..0000000000 --- a/types/react-chartjs-2/test/doughnut.tsx +++ /dev/null @@ -1,34 +0,0 @@ -import * as React from 'react'; -import { Doughnut } from 'react-chartjs-2'; - -const data = { - labels: [ - 'Red', - 'Green', - 'Yellow' - ], - datasets: [{ - data: [300, 50, 100], - backgroundColor: [ - '#FF6384', - '#36A2EB', - '#FFCE56' - ], - pointHoverBackgroundColor: [ - '#FF6384', - '#36A2EB', - '#FFCE56' - ] - }] -}; - -export default class DoughnutExample extends React.Component { - render() { - return ( -
-

Doughnut Example

- -
- ); - } -} diff --git a/types/react-chartjs-2/test/dynamic-doughnut.tsx b/types/react-chartjs-2/test/dynamic-doughnut.tsx deleted file mode 100755 index 977c5a9801..0000000000 --- a/types/react-chartjs-2/test/dynamic-doughnut.tsx +++ /dev/null @@ -1,48 +0,0 @@ -import * as React from 'react'; -import { Doughnut } from 'react-chartjs-2'; - -function getRandomInt(min: number, max: number) { - return Math.floor(Math.random() * (max - min + 1)) + min; -} - -const getState = () => ({ - labels: [ - 'Red', - 'Green', - 'Yellow' - ], - datasets: [{ - data: [getRandomInt(50, 200), getRandomInt(100, 150), getRandomInt(150, 250)], - backgroundColor: [ - '#CCC', - '#36A2EB', - '#FFCE56' - ], - hoverBackgroundColor: [ - '#FF6384', - '#36A2EB', - '#FFCE56' - ] - }] -}); - -export default class DynamicDoughnutExample extends React.Component { - getInitialState() { - return getState(); - } - - componentWillMount() { - setInterval(() => { - this.setState(getState()); - }, 5000); - } - - render() { - return ( -
-

Dynamically refreshed Doughnut Example

- -
- ); - } -} diff --git a/types/react-chartjs-2/test/horizontalBar.tsx b/types/react-chartjs-2/test/horizontalBar.tsx deleted file mode 100755 index f63d21b51b..0000000000 --- a/types/react-chartjs-2/test/horizontalBar.tsx +++ /dev/null @@ -1,28 +0,0 @@ -import * as React from 'react'; -import { HorizontalBar } from 'react-chartjs-2'; - -const data = { - labels: ['January', 'February', 'March', 'April', 'May', 'June', 'July'], - datasets: [ - { - label: 'My First dataset', - backgroundColor: 'rgba(255,99,132,0.2)', - borderColor: 'rgba(255,99,132,1)', - borderWidth: 1, - hoverBackgroundColor: 'rgba(255,99,132,0.4)', - hoverBorderColor: 'rgba(255,99,132,1)', - data: [65, 59, 80, 81, 56, 55, 40] - } - ] -}; - -export default class HorizontalBarExample extends React.Component { - render() { - return ( -
-

Horizontal Bar Example

- -
- ); - } -} diff --git a/types/react-chartjs-2/test/index.tsx b/types/react-chartjs-2/test/index.tsx deleted file mode 100644 index 4032fe82e2..0000000000 --- a/types/react-chartjs-2/test/index.tsx +++ /dev/null @@ -1,47 +0,0 @@ -import * as React from 'react'; -import * as ReactDOM from 'react-dom'; - -import DoughnutExample from './doughnut'; -import DynamicDoughnutExample from './dynamic-doughnut'; -import PieExample from './pie'; -import LineExample from './line'; -import BarExample from './bar'; -import HorizontalBarExample from './horizontalBar'; -import RadarExample from './radar'; -import PolarExample from './polar'; -import BubbleExample from './bubble'; -import MixedDataExample from './mix'; -import RandomizedDataLineExample from './randomizedLine'; - -class App extends React.Component { - render() { - return ( -
-
- -
- -
- -
- -
- -
- -
- -
- -
- -
- -
- -
- ); - } -} - -ReactDOM.render(, document.getElementById('app')); diff --git a/types/react-chartjs-2/test/line.tsx b/types/react-chartjs-2/test/line.tsx deleted file mode 100755 index 132b345dce..0000000000 --- a/types/react-chartjs-2/test/line.tsx +++ /dev/null @@ -1,40 +0,0 @@ -import * as React from 'react'; -import { Line } from 'react-chartjs-2'; - -const data = { - labels: ['January', 'February', 'March', 'April', 'May', 'June', 'July'], - datasets: [ - { - label: 'My First dataset', - fill: false, - lineTension: 0.1, - backgroundColor: 'rgba(75,192,192,0.4)', - borderColor: 'rgba(75,192,192,1)', - borderCapStyle: 'butt', - borderDash: [] as any[], - borderDashOffset: 0.0, - borderJoinStyle: 'miter', - pointBorderColor: 'rgba(75,192,192,1)', - pointBackgroundColor: '#fff', - pointBorderWidth: 1, - pointHoverRadius: 5, - pointHoverBackgroundColor: 'rgba(75,192,192,1)', - pointHoverBorderColor: 'rgba(220,220,220,1)', - pointHoverBorderWidth: 2, - pointRadius: 1, - pointHitRadius: 10, - data: [65, 59, 80, 81, 56, 55, 40] - } - ] -}; - -export default class LineExample extends React.Component { - render() { - return ( -
-

Line Example

- -
- ); - } -} diff --git a/types/react-chartjs-2/test/mix.tsx b/types/react-chartjs-2/test/mix.tsx deleted file mode 100755 index 56c6e01cdc..0000000000 --- a/types/react-chartjs-2/test/mix.tsx +++ /dev/null @@ -1,84 +0,0 @@ -import * as React from 'react'; -import { Bar } from 'react-chartjs-2'; -import { ChartData, ChartOptions } from 'chart.js'; - -const data: ChartData = { - labels: ['January', 'February', 'March', 'April', 'May', 'June', 'July'], - datasets: [{ - label: 'Sales', - type: 'line', - data: [51, 65, 40, 49, 60, 37, 40], - fill: false, - borderColor: '#EC932F', - backgroundColor: '#EC932F', - pointBorderColor: '#EC932F', - pointBackgroundColor: '#EC932F', - pointHoverBackgroundColor: '#EC932F', - pointHoverBorderColor: '#EC932F', - yAxisID: 'y-axis-2' - }, { - type: 'bar', - label: 'Visitor', - data: [200, 185, 590, 621, 250, 400, 95], - fill: false, - backgroundColor: '#71B37C', - borderColor: '#71B37C', - yAxisID: 'y-axis-1' - }] -}; - -const options: ChartOptions = { - responsive: true, - tooltips: { - mode: 'label' - }, - elements: { - line: { - fill: false - } - }, - scales: { - xAxes: [ - { - display: true, - gridLines: { - display: false - } - } - ], - yAxes: [ - { - type: 'linear', - display: true, - position: 'left', - id: 'y-axis-1', - gridLines: { - display: false - } - }, - { - type: 'linear', - display: true, - position: 'right', - id: 'y-axis-2', - gridLines: { - display: false - } - } - ] - } -}; - -export default class MixExample extends React.Component { - render() { - return ( -
-

Mixed data Example

- -
- ); - } -} diff --git a/types/react-chartjs-2/test/pie.tsx b/types/react-chartjs-2/test/pie.tsx deleted file mode 100755 index 6aaedbb20f..0000000000 --- a/types/react-chartjs-2/test/pie.tsx +++ /dev/null @@ -1,34 +0,0 @@ -import * as React from 'react'; -import { Pie } from 'react-chartjs-2'; - -const data = { - labels: [ - 'Red', - 'Green', - 'Yellow' - ], - datasets: [{ - data: [300, 50, 100], - backgroundColor: [ - '#FF6384', - '#36A2EB', - '#FFCE56' - ], - pointHoverBackgroundColor: [ - '#FF6384', - '#36A2EB', - '#FFCE56' - ] - }] -}; - -export default class PieExample extends React.Component { - render() { - return ( -
-

Pie Example

- -
- ); - } -} diff --git a/types/react-chartjs-2/test/polar.tsx b/types/react-chartjs-2/test/polar.tsx deleted file mode 100755 index 264c3d9f2b..0000000000 --- a/types/react-chartjs-2/test/polar.tsx +++ /dev/null @@ -1,40 +0,0 @@ -import * as React from 'react'; -import { Polar } from 'react-chartjs-2'; - -const data = { - datasets: [{ - data: [ - 11, - 16, - 7, - 3, - 14 - ], - backgroundColor: [ - '#FF6384', - '#4BC0C0', - '#FFCE56', - '#E7E9ED', - '#36A2EB' - ], - label: 'My dataset' // for legend - }], - labels: [ - 'Red', - 'Green', - 'Yellow', - 'Grey', - 'Blue' - ] -}; - -export default class PolarExample extends React.Component { - render() { - return ( -
-

Polar Example

- -
- ); - } -} diff --git a/types/react-chartjs-2/test/radar.tsx b/types/react-chartjs-2/test/radar.tsx deleted file mode 100755 index 886b111ae6..0000000000 --- a/types/react-chartjs-2/test/radar.tsx +++ /dev/null @@ -1,39 +0,0 @@ -import * as React from 'react'; -import { Radar } from 'react-chartjs-2'; - -const data = { - labels: ['Eating', 'Drinking', 'Sleeping', 'Designing', 'Coding', 'Cycling', 'Running'], - datasets: [ - { - label: 'My First dataset', - backgroundColor: 'rgba(179,181,198,0.2)', - borderColor: 'rgba(179,181,198,1)', - pointBackgroundColor: 'rgba(179,181,198,1)', - pointBorderColor: '#fff', - pointHoverBackgroundColor: '#fff', - pointHoverBorderColor: 'rgba(179,181,198,1)', - data: [65, 59, 90, 81, 56, 55, 40] - }, - { - label: 'My Second dataset', - backgroundColor: 'rgba(255,99,132,0.2)', - borderColor: 'rgba(255,99,132,1)', - pointBackgroundColor: 'rgba(255,99,132,1)', - pointBorderColor: '#fff', - pointHoverBackgroundColor: '#fff', - pointHoverBorderColor: 'rgba(255,99,132,1)', - data: [28, 48, 40, 19, 96, 27, 100] - } - ] -}; - -export default class RadarExample extends React.Component { - render() { - return ( -
-

Radar Example

- -
- ); - } -} diff --git a/types/react-chartjs-2/test/randomizedLine.tsx b/types/react-chartjs-2/test/randomizedLine.tsx deleted file mode 100755 index fc63f75141..0000000000 --- a/types/react-chartjs-2/test/randomizedLine.tsx +++ /dev/null @@ -1,70 +0,0 @@ -import * as React from 'react'; -import { Line } from 'react-chartjs-2'; - -const initialState = { - labels: ['January', 'February', 'March', 'April', 'May', 'June', 'July'], - datasets: [ - { - label: 'My First dataset', - fill: false, - lineTension: 0.1, - backgroundColor: 'rgba(75,192,192,0.4)', - borderColor: 'rgba(75,192,192,1)', - borderCapStyle: 'butt', - borderDash: [] as any[], - borderDashOffset: 0.0, - borderJoinStyle: 'miter', - pointBorderColor: 'rgba(75,192,192,1)', - pointBackgroundColor: '#fff', - pointBorderWidth: 1, - pointHoverRadius: 5, - pointHoverBackgroundColor: 'rgba(75,192,192,1)', - pointHoverBorderColor: 'rgba(220,220,220,1)', - pointHoverBorderWidth: 2, - pointRadius: 1, - pointHitRadius: 10, - data: [65, 59, 80, 81, 56, 55, 40] - } - ] -}; - -class Graph extends React.Component { - componentWillMount() { - this.setState(initialState); - } - - componentDidMount() { - setInterval(() => { - const oldDataSet = this.state; - const newData: number[] = []; - - this.state.labels.forEach(() => { - newData.push(Math.floor(Math.random() * 100)); - }); - - const newDataSet = { - ...oldDataSet, - data: newData - }; - - this.setState({ datasets: [newDataSet] }); - }, 5000); - } - - render() { - return ( - - ); - } -} - -export default class RandomizedDataLineExample extends React.Component { - render() { - return ( -
-

Random Animated Line Example

- -
- ); - } -} diff --git a/types/react-chartjs-2/tsconfig.json b/types/react-chartjs-2/tsconfig.json deleted file mode 100644 index ef5b3e00c9..0000000000 --- a/types/react-chartjs-2/tsconfig.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6", - "dom" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": false, - "strictFunctionTypes": true, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true, - "jsx": "react" - }, - "files": [ - "index.d.ts", - "test/index.tsx", - "test/bar.tsx", - "test/bubble.tsx", - "test/doughnut.tsx", - "test/dynamic-doughnut.tsx", - "test/horizontalBar.tsx", - "test/line.tsx", - "test/mix.tsx", - "test/pie.tsx", - "test/polar.tsx", - "test/radar.tsx", - "test/randomizedLine.tsx" - ] -} \ No newline at end of file diff --git a/types/react-chartjs-2/tslint.json b/types/react-chartjs-2/tslint.json deleted file mode 100644 index 3db14f85ea..0000000000 --- a/types/react-chartjs-2/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "dtslint/dt.json" }