Skip to content

Attribute 'connectionstyle' ignored, impossible to curve the graph edges. #683

@agicquel

Description

@agicquel

ALL software version info

python 3.10
bokeh 2.4.2
networkx 2.6.2

Description of expected behavior and the observed behavior

I tried to draw directed graph along with the multipartite layout from networkx. The graph is rendered however all the edges overlap between each other. To correct this behavior, I added the 'connectionstyle' attribute in order to curve the edges in function draw_networkx_edges but the edges are still straight.

Complete, minimal, self-contained example code that reproduces the issue

defaults = dict(width=1600, height=1000)
hv.opts.defaults(opts.EdgePaths(**defaults), opts.Graph(**defaults), opts.Nodes(**defaults))pos = nx.layout.multipartite_layout(self.nx_cfg, subset_key="address", align="horizontal", scale=4)

nodes = hvnx.draw_networkx_nodes(self.nx_cfg, pos, node_size=30, node_color='blue')
edges = hvnx.draw_networkx_edges(self.nx_cfg, pos, node_size=30, arrows=True, arrowstyle=']->',
                                         arrowsize=10, edge_color="green", connectionstyle="arc3",
                                         edge_cmap='Blues', edge_width=2, colorbar=True)

show(hv.render(nodes * edges))

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions