microsoft / vivainsights-py

Python package for Analyzing and Visualizing data from Viva Insights
https://microsoft.github.io/vivainsights-py/
Other
14 stars 2 forks source link

Patch: bug fixes to network functions #18

Closed martinctc closed 8 months ago

martinctc commented 8 months ago

Summary

This branch adds some critical bug fixes to the network functions. The package version is aligned to v0.2.2.

Changes

The changes made in this PR are:

  1. Nodes may not display properly on some set-ups due to a small node size (see #16). The parameter node_scale has now been added to both network_g2g() and network_p2p().

  2. In network_g2g()...

    • there is a misalignment between the edge widths and the table output, which has now been resolved.
    • igraph.simplify is leading to some unexpected results to the graph, and has now been commented out.
    • edge transparency has previously not been working, and is now added by appending an edge attribute with a RGBA value.
    • The default for metric is changed to 'Group_collaboration_time_invested'. The example data in vi.load_pq_data() is updated to reflect that.
  3. In network_p2p() and network_summary()...

    • igraph.simplify is leading to some unexpected 'ZeroDivsionError', and has now been commented out.
  4. import_query() is updated so that '%' is replaced with the string 'Percent'. This is added to handle the fact that in the group-to-group query, two column names would be identical if special characters were simply removed, i.e. '% Group collaboration time invested' and 'Group collaboration time invested'.

  5. More examples have been added to the two network functions.

Checks

Example

The new network_g2g() is aligned with the table output, and has properly working transparent edges. The non-overlapping edges is however not identical to the output produced in the R library counterpart, which is a potential fix for the future.

image

Notes

This fixes #16.