@@ -231,24 +231,21 @@ Polymer({
231231 return positionMode === 'scatter' ;
232232 } ,
233233
234- _isKeyNumeric ( this : any , key : string ) : boolean {
234+ _isKeyNumeric : function ( this : any , key : string ) : boolean {
235235 return this . stats && ( key in this . stats ) && this . stats [ key ] . isNumeric ( ) ;
236236 } ,
237237
238- _isKeyCategorical ( this : any , key : string ) : boolean {
238+ _isKeyCategorical : function ( this : any , key : string ) : boolean {
239239 return this . stats && ( key in this . stats ) && ! this . stats [ key ] . isNumeric ( ) ;
240240 } ,
241241
242242 _updateCSSVars ( this : any ) {
243- this . customStyle [ '--grid-faceting-vertical-label-color' ] =
244- this . gridFacetingVerticalLabelColor ;
245- this . customStyle [ '--grid-faceting-horizontal-label-color' ] =
246- this . gridFacetingHorizontalLabelColor ;
247- this . customStyle [ '--item-positioning-vertical-label-color' ] =
248- this . itemPositioningVerticalLabelColor ;
249- this . customStyle [ '--item-positioning-horizontal-label-color' ] =
250- this . itemPositioningHorizontalLabelColor ;
251- this . updateStyles ( ) ;
243+ this . updateStyles ( {
244+ '--grid-faceting-vertical-label-color' : this . gridFacetingVerticalLabelColor ,
245+ '--grid-faceting-horizontal-label-color' : this . gridFacetingHorizontalLabelColor ,
246+ '--item-positioning-vertical-label-color' : this . itemPositioningVerticalLabelColor ,
247+ '--item-positioning-horizontal-label-color' : this . itemPositioningHorizontalLabelColor
248+ } ) ;
252249 } ,
253250
254251 /**
@@ -263,7 +260,7 @@ Polymer({
263260 */
264261 _maxBuckets ( this : any , fieldName : string , bagOfWords : boolean ) : number {
265262 const defaultMax = 100 ;
266- const fieldStats : FieldStats = this . stats [ fieldName ] ;
263+ const fieldStats : FieldStats = this . stats ? this . stats [ fieldName ] : null ;
267264 if ( ! fieldStats ) {
268265 return defaultMax ;
269266 }
@@ -276,8 +273,8 @@ Polymer({
276273 /**
277274 * Return whether the chosen field has a usable word tree.
278275 */
279- _hasWordTree ( this : any , fieldName : string ) : boolean {
280- const fieldStats : FieldStats = this . stats [ fieldName ] ;
276+ _hasWordTree : function ( this : any , fieldName : string ) : boolean {
277+ const fieldStats : FieldStats = this . stats ? this . stats [ fieldName ] : null ;
281278 return ! ! fieldStats && ! ! fieldStats . wordTree &&
282279 fieldStats . wordTree . highestLevel > 1 ;
283280 } ,
0 commit comments