.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "tutorial/09_trame/a_trame_simple.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code or to run this example in your browser via Binder .. rst-class:: sphx-glr-example-title .. _sphx_glr_tutorial_09_trame_a_trame_simple.py: Simple Trame App ~~~~~~~~~~~~~~~~ A simple example of how to create a Trame app with a PyVista Plotter. This example contains the boilerplate code to use anytime you are creating a new Trame application with PyVista. .. GENERATED FROM PYTHON SOURCE LINES 11-34 .. code-block:: Python import pyvista as pv from pyvista import examples from pyvista.trame.ui import plotter_ui from trame.app import get_server from trame.ui.vuetify3 import SinglePageLayout pv.OFF_SCREEN = True server = get_server() state, ctrl = server.state, server.controller mesh = examples.load_random_hills() pl = pv.Plotter() pl.add_mesh(mesh) with SinglePageLayout(server) as layout: with layout.content: view = plotter_ui(pl) server.start() .. GENERATED FROM PYTHON SOURCE LINES 35-42 .. raw:: html
Open In Colab
.. _sphx_glr_download_tutorial_09_trame_a_trame_simple.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: binder-badge .. image:: images/binder_badge_logo.svg :target: https://mybinder.org/v2/gh/pyvista/pyvista-tutorial/gh-pages?urlpath=lab/tree/notebooks/tutorial/09_trame/a_trame_simple.ipynb :alt: Launch binder :width: 150 px .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: a_trame_simple.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: a_trame_simple.py ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_