Skip to content

Commit ef2b359

Browse files
committed
heatmap legend and title fix
1 parent b81ac73 commit ef2b359

File tree

2 files changed

+11
-14
lines changed

2 files changed

+11
-14
lines changed

src/components/componentMapper.tsx

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -259,25 +259,19 @@ export default function ComponentMapper({
259259
className="grid lg:grid-cols-[50%_50%] grid-cols-[100%]"
260260
>
261261
<div className="col-[1]">
262-
<h2 className="pb-2">
263-
{t('heatmap.realdata')}
264-
</h2>
265262
<HeatMapChart
266263
columns={realColumns}
267264
key={index}
268265
data={convertedData}
269-
title={resultItem.title ?? ''}
266+
title={t('heatmap.realdata')}
270267
/>
271268
</div>
272269
<div className="col-[1] lg:col-[2]">
273-
<h2 className="pb-2">
274-
{t('heatmap.syntheticdata')}
275-
</h2>
276270
<HeatMapChart
277271
columns={synthticColumns}
278272
key={index}
279273
data={syntheticData}
280-
title={resultItem.title ?? ''}
274+
title={t('heatmap.syntheticdata')}
281275
/>
282276
</div>
283277
</div>

src/components/graphs/HeatMap.tsx

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -184,12 +184,15 @@ const HeatMapChart = ({ title, data, columns }: HeatMapChartProps) => {
184184

185185
// Render the chart container and SVG element with horizontal scroll if needed
186186
return (
187-
<div
188-
ref={containerRef}
189-
style={{ width: '100%', display: 'flex', overflowX: 'auto' }}
190-
className={`min-h-[${height}px] flex-col`}
191-
>
192-
<svg ref={svgRef}></svg>
187+
<div className="flex flex-col gap-4">
188+
<h3 className="text-center font-semibold text-base">{title}</h3>
189+
<div
190+
ref={containerRef}
191+
style={{ width: '100%', display: 'flex', overflowX: 'auto' }}
192+
className={`min-h-[${height}px] flex-col`}
193+
>
194+
<svg ref={svgRef}></svg>
195+
</div>
193196
</div>
194197
);
195198
};

0 commit comments

Comments
 (0)