Skip to main content

Lightweight library for plotting FEniCS x objects using plotly

Project description

MIT PyPI version Test package Pre-commit Deploy static content to Pages Code style: black Create and publish a Docker image Coverage

fenicsx-plotly

fenicsx-plotly is package for plotting FEniCSx objects using plotly. It is a successor of fenics-plotly.

Install

To install fenicsx-plotly you need to first install FEniCSx. Next you can install fenicsx-plotly via pip

python3 -m pip install fenicsx-plotly

We also provide a pre-built docker image with FEniCSx and fenicsx-plotly installed. You pull this image using the command

docker pull ghcr.io/finsberg/fenicsx-plotly:v0.3.0

Simple Example

import dolfinx
from mpi4py import MPI
from fenicsx_plotly import plot

mesh = dolfinx.mesh.create_unit_cube(MPI.COMM_WORLD, 3, 3, 3)

plot(mesh)

Supported objects (and object that will be supported in the future)

  • dolfinx.mesh.Mesh
  • dolfinx.mesh.MeshTagsMetaClass
  • dolfinx.fem.FunctionSpace
  • dolfinx.fem.Function
    • Scalar
    • Vector
  • dolfinx.fem.bcs.DirichletBCMetaClass
    • Scalar
    • Vector

Usage with JupyterBook

If you want to embed the visualizations generated by fenicsx-plotly into a webpage generated by JupyterBook such as the documentation for fenicsx-plotly you need to add the following configuration in your _config.yml

sphinx:
  config:
    html_js_files:
      - https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.4/require.min.js

See https://jupyterbook.org/en/stable/interactive/interactive.html#plotly for more information.

Contributing

Contributions are welcomed!

See https://finsberg.github.io/fenicsx-plotly/CONTRIBUTING.html for more info.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fenicsx_plotly-0.3.0.tar.gz (10.6 kB view hashes)

Uploaded Source

Built Distribution

fenicsx_plotly-0.3.0-py3-none-any.whl (8.4 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page