mendeleev.vis.plotly

Functions

periodic_table_plotly(elements: DataFrame, attribute: str = 'atomic_weight', cmap: str = 'RdBu_r', colorby: str = 'color', decimals: int = 3, height: int = 800, missing: str = '#ffffff', title: str = 'Periodic Table', wide_layout: bool = False, width: int = 1200) Figure[source]

Create a periodic table visualization with plotly.Figure

Parameters:
  • elements – Pandas DataFrame with the elements data. Needs to have x and y columns with coordianates for each tile.

  • attribute – Name of the attribute to be displayed

  • cmap – Colormap to use, see matplotlib colormaps

  • colorby – Name of the column containig the colors

  • decimals – Number of decimals to be displayed in the bottom row of each cell

  • height – Height of the figure in pixels

  • missing – Hex code of the color to be used for the missing values

  • title – Title to appear above the periodic table

  • wide_layout – wide layout variant of the periodic table

  • width – Width of the figure in pixels

create_annotation(row: Series, attr: str, size: int = 10, x_offset: float = 0.0, y_offset: float = 0.0) Annotation[source]

Create an annotation from pandas series

create_tile(element: Series, color: str, x_offset: float = 0.45, y_offset: float = 0.45) Shape[source]

Create tile shape