{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "\n# Separated layout\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The :class:`ptvis.layouts.SeparatedTableLayout` class defines a layout of the\nperiodic table whose *f*-block is separated from the others.\n\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "import plotly\nimport ptvis.layouts\n\n\nelements = list(ptvis.Element)\n\nfig = plotly.graph_objects.Figure()\nptvis.attach_plain_cells(\n fig,\n elements,\n table_layout=ptvis.layouts.SeparatedTableLayout(),\n)\n\nplotly.io.show(fig)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Symbols for the *f*-block\n\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Symbols for the *f*-block can be changed by the `lanthanoids_symbol` and\n`actinoids_symbol` arguments.\n\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "import plotly\nimport ptvis.layouts\n\n\nelements = list(ptvis.Element)\n\nfig = plotly.graph_objects.Figure()\nptvis.attach_plain_cells(\n fig,\n elements,\n table_layout=ptvis.layouts.SeparatedTableLayout(\n lanthanoids_symbol=\"*\",\n actinoids_symbol=\"**\",\n ),\n)\n\nplotly.io.show(fig)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The width for the symbols can be changed by the `symbol_width` argument.\n\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "import plotly\nimport ptvis.layouts\n\n\nelements = list(ptvis.Element)\n\nfig = plotly.graph_objects.Figure()\nptvis.attach_plain_cells(\n fig,\n elements,\n table_layout=ptvis.layouts.SeparatedTableLayout(symbol_width=2.),\n)\n\nplotly.io.show(fig)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Separation above the *f*-block\n\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "A separation between the *f*-block and the others can be changed by the\n`separation` argument.\n\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "import plotly\nimport ptvis.layouts\n\n\nelements = list(ptvis.Element)\n\nfig = plotly.graph_objects.Figure()\nptvis.attach_plain_cells(\n fig,\n elements,\n table_layout=ptvis.layouts.SeparatedTableLayout(separation=2.),\n)\n\nplotly.io.show(fig)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Padding around the periodic table\n\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "A padding around the periodic table can be changed by the `padding` argument.\n\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "import plotly\nimport ptvis.layouts\n\n\nelements = list(ptvis.Element)\n\nfig = plotly.graph_objects.Figure()\nptvis.attach_plain_cells(\n fig,\n elements,\n table_layout=ptvis.layouts.SeparatedTableLayout(padding=1.),\n)\n\nplotly.io.show(fig)" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.13.3" } }, "nbformat": 4, "nbformat_minor": 0 }