From b941cc71f157db01893a326f0eefc23890cbf69d Mon Sep 17 00:00:00 2001 From: mnsrulz Date: Thu, 24 Oct 2024 00:00:14 -0400 Subject: [PATCH] rendering fix --- src/components/ConditionalFormattingBox.tsx | 2 +- src/components/HeatMap.tsx | 6 ++-- src/components/HistoricalSeason.tsx | 34 ++++++++++----------- 3 files changed, 21 insertions(+), 21 deletions(-) diff --git a/src/components/ConditionalFormattingBox.tsx b/src/components/ConditionalFormattingBox.tsx index 888c6cd..143f4af 100644 --- a/src/components/ConditionalFormattingBox.tsx +++ b/src/components/ConditionalFormattingBox.tsx @@ -10,7 +10,7 @@ export const ConditionalFormattingBox = (props: IConditionalFormattingBoxProps) backgroundColor: color, width: "100%", height: "100%", - padding: "2px", + padding: "2px", //padding seems to have no effect??? display: 'flex', alignItems: 'center', // Align content vertically justifyContent: 'flex-end' diff --git a/src/components/HeatMap.tsx b/src/components/HeatMap.tsx index 965a034..5bc2909 100644 --- a/src/components/HeatMap.tsx +++ b/src/components/HeatMap.tsx @@ -11,7 +11,7 @@ type MyProps = { data: number[][], formatter: 'percent' | 'number' } -const formatters = {'percent': percentageFormatter, number: numberFormatter} +const formatters = { 'percent': percentageFormatter, number: numberFormatter } export const HeatMap = (props: MyProps) => { const { xLabels, yLabels, data, formatter } = props; const fmt = formatters[formatter]; @@ -39,11 +39,11 @@ export const HeatMap = (props: MyProps) => { key={`row-${ix}`} sx={{ '&:last-child td, &:last-child th': { border: 0 }, padding: 0 }} > - + {yLabels[ix]} { - row.map((c, ixx) => + row.map((c, ixx) => {/* {row[`d${c}`]} */} ) diff --git a/src/components/HistoricalSeason.tsx b/src/components/HistoricalSeason.tsx index f7a118d..3b8d6f5 100644 --- a/src/components/HistoricalSeason.tsx +++ b/src/components/HistoricalSeason.tsx @@ -11,26 +11,26 @@ import customParseFormat from 'dayjs/plugin/customParseFormat'; dayjs.extend(customParseFormat); const months = [ - 'January', - 'February', - 'March', - 'April', + 'Jan', + 'Feb', + 'Mar', + 'Apr', 'May', - 'June', - 'July', - 'August', - 'September', - 'October', - 'November', - 'December', + 'Jun', + 'Jul', + 'Aug', + 'Sep', + 'Oct', + 'Nov', + 'Dec', ]; const days = [ - 'Monday', - 'Tuesday', - 'Wednesday', - 'Thursday', - 'Friday' + 'Mon', + 'Tue', + 'Wed', + 'Thu', + 'Fri' ] enum DataMode { @@ -77,7 +77,7 @@ function getDailyData(dt: HistoricalDataResponse) { const firstMonday = dayjs(startDate.subtract(startDate.day() - 1).format('YYYY-MM-DD'), 'YYYY-MM-DD', true); const numberOfWeeks = endDate.diff(startDate, 'w') + 1; const ys = [...Array(numberOfWeeks).keys()].reduce((j: string[], c) => { - j.push(`${firstMonday.add(c, 'w').format('DD MMM YYYY')}`); + j.push(`${firstMonday.add(c, 'w').format('DD MMM YY')}`); return j; }, []); let lastClosingPrice = 0;