Skip to content

Commit

Permalink
remplacer le unknown par string to see
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex-NRCan committed Sep 27, 2023
1 parent d09b689 commit b5f47be
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 13 deletions.
11 changes: 1 addition & 10 deletions src/chart/chart-types.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,8 @@
import { ChartType, ChartData, ChartOptions, DefaultDataPoint, Plugin } from 'chart.js';
import { ChartType, ChartData, ChartOptions, DefaultDataPoint } from 'chart.js';

export const EVENT_CHART_CHANGED: string = "chart/changed";
export const EVENT_CHART_PARSE: string = "chart/parse";

/**
* Main props for the Chart
*/
export interface TypeChartProps<TType extends ChartType, TData extends DefaultDataPoint<TType>, TLabel = unknown> {
data: ChartData<TType, TData, TLabel>;
options: ChartOptions<TType> | OptionsGeoChart;
plugins?: Plugin<TType>[];
}

export type OptionsParameters = {
chart: ChartType;
featuresUsePalette?: boolean;
Expand Down
16 changes: 13 additions & 3 deletions src/chart/chart.tsx
Original file line number Diff line number Diff line change
@@ -1,21 +1,31 @@
// import { useEffect, useState } from 'react';
import { Box } from '@mui/material';
import { ChartType, ChartData, ChartOptions, DefaultDataPoint } from 'chart.js';
import { TypeChartProps, ChartPayloadChanged, ChartPayloadParse, OptionsGeoChart, EVENT_CHART_CHANGED, EVENT_CHART_PARSE } from './chart-types';
import { ChartType, ChartData, ChartOptions, DefaultDataPoint, Plugin } from 'chart.js';
import { ChartPayloadChanged, ChartPayloadParse, OptionsGeoChart, EVENT_CHART_CHANGED, EVENT_CHART_PARSE } from './chart-types';
import { formatGenericData, formatGenericOptions } from './chart-parser';
import { ChartDoughnut } from './charts/chart-doughnut';
import { ChartBarsVertical } from './charts/chart-bars-vertical';
import { ChartPie } from './charts/chart-pie';
import { ChartLine } from './charts/chart-line';
import styles from "./chart.module.css";


/**
* Main props for the Chart
*/
export interface TypeChartProps<TType extends ChartType, TData extends DefaultDataPoint<TType>, TLabel = string> {
data: ChartData<TType, TData, TLabel>;
options: ChartOptions<TType> | OptionsGeoChart;
plugins?: Plugin<TType>[];
}

/**
* Create a customized Chart UI
*
* @param {TypeChartProps} props the properties passed to the Chart element
* @returns {JSX.Element} the created Chart element
*/
export function Chart(props: TypeChartProps<ChartType, DefaultDataPoint<ChartType>, unknown>): JSX.Element {
export function Chart(props: TypeChartProps<ChartType, DefaultDataPoint<ChartType>, string>): JSX.Element {
// Fetch the cgpv module
const w = window as any;
const cgpv = w['cgpv'];
Expand Down

0 comments on commit b5f47be

Please sign in to comment.