@oliasoft-open-source/charts-library 3.6.5 → 3.6.6-beta-1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +127 -91
- package/dist/index.js.map +1 -1
- package/dist/src/components/line-chart/hooks/use-chart-functions.d.ts +0 -1
- package/dist/src/components/line-chart/hooks/use-legend-state.d.ts +33 -0
- package/dist/src/components/line-chart/legend/create-style-object.d.ts +26 -0
- package/dist/src/components/line-chart/line-chart.stories.d.ts +1 -0
- package/package.json +1 -1
|
@@ -20,7 +20,6 @@ interface IUseChartFunctions {
|
|
|
20
20
|
* @returns {Object} An object containing the chart-related functions
|
|
21
21
|
*/
|
|
22
22
|
export declare const useChartFunctions: ({ chartRef, state, options, dispatch, generatedDatasets, }: IUseChartFunctions) => {
|
|
23
|
-
legendClick: (_e: ChartEvent, legendItem: any) => void;
|
|
24
23
|
resetZoom: () => void;
|
|
25
24
|
onHover: (hoveredPoint: any, setHoveredPoint: any) => (evt: ChartEvent, hoveredItems: ICommonHoveredItems[]) => void;
|
|
26
25
|
handleDownload: () => void;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { Dispatch, RefObject } from 'react';
|
|
2
|
+
import { Chart, ChartEvent } from 'chart.js';
|
|
3
|
+
import { ILineChartOptions } from '../line-chart.interface';
|
|
4
|
+
import { IState } from '../state/state.interfaces';
|
|
5
|
+
export interface IUseLegendStateProps {
|
|
6
|
+
chartRef: RefObject<Chart>;
|
|
7
|
+
options: ILineChartOptions;
|
|
8
|
+
state: IState;
|
|
9
|
+
dispatch: Dispatch<any>;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Custom hook to manage legend state.
|
|
13
|
+
*/
|
|
14
|
+
export declare const useLegendState: ({ chartRef, options, state, dispatch, }: IUseLegendStateProps) => {
|
|
15
|
+
legendClick: (_e: ChartEvent, legendItem: any) => void;
|
|
16
|
+
hiddenStates: Record<number, boolean>;
|
|
17
|
+
legend: {
|
|
18
|
+
position: import("../../common/helpers/enums").Position;
|
|
19
|
+
display: boolean | undefined;
|
|
20
|
+
align: string | undefined;
|
|
21
|
+
labels: {
|
|
22
|
+
boxHeight: number;
|
|
23
|
+
boxWidth: number | undefined;
|
|
24
|
+
usePointStyle: boolean | undefined;
|
|
25
|
+
};
|
|
26
|
+
onClick: (_e: any, legendItem: any) => void;
|
|
27
|
+
};
|
|
28
|
+
customLegendPlugin: {
|
|
29
|
+
htmlLegend: {
|
|
30
|
+
containerID: string;
|
|
31
|
+
} | null | undefined;
|
|
32
|
+
};
|
|
33
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Position } from '../../common/helpers/enums';
|
|
2
|
+
interface IChartArea {
|
|
3
|
+
top: number;
|
|
4
|
+
left: number;
|
|
5
|
+
bottom: number;
|
|
6
|
+
right: number;
|
|
7
|
+
}
|
|
8
|
+
interface IChart {
|
|
9
|
+
height?: number;
|
|
10
|
+
width?: number;
|
|
11
|
+
chartArea: IChartArea;
|
|
12
|
+
}
|
|
13
|
+
interface IStyleObject {
|
|
14
|
+
left: number | undefined;
|
|
15
|
+
right: number | undefined;
|
|
16
|
+
top: number | undefined;
|
|
17
|
+
bottom: number | undefined;
|
|
18
|
+
maxHeight: number;
|
|
19
|
+
maxWidth: number;
|
|
20
|
+
margin: number;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Creates a style object for positioning and sizing the legend panel based on the chart dimensions and legend position.
|
|
24
|
+
*/
|
|
25
|
+
export declare const createStyleObject: (legendPosition: Position, chart: IChart) => IStyleObject;
|
|
26
|
+
export {};
|
|
@@ -1074,6 +1074,7 @@ export namespace CombiningTypes {
|
|
|
1074
1074
|
}
|
|
1075
1075
|
export { args_39 as args };
|
|
1076
1076
|
}
|
|
1077
|
+
export function ExternalSelect(): import("react/jsx-runtime").JSX.Element;
|
|
1077
1078
|
import { LineChart } from './line-chart';
|
|
1078
1079
|
declare namespace basicChart { }
|
|
1079
1080
|
declare const customLegendContainerID: "custom-legend-container";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oliasoft-open-source/charts-library",
|
|
3
|
-
"version": "3.6.
|
|
3
|
+
"version": "3.6.6-beta-1",
|
|
4
4
|
"description": "React Chart Library (based on Chart.js and react-chart-js-2)",
|
|
5
5
|
"homepage": "https://gitlab.com/oliasoft-open-source/charts-library",
|
|
6
6
|
"resolutions": {
|