# Edges converging on markers chord diagram Holoviews/Bokeh

**URL:** <https://discourse.bokeh.org/t/edges-converging-on-markers-chord-diagram-holoviews-bokeh/11098>\
**Category:** Community Support\
**Created:** [December 8, 2023, 11:30am UTC](https://discourse.bokeh.org/t/edges-converging-on-markers-chord-diagram-holoviews-bokeh/11098 "2023-12-08T11:30:56Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Salvador\_Sanchis\_Ben](https://discourse.bokeh.org/user_avatar/discourse.bokeh.org/salvador_sanchis_ben/32/6450_2.png) [@Salvador\_Sanchis\_Ben](https://discourse.bokeh.org/u/Salvador_Sanchis_Ben)\
**Post date:** [December 8, 2023, 11:30am UTC](https://discourse.bokeh.org/t/edges-converging-on-markers-chord-diagram-holoviews-bokeh/11098/1 "2023-12-08T11:30:57Z")

</div>

I have the following code:

hv.extension(‘bokeh’)  
hv.output(size=200)

edges\_df = pd.DataFrame(edges, columns=[‘source’, ‘target’, ‘weight’])

chord = hv.Chord(edges\_df)

chord.opts(  
opts.Chord(cmap=‘viridis’, edge\_color=dim(‘weight’), node\_color=None, node\_size=10, labels=‘index’,  
colorbar=True, node\_fill\_color=None, node\_marker=‘dot’)  
)

chord

It comes out fine, but the edge lines are always falling on different points of the segment that each node occupies in the circle. **I need the edge lines to converge on the single point (marker) of each node** Any ideas?

Here is an example of what I am looking for:

 ![connect](https://discourse-uploads.bokeh.org/original/2X/2/21f04494056cb416a29f2b5c24d32883680d47eb.jpeg)

---

<div class="post-metadata">

**Author:** ![Salvador\_Sanchis\_Ben](https://discourse.bokeh.org/user_avatar/discourse.bokeh.org/salvador_sanchis_ben/32/6450_2.png) [@Salvador\_Sanchis\_Ben](https://discourse.bokeh.org/u/Salvador_Sanchis_Ben)\
**Post date:** [December 8, 2023, 11:33am UTC](https://discourse.bokeh.org/t/edges-converging-on-markers-chord-diagram-holoviews-bokeh/11098/2 "2023-12-08T11:33:09Z")

</div>

And here is an image of what I have now…

 ![bokeh_plot](https://discourse-uploads.bokeh.org/original/2X/d/d1c0d69850f6a56b427015494acbbea9d7c743c9.png)

---

<div class="post-metadata">

**Author:** ![Icoti](https://discourse.bokeh.org/user_avatar/discourse.bokeh.org/icoti/32/5856_2.png) [@Icoti](https://discourse.bokeh.org/u/Icoti)\
**Post date:** [December 8, 2023, 12:04pm UTC](https://discourse.bokeh.org/t/edges-converging-on-markers-chord-diagram-holoviews-bokeh/11098/3 "2023-12-08T12:04:17Z")

</div>

As far as I know, Bokeh doesn’t support chord diagrams natively, but HoloViews does.  
However, HoloViews doesn’t seem to support edge bundling, in which the lines would convert to a single point.

You can have a look at these links:  
[https://holoviews.org/reference/elements/bokeh/Chord.html](https://holoviews.org/reference/elements/bokeh/Chord.html)

> **[Hierarchical Edge Bundling | The Python Graph Gallery](https://python-graph-gallery.com/hierarchical-edge-bundling/)**
>
> A collection of hierarchical edge bundling examples made with Python, coming with explanation and reproducible code

> <https://github.com/holoviz/holoviews/issues/3428>
>
> Hi, I'm trying to get my chord plot to appear more like a hierarchical edge bund…le plot. I've noticed that by default the width of the ribbons in the chord plot are associated with the color when I set the edge\_color\_index to the correlation coeff. I would rather have the ribbons come to a point on each node, and have each node around the chord plot spread out evenly, instead of being clustered up on one another. It makes the plot look messy when there is a lot of data, such as the other holoviews chord plot I've attached.
> 
> I've attached three plots. One plot is my chord plot with thick ribbons using a simple moderately sized dataset. I set the edge\_line\_width to 1, and it had no effect. The other two plots are using a much larger dataset, one written in D3 JavaScript where the ribbons are the same width and all meet at the node, instead of spread out across the arc where the nodes are, and the other is written in holoviews.
> 
> Is it possible to get the chord plots more similar to the one written in JavaScript, by changing a few parameters? Mainly ribbon thickness and spacing around the arcs. Thanks.
> 
> Also is it possible to change how the labels appear around the chord plot. I have seen some code snippets online to do this, but although I can now get them orientated for reading, the text does sometimes overlap and can be unreadable, as they're now all displayed horizontally. Thanks.
> 
> !\[bokeh\_plot\](https://user-images.githubusercontent.com/8529807/51655189-77824800-1fd6-11e9-9c3e-21d5b4c90a1e.png)
> !\[screen shot 2019-01-24 at 12 41 17 pm\](https://user-images.githubusercontent.com/8529807/51655190-7a7d3880-1fd6-11e9-94d0-929977ff211e.png)
> !\[bokeh\_plot\_2\](https://user-images.githubusercontent.com/8529807/51655302-0c854100-1fd7-11e9-8073-eb615d3259ce.png)

I would recommend you to first post your question on the [HoloViews discourse](https://discourse.holoviz.org/c/holoviews), and possibly make a feature request afterwards.

---

<div class="post-metadata">

**Author:** ![Bryan](https://discourse.bokeh.org/user_avatar/discourse.bokeh.org/bryan/32/3625_2.png) [@Bryan](https://discourse.bokeh.org/u/Bryan)\
**Post date:** [December 8, 2023, 7:46pm UTC](https://discourse.bokeh.org/t/edges-converging-on-markers-chord-diagram-holoviews-bokeh/11098/4 "2023-12-08T19:46:22Z")

</div>

Holoviews supports edge bundling via Datashader:

[https://holoviews.org/user\_guide/Network\_Graphs.html#datashading-graphs](https://holoviews.org/user_guide/Network_Graphs.html#datashading-graphs)

But using that feature is not a Bokeh question so I’d agree that is is best to move this discussion to the Holoviz Discourse.

---

<div class="post-metadata">

**Author:** ![system](https://discourse-uploads.bokeh.org/original/2X/1/14eb24f9e10e4e9b78e3f10f66c04ffa96446e5a.svg) [@system](https://discourse.bokeh.org/u/system)\
**Post date:** [March 7, 2024, 7:47pm UTC](https://discourse.bokeh.org/t/edges-converging-on-markers-chord-diagram-holoviews-bokeh/11098/5 "2024-03-07T19:47:03Z")

</div>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
