@deephaven/grid 1.13.0 → 1.15.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/GridMetricCalculator.d.ts +8 -2
- package/dist/GridMetricCalculator.d.ts.map +1 -1
- package/dist/GridMetricCalculator.js +27 -5
- package/dist/GridMetricCalculator.js.map +1 -1
- package/dist/GridMetrics.d.ts +1 -0
- package/dist/GridMetrics.d.ts.map +1 -1
- package/dist/GridMetrics.js.map +1 -1
- package/dist/GridRenderer.js +12 -12
- package/dist/GridRenderer.js.map +1 -1
- package/package.json +2 -2
package/dist/GridMetrics.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GridMetrics.js","names":[],"sources":["../src/GridMetrics.ts"],"sourcesContent":["import type { BoundedAxisRange } from './GridAxisRange';\n\n/** A grid coordinate value */\nexport type Coordinate = number;\n\n/** Coordinates of a box */\nexport type BoxCoordinates = {\n x1: Coordinate;\n y1: Coordinate;\n x2: Coordinate;\n y2: Coordinate;\n};\n\n/** The visible index of the item, eg. after moves are applied */\nexport type VisibleIndex = number;\n\n/** The model index of the item, eg. moves are not applied */\nexport type ModelIndex = number;\n\n/** Map from an item index to it's coordinate */\nexport type CoordinateMap = Map<VisibleIndex, Coordinate>;\n\n/** Map from an item index to it's size */\nexport type SizeMap = Map<VisibleIndex, number>;\n\n/** Map from a ModelIndex to it's size */\nexport type ModelSizeMap = Map<ModelIndex, number>;\n\n/** Map from visible Index to ModelIndex */\nexport type VisibleToModelMap = Map<VisibleIndex, ModelIndex>;\n\n/** Represents a move operation from one index to another */\nexport type MoveOperation = {\n from: VisibleIndex | BoundedAxisRange;\n to: VisibleIndex;\n};\n\nexport type GridMetrics = {\n // Row/Column metrics from model\n rowHeight: number;\n rowHeaderWidth: number;\n rowFooterWidth: number;\n rowCount: number;\n columnWidth: number;\n columnCount: number;\n columnHeaderHeight: number;\n\n // Floating row and column counts\n floatingTopRowCount: number;\n floatingBottomRowCount: number;\n floatingLeftColumnCount: number;\n floatingRightColumnCount: number;\n\n // The grid offset from the top left\n gridX: Coordinate;\n gridY: Coordinate;\n\n // Index of non-hidden row/columns\n firstRow: VisibleIndex;\n firstColumn: VisibleIndex;\n\n // The amount of padding for tree (if applicable)\n treePaddingX: number;\n treePaddingY: number;\n\n // What viewport is currently visible, limited by data size\n /**\n * The visible index of the left-most column that is at least partially visible.\n */\n left: VisibleIndex;\n /**\n * The visible index of the top row that is at least partially visible.\n */\n top: VisibleIndex;\n /**\n * The visible index of the bottom row that is at least partially visible.\n */\n bottom: VisibleIndex;\n /**\n * The visible index of the right-most column that is at least partially visible.\n */\n right: VisibleIndex;\n topOffset: Coordinate;\n leftOffset: Coordinate;\n\n // Bottom and right that are fully visible, not overlapped by scroll bars or anything\n topVisible: VisibleIndex;\n leftVisible: VisibleIndex;\n bottomVisible: VisibleIndex;\n rightVisible: VisibleIndex;\n\n // Bottom and right of the viewport, not limited by data size\n bottomViewport: VisibleIndex;\n rightViewport: VisibleIndex;\n\n // Canvas width/height\n width: number;\n height: number;\n\n // Max x/y coordinate of the grid (does not include headers)\n maxX: Coordinate;\n maxY: Coordinate;\n\n // Last valid column/row that can be the left/top of the grid\n lastLeft: VisibleIndex;\n lastTop: VisibleIndex;\n\n // Scroll bar metrics\n barHeight: number;\n barTop: number; // Relative to canvas dimensions\n barWidth: number;\n barLeft: number; // Relative to canvas dimensions\n handleHeight: number;\n handleWidth: number;\n hasHorizontalBar: boolean;\n hasVerticalBar: boolean;\n verticalBarWidth: number;\n horizontalBarHeight: number;\n\n // The vertical x/y scroll amount\n scrollX: number;\n scrollY: number;\n\n // The size of all known content in the scrollable area\n scrollableContentWidth: number;\n scrollableContentHeight: number;\n\n // The visible space for scrollable content to display\n scrollableViewportWidth: number;\n scrollableViewportHeight: number;\n\n // Array of visible rows/columns, by
|
|
1
|
+
{"version":3,"file":"GridMetrics.js","names":[],"sources":["../src/GridMetrics.ts"],"sourcesContent":["import type { BoundedAxisRange } from './GridAxisRange';\n\n/** A grid coordinate value */\nexport type Coordinate = number;\n\n/** Coordinates of a box */\nexport type BoxCoordinates = {\n x1: Coordinate;\n y1: Coordinate;\n x2: Coordinate;\n y2: Coordinate;\n};\n\n/** The visible index of the item, eg. after moves are applied */\nexport type VisibleIndex = number;\n\n/** The model index of the item, eg. moves are not applied */\nexport type ModelIndex = number;\n\n/** Map from an item index to it's coordinate */\nexport type CoordinateMap = Map<VisibleIndex, Coordinate>;\n\n/** Map from an item index to it's size */\nexport type SizeMap = Map<VisibleIndex, number>;\n\n/** Map from a ModelIndex to it's size */\nexport type ModelSizeMap = Map<ModelIndex, number>;\n\n/** Map from visible Index to ModelIndex */\nexport type VisibleToModelMap = Map<VisibleIndex, ModelIndex>;\n\n/** Represents a move operation from one index to another */\nexport type MoveOperation = {\n from: VisibleIndex | BoundedAxisRange;\n to: VisibleIndex;\n};\n\nexport type GridMetrics = {\n // Row/Column metrics from model\n rowHeight: number;\n rowHeaderWidth: number;\n rowFooterWidth: number;\n rowCount: number;\n columnWidth: number;\n columnCount: number;\n columnHeaderHeight: number;\n\n // Floating row and column counts\n floatingTopRowCount: number;\n floatingBottomRowCount: number;\n floatingLeftColumnCount: number;\n floatingRightColumnCount: number;\n\n // The grid offset from the top left\n gridX: Coordinate;\n gridY: Coordinate;\n\n // Index of non-hidden row/columns\n firstRow: VisibleIndex;\n firstColumn: VisibleIndex;\n\n // The amount of padding for tree (if applicable)\n treePaddingX: number;\n treePaddingY: number;\n\n // What viewport is currently visible, limited by data size\n /**\n * The visible index of the left-most column that is at least partially visible.\n */\n left: VisibleIndex;\n /**\n * The visible index of the top row that is at least partially visible.\n */\n top: VisibleIndex;\n /**\n * The visible index of the bottom row that is at least partially visible.\n */\n bottom: VisibleIndex;\n /**\n * The visible index of the right-most column that is at least partially visible.\n */\n right: VisibleIndex;\n topOffset: Coordinate;\n leftOffset: Coordinate;\n\n // Bottom and right that are fully visible, not overlapped by scroll bars or anything\n topVisible: VisibleIndex;\n leftVisible: VisibleIndex;\n bottomVisible: VisibleIndex;\n rightVisible: VisibleIndex;\n\n // Bottom and right of the viewport, not limited by data size\n bottomViewport: VisibleIndex;\n rightViewport: VisibleIndex;\n\n // Canvas width/height\n width: number;\n height: number;\n\n // Max x/y coordinate of the grid (does not include headers)\n maxX: Coordinate;\n maxY: Coordinate;\n\n // Last valid column/row that can be the left/top of the grid\n lastLeft: VisibleIndex;\n lastTop: VisibleIndex;\n\n // Scroll bar metrics\n barHeight: number;\n barTop: number; // Relative to canvas dimensions\n barWidth: number;\n barLeft: number; // Relative to canvas dimensions\n handleHeight: number;\n handleWidth: number;\n hasHorizontalBar: boolean;\n hasVerticalBar: boolean;\n verticalBarWidth: number;\n horizontalBarHeight: number;\n\n // The vertical x/y scroll amount\n scrollX: number;\n scrollY: number;\n\n // The size of all known content in the scrollable area\n scrollableContentWidth: number;\n scrollableContentHeight: number;\n\n // The visible space for scrollable content to display\n scrollableViewportWidth: number;\n scrollableViewportHeight: number;\n\n // Array of visible (i.e., in the viewport) rows/columns, by VisibleIndex\n visibleRows: readonly VisibleIndex[];\n visibleColumns: readonly VisibleIndex[];\n\n // Renderer performance optimization - array of visible, non-hidden columns, by VisibleIndex\n // Use visibleColumns if hidden columns should be included (e.g. rendering column headers)\n columnsForRender: readonly VisibleIndex[];\n\n // Map of the height/width of visible rows/columns\n visibleRowHeights: SizeMap;\n visibleColumnWidths: SizeMap;\n\n // Array of floating rows/columns, by grid index\n floatingRows: readonly VisibleIndex[];\n floatingColumns: readonly VisibleIndex[];\n\n // Array of all rows/columns, visible and floating, by grid index\n allRows: readonly VisibleIndex[];\n allColumns: readonly VisibleIndex[];\n\n // Map of the height/width of all rows/columns, visible and floating\n allRowHeights: SizeMap;\n allColumnWidths: SizeMap;\n\n // Floating metrics\n floatingTopHeight: number;\n floatingBottomHeight: number;\n floatingLeftWidth: number;\n floatingRightWidth: number;\n\n // Map of the X/Y coordinates of the visible rows/columns, from the top left of the grid\n visibleRowYs: CoordinateMap;\n visibleColumnXs: CoordinateMap;\n\n // Map of the X/Y coordinates of all rows/columns, visible and floating, from the top left of the grid\n allRowYs: CoordinateMap;\n allColumnXs: CoordinateMap;\n\n // The boxes user can click on for expanding/collapsing tree rows\n visibleRowTreeBoxes: Map<VisibleIndex, BoxCoordinates>;\n\n // Mapping from visible row indexes to the model row/columns they pull from\n modelRows: VisibleToModelMap;\n modelColumns: VisibleToModelMap;\n\n movedRows: readonly MoveOperation[];\n movedColumns: readonly MoveOperation[];\n\n // Map of the width of the fonts\n fontWidthsLower: Map<string, number>;\n fontWidthsUpper: Map<string, number>;\n\n // Map of user set column/row width/height\n userColumnWidths: ModelSizeMap;\n userRowHeights: ModelSizeMap;\n\n // Map of calculated row/column height/width\n calculatedRowHeights: ModelSizeMap;\n calculatedColumnWidths: ModelSizeMap;\n\n // Map of calculated row/column height/width without caching largest value\n contentColumnWidths: ModelSizeMap;\n contentRowHeights: ModelSizeMap;\n\n // Max depth of column headers. Depth of 1 for a table without column groups\n columnHeaderMaxDepth: number;\n};\n\nexport default GridMetrics;\n"],"mappings":"","ignoreList":[]}
|
package/dist/GridRenderer.js
CHANGED
|
@@ -190,7 +190,7 @@ export class GridRenderer {
|
|
|
190
190
|
floatingBottomRowCount,
|
|
191
191
|
floatingRows,
|
|
192
192
|
rowCount,
|
|
193
|
-
|
|
193
|
+
columnsForRender,
|
|
194
194
|
allRowYs,
|
|
195
195
|
allRowHeights
|
|
196
196
|
} = metrics;
|
|
@@ -203,8 +203,8 @@ export class GridRenderer {
|
|
|
203
203
|
if (draggingRow == null && draggingColumn == null) {
|
|
204
204
|
this.drawFloatingMouseRowHover(context, state);
|
|
205
205
|
}
|
|
206
|
-
this.drawGridLinesForItems(context, state,
|
|
207
|
-
this.drawCellBackgroundsForItems(context, state,
|
|
206
|
+
this.drawGridLinesForItems(context, state, columnsForRender, floatingRows, theme.floatingGridColumnColor, theme.floatingGridRowColor);
|
|
207
|
+
this.drawCellBackgroundsForItems(context, state, columnsForRender, floatingRows);
|
|
208
208
|
this.drawFloatingBorders(context, state);
|
|
209
209
|
|
|
210
210
|
// Draw the floating row selection...
|
|
@@ -225,8 +225,8 @@ export class GridRenderer {
|
|
|
225
225
|
}
|
|
226
226
|
|
|
227
227
|
// Draw the cell content...
|
|
228
|
-
for (var c = 0; c <
|
|
229
|
-
var column =
|
|
228
|
+
for (var c = 0; c < columnsForRender.length; c += 1) {
|
|
229
|
+
var column = columnsForRender[c];
|
|
230
230
|
for (var r = 0; r < floatingRows.length; r += 1) {
|
|
231
231
|
var row = floatingRows[r];
|
|
232
232
|
this.drawCellContent(context, state, column, row);
|
|
@@ -627,10 +627,10 @@ export class GridRenderer {
|
|
|
627
627
|
theme
|
|
628
628
|
} = state;
|
|
629
629
|
var {
|
|
630
|
-
|
|
630
|
+
columnsForRender,
|
|
631
631
|
visibleRows
|
|
632
632
|
} = metrics;
|
|
633
|
-
this.drawGridLinesForItems(context, state,
|
|
633
|
+
this.drawGridLinesForItems(context, state, columnsForRender, visibleRows, theme.gridColumnColor, theme.gridRowColor);
|
|
634
634
|
}
|
|
635
635
|
drawGridLinesForItems(context, state, columns, rows, columnColor, rowColor) {
|
|
636
636
|
if (columnColor == null && rowColor == null) {
|
|
@@ -686,10 +686,10 @@ export class GridRenderer {
|
|
|
686
686
|
metrics
|
|
687
687
|
} = state;
|
|
688
688
|
var {
|
|
689
|
-
|
|
689
|
+
columnsForRender,
|
|
690
690
|
visibleRows
|
|
691
691
|
} = metrics;
|
|
692
|
-
this.drawCellBackgroundsForItems(context, state,
|
|
692
|
+
this.drawCellBackgroundsForItems(context, state, columnsForRender, visibleRows);
|
|
693
693
|
}
|
|
694
694
|
drawCellBackgroundsForItems(context, state, columns, rows) {
|
|
695
695
|
context.save();
|
|
@@ -740,10 +740,10 @@ export class GridRenderer {
|
|
|
740
740
|
metrics
|
|
741
741
|
} = state;
|
|
742
742
|
var {
|
|
743
|
-
|
|
743
|
+
columnsForRender
|
|
744
744
|
} = metrics;
|
|
745
|
-
for (var i = 0; i <
|
|
746
|
-
var column =
|
|
745
|
+
for (var i = 0; i < columnsForRender.length; i += 1) {
|
|
746
|
+
var column = columnsForRender[i];
|
|
747
747
|
this.drawColumnCellContents(context, state, column);
|
|
748
748
|
}
|
|
749
749
|
}
|