Skip to content

Commit 5a8cfc7

Browse files
Koladata Teamcopybara-github
authored andcommitted
Expand click area to focus MultiDimTable detail pane and add hover styles for interactive details.
PiperOrigin-RevId: 892617887 Change-Id: I44c97a4209f07946d9f622676860fb2bec229000
1 parent b257d6a commit 5a8cfc7

File tree

3 files changed

+18
-8
lines changed

3 files changed

+18
-8
lines changed

py/koladata/ext/vis.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -836,6 +836,20 @@ def visualize_slice(
836836
border: 1px solid var(--emphasized-border-color, gray);
837837
}
838838
839+
.attr:hover,
840+
.object-id:hover,
841+
.limited:hover {
842+
background-color: color-mix(in srgb, currentcolor, transparent 85%);
843+
border-radius: 2px;
844+
}
845+
846+
.truncated:hover {
847+
background-color: color-mix(
848+
in srgb,
849+
var(--emphasized-background-color, whitesmoke),
850+
currentcolor 10%);
851+
}
852+
839853
.attr:active,
840854
.object-id:active,
841855
.truncated:active,

ts/multi_dim_table.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -460,11 +460,11 @@ export class MultiDimTable
460460
dimNav.scrollLeft = existingScrollLeft;
461461

462462
dataRegionParts.detailPane.addEventListener('click', (e: MouseEvent) => {
463-
const {target} = e;
464-
if (target instanceof HTMLSlotElement) {
463+
const slot = e.composedPath().find(el => el instanceof HTMLSlotElement);
464+
if (slot) {
465465
// Handle a click to scroll to a cell based on the detail pane.
466-
const row = Number(target.dataset['row']);
467-
const col = Number(target.dataset['col']);
466+
const row = Number(slot.dataset['row']);
467+
const col = Number(slot.dataset['col']);
468468
this.focusDataCell(row, col);
469469
this.suppressLoadRequests = 1;
470470
this.scrollToIndex(col + this.loadedRange[0]);

ts/multi_dim_table_style.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -150,10 +150,6 @@ export function shadow() {
150150
position: relative;
151151
}
152152
153-
slot::slotted(*) {
154-
cursor: default;
155-
}
156-
157153
/* No pointer when there is only one element. */
158154
slot:first-child:last-child {
159155
cursor: default;

0 commit comments

Comments
 (0)