@@ -26,8 +26,13 @@ export class UnconnectedDataSelector extends Component {
2626 this . dataSourceOptions = context . dataSourceOptions || [ ] ;
2727
2828 this . srcAttr = props . attr + 'src' ;
29- this . srcProperty = nestedProperty ( props . container , this . srcAttr ) ;
30- this . fullValue = this . srcProperty . get ( ) ;
29+ this . srcProperty = nestedProperty ( props . container , this . srcAttr ) . get ( ) ;
30+ this . fullValue = this . context . customSrcHandling
31+ ? this . context . customSrcHandling . toSrc (
32+ this . srcProperty ,
33+ props . container . type
34+ )
35+ : this . srcProperty ;
3136
3237 this . is2D = false ;
3338 if ( props . container ) {
@@ -44,15 +49,6 @@ export class UnconnectedDataSelector extends Component {
4449 ] . includes ( props . container . type ) ) ||
4550 ( props . container . type === 'table' && props . attr !== 'columnorder' ) ;
4651 }
47-
48- if (
49- this . is2D &&
50- this . fullValue &&
51- this . fullValue . length &&
52- this . context . customSrcHandling
53- ) {
54- this . fullValue = this . context . customSrcHandling . splitSrcs ( this . fullValue ) ;
55- }
5652 }
5753
5854 updatePlot ( value ) {
@@ -81,8 +77,8 @@ export class UnconnectedDataSelector extends Component {
8177 this . srcAttr ,
8278 this . props . container . type ,
8379 {
84- joinSrcs : this . context . customSrcHandling
85- ? this . context . customSrcHandling . joinSrcs
80+ fromSrc : this . context . customSrcHandling
81+ ? this . context . customSrcHandling . fromSrc
8682 : null ,
8783 }
8884 ) ;
@@ -131,7 +127,10 @@ UnconnectedDataSelector.contextTypes = {
131127 dataSourceOptions : PropTypes . array ,
132128 dataSourceValueRenderer : PropTypes . func ,
133129 dataSourceOptionRenderer : PropTypes . func ,
134- customSrcHandling : PropTypes . object ,
130+ customSrcHandling : PropTypes . shape ( {
131+ toSrc : PropTypes . func ,
132+ fromSrc : PropTypes . func ,
133+ } ) ,
135134} ;
136135
137136function modifyPlotProps ( props , context , plotProps ) {
0 commit comments