question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support inverted label text option for Chord plot

See original GitHub issue

ALL software version info

holoviews=1.13.3, bokeh=2.1.1

Description of expected behavior and the observed behavior

The label texts in the left half of the chord plot getting inverted. inverted

It would be good if the default label text orientation can be made something like this image below: expected

Example code

import pandas as pd
import holoviews as hv
from holoviews import opts, dim
from bokeh.sampledata.les_mis import data

hv.extension('bokeh')
hv.output(size=300)

links = pd.DataFrame(data['links'])
nodes = hv.Dataset(pd.DataFrame(data['nodes']), 'index')
chord = hv.Chord((links, nodes)).select(value=(5, None))
chord.opts(
    opts.Chord(cmap='Category20', edge_cmap='Category20', edge_color=dim('source').str(), label_text_font_size='15px',
               labels='name', node_color=dim('index').str()))

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:3
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
mullimankocommented, Jan 7, 2021

I wrote a function to rotate the label text also for bokeh as backend. Not perfect, but maybe useful: https://stackoverflow.com/a/65610161

0reactions
mullimankocommented, Dec 28, 2020

@janrygl, I tried your function and get the following error: WARNING:param.ChordPlot13794: Plotting hook <function rotate_label at 0x0000019D040C11F8> could not be applied:

‘labels’

– UPDATE –

janrygl’s solution only works by selecting matplotlib as plotting library backend with hv.extension("matplotlib"), which is not clear from his answer. Otherwise the above-mentioned error occurs.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Label text are inverted in the left half of Holoviews Chord plot
Hi, I have created a Holoviews Chord plot using some data and everything is fine. However the label texts in the left half...
Read more >
inverted label text (half turn) for Chord diagram on holoviews ...
This was quite difficult. If the label text is just a few characters long this solution with a hook might be appropriate.
Read more >
Chapter 15 Advanced usage of chordDiagram()
By default, chordDiagram() creates two tracks, one track for labels and one track ... Several empty tracks can be allocated before Chord diagram...
Read more >
Chord Pro Features For Chord Diagrams - Data Crayon
Chord Colours; Opacity; Reverse Gradients; Arc Numbers; Diagram Title ... Label Wrapping; Margins; Font-size; Popup Width; Popup Text ...
Read more >
Inverted Label Text (Half Turn) For Chord Diagram ... - ADocLib
The label texts in the left half of the chord plot getting inverted. inverted. It would be good if the default label text...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found