def build_wedge_text_source(df, start_col='start', end_col='end', center_col='centers'):
 (x, y) = polar_to_cartesian(df[center_col], df[start_col], df[end_col])
 df = add_text_label_from_index(df)
 df['text_angle'] = calc_text_angle(df['start'], df['end'])
 df.ix[((df.level == 0), 'text_angle')] = 0.0
 text_source = ColumnDataSource(dict(text=df['text'], x=x, y=y, text_angle=df['text_angle']))
 return text_source

def build_wedge_text_source ( df , start_col = 'start' , end_col = 'end' , center_col = 'centers' ) : ( x , y ) = polar_to_cartesian ( df [ center_col ] , df [ start_col ] , df [ end_col ] ) df = add_text_label_from_index ( df ) df [ 'text_angle' ] = calc_text_angle ( df [ 'start' ] , df [ 'end' ] ) df . ix [ ( ( df . level == 0 ) , 'text_angle' ) ] = 0.0 text_source = ColumnDataSource ( dict ( text = df [ 'text' ] , x = x , y = y , text_angle = df [ 'text_angle' ] ) ) return text_source
generate columndatasource for text representation of donut levels .