ricklupton / ipysankeywidget

IPython / Jupyter Sankey diagram widget
MIT License
174 stars 24 forks source link

Another formatting question #57

Closed MinahilRaza closed 1 year ago

MinahilRaza commented 3 years ago

I am trying to display patient paths using sankey diagrams. I increased the node width using .node-body { fill: #bbb; stroke: gray; stroke-width: 20px; opacity: 1.0; }

Now I want to change the following

  1. The position of the labels and values so that the wide node does not cover them.
  2. The size of numbers (linkValues). Is there a font size option for this?
  3. Is there any way to write values within the node rectangle. I have already accomplished this using groups so I was wondering if there is a better approach for this?

image

ricklupton commented 1 year ago

Sorry for the late reply. Sounds like an interesting application!

I think when you get to this level of detail to adjust the diagram, it's not currently possible to adjust the layout with enough precision. It may be best to export the SVG and adjust the text manually in your final version of the diagram using Inkscape or similar.

Alternatively if you are comfortable with d3 and JS you can export your data as JSON and use the d3-sankey-diagram library directly, which would give you more control to adjust positions etc.

I would expect that you can change the link value font size with CSS (not tested)

Closing since I assume you've finished this project by now, but follow-ups are welcome.