Color bindings
When binding to colors, you can provide RGB values or use numbers that correspond to
palette entry indexes.
To provide RGB values, provide
int64 values, while for palette values, use
int32 values. Note that
uint values are currently
not supported. Palette colors will be assigned assuming
int32 values are palette indexes. If
int32 values cannot be mapped to valid palette indexes they will be assigned round-robin using Paired-12 palette. For untyped formats, Graphistry attempts to infer whether a palette is being used.
Example: Providing point colors as RGB values
In the following code, the PyGraphistry library will automatically convert Pandas
pd.Series(dtype='int64') columns into Apache Arrow
int64 buffers for transport.
# Colors: red, green, blue
graphistry.nodes(pd.DataFrame({
'myRGBCol': pd.Series([0xFF000000, 0x00FF0000, 0x0000FF00], dtype='int64')
})).bind(point_color='myRGBCol')
Example: Providing point colors as palette colors
In the following code, the PyGraphistry library will automatically convert Pandas
pd.Series(dtype='int32') columns into Apache Arrow
int32 buffers for transport.
graphistry.nodes(pd.DataFrame({
'myPaletteCol': pd.Series([2, 4, 6], dtype='int32')
})).bind(pointColor='myPaletteCol')