Hiveplotlib Change Log
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog,
As of January, 2024, this project adheres to Semantic Versioning.
Version 0.25.1 (released Jul 5, 2024)
Fixed
Compatibility with
numpy 2.0.0.
Version 0.25.0 (released Mar 23, 2024)
Added
Added
hiveplotlib.viz.holoviewsmodule supporting hive plot and P2CP viz in holoviews.hiveplotlib.datasets.example_p2cp()added for generating P2CP with Gaussian four blobs example.
Version 0.24.0 (Released Feb 18, 2024)
Added
hiveplotlib.datasets.example_nodes_and_edges()added for generating random nodes, node splits, and edges for an arbitrary number of axes.hiveplotlib.HivePlot.connect_axes()now allows users to specifycontrol_rho_scaleandcontrol_angle_shift, which allow users to modify the positioning of the control point for the Bézier curve of each edge. By default, the control point for an edge between two nodes is the polar midpoint of the two curves, but users can now scale the polar distance from the origin (control_rho_scale) or shift the angle counterclockwise (control_angle_shift) for each control point relative to its default median polar position.
Changed
hiveplotlib.HivePlot.add_axes()now supports adding a singleAxisinstance (before, a singleAxisneeded to be added as a list with one element).hiveplotlib.viz.matplotlibwhen settingcenter_plot=Truenow performsax.axis("equal")for the provided / resultingmatplotlibaxis. Before, the global effectplt.axis("equal")was being called.Code hygiene (linting and formatting) revised from
flake8andblack, respectively, to ruff.Documentation moved over to ReadTheDocs: https://hiveplotlib.readthedocs.io/en/stable/hive_plot_viz_outside_matplotlib.html.
Fixed
hiveplotlib.viz.matplotlib.hive_plot_viz()andhiveplotlib.viz.matplotlib.p2cp_viz()had a bug from the0.23.0release that made the function calls non-responsive to changing thecenter_plot,buffer, andaxes_offparameters.hiveplotlib.viz.matplotlibhad a bug that made composing viz functions from this module and callingaxes_off=Falsefor a later function call unable to cancel out theaxes_off=Truebehavior of an earlier function call.
Removed
hiveplotlib.HivePlot.to_json()revised to generate a more D3-friendly JSON structure. The"curves"key originally contained multiple lines in a single list of[x, y]values separated by[null, null]values. The lines are now split into their own lists. This proved more compatible for plotting in JavaScript. The original JSON structure could still be created for now by running withdeprecated_version=Truein versions0.22.0and0.23.0. The old JSON structure was deprecated in version0.22.0and has been removed in this version.
- Many thanks to:
@besiansejdiu for ideas, discussion, and code review for exposing the changing of control points of edge Bézier curves.
@michael.catanzaro for assistance on migrating to
ruff.@abrahamdavidsmith for assistance on automating Gitlab releases.
Version 0.23.0 (released Feb 2, 2024)
Added
Added
hiveplotlib.viz.plotlymodule supporting hive plot and P2CP viz in plotly.hiveplotlib.HivePlotnow tracks the radius corresponding to the largest polar endpoint of all axes with themax_polar_endparameter.
Changed
All occurances of
mpl_axes_offinhiveplotlib.viz.matplotlibandhiveplotlib.viz.datashaderrenamed toaxes_offfor consistency between different viz back ends.Many redundant viz warnings used for all viz back ends pulled out of individual viz functions into
hiveplotlib.viz.input_checks.input_check()to avoid redundant code, especially as the repository expands support for more visualization packages. User experience will not be changed by this.Other redundant, viz package-agnostic code pulled out from individual viz functions into the
hiveplotlib.viz.basesub-module as well as into private_fig_setupmethods. User experience will not be changed by either of these revisions.For all occurances of
axes_labels_fontsizeinhiveplotlib.viz.bokeh, the default value has been raised from"13px"to"16px".For all occurances of
bufferinhiveplotlib.viz.bokeh, the default value has been raised from"0.2"to"0.3"(to compensate for the larger default font for axes labels).For all occurances of
center_plotinhiveplotlib.viz, if the provided hive plot / P2CP has no axes, then no centering will run. (This would previously trigger an error.)hiveplotlib.datasets.example_hive_plot()no longer defaults to putting the kwargalpha=1on all edges for viz, as this does not generalize to thehiveplotlib.viz.plotlyuse case. Kwargs now exposed for the underlyinghiveplotlib.hive_plot_n_axes()call.
Version 0.22.0 (released Jan 23, 2024)
Added
hiveplotlib.datasets.example_hive_plot()added for generating a hive plot with random nodes and edges.
Changed
hiveplotlib.HivePlot.to_json()revised to generate a more D3-friendly JSON structure. The"curves"key originally contained multiple lines in a single list of[x, y]values separated by[null, null]values. The lines are now split into their own lists. This proved more compatible for plotting in JavaScript. The original JSON structure can still be created for now by running withdeprecated_version=True. Running this way will raise aDeprecationWarningand will be removed in version0.24.0.Moving to full semantic versioning (e.g.
x.y.z) this release and onward.
Version 0.21 (released Mar 20, 2023)
Enhancements
hiveplotlib.hive_plot_n_axes()now accepts aNonevalue as one of the values in theaxes_assignmentsinput. TheNoneaxis takes all otherwise-unassigned nodes from thenode_listinput and assigns them to that axis.Restructure
hiveplotlib.__init__.pyto split out capabilities into submodules. Now havehiveplotlib.node,hiveplotlib.axis,hiveplotlib.hiveplot, andhiveplotlib.p2cpmodules. High-level imports have been left unchanged.split_nodes_on_variable(), a node-specific utility function, moved fromhiveplotlib.utilsmoved intohiveplotlib.node.The two
P2CP-specific utility functions inhiveplotlib.p2cp_utils–split_df_on_variable()andindices_for_unique_values()– have been moved intohiveplotlib.p2cp. Thehiveplotlib.p2cp_utilsmodule has been deleted.Added
hiveplotlib.node.dataframe_to_node_list()for converting rows of a dataframe into a list ofNodeinstances.Added
hiveplotlib.viz.datashader.datashade_hive_plot_mpl()for higher-level call to do fully-datashaded hive plots (node and edges plus the standardaxes_viz()).Add a
bufferparameter to the datashading calls to have their extent go slightly beyond axis extents by default (and can be increased further by the user as desired).Add some international trade network data to the package, and a reader function
hiveplotlib.datasets.international_trade_data(). Also added generalized runner with instructions for how to make additional trade datasets from the Harvard Growth Lab dataset in the hiveplotlib repository under./runners/make_trade_network_dataset.py.Improved type hinting throughout the package.
Fix / clarify some of the
hiveplotlib.viz.datashaderfunction docstrings.Formally add
seabornto dependencies forhiveplotlib[datashader]. Switch default edge colormap forhiveplotlib.viz.datashader.datashade_edges_mpl()from"viridis"to theseaborncolormap used in the “Hive Plots for Large Networks” example notebook.All remaining
np.random.seed()removed from repository (some of this was still in the test suite). These have all been replaced withrng = np.random.default_rng(0).Added notebook called “Hive Plots with More Than 3 Groups,” documenting examples of the new
Noneaxis capability as well as other 4+ group hive plot options, specifically a multi-layered axes hive plots, and a Hive Plot Matrix (HPM).Major refurbishment of the “Bitcoin Trader Network” notebook.
Bug Fixes
Fix to the
hiveplotlib.viz.datashaderfunctions, which did not correctly compose. If datashading onto an existing figure and axis without any hive plot axes, the image did not span the correct extent. Now, when datashading onto an existing figure and and axis, the datashader images will now always auto-scale to the extent of the hive plot axes.
Removed Deprecations
The
_mplnamed viz functions, which raised aDeprecationWarningin version0.20, have been removed in version0.21. For example,hiveplotlib.viz.hive_plot_viz_mpl()is now calledhiveplotlib.viz.hive_plot_viz. Although thematplotlibbackend is available by default, different backends can be accessed within thehiveplotlib.vizmodule. For example an explicitmatplotlibbackend hive plot visualization can now be called viahiveplotlib.viz.matplotlib.hive_plot_viz(), and abokehbackend hive plot visualization can now be called viahiveplotlib.viz.bokeh.hive_plot_viz().Note
hiveplotlib.viz.datashader.datashade_edges_mpl()andhiveplotlib.viz.datashader.datashade_nodes_mplhave been left with their_mplnaming for now, as datashading could eventually be done via multiple backends.
Version 0.20 (released Jan 19, 2023)
Enhancements
hiveplotlib.viz.bokehsubmodule ofbokeh-backend viz functions for hive plots and P2CPs added.hiveplotlib.vizdefaultmatplotlib-backend viz functions have been renamed without the_mplending.matplotlib-backend viz code is now contained in thehiveplotlib.viz.matplotlibsub-module, making the_mplredundant. Default viz called underhiveplotlib.viz, however, will still use thematplotlibbackend.Improvements to
hiveplotlib.vizdocstrings.Exposed kwargs that allow the modification of axes labels in the
hiveplotlib.vizmodule.hiveplotlibnow being checked againstflake8-docstrings. (flake8and documentation-building checks also incorporated into the CI pipeline). Many subtle documentation revisions from this change.hiveplotlib.vizfunctions that are exposed to bothHivePlotandP2CPinstances now use thehiveplotlib.viz.input_checks.input_check()call to validate proper inputs. This will scale better if the code ever supports additional instances or further checks on said instances. In the least, this made the viz code a little more DRY.
Note
The _mpl named viz functions will raise a DeprecationWarning in version 0.20, with support to be removed
in version 0.21.
hiveplotlib.viz.datashader.datashade_edges_mpl() and
hiveplotlib.viz.datashader.datashade_nodes_mpl have been left with their _mpl naming for now,
as datashading could eventually be done via multiple backends.
Bug Fixes
pytestwarnings in the CI about a coming deprecation resolved.
Version 0.19 (released Sept 6, 2022)
Enhancements
Added
hiveplotlib.viz.datashadermodule added, plus documentation explaining and demonstrating datashading capabilities for both hive plots and P2CPs.hiveplotlib.viz.edge_viz_mpl(),hiveplotlib.viz.hive_plot_viz_mpl()andhiveplotlib.viz.p2cp_viz_mpl()now have an exposedtagsparameter that allows plotting a subset of tags (with default behavior to plot all tags).Improved type hints for
hiveplotlib.vizmodule.hiveplotlib.viz.p2cp_legend_mpl()revisedtags_to_includeparameter totagsto be more consistent with the rest of the API.License revised from GNU AGPL to BSD License (BSD-3-Clause).
Bug Fixes
Major bug fix in
hiveplotlib.viz.edge_viz_mpl(), which made incorrect assumptions about how one can compose lines inmatplotlib. Revised to useLineCollectionon the backend.Incorrect assumptions also found in notebooks demonstrating viz in other packages. These have been corrected.
Fixed
hiveplotlib.viz.axes_viz_mpl()not responding tompl_axes_of=Falseuse case.
Version 0.18 (released Aug 17, 2022)
Enhancements
HivePlot.to_json()andP2CP.to_json()implemented.Documentation notebook showing how to visualize hive plots and P2CPs with other viz libraries off of the JSON output.
Started this change log (and filled in a little bit of it looking back at some previous versions).
Switched the spacers between discretized edges in the
(n, 2)numpyarrays to beingnp.naninstead ofNone. This allows us to preservefloat-typed arrays instead of being forced to switch toObject-typed arrays, which speeds up the code and improves memory usage.
Bug Fixes
HivePlot.add_edge_kwargs()doesn’t need to be run witha2_to_a1=Falseto avoid errors with axis <-> repeat axis anymore.Generally more case control / useful warnings for
HivePlot.add_edge_kwargs()when trying to put kwargs on impossible edge sets.Revised
DeprecationWarningissues that were arising from usingpytest.warns(None)throughout the test suite.Revised random draws in
hiveplotlib.datasets.four_gaussian_blobs_3d()to usenp.random.default_rng()instead ofnp.random.seed().
Version 0.17 (released Feb 8, 2022)
A couple of bug fixes in
hive_plot_n_axes(), additional utility functions, pandas futurewarning resolved, lots more documentation.
Enhancements
Additional Utility Functions
Bug Fixes
A couple of bug fixes in
hive_plot_n_axes().
Version 0.16 (released Dec 21, 2021)
Started a change log!
Added in Polar Parallel Coordinate Plots (P2CPs).