Skip to content

Commit

Permalink
Merge pull request #84 from Alex-NRCan/fix-styling
Browse files Browse the repository at this point in the history
Small styling fixes
  • Loading branch information
jolevesq authored Dec 13, 2024
2 parents c4a471e + 9913f78 commit b4c23e9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 12 deletions.
8 changes: 4 additions & 4 deletions src/chart-parsing.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ChartType, ChartData, ChartDataset, ChartOptions, Tick, PluginChartOptions } from 'chart.js';
import { Chart as ChartJS, ChartType, ChartData, ChartDataset, ChartOptions, Tick, PluginChartOptions } from 'chart.js';
import {
GeoChartConfig,
GeoChartXYData,
Expand Down Expand Up @@ -414,7 +414,7 @@ function createDatasetsLineBar<
} else {
// 1 feature = 1 dataset
// Create dataset
const newDataset = createDataset<TType, TData>(chartConfig, undefined, undefined, steps, undefined);
const newDataset = createDataset<TType, TData>(chartConfig, ChartJS.defaults.color as string, undefined, steps, undefined);
returnedChartData.datasets.push(newDataset);

// For each record
Expand Down Expand Up @@ -482,7 +482,7 @@ function createDatasetsPieDoughnut<
// If new category
if (!Object.keys(categoriesRead).includes(catName)) {
// Create dataset
const newDataset = createDataset<TType, TData>(chartConfig, paletteBackgroundAll, undefined, undefined, catName);
const newDataset = createDataset<TType, TData>(chartConfig, paletteBackgroundAll, ChartJS.defaults.color as string, undefined, catName);
categoriesRead[catName] = { index: idx++, data: newDataset.data };
returnedChartData.datasets.push(newDataset);
}
Expand All @@ -502,7 +502,7 @@ function createDatasetsPieDoughnut<
} else {
// 1 feature = 1 dataset
// Create dataset
const newDataset = createDataset<TType, TData>(chartConfig, undefined, undefined, undefined, undefined);
const newDataset = createDataset<TType, TData>(chartConfig, ChartJS.defaults.color as string, undefined, undefined, undefined);
returnedChartData.datasets.push(newDataset);

// Compress the data for the ChartDataset
Expand Down
9 changes: 1 addition & 8 deletions src/chart-style.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,7 @@ export const getSxClasses = (theme: Theme) => {
marginLeft: 'auto',
'& button': {
height: '40px',
textTransform: 'capitalize',
backgroundColor: theme.palette.geoViewColor?.bgColor.dark[100],
color: theme.palette.geoViewColor?.textColor.main,
'&:hover': {
backgroundColor: theme.palette.geoViewColor?.bgColor.dark[50],
color: theme.palette.geoViewColor?.textColor.main,
},
textTransform: 'capitalize'
},
},
dataset: {
Expand Down Expand Up @@ -118,7 +112,6 @@ export const getSxClasses = (theme: Theme) => {
ySliderWrapper: {
height: '70%',
textAlign: 'center',
marginTop: '-20px',
marginLeft: '20px',
'& .MuiSlider-root': {
color: theme.palette.geoViewColor?.primary.main,
Expand Down

0 comments on commit b4c23e9

Please sign in to comment.