@deephaven/grid 0.72.1-beta.4 → 0.72.1-core-plugins.9
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/DeletableGridModel.d.ts +31 -0
- package/dist/DeletableGridModel.d.ts.map +1 -0
- package/dist/DeletableGridModel.js +14 -0
- package/dist/DeletableGridModel.js.map +1 -0
- package/dist/GridMetricCalculator.d.ts.map +1 -1
- package/dist/GridMetricCalculator.js +3 -0
- package/dist/GridMetricCalculator.js.map +1 -1
- package/dist/GridRenderer.d.ts +14 -3
- package/dist/GridRenderer.d.ts.map +1 -1
- package/dist/GridRenderer.js +45 -24
- package/dist/GridRenderer.js.map +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/mouse-handlers/GridColumnMoveMouseHandler.d.ts.map +1 -1
- package/dist/mouse-handlers/GridColumnMoveMouseHandler.js +14 -10
- package/dist/mouse-handlers/GridColumnMoveMouseHandler.js.map +1 -1
- package/dist/mouse-handlers/GridSeparatorMouseHandler.d.ts.map +1 -1
- package/dist/mouse-handlers/GridSeparatorMouseHandler.js +7 -6
- package/dist/mouse-handlers/GridSeparatorMouseHandler.js.map +1 -1
- package/package.json +3 -3
package/dist/GridRenderer.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/// <reference types="memoizee" />
|
|
2
|
+
import { ColorUtils } from '@deephaven/utils';
|
|
2
3
|
import { GridColor, GridColorWay, NullableGridColor } from './GridTheme';
|
|
3
4
|
import { Coordinate, VisibleIndex } from './GridMetrics';
|
|
4
5
|
import { BoundedAxisRange } from './GridAxisRange';
|
|
@@ -45,6 +46,19 @@ export declare class GridRenderer {
|
|
|
45
46
|
* @returns The truncated string that fits within the width provided
|
|
46
47
|
*/
|
|
47
48
|
static truncateToWidth(context: CanvasRenderingContext2D, str: string, width: number, fontWidth?: number, truncationChar?: string): string;
|
|
49
|
+
/**
|
|
50
|
+
* Cache shared between all grids. Often grids will have the same theme/colors, so we should share the cache.
|
|
51
|
+
*/
|
|
52
|
+
static getCachedBackgroundColors: ((backgroundColors: GridColorWay, maxDepth: number) => GridColor[][]) & import("@types/memoizee").Memoized<(backgroundColors: GridColorWay, maxDepth: number) => GridColor[][]>;
|
|
53
|
+
/**
|
|
54
|
+
* A memoized version of the GridColorUtils.colorWithAlpha function.
|
|
55
|
+
*/
|
|
56
|
+
static getCachedColorWithAlpha: typeof import("./GridColorUtils").colorWithAlpha & import("@types/memoizee").Memoized<typeof import("./GridColorUtils").colorWithAlpha>;
|
|
57
|
+
/**
|
|
58
|
+
* A memoized version of the ColorUtils.isDark function.
|
|
59
|
+
* ColorUtils.isDark is a very expensive function, and having a shared cache between all grids is a good idea.
|
|
60
|
+
*/
|
|
61
|
+
static getCachedColorIsDark: typeof ColorUtils.isDark & import("@types/memoizee").Memoized<typeof ColorUtils.isDark>;
|
|
48
62
|
/**
|
|
49
63
|
* Draw the grid canvas with the state provided
|
|
50
64
|
* @param state The state of the grid
|
|
@@ -75,9 +89,6 @@ export declare class GridRenderer {
|
|
|
75
89
|
drawCellContent(context: CanvasRenderingContext2D, state: GridRenderState, column: VisibleIndex, row: VisibleIndex): void;
|
|
76
90
|
getCellRenderer(renderType: CellRenderType): CellRenderer;
|
|
77
91
|
drawCellRowTreeDepthLines(context: CanvasRenderingContext2D, state: GridRenderState, row: VisibleIndex, rowAfter?: VisibleIndex): void;
|
|
78
|
-
getCachedBackgroundColors: ((backgroundColors: GridColorWay, maxDepth: number) => GridColor[][]) & import("@types/memoizee").Memoized<(backgroundColors: GridColorWay, maxDepth: number) => GridColor[][]>;
|
|
79
|
-
getCachedColorWithAlpha: ((color: string, alpha: number) => string) & import("@types/memoizee").Memoized<(color: string, alpha: number) => string>;
|
|
80
|
-
getCachedColorIsDark: ((color: string) => boolean) & import("@types/memoizee").Memoized<(color: string) => boolean>;
|
|
81
92
|
drawHeaders(context: CanvasRenderingContext2D, state: GridRenderState): void;
|
|
82
93
|
drawFooters(context: CanvasRenderingContext2D, state: GridRenderState): void;
|
|
83
94
|
drawColumnHeaders(context: CanvasRenderingContext2D, state: GridRenderState): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GridRenderer.d.ts","sourceRoot":"","sources":["../src/GridRenderer.ts"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"GridRenderer.d.ts","sourceRoot":"","sources":["../src/GridRenderer.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,UAAU,EAAc,MAAM,kBAAkB,CAAC;AAK1D,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AACzE,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAGzD,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,EAAsB,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAC1E,OAAO,YAAY,EAAE,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAC9D,OAAO,mBAAmB,MAAM,uBAAuB,CAAC;AACxD,OAAO,gBAAgB,MAAM,oBAAoB,CAAC;AASlD;;;;GAIG;AACH,qBAAa,YAAY;IAEvB,MAAM,CAAC,mBAAmB,SAAK;IAE/B,SAAS,CAAC,gBAAgB,mBAA0B;IAEpD,SAAS,CAAC,mBAAmB,sBAA6B;IAE1D;;;;;OAKG;IACH,MAAM,CAAC,QAAQ,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM;IAQjD;;;;;;;;;OASG;IACH,MAAM,CAAC,qBAAqB,CAC1B,OAAO,EAAE,wBAAwB,EACjC,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,MAAM,EACb,KAAK,SAAI,EACT,GAAG,SAAa,EAChB,cAAc,CAAC,EAAE,MAAM,GACtB,MAAM;IAuCT;;;;;;;;;;OAUG;IAC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B,EACjC,KAAK,EAAE,eAAe,EACtB,MAAM,EAAE,YAAY,EACpB,GAAG,EAAE,YAAY,GAChB,IAAI;IAyCP;;;;;;;;;OASG;IACH,eAAe,CACb,OAAO,EAAE,wBAAwB,EACjC,CAAC,EAAE,UAAU,EACb,CAAC,EAAE,UAAU,EACb,CAAC,EAAE,MAAM,EACT,CAAC,EAAE,MAAM,EACT,CAAC,SAAmC,GACnC,IAAI;IAcP,kBAAkB,CAChB,OAAO,EAAE,wBAAwB,EACjC,KAAK,EAAE,eAAe,GACrB,IAAI;IAiJP,eAAe,CACb,OAAO,EAAE,wBAAwB,EACjC,KAAK,EAAE,eAAe,GACrB,IAAI;IA+DP,cAAc,CACZ,OAAO,EAAE,wBAAwB,EACjC,KAAK,EAAE,eAAe,GACrB,IAAI;CAgUR;AAED,eAAe,YAAY,CAAC"}
|
package/dist/GridRenderer.js
CHANGED
|
@@ -24,21 +24,6 @@ export class GridRenderer {
|
|
|
24
24
|
constructor() {
|
|
25
25
|
_defineProperty(this, "textCellRenderer", new TextCellRenderer());
|
|
26
26
|
_defineProperty(this, "dataBarCellRenderer", new DataBarCellRenderer());
|
|
27
|
-
_defineProperty(this, "getCachedBackgroundColors", memoizeClear((backgroundColors, maxDepth) => backgroundColors.split(' ').map(color => {
|
|
28
|
-
var colors = [];
|
|
29
|
-
for (var i = 0; i < maxDepth; i += 1) {
|
|
30
|
-
colors.push(GridColorUtils.darkenForDepth(color, i, maxDepth));
|
|
31
|
-
}
|
|
32
|
-
return colors;
|
|
33
|
-
}), {
|
|
34
|
-
max: 1000
|
|
35
|
-
}));
|
|
36
|
-
_defineProperty(this, "getCachedColorWithAlpha", memoizeClear((color, alpha) => GridColorUtils.colorWithAlpha(color, alpha), {
|
|
37
|
-
max: 1000
|
|
38
|
-
}));
|
|
39
|
-
_defineProperty(this, "getCachedColorIsDark", memoizeClear(color => ColorUtils.isDark(color), {
|
|
40
|
-
max: 1000
|
|
41
|
-
}));
|
|
42
27
|
} // Default radius in pixels for corners for some elements (like the active cell)
|
|
43
28
|
/**
|
|
44
29
|
* Truncate a string to the specified length and add ellipses if necessary
|
|
@@ -129,6 +114,19 @@ export class GridRenderer {
|
|
|
129
114
|
return GridRenderer.binaryTruncateToWidth(context, str, width, lo, hi, truncationChar);
|
|
130
115
|
}
|
|
131
116
|
|
|
117
|
+
/**
|
|
118
|
+
* Cache shared between all grids. Often grids will have the same theme/colors, so we should share the cache.
|
|
119
|
+
*/
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* A memoized version of the GridColorUtils.colorWithAlpha function.
|
|
123
|
+
*/
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* A memoized version of the ColorUtils.isDark function.
|
|
127
|
+
* ColorUtils.isDark is a very expensive function, and having a shared cache between all grids is a good idea.
|
|
128
|
+
*/
|
|
129
|
+
|
|
132
130
|
/**
|
|
133
131
|
* Draw the grid canvas with the state provided
|
|
134
132
|
* @param state The state of the grid
|
|
@@ -447,7 +445,7 @@ export class GridRenderer {
|
|
|
447
445
|
shadowColor,
|
|
448
446
|
shadowAlpha
|
|
449
447
|
} = theme;
|
|
450
|
-
var colorSets =
|
|
448
|
+
var colorSets = GridRenderer.getCachedBackgroundColors(rowBackgroundColors, maxDepth);
|
|
451
449
|
var {
|
|
452
450
|
allRowYs,
|
|
453
451
|
allRowHeights
|
|
@@ -494,8 +492,8 @@ export class GridRenderer {
|
|
|
494
492
|
});
|
|
495
493
|
if (topShadowRows.length > 0) {
|
|
496
494
|
context.save();
|
|
497
|
-
var startColor =
|
|
498
|
-
var endColor =
|
|
495
|
+
var startColor = GridRenderer.getCachedColorWithAlpha(shadowColor, shadowAlpha);
|
|
496
|
+
var endColor = GridRenderer.getCachedColorWithAlpha(shadowColor, 0);
|
|
499
497
|
var gradient = context.createLinearGradient(0, 0, 0, shadowBlur);
|
|
500
498
|
gradient.addColorStop(0, startColor);
|
|
501
499
|
gradient.addColorStop(1, endColor);
|
|
@@ -512,8 +510,8 @@ export class GridRenderer {
|
|
|
512
510
|
}
|
|
513
511
|
if (bottomShadowRows.length > 0) {
|
|
514
512
|
context.save();
|
|
515
|
-
var _startColor =
|
|
516
|
-
var _endColor =
|
|
513
|
+
var _startColor = GridRenderer.getCachedColorWithAlpha(shadowColor, 0);
|
|
514
|
+
var _endColor = GridRenderer.getCachedColorWithAlpha(shadowColor, shadowAlpha);
|
|
517
515
|
var _gradient = context.createLinearGradient(0, 0, 0, shadowBlur);
|
|
518
516
|
_gradient.addColorStop(0, _startColor);
|
|
519
517
|
_gradient.addColorStop(1, _endColor);
|
|
@@ -1168,8 +1166,8 @@ export class GridRenderer {
|
|
|
1168
1166
|
textColor = headerColor
|
|
1169
1167
|
} = style !== null && style !== void 0 ? style : {};
|
|
1170
1168
|
try {
|
|
1171
|
-
var isDarkBackground =
|
|
1172
|
-
var isDarkText =
|
|
1169
|
+
var isDarkBackground = GridRenderer.getCachedColorIsDark(backgroundColor);
|
|
1170
|
+
var isDarkText = GridRenderer.getCachedColorIsDark(textColor);
|
|
1173
1171
|
if (isDarkBackground && isDarkText) {
|
|
1174
1172
|
textColor = white;
|
|
1175
1173
|
} else if (!isDarkBackground && !isDarkText) {
|
|
@@ -1771,7 +1769,10 @@ export class GridRenderer {
|
|
|
1771
1769
|
context.beginPath();
|
|
1772
1770
|
context.rect(draggingColumn.left, columnHeaderOffset, draggingColumn.width + 1, height);
|
|
1773
1771
|
context.clip();
|
|
1774
|
-
|
|
1772
|
+
|
|
1773
|
+
// The header drawing functions expect the context to be at the edge of the canvas
|
|
1774
|
+
// We offset it by how much the user has dragged
|
|
1775
|
+
context.translate(draggingLeft - originalLeft - gridX, 0);
|
|
1775
1776
|
context.font = headerFont;
|
|
1776
1777
|
var visibleColumns = [];
|
|
1777
1778
|
for (var i = draggingColumn.range[0]; i <= draggingColumn.range[1]; i += 1) {
|
|
@@ -1789,9 +1790,14 @@ export class GridRenderer {
|
|
|
1789
1790
|
minX: originalLeft,
|
|
1790
1791
|
maxX: width
|
|
1791
1792
|
});
|
|
1792
|
-
|
|
1793
|
+
|
|
1794
|
+
// Now move to the edge of the "grid" (top-left of top-left cell). We then draw the
|
|
1795
|
+
// grid background, but only the clipped region will be drawn where the dragging column is.
|
|
1796
|
+
context.translate(gridX, gridY);
|
|
1793
1797
|
context.font = font;
|
|
1794
1798
|
this.drawGridBackground(context, state);
|
|
1799
|
+
|
|
1800
|
+
// Then draw the contents of the column that is being dragged
|
|
1795
1801
|
for (var _i9 = startIndex; _i9 <= endIndex; _i9 += 1) {
|
|
1796
1802
|
this.drawColumnCellContents(context, state, _i9);
|
|
1797
1803
|
}
|
|
@@ -2044,5 +2050,20 @@ export class GridRenderer {
|
|
|
2044
2050
|
}
|
|
2045
2051
|
}
|
|
2046
2052
|
_defineProperty(GridRenderer, "DEFAULT_EDGE_RADIUS", 2);
|
|
2053
|
+
_defineProperty(GridRenderer, "getCachedBackgroundColors", memoizeClear((backgroundColors, maxDepth) => backgroundColors.split(' ').map(color => {
|
|
2054
|
+
var colors = [];
|
|
2055
|
+
for (var i = 0; i < maxDepth; i += 1) {
|
|
2056
|
+
colors.push(GridColorUtils.darkenForDepth(color, i, maxDepth));
|
|
2057
|
+
}
|
|
2058
|
+
return colors;
|
|
2059
|
+
}), {
|
|
2060
|
+
max: 1000
|
|
2061
|
+
}));
|
|
2062
|
+
_defineProperty(GridRenderer, "getCachedColorWithAlpha", memoizeClear(GridColorUtils.colorWithAlpha, {
|
|
2063
|
+
max: 1000
|
|
2064
|
+
}));
|
|
2065
|
+
_defineProperty(GridRenderer, "getCachedColorIsDark", memoizeClear(ColorUtils.isDark, {
|
|
2066
|
+
max: 1000
|
|
2067
|
+
}));
|
|
2047
2068
|
export default GridRenderer;
|
|
2048
2069
|
//# sourceMappingURL=GridRenderer.js.map
|