shahinrostami / plotapi

Engaging visualisations, made easy.
https://plotapi.com
MIT License
267 stars 17 forks source link

Arc for diagonal data… #37

Closed zedrdave closed 3 years ago

zedrdave commented 3 years ago

While testing with the non-pro version, it seemed that diagonal data (number of instances from a node to itself) were ignored: the area was shown on the outer circle, but no arc was plotted.

With the Pro version, there is an arc to itself (which essentially looks like a half ellipse). Is there a way to obtain the behaviour of the non-Pro version (diagonal data used for scale of each node, but no arc)?

shahinrostami commented 3 years ago

Hi @zedrdave

The pro version has the defined and intended behaviour for entries in the diagonal of the matrix.

Can you share a minimal example (code + screenshot) that demonstrates the output you're after? I'm happy to take feature requests, so I could add this one to the list!

zedrdave commented 3 years ago

I can understand that this would be the preferred default behaviour. It would be great if there was a flag option to disable it.

It's fairly simple to reproduce, using the default sample code with some values added along the diagonal, eg:

matrix = [
    [19, 5, 6, 4, 7, 4],
    [5, 4, 5, 4, 6, 5],
    [6, 5, 0, 4, 5, 5],
    [4, 4, 4, 0, 5, 5],
    [7, 6, 5, 5, 0, 4],
    [4, 5, 5, 5, 4, 0],
]

Calling Chord(matrix, names) then gives this in non-Pro mode:

Screenshot 2021-04-11 at 10 47 04

but this in Pro mode:

Screenshot 2021-04-11 at 10 47 27

I looked for a possible option that controls this behaviour, but couldn't find it.

Thanks a lot!

shahinrostami commented 3 years ago

Thank you for the screenshot, I understand exactly what you mean now!

I don't think it will be too troublesome to implement a flag for that so I'll put it on top of the list. I was planning to work on chord pro tonight so I'll try slip this in to the update. I'll ping you on this issue when it's done 👍

shahinrostami commented 3 years ago

Hey @zedrdave, pinging you as promised!

I've reproduced the desired chord free for chord pro under the parameter colored_labels being set to False. This is available in version 1.0.0 of chord (please update with pip!).

There's an example in the documentation [1] and here's a screenshot too:

Screenshot 2021-04-11 at 15 23 05

It was nice to get some time to work on chord pro, thank you for your suggestion 👍

[1] https://datacrayon.com/posts/statistics/data-is-beautiful/chord-pro-features-for-chord-diagrams/#Colored-Diagonals

zedrdave commented 3 years ago

Thanks a lot for your reactivity and fast work on this! I'll test it and let you know if there's any problem…

Since we're in suggestion mode: may I suggest perhaps extending the current templating approach (verb, noun) to something more generic and broader: eg passing a Python-style or JS-style f-string that gets used as template…

shahinrostami commented 3 years ago

Thanks a lot for your reactivity and fast work on this! I'll test it and let you know if there's any problem…

My pleasure :) I'll close this for now but please re-open you spot anything wrong with it.

Since we're in suggestion mode: may I suggest perhaps extending the current templating approach (verb, noun) to something more generic and broader: eg passing a Python-style or JS-style f-string that gets used as template…

This one is actually already on my list! I won't be removing the existing parameters (to maintain some backwards compatibility), but I will be adding a new overriding parameter to specify a template.

The main challenge for me is finding time to work on it! The lifetime license model I'm using means it's generally given 'as is', so aside from bug fixing it is tricky... I'm not sure something like a SaaS model would suit chord pro, so I just work on new features whenever I have spare time.

I hope the new feature is useful to you :)

zedrdave commented 3 years ago

I hear you, and I'm perfectly happy with it as is. Merely when you feel inspired and have time for it. Good luck with everything!