@@ -43,7 +43,7 @@ export class DataSource extends DataSourceApi<MyQuery, MyDataSourceOptions> {
4343 interface FrameFieldType {
4444 name : string ;
4545 type : any ;
46- config ?: any ;
46+ config : Record < string , any > ;
4747 }
4848 // This function gets the fields of the api and transforms them to what grafana dataframe prefers
4949 function fieldAssignator ( FieldsResponse : any ) : FrameFieldType [ ] {
@@ -52,14 +52,14 @@ export class DataSource extends DataSourceApi<MyQuery, MyDataSourceOptions> {
5252 // fieldType can be either number of string
5353 var fieldType = field [ 'type' ] === 'number' ? FieldType . number : FieldType . string ;
5454 // add 'name' and 'type' items to the output object
55- var outputField : FrameFieldType = { name : field [ 'field_name' ] , type : fieldType } ;
55+ var outputField : FrameFieldType = { name : field [ 'field_name' ] , type : fieldType , config : { } } ;
5656 // add color for 'arc__*' items(only apperas for the nodes)
5757 if ( 'color' in field ) {
58- outputField . config = { color : { fixedColor : field [ 'color' ] , mode : FieldColorModeId . Fixed } } ;
58+ outputField . config . color = { fixedColor : field [ 'color' ] , mode : FieldColorModeId . Fixed } ;
5959 }
6060 // add disPlayName for 'detail__*' items
6161 if ( 'displayName' in field ) {
62- outputField . config = { displayName : field [ 'displayName' ] } ;
62+ outputField . config . displayName = field [ 'displayName' ] ;
6363 }
6464 outputFields . push ( outputField ) ;
6565 } ) ;
0 commit comments