def _generate_dendro(self, current_section, spacing, offsets):
max_dims = self._max_dims<EOL>start_x = _spacingx(current_section, max_dims, offsets[<NUM_LIT:0>], spacing[<NUM_LIT:0>])<EOL>for child in current_section.children:<EOL><INDENT>segments = child.points<EOL>terminations = _n_terminations(child)<EOL>seg_lengths = np.linalg.norm(np.subtract(segments[:-<NUM_LIT:1>, COLS.XYZ],<EOL>segments[<NUM_LIT:1>:, COLS.XYZ]), axis=<NUM_LIT:1>)<EOL>radii = np.vstack((segments[:-<NUM_LIT:1>, COLS.R], segments[<NUM_LIT:1>:, COLS.R])).Tif self._show_diameters else np.zeros((seg_lengths.shape[<NUM_LIT:0>], <NUM_LIT:2>))<EOL>y_offset = offsets[<NUM_LIT:1>]<EOL>for i, slen in enumerate(seg_lengths):<EOL><INDENT>new_offsets = _update_offsets(start_x, spacing, terminations,<EOL>(offsets[<NUM_LIT:0>], y_offset), slen)<EOL>self._rectangles[self._n] = _vertical_segment((offsets[<NUM_LIT:0>], y_offset),<EOL>new_offsets, spacing, radii[i, :])<EOL>self._n += <NUM_LIT:1><EOL>y_offset = new_offsets[<NUM_LIT:1>]<EOL><DEDENT>if y_offset + spacing[<NUM_LIT:1>] * <NUM_LIT:2> + sum(seg_lengths) > max_dims[<NUM_LIT:1>]:<EOL><INDENT>max_dims[<NUM_LIT:1>] = y_offset + spacing[<NUM_LIT:1>] * <NUM_LIT> + sum(seg_lengths)<EOL><DEDENT>self._max_dims = max_dims<EOL>self._generate_dendro(child, spacing, new_offsets)<EOL>start_x += terminations * spacing[<NUM_LIT:0>]<EOL>if offsets[<NUM_LIT:0>] != new_offsets[<NUM_LIT:0>]:<EOL><INDENT>self._rectangles[self._n] = _horizontal_segment(offsets, new_offsets, spacing, <NUM_LIT:0.>)<EOL>self._n += <NUM_LIT:1><EOL><DEDENT><DEDENT>
Recursive function for dendrogram line computations