biPartite - fill
Two bipartite graphs show the same dataset with edges and bars colored by different categorical variables. The left chart uses the primary category for fill, while the right chart uses the secondary category. The visualization is built with the VizJS library’s `viz.bP()` API, which returns a D3 v4 SVG component. The code defines custom color functions for the fill, and the edges are rendered with a fill opacity of 0.3. Data is hardcoded as an array of tuples with primary, secondary, and two value columns. The rendering relies on SVG shapes and crisp edges for the bars.
AI-generated descriptionviz.bP().fill
The fill method is used to set the fill color function for the bars and edges. The function will be passed an object of the type {primary:...,secondary:...} and should return a color.
The example on the left is using the primary attribute to color whereas the example on the right is using the secondary attribute to color.
For other options and examples, check VizJS