Skip to content

Commit

Permalink
And...
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex-NRCan committed Sep 29, 2023
1 parent 9c8a14c commit d5cf39b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 10 deletions.
4 changes: 0 additions & 4 deletions src/chart/chart-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@ import { ChartType, ChartData, ChartOptions, DefaultDataPoint } from 'chart.js';
export const EVENT_CHART_CHANGED: string = "chart/changed";
export const EVENT_CHART_PARSE: string = "chart/parse";

export type Toto = {
yo: string;
};

export type OptionsParameters = {
chart: ChartType;
featuresUsePalette?: boolean;
Expand Down
2 changes: 1 addition & 1 deletion src/chart/chart.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export * from 'chart.js';
export * from './chart-parser';
export * from './chart-types';
export { Chart, TypeChartProps } from './chart';
export * from './chart';
9 changes: 4 additions & 5 deletions src/chart/chart.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// import { useEffect, useState } from 'react';
import { Box } from '@mui/material';
import { ChartType, ChartData, ChartOptions, DefaultDataPoint, Plugin } from 'chart.js';
import { ChartPayloadChanged, ChartPayloadParse, OptionsGeoChart, EVENT_CHART_CHANGED, EVENT_CHART_PARSE, Toto } from './chart-types';
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';
Expand All @@ -14,20 +14,19 @@ console.log("geochart chart.tsx run");
/**
* Main props for the Chart
*/
export interface TypeChartProps<TType extends ChartType, TData extends DefaultDataPoint<TType>, TLabel = string> {
export interface TypeGeoChartChartProps<TType extends ChartType, TData extends DefaultDataPoint<TType>, TLabel = string> {
data?: ChartData<TType, TData, TLabel>;
options?: ChartOptions<TType> | OptionsGeoChart;
plugins?: Plugin<TType>[];
t?: Toto;
}

/**
* Create a customized Chart UI
*
* @param {TypeChartProps} props the properties passed to the Chart element
* @param {TypeGeoChartChartProps} props the properties passed to the Chart element
* @returns {JSX.Element} the created Chart element
*/
export function Chart(props: TypeChartProps<ChartType, DefaultDataPoint<ChartType>, string>): JSX.Element {
export function GeoChart(props: TypeGeoChartChartProps<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 d5cf39b

Please sign in to comment.