String(value),
- }}
- axisLeft={{
- tickSize: 0,
- tickPadding: 10,
- format: (value) => String(value).replace(/-\d+$/, ""),
- }}
- axisRight={
- statisticType !== Metrics.PROBABILITY
- ? {
- tickSize: 0,
- tickPadding: 10,
- format: (value) => {
- // Access rightAxisLabel using the lookup map
- return (
- rightAxisLabelMap[value] || String(value).replace(/-\d+$/, "")
- );
- },
- }
- : null
- }
- label={(cell) => {
- if (cell.data.label) {
- return cell.data.label;
+ <>
+ {heatmapCanvasRef && }
+
+ {useTooltip && }
+ String(value),
+ }}
+ axisLeft={{
+ tickSize: 0,
+ tickPadding: 10,
+ format: (value) => String(value).replace(/-\d+$/, ""),
+ }}
+ axisRight={
+ statisticType !== Metrics.PROBABILITY
+ ? {
+ tickSize: 0,
+ tickPadding: 10,
+ format: (value) => {
+ // Access rightAxisLabel using the lookup map
+ return (
+ rightAxisLabelMap[value] ||
+ String(value).replace(/-\d+$/, "")
+ );
+ },
+ }
+ : null
}
- return "";
- }}
- labelTextColor={(cell) => {
- // Use white text for dark cells, black for light cells
- const value = cell.data.y;
- return value !== null && value > 0.5 ? "#ffffff" : "#000000";
- }}
- colors={{
- type: "sequential",
- scheme: "blues",
- minValue: minValue,
- maxValue: maxValue,
- }}
- hoverTarget="cell"
- inactiveOpacity={1}
- theme={resolvedTheme}
- animate={false}
- isInteractive={false}
- legends={[
- {
- title: statisticType === Metrics.RANK ? "Rank (log)" : statisticType,
- anchor: "right",
- translateX: statisticType !== Metrics.PROBABILITY ? 60 : 30,
- translateY: 0,
- length: 400,
- thickness: 8,
- direction: "column",
- tickPosition: "after",
- tickSize: 3,
- tickSpacing: 4,
- tickOverlap: false,
- tickFormat: ">-.2f",
- titleAlign: "start",
- },
- ]}
- />
-
+ label={(cell) => {
+ if (cell.data.label) {
+ return cell.data.label;
+ }
+ return "";
+ }}
+ labelTextColor={(cell) => {
+ // Use white text for dark cells, black for light cells
+ const value = cell.data.y;
+ return value !== null && value > 0.5 ? "#ffffff" : "#000000";
+ }}
+ colors={{
+ type: "sequential",
+ scheme: "blues",
+ minValue: minValue,
+ maxValue: maxValue,
+ }}
+ hoverTarget="cell"
+ inactiveOpacity={1}
+ theme={resolvedTheme}
+ animate={false}
+ isInteractive={false}
+ legends={[
+ {
+ title: statisticType === Metrics.RANK ? "Rank (log)" : statisticType,
+ anchor: "right",
+ translateX: statisticType !== Metrics.PROBABILITY ? 60 : 30,
+ translateY: 0,
+ length: 400,
+ thickness: 8,
+ direction: "column",
+ tickPosition: "after",
+ tickSize: 3,
+ tickSpacing: 4,
+ tickOverlap: false,
+ tickFormat: ">-.2f",
+ titleAlign: "start",
+ },
+ ]}
+ />
+