@@ -4,9 +4,9 @@ import { useConfig } from '../../hooks/useConfig.js'
44import { cn } from '../../lib/utils.js'
55import ContentWrapper from '../ContentWrapper/ContentWrapper.js'
66import Json from '../Json/Json.js'
7+ import jsonStyles from '../Json/Json.module.css'
78import SlideCloseButton from '../SlideCloseButton/SlideCloseButton.js'
89import styles from '../TextView/TextView.module.css'
9- import jsonStyles from '../Json/Json.module.css'
1010
1111interface ViewerProps {
1212 df : DataFrame
@@ -29,21 +29,17 @@ export default function CellPanel({ df, row, col, setProgress, setError, onClose
2929 async function loadCellData ( ) {
3030 try {
3131 setProgress ( 0.5 )
32- const asyncRows = df . rows ( { start : row , end : row + 1 } )
33- if ( asyncRows . length > 1 || ! ( 0 in asyncRows ) ) {
34- throw new Error ( `Expected 1 row, got ${ asyncRows . length } ` )
35- }
36- const asyncRow = asyncRows [ 0 ]
37- // Await cell data
32+
3833 const columnName = df . header [ col ]
3934 if ( columnName === undefined ) {
4035 throw new Error ( `Column name missing at index col=${ col } ` )
4136 }
42- const asyncCell = asyncRow . cells [ columnName ]
43- if ( asyncCell === undefined ) {
44- throw new Error ( `Cell missing at column ${ columnName } ` )
37+ await df . fetch ( { rowStart : row , rowEnd : row + 1 , columns : [ columnName ] } )
38+ const cell = df . getCell ( { row, column : columnName } )
39+ if ( cell === undefined ) {
40+ throw new Error ( `Cell at row=${ row } , col=${ col } is undefined` )
4541 }
46- const value : unknown = await asyncCell
42+ const value : unknown = await cell . value
4743 if ( value instanceof Object && ! ( value instanceof Date ) ) {
4844 setContent (
4945 < code className = { cn ( jsonStyles . jsonView , customClass ?. jsonView ) } >
0 commit comments