File tree Expand file tree Collapse file tree 2 files changed +14
-14
lines changed Expand file tree Collapse file tree 2 files changed +14
-14
lines changed Original file line number Diff line number Diff line change @@ -53,14 +53,14 @@ export function toChannelOption(
53
53
return isDataRecord ( channel )
54
54
? ( channel as ChannelOptions )
55
55
: {
56
- value : channel ,
57
- scale :
58
- ( ! isPositionScale && ! isOpacityScale && typeof channel === 'number' ) ||
59
- typeof channel === 'undefined'
60
- ? null
61
- : CHANNEL_SCALE [ name ] ,
62
- channel : null
63
- } ;
56
+ value : channel ,
57
+ scale :
58
+ ( ! isPositionScale && ! isOpacityScale && typeof channel === 'number' ) ||
59
+ typeof channel === 'undefined'
60
+ ? null
61
+ : CHANNEL_SCALE [ name ] ,
62
+ channel : null
63
+ } ;
64
64
}
65
65
66
66
export function resolveChannel (
@@ -95,7 +95,7 @@ function resolve(
95
95
// so we're passing the original value to accessor functions instead of our wrapped record
96
96
return accessor ( datum . ___orig___ != null ? datum . ___orig___ : datum ) ;
97
97
// use accessor string
98
- if ( typeof accessor === 'string' && datum [ accessor ] !== undefined ) return datum [ accessor ] ;
98
+ if ( ( typeof accessor === 'string' || typeof accessor === 'symbol' ) && datum [ accessor ] !== undefined ) return datum [ accessor ] ;
99
99
// fallback to channel name as accessor
100
100
if ( accessor === null && datum [ channel ] !== undefined ) return datum [ channel ] ;
101
101
return isRawValue ( accessor ) ? accessor : null ;
@@ -110,10 +110,10 @@ function resolve(
110
110
return typeof accessor === 'function'
111
111
? accessor ( datum )
112
112
: accessor !== null && isRawValue ( accessor )
113
- ? accessor
114
- : ! Array . isArray ( datum ) && ( scale === 'x' || scale === 'y' )
115
- ? datum
116
- : null ;
113
+ ? accessor
114
+ : ! Array . isArray ( datum ) && ( scale === 'x' || scale === 'y' )
115
+ ? datum
116
+ : null ;
117
117
}
118
118
}
119
119
Original file line number Diff line number Diff line change @@ -93,7 +93,7 @@ export type ScaledChannelName =
93
93
94
94
export type ChannelName = ScaledChannelName | 'z' | 'sort' | 'filter' | 'interval' ;
95
95
96
- export type RawValue = number | Date | boolean | string ;
96
+ export type RawValue = number | Date | boolean | string | symbol ;
97
97
98
98
export type ScaleOptions = {
99
99
/**
You can’t perform that action at this time.
0 commit comments