Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,9 @@ export const IcicleNode = React.memo(function IcicleNodeNoMemo({
const filename: string | null = arrowToString(filenameColumn?.get(row));
const depth: number = depthColumn?.get(row) ?? 0;
const valueOffset: bigint =
valueOffsetColumn?.get(row) !== null ? BigInt(valueOffsetColumn?.get(row)) : 0n;
valueOffsetColumn?.get(row) !== null && valueOffsetColumn?.get(row) !== undefined
? BigInt(valueOffsetColumn?.get(row))
: 0n;

const colorAttribute =
colorBy === 'filename' ? filename : colorBy === 'binary' ? mappingFile : null;
Expand Down Expand Up @@ -147,7 +149,10 @@ export const IcicleNode = React.memo(function IcicleNodeNoMemo({
}, [searchString, name]);

const selectionOffset =
valueOffsetColumn?.get(selectedRow) !== null ? BigInt(valueOffsetColumn?.get(selectedRow)) : 0n;
valueOffsetColumn?.get(selectedRow) !== null &&
valueOffsetColumn?.get(selectedRow) !== undefined
? BigInt(valueOffsetColumn?.get(selectedRow))
: 0n;
const selectionCumulative =
cumulativeColumn?.get(selectedRow) !== null ? BigInt(cumulativeColumn?.get(selectedRow)) : 0n;
if (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,17 @@ export const getFilenameColors = (

const noop = (): void => {};

function getMaxDepth(depthColumn: Vector<any> | null): number {
if (depthColumn === null) return 0;

let max = 0;
for (const val of depthColumn) {
const numVal = Number(val);
if (numVal > max) max = numVal;
}
return max;
}

export const IcicleGraphArrow = memo(function IcicleGraphArrow({
arrow,
total,
Expand Down Expand Up @@ -237,7 +248,7 @@ export const IcicleGraphArrow = memo(function IcicleGraphArrow({
};

const depthColumn = table.getChild(FIELD_DEPTH);
const maxDepth = depthColumn === null ? 0 : Math.max(...depthColumn.toArray());
const maxDepth = getMaxDepth(depthColumn);
const height = maxDepth * RowHeight;

// To find the selected row, we must walk the current path and look at which
Expand Down