Skip to content

Commit

Permalink
Cleaner dom tree
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex-NRCan committed Oct 2, 2023
1 parent 260511f commit e423c1c
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/chart/chart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ export function Chart(props: TypeChartChartProps<GeoChartType>): JSX.Element {
};
});

function renderChart() {
function renderChart(): JSX.Element {
// Depending on the type of chart
switch (options.geochart.chart) {
case 'bar':
Expand Down Expand Up @@ -124,7 +124,7 @@ export function Chart(props: TypeChartChartProps<GeoChartType>): JSX.Element {
}
}

function renderXSlider() {
function renderXSlider(): JSX.Element {
const { xSlider } = options.geochart;
if (xSlider?.display) {
return (
Expand All @@ -149,7 +149,7 @@ export function Chart(props: TypeChartChartProps<GeoChartType>): JSX.Element {
return <div />;
}

function renderYSlider() {
function renderYSlider(): JSX.Element {
const { ySlider } = options.geochart;
if (ySlider?.display) {
return (
Expand All @@ -174,7 +174,7 @@ export function Chart(props: TypeChartChartProps<GeoChartType>): JSX.Element {
return <div />;
}

function renderChartContainer() {
function renderChartContainer(): JSX.Element {
if (options && options.geochart && options.geochart.chart) {
return (
<div className={styles.chartContainer}>
Expand All @@ -185,7 +185,8 @@ export function Chart(props: TypeChartChartProps<GeoChartType>): JSX.Element {
</div>
);
}
return <div></div>;
}

return <div>{renderChartContainer()}</div>;
return renderChartContainer();
}

0 comments on commit e423c1c

Please sign in to comment.