Repository: quigleyj97/jupyterlab-spreadsheet (language: python)

Issue:
'A' Column not shown when it is blank
I am not sure if this is a SheetJS or SlickGrid thing, or possibly your wrapper?

But if the 'A' Column is blank it is not shown.

It's not a big deal but it is weird when you always expect an Excel sheet to show columns A through M and rows 1 to N?

The plugin is awesome btw congrats and thanks. If this is an easy fix and if it's easy for me to get my head around your code, I could potentially submit a PR.
![image](https://user-images.githubusercontent.com/39010050/117033455-aa156200-ad02-11eb-8b38-1a394e16f8f5.png)

'A' Column not shown when it is blank
I am not sure if this is a SheetJS or SlickGrid thing, or possibly your wrapper?

But if the 'A' Column is blank it is not shown.

It's not a big deal but it is weird when you always expect an Excel sheet to show columns A through M and rows 1 to N?

The plugin is awesome btw congrats and thanks. If this is an easy fix and if it's easy for me to get my head around your code, I could potentially submit a PR.
![image](https://user-images.githubusercontent.com/39010050/117033455-aa156200-ad02-11eb-8b38-1a394e16f8f5.png)



Discussion / hints:
Oh man, thanks for reporting this! My first guess is that this is a rendering issue with SlickGrid, but the column sizes are given by SheetJS. Does this happen exclusively in sheets where all the first column cells are empty? Or is the first column resized as well? I'll see if I can repro this tonight.
Oh man, thanks for reporting this! My first guess is that this is a rendering issue with SlickGrid, but the column sizes are given by SheetJS. Does this happen exclusively in sheets where all the first column cells are empty? Or is the first column resized as well? I'll see if I can repro this tonight.

Fix patch:
diff --git a/src/model.ts b/src/model.ts
index 519722c..4937e57 100644
--- a/src/model.ts
+++ b/src/model.ts
@@ -80,7 +80,8 @@ export class SpreadsheetModel
     }
 
     /**
-     * Returns the extent of the current sheet, so that views can calculate columns and
+     * Returns the extent of the current sheet, from the top-left A1 column to
+     * the bottom-right-most cell, so that views can calculate columns and
      * row numbers.
      */
     public getExtent() {
@@ -92,7 +93,13 @@ export class SpreadsheetModel
         // cf. https://github.com/SheetJS/js-xlsx#sheet-objects, "Special Sheet Keys"
         // TODO: Low: Inspect sheet data to attempt to guess at the true size
         const range = sheetData["!ref"] || "A1:A1";
-        return utils.decode_range(range);
+        // This range is _not_ from the top-left cell! It's from the first
+        // cell _with_ data, so it can actually skip rows/columns. We can't
+        // allow this as it'll cause misaligned rendering.
+        const sheetRangeExclusive = utils.decode_range(range);
+        // force the start of the range to be the top-most cell, always
+        sheetRangeExclusive.s = {c: 0, r: 0};
+        return sheetRangeExclusive;
     }
 
     /**


Test patch:
diff --git a/data/fancy-test.xlsx b/data/fancy-test.xlsx
index aca3eba..93017d5 100644
Binary files a/data/fancy-test.xlsx and b/data/fancy-test.xlsx differ