@@ -53,7 +53,7 @@ export class VariableExplorer extends React.Component<IVariableExplorerProps, IV
5353 const  columns  =  [ 
5454 { key : 'name' ,  name : getLocString ( 'DataScience.variableExplorerNameColumn' ,  'Name' ) ,  type : 'string' ,  width : 120 ,  formatter : < VariableExplorerCellFormatter  cellStyle = { CellStyle . variable }  /> } , 
5555 { key : 'type' ,  name : getLocString ( 'DataScience.variableExplorerTypeColumn' ,  'Type' ) ,  type : 'string' ,  width : 120 } , 
56-  { key : 'size' ,  name : getLocString ( 'DataScience.variableExplorerSizeColumn' ,  'Size ' ) ,  type : 'number ' ,  width : 120 ,  formatter : < VariableExplorerCellFormatter  cellStyle = { CellStyle . numeric }  /> } , 
56+  { key : 'size' ,  name : getLocString ( 'DataScience.variableExplorerSizeColumn' ,  'Count ' ) ,  type : 'string ' ,  width : 120 ,  formatter : < VariableExplorerCellFormatter  cellStyle = { CellStyle . numeric }  /> } , 
5757 { key : 'value' ,  name : getLocString ( 'DataScience.variableExplorerValueColumn' ,  'Value' ) ,  type : 'string' ,  width : 300 } , 
5858 { key : 'buttons' ,  name : '' ,  type : 'boolean' ,  width : 34 ,  formatter : < VariableExplorerButtonCellFormatter  showDataExplorer = { this . props . showDataExplorer }  baseTheme = { this . props . baseTheme }  />  } 
5959 ] ; 
@@ -125,7 +125,7 @@ export class VariableExplorer extends React.Component<IVariableExplorerProps, IV
125125 // Help to keep us independent of main history window state if we choose to break out the variable explorer 
126126 public  newVariablesData ( newVariables : IJupyterVariable [ ] )  { 
127127 const  newGridRows  =  newVariables . map ( newVar  =>  { 
128-  return  {  buttons : { name : newVar . name ,  supportsDataExplorer : newVar . supportsDataExplorer } ,  name : newVar . name ,  type : newVar . type ,  size : newVar . size ,  value : getLocString ( 'DataScience.variableLoadingValue' ,  'Loading...' ) } ; 
128+  return  {  buttons : { name : newVar . name ,  supportsDataExplorer : newVar . supportsDataExplorer } ,  name : newVar . name ,  type : newVar . type ,  size : '' ,  value : getLocString ( 'DataScience.variableLoadingValue' ,  'Loading...' ) } ; 
129129 } ) ; 
130130
131131 this . setState ( {  gridRows : newGridRows } ) ; 
@@ -136,7 +136,19 @@ export class VariableExplorer extends React.Component<IVariableExplorerProps, IV
136136 const  newGridRows  =  this . state . gridRows . slice ( ) ; 
137137 for  ( let  i  =  0 ;  i  <  newGridRows . length ;  i  =  i  +  1 )  { 
138138 if  ( newGridRows [ i ] . name  ===  newVariable . name )  { 
139-  const  newGridRow  =  { ...newGridRows [ i ] ,  value : newVariable . value } ; 
139+ 
140+  // For object with shape, use that for size 
141+  // for object with length use that for size 
142+  // If it doesn't have either, then just leave it out 
143+  let  newSize  =  '' ; 
144+  if  ( newVariable . shape  &&  newVariable . shape  !==  '' )  { 
145+  newSize  =  newVariable . shape ; 
146+  }  else  if  ( newVariable . count )  { 
147+  newSize  =  newVariable . count . toString ( ) ; 
148+  } 
149+ 
150+  const  newGridRow  =  { ...newGridRows [ i ] ,  value : newVariable . value ,  size : newSize } ; 
151+ 
140152 newGridRows [ i ]  =  newGridRow ; 
141153 } 
142154 } 
0 commit comments