

def process_data(self):
    weights_of_areas = ((self.matrix.sum(axis=0) + self.matrix.sum(axis=1)) - self.matrix.diagonal())
    areas_in_radians = ((weights_of_areas / weights_of_areas.sum()) * (2 * pi))
    points = np.zeros((areas_in_radians.shape[0] + 1))
    points[1:] = areas_in_radians
    points = points.cumsum()
    colors = [color_in_equal_space((area / areas_in_radians.shape[0])) for area in range(areas_in_radians.shape[0])]
    arcs_data = pd.DataFrame({
        'start_angle': points[:(- 1)],
        'end_angle': points[1:],
        'line_color': colors,
    })
    self.arcs_data = ColumnDataSource(arcs_data)
    if self.label:
        text_radius = 1.1
        angles = ((points[:(- 1)] + points[1:]) / 2.0)
        text_positions = pd.DataFrame({
            'angles': angles,
            'text_x': (np.cos(angles) * text_radius),
            'text_y': (np.sin(angles) * text_radius),
            'text': list(self.label),
        })
        self.text_data = ColumnDataSource(text_positions)
    all_areas = []
    for i in range(areas_in_radians.shape[0]):
        all_areas.append(Area(weights_of_areas[i], points[:(- 1)][i], points[1:][i]))
    all_connections = []
    for (j, region1) in enumerate(self.matrix):
        source = all_areas[j]
        color = colors[j]
        weight = weights_of_areas[j]
        for (k, region2) in enumerate(region1):
            target = all_areas[k]
            for _ in range(int(region2)):
                p1 = source.free_points.pop()
                p2 = target.free_points.pop()
                all_connections.append(((p1 + p2) + [color, weight]))
    connections_df = pd.DataFrame(all_connections, dtype=str)
    connections_df.columns = ['start_x', 'start_y', 'end_x', 'end_y', 'colors', 'weight']
    connections_df['cx0'] = (connections_df.start_x.astype('float64') / 2)
    connections_df['cy0'] = (connections_df.start_y.astype('float64') / 2)
    connections_df['cx1'] = (connections_df.end_x.astype('float64') / 2)
    connections_df['cy1'] = (connections_df.end_y.astype('float64') / 2)
    connections_df.weight = ((connections_df.weight.astype('float64') / connections_df.weight.astype('float64').sum()) * 3000)
    self.connection_data = ColumnDataSource(connections_df)

dataset/ETHPy150Open bokeh/bokeh/bokeh/charts/builders/chord_builder.py ChordBuilder.process_data/original