From 5cfd2fb328c8f1a226c4d639a3590b59f23dd789 Mon Sep 17 00:00:00 2001 From: Paul Irish Date: Wed, 6 Sep 2023 17:08:30 -0700 Subject: [PATCH 1/2] two bar colors. darker for bytesizes --- src/bundle/FileDetails.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/bundle/FileDetails.tsx b/src/bundle/FileDetails.tsx index 3b296b7..694c05b 100644 --- a/src/bundle/FileDetails.tsx +++ b/src/bundle/FileDetails.tsx @@ -51,6 +51,11 @@ function getColumns( ); }); + function isByteColumn(d: any): boolean { + const id = d.column.id; + return id === 'totalBytes' || id === 'transitiveRequiresSize'; + } + function getBar( // d: Column, d: any, @@ -61,7 +66,7 @@ function getColumns(
Date: Wed, 6 Sep 2023 17:09:12 -0700 Subject: [PATCH 2/2] fix 'undefined' in filedetails table --- src/bundle/stringFormats.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bundle/stringFormats.js b/src/bundle/stringFormats.js index 5fe018c..11900b4 100644 --- a/src/bundle/stringFormats.js +++ b/src/bundle/stringFormats.js @@ -2,7 +2,7 @@ const mb = 1024 * 1024; const kb = 1024; export function getFileSizeSplit(size) { - if (!size || size === 0) return { size: 0, type: "KB" }; + if (!size || size === 0) return { value: 0, type: "KB" }; let value = size && size >= mb ? size / mb : size / kb; if (value < 1 || size >= mb) value = value.toFixed(2); else value = value.toFixed(0);