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.0 (released Mar 23, 2024)
Added
Added
hiveplotlib.viz.holoviews
module 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_scale
andcontrol_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 singleAxis
instance (before, a singleAxis
needed to be added as a list with one element).hiveplotlib.viz.matplotlib
when settingcenter_plot=True
now performsax.axis("equal")
for the provided / resultingmatplotlib
axis. Before, the global effectplt.axis("equal")
was being called.Code hygiene (linting and formatting) revised from
flake8
andblack
, 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.0
release that made the function calls non-responsive to changing thecenter_plot
,buffer
, andaxes_off
parameters.hiveplotlib.viz.matplotlib
had a bug that made composing viz functions from this module and callingaxes_off=False
for a later function call unable to cancel out theaxes_off=True
behavior 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=True
in versions0.22.0
and0.23.0
. The old JSON structure was deprecated in version0.22.0
and 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.plotly
module supporting hive plot and P2CP viz in plotly.hiveplotlib.HivePlot
now tracks the radius corresponding to the largest polar endpoint of all axes with themax_polar_end
parameter.
Changed
All occurances of
mpl_axes_off
inhiveplotlib.viz.matplotlib
andhiveplotlib.viz.datashader
renamed toaxes_off
for 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.base
sub-module as well as into private_fig_setup
methods. User experience will not be changed by either of these revisions.For all occurances of
axes_labels_fontsize
inhiveplotlib.viz.bokeh
, the default value has been raised from"13px"
to"16px"
.For all occurances of
buffer
inhiveplotlib.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_plot
inhiveplotlib.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=1
on all edges for viz, as this does not generalize to thehiveplotlib.viz.plotly
use 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 aDeprecationWarning
and 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 aNone
value as one of the values in theaxes_assignments
input. TheNone
axis takes all otherwise-unassigned nodes from thenode_list
input and assigns them to that axis.Restructure
hiveplotlib.__init__.py
to split out capabilities into submodules. Now havehiveplotlib.node
,hiveplotlib.axis
,hiveplotlib.hiveplot
, andhiveplotlib.p2cp
modules. High-level imports have been left unchanged.split_nodes_on_variable()
, a node-specific utility function, moved fromhiveplotlib.utils
moved 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_utils
module has been deleted.Added
hiveplotlib.node.dataframe_to_node_list()
for converting rows of a dataframe into a list ofNode
instances.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
buffer
parameter 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.datashader
function docstrings.Formally add
seaborn
to dependencies forhiveplotlib[datashader]
. Switch default edge colormap forhiveplotlib.viz.datashader.datashade_edges_mpl()
from"viridis"
to theseaborn
colormap 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
None
axis 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.datashader
functions, 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
_mpl
named viz functions, which raised aDeprecationWarning
in version0.20
, have been removed in version0.21
. For example,hiveplotlib.viz.hive_plot_viz_mpl()
is now calledhiveplotlib.viz.hive_plot_viz
. Although thematplotlib
backend is available by default, different backends can be accessed within thehiveplotlib.viz
module. For example an explicitmatplotlib
backend hive plot visualization can now be called viahiveplotlib.viz.matplotlib.hive_plot_viz()
, and abokeh
backend 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_mpl
have been left with their_mpl
naming for now, as datashading could eventually be done via multiple backends.
Version 0.20 (released Jan 19, 2023)
Enhancements
hiveplotlib.viz.bokeh
submodule ofbokeh
-backend viz functions for hive plots and P2CPs added.hiveplotlib.viz
defaultmatplotlib
-backend viz functions have been renamed without the_mpl
ending.matplotlib
-backend viz code is now contained in thehiveplotlib.viz.matplotlib
sub-module, making the_mpl
redundant. Default viz called underhiveplotlib.viz
, however, will still use thematplotlib
backend.Improvements to
hiveplotlib.viz
docstrings.Exposed kwargs that allow the modification of axes labels in the
hiveplotlib.viz
module.hiveplotlib
now being checked againstflake8-docstrings
. (flake8
and documentation-building checks also incorporated into the CI pipeline). Many subtle documentation revisions from this change.hiveplotlib.viz
functions that are exposed to bothHivePlot
andP2CP
instances 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
pytest
warnings in the CI about a coming deprecation resolved.
Version 0.19 (released Sept 6, 2022)
Enhancements
Added
hiveplotlib.viz.datashader
module 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 exposedtags
parameter that allows plotting a subset of tags (with default behavior to plot all tags).Improved type hints for
hiveplotlib.viz
module.hiveplotlib.viz.p2cp_legend_mpl()
revisedtags_to_include
parameter totags
to 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 useLineCollection
on 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=False
use 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)
numpy
arrays to beingnp.nan
instead 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=False
to 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
DeprecationWarning
issues 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).