Comparing version 2.0.4 to 2.0.5
@@ -0,1 +1,12 @@ | ||
## 2.0.5 (Feb 08, 2021) | ||
### feat | ||
- defer when syncing to other charts | ||
### fix | ||
- Fix Customized component types | ||
- fix child event not dispatched, fix #2414 | ||
## 2.0.4 (Jan 27, 2021) | ||
@@ -2,0 +13,0 @@ |
@@ -9,2 +9,2 @@ import EventEmitter from 'eventemitter3'; | ||
export { eventCenter }; | ||
export var SYNC_EVENT = 'recharts.syncMouseEvents'; | ||
export var SYNC_EVENT = 'recharts.syncMouseEvents'; // eslint-disable-next-line no-redeclare |
@@ -19,3 +19,4 @@ "use strict"; | ||
var SYNC_EVENT = 'recharts.syncMouseEvents'; | ||
var SYNC_EVENT = 'recharts.syncMouseEvents'; // eslint-disable-next-line no-redeclare | ||
exports.SYNC_EVENT = SYNC_EVENT; |
{ | ||
"name": "recharts", | ||
"version": "2.0.4", | ||
"version": "2.0.5", | ||
"description": "React charts", | ||
@@ -5,0 +5,0 @@ "main": "lib/index", |
import EventEmitter from 'eventemitter3'; | ||
const eventCenter: any = new EventEmitter(); | ||
type CategoricalChartState = import('../chart/generateCategoricalChart').CategoricalChartState; | ||
interface EventCenter extends EventEmitter<EventTypes> { | ||
setMaxListeners?(maxListeners: number): void; | ||
_maxListeners?: number; | ||
} | ||
const eventCenter: EventCenter = new EventEmitter(); | ||
if (eventCenter.setMaxListeners) { | ||
@@ -11,1 +17,7 @@ eventCenter.setMaxListeners(10); | ||
export const SYNC_EVENT = 'recharts.syncMouseEvents'; | ||
// eslint-disable-next-line no-redeclare | ||
type SYNC_EVENT = typeof SYNC_EVENT; | ||
interface EventTypes { | ||
[SYNC_EVENT](syncId: number | string, uniqueChartId: string, data: CategoricalChartState): void; | ||
} |
@@ -7,2 +7,3 @@ /// <reference types="react" /> | ||
legendInstance: any; | ||
deferId: any; | ||
container?: any; | ||
@@ -32,4 +33,5 @@ componentDidMount(): void; | ||
removeListener(): void; | ||
clearDeferId: () => void; | ||
handleLegendBBoxUpdate: (box: any) => void; | ||
handleReceiveSyncEvent: (cId: any, chartId: any, data: any) => void; | ||
handleReceiveSyncEvent: (cId: string | number, chartId: string, data: import("./generateCategoricalChart").CategoricalChartState) => void; | ||
handleBrushChange: ({ startIndex, endIndex }: any) => void; | ||
@@ -49,3 +51,4 @@ handleMouseEnter: (e: any) => void; | ||
handleTouchEnd: (e: any) => void; | ||
triggerSyncEvent(data: any): void; | ||
triggerSyncEvent(data: import("./generateCategoricalChart").CategoricalChartState): void; | ||
applySyncEvent(data: import("./generateCategoricalChart").CategoricalChartState): void; | ||
verticalCoordinatesGenerator: ({ xAxis, width, height, offset }: import("../util/types").ChartCoordinate) => number[]; | ||
@@ -52,0 +55,0 @@ horizontalCoordinatesGenerator: ({ yAxis, width, height, offset }: import("../util/types").ChartCoordinate) => number[]; |
@@ -7,2 +7,3 @@ /// <reference types="react" /> | ||
legendInstance: any; | ||
deferId: any; | ||
container?: any; | ||
@@ -32,4 +33,5 @@ componentDidMount(): void; | ||
removeListener(): void; | ||
clearDeferId: () => void; | ||
handleLegendBBoxUpdate: (box: any) => void; | ||
handleReceiveSyncEvent: (cId: any, chartId: any, data: any) => void; | ||
handleReceiveSyncEvent: (cId: string | number, chartId: string, data: import("./generateCategoricalChart").CategoricalChartState) => void; | ||
handleBrushChange: ({ startIndex, endIndex }: any) => void; | ||
@@ -49,3 +51,4 @@ handleMouseEnter: (e: any) => void; | ||
handleTouchEnd: (e: any) => void; | ||
triggerSyncEvent(data: any): void; | ||
triggerSyncEvent(data: import("./generateCategoricalChart").CategoricalChartState): void; | ||
applySyncEvent(data: import("./generateCategoricalChart").CategoricalChartState): void; | ||
verticalCoordinatesGenerator: ({ xAxis, width, height, offset }: import("../util/types").ChartCoordinate) => number[]; | ||
@@ -52,0 +55,0 @@ horizontalCoordinatesGenerator: ({ yAxis, width, height, offset }: import("../util/types").ChartCoordinate) => number[]; |
@@ -7,2 +7,3 @@ /// <reference types="react" /> | ||
legendInstance: any; | ||
deferId: any; | ||
container?: any; | ||
@@ -32,4 +33,5 @@ componentDidMount(): void; | ||
removeListener(): void; | ||
clearDeferId: () => void; | ||
handleLegendBBoxUpdate: (box: any) => void; | ||
handleReceiveSyncEvent: (cId: any, chartId: any, data: any) => void; | ||
handleReceiveSyncEvent: (cId: string | number, chartId: string, data: import("./generateCategoricalChart").CategoricalChartState) => void; | ||
handleBrushChange: ({ startIndex, endIndex }: any) => void; | ||
@@ -49,3 +51,4 @@ handleMouseEnter: (e: any) => void; | ||
handleTouchEnd: (e: any) => void; | ||
triggerSyncEvent(data: any): void; | ||
triggerSyncEvent(data: import("./generateCategoricalChart").CategoricalChartState): void; | ||
applySyncEvent(data: import("./generateCategoricalChart").CategoricalChartState): void; | ||
verticalCoordinatesGenerator: ({ xAxis, width, height, offset }: import("../util/types").ChartCoordinate) => number[]; | ||
@@ -52,0 +55,0 @@ horizontalCoordinatesGenerator: ({ yAxis, width, height, offset }: import("../util/types").ChartCoordinate) => number[]; |
@@ -7,2 +7,3 @@ /// <reference types="react" /> | ||
legendInstance: any; | ||
deferId: any; | ||
container?: any; | ||
@@ -32,4 +33,5 @@ componentDidMount(): void; | ||
removeListener(): void; | ||
clearDeferId: () => void; | ||
handleLegendBBoxUpdate: (box: any) => void; | ||
handleReceiveSyncEvent: (cId: any, chartId: any, data: any) => void; | ||
handleReceiveSyncEvent: (cId: string | number, chartId: string, data: import("./generateCategoricalChart").CategoricalChartState) => void; | ||
handleBrushChange: ({ startIndex, endIndex }: any) => void; | ||
@@ -49,3 +51,4 @@ handleMouseEnter: (e: any) => void; | ||
handleTouchEnd: (e: any) => void; | ||
triggerSyncEvent(data: any): void; | ||
triggerSyncEvent(data: import("./generateCategoricalChart").CategoricalChartState): void; | ||
applySyncEvent(data: import("./generateCategoricalChart").CategoricalChartState): void; | ||
verticalCoordinatesGenerator: ({ xAxis, width, height, offset }: import("../util/types").ChartCoordinate) => number[]; | ||
@@ -52,0 +55,0 @@ horizontalCoordinatesGenerator: ({ yAxis, width, height, offset }: import("../util/types").ChartCoordinate) => number[]; |
@@ -79,2 +79,3 @@ import React from 'react'; | ||
legendInstance: any; | ||
deferId: any; | ||
container?: any; | ||
@@ -104,4 +105,5 @@ componentDidMount(): void; | ||
removeListener(): void; | ||
clearDeferId: () => void; | ||
handleLegendBBoxUpdate: (box: any) => void; | ||
handleReceiveSyncEvent: (cId: any, chartId: any, data: any) => void; | ||
handleReceiveSyncEvent: (cId: number | string, chartId: string, data: CategoricalChartState) => void; | ||
handleBrushChange: ({ startIndex, endIndex }: any) => void; | ||
@@ -121,3 +123,4 @@ handleMouseEnter: (e: any) => void; | ||
handleTouchEnd: (e: any) => void; | ||
triggerSyncEvent(data: any): void; | ||
triggerSyncEvent(data: CategoricalChartState): void; | ||
applySyncEvent(data: CategoricalChartState): void; | ||
verticalCoordinatesGenerator: ({ xAxis, width, height, offset }: ChartCoordinate) => number[]; | ||
@@ -124,0 +127,0 @@ horizontalCoordinatesGenerator: ({ yAxis, width, height, offset }: ChartCoordinate) => number[]; |
@@ -7,2 +7,3 @@ /// <reference types="react" /> | ||
legendInstance: any; | ||
deferId: any; | ||
container?: any; | ||
@@ -32,4 +33,5 @@ componentDidMount(): void; | ||
removeListener(): void; | ||
clearDeferId: () => void; | ||
handleLegendBBoxUpdate: (box: any) => void; | ||
handleReceiveSyncEvent: (cId: any, chartId: any, data: any) => void; | ||
handleReceiveSyncEvent: (cId: string | number, chartId: string, data: import("./generateCategoricalChart").CategoricalChartState) => void; | ||
handleBrushChange: ({ startIndex, endIndex }: any) => void; | ||
@@ -49,3 +51,4 @@ handleMouseEnter: (e: any) => void; | ||
handleTouchEnd: (e: any) => void; | ||
triggerSyncEvent(data: any): void; | ||
triggerSyncEvent(data: import("./generateCategoricalChart").CategoricalChartState): void; | ||
applySyncEvent(data: import("./generateCategoricalChart").CategoricalChartState): void; | ||
verticalCoordinatesGenerator: ({ xAxis, width, height, offset }: import("../util/types").ChartCoordinate) => number[]; | ||
@@ -52,0 +55,0 @@ horizontalCoordinatesGenerator: ({ yAxis, width, height, offset }: import("../util/types").ChartCoordinate) => number[]; |
@@ -7,2 +7,3 @@ /// <reference types="react" /> | ||
legendInstance: any; | ||
deferId: any; | ||
container?: any; | ||
@@ -32,4 +33,5 @@ componentDidMount(): void; | ||
removeListener(): void; | ||
clearDeferId: () => void; | ||
handleLegendBBoxUpdate: (box: any) => void; | ||
handleReceiveSyncEvent: (cId: any, chartId: any, data: any) => void; | ||
handleReceiveSyncEvent: (cId: string | number, chartId: string, data: import("./generateCategoricalChart").CategoricalChartState) => void; | ||
handleBrushChange: ({ startIndex, endIndex }: any) => void; | ||
@@ -49,3 +51,4 @@ handleMouseEnter: (e: any) => void; | ||
handleTouchEnd: (e: any) => void; | ||
triggerSyncEvent(data: any): void; | ||
triggerSyncEvent(data: import("./generateCategoricalChart").CategoricalChartState): void; | ||
applySyncEvent(data: import("./generateCategoricalChart").CategoricalChartState): void; | ||
verticalCoordinatesGenerator: ({ xAxis, width, height, offset }: import("../util/types").ChartCoordinate) => number[]; | ||
@@ -52,0 +55,0 @@ horizontalCoordinatesGenerator: ({ yAxis, width, height, offset }: import("../util/types").ChartCoordinate) => number[]; |
@@ -7,2 +7,3 @@ /// <reference types="react" /> | ||
legendInstance: any; | ||
deferId: any; | ||
container?: any; | ||
@@ -32,4 +33,5 @@ componentDidMount(): void; | ||
removeListener(): void; | ||
clearDeferId: () => void; | ||
handleLegendBBoxUpdate: (box: any) => void; | ||
handleReceiveSyncEvent: (cId: any, chartId: any, data: any) => void; | ||
handleReceiveSyncEvent: (cId: string | number, chartId: string, data: import("./generateCategoricalChart").CategoricalChartState) => void; | ||
handleBrushChange: ({ startIndex, endIndex }: any) => void; | ||
@@ -49,3 +51,4 @@ handleMouseEnter: (e: any) => void; | ||
handleTouchEnd: (e: any) => void; | ||
triggerSyncEvent(data: any): void; | ||
triggerSyncEvent(data: import("./generateCategoricalChart").CategoricalChartState): void; | ||
applySyncEvent(data: import("./generateCategoricalChart").CategoricalChartState): void; | ||
verticalCoordinatesGenerator: ({ xAxis, width, height, offset }: import("../util/types").ChartCoordinate) => number[]; | ||
@@ -52,0 +55,0 @@ horizontalCoordinatesGenerator: ({ yAxis, width, height, offset }: import("../util/types").ChartCoordinate) => number[]; |
@@ -7,2 +7,3 @@ /// <reference types="react" /> | ||
legendInstance: any; | ||
deferId: any; | ||
container?: any; | ||
@@ -32,4 +33,5 @@ componentDidMount(): void; | ||
removeListener(): void; | ||
clearDeferId: () => void; | ||
handleLegendBBoxUpdate: (box: any) => void; | ||
handleReceiveSyncEvent: (cId: any, chartId: any, data: any) => void; | ||
handleReceiveSyncEvent: (cId: string | number, chartId: string, data: import("./generateCategoricalChart").CategoricalChartState) => void; | ||
handleBrushChange: ({ startIndex, endIndex }: any) => void; | ||
@@ -49,3 +51,4 @@ handleMouseEnter: (e: any) => void; | ||
handleTouchEnd: (e: any) => void; | ||
triggerSyncEvent(data: any): void; | ||
triggerSyncEvent(data: import("./generateCategoricalChart").CategoricalChartState): void; | ||
applySyncEvent(data: import("./generateCategoricalChart").CategoricalChartState): void; | ||
verticalCoordinatesGenerator: ({ xAxis, width, height, offset }: import("../util/types").ChartCoordinate) => number[]; | ||
@@ -52,0 +55,0 @@ horizontalCoordinatesGenerator: ({ yAxis, width, height, offset }: import("../util/types").ChartCoordinate) => number[]; |
@@ -7,2 +7,3 @@ /// <reference types="react" /> | ||
legendInstance: any; | ||
deferId: any; | ||
container?: any; | ||
@@ -32,4 +33,5 @@ componentDidMount(): void; | ||
removeListener(): void; | ||
clearDeferId: () => void; | ||
handleLegendBBoxUpdate: (box: any) => void; | ||
handleReceiveSyncEvent: (cId: any, chartId: any, data: any) => void; | ||
handleReceiveSyncEvent: (cId: string | number, chartId: string, data: import("./generateCategoricalChart").CategoricalChartState) => void; | ||
handleBrushChange: ({ startIndex, endIndex }: any) => void; | ||
@@ -49,3 +51,4 @@ handleMouseEnter: (e: any) => void; | ||
handleTouchEnd: (e: any) => void; | ||
triggerSyncEvent(data: any): void; | ||
triggerSyncEvent(data: import("./generateCategoricalChart").CategoricalChartState): void; | ||
applySyncEvent(data: import("./generateCategoricalChart").CategoricalChartState): void; | ||
verticalCoordinatesGenerator: ({ xAxis, width, height, offset }: import("../util/types").ChartCoordinate) => number[]; | ||
@@ -52,0 +55,0 @@ horizontalCoordinatesGenerator: ({ yAxis, width, height, offset }: import("../util/types").ChartCoordinate) => number[]; |
@@ -1,3 +0,3 @@ | ||
import { Component, FunctionComponent } from 'react'; | ||
declare type Comp<P> = FunctionComponent<P> | Component<P>; | ||
import { Component, FunctionComponent, ReactElement } from 'react'; | ||
declare type Comp<P> = FunctionComponent<P> | Component<P> | ReactElement<P>; | ||
export declare type Props<P, C extends Comp<P>> = P & { | ||
@@ -4,0 +4,0 @@ component: C; |
@@ -1,3 +0,13 @@ | ||
declare const eventCenter: any; | ||
import EventEmitter from 'eventemitter3'; | ||
declare type CategoricalChartState = import('../chart/generateCategoricalChart').CategoricalChartState; | ||
interface EventCenter extends EventEmitter<EventTypes> { | ||
setMaxListeners?(maxListeners: number): void; | ||
_maxListeners?: number; | ||
} | ||
declare const eventCenter: EventCenter; | ||
export { eventCenter }; | ||
export declare const SYNC_EVENT = "recharts.syncMouseEvents"; | ||
declare type SYNC_EVENT = typeof SYNC_EVENT; | ||
interface EventTypes { | ||
[SYNC_EVENT](syncId: number | string, uniqueChartId: string, data: CategoricalChartState): void; | ||
} |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
11255158
117517