FletMath control for Flet
Project description
A flet extension to render LaTex formulas
|
|
Installation
available in pypi:
pip install flet_math
- Add the dependency to your
pyproject.toml:
dependencies = [
"flet_math" # or flet_math @ git+https://github.com/Bbalduzz/flet_math.git
]
- Build with
flet build:
flet build <target> -v
Basic Usage
Here's a simple example of rendering a mathematical equation:
import flet as ft
from flet_math import Math
def main(page: ft.Page):
page.title = "Flet Math Example"
page.theme_mode = ft.ThemeMode.LIGHT
page.padding = 20
page.scroll = ft.ScrollMode.AUTO
page.add(
ft.Text("Flet Math - LaTeX Rendering", size=30, weight=ft.FontWeight.BOLD),
ft.Divider(),
ft.Text("Basic equation:", size=20),
Math(
tex=r"E = mc^2",
text_size=24,
),
)
page.update()
ft.app(target=main)
Properties
The Math control supports the following properties:
Core Properties
tex(str): The LaTeX formula to rendertext_color(ColorValue): Color of the rendered texttext_size(number): Size of the rendered textfont_family(str): Font family for the textfont_weight(FontWeight | str): Weight of the fonttext_align(TextAlign): Text alignmentselectable(bool): Whether the text can be selected
Layout Properties
cross_axis_alignment(CrossAxisAlignment): Cross-axis alignmentmain_axis_alignment(MainAxisAlignment): Main-axis alignment
Control Properties
width(number): Width of the controlheight(number): Height of the controlexpand(bool): Whether to expand to fill available spaceopacity(number): Opacity of the controltooltip(str): Tooltip textvisible(bool): Whether the control is visibledisabled(bool): Whether the control is disabled
Animation Properties
animate_opacity(bool): Animate opacity changesanimate_position(bool): Animate position changesanimate_scale(bool): Animate scale changesanimate_size(bool): Animate size changeson_animation_end(callable): Callback when animation endsrotate(number): Rotation anglescale(number): Scale factor
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
flet_math-0.1.1.tar.gz
(11.6 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
flet_math-0.1.1-py3-none-any.whl
(12.9 kB
view details)
File details
Details for the file flet_math-0.1.1.tar.gz.
File metadata
- Download URL: flet_math-0.1.1.tar.gz
- Upload date:
- Size: 11.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
25def6a4cef8e917615fcf466ef16263cd30389a26199f4e98f75a69f3ec868c
|
|
| MD5 |
0d2ca5dba3033358e13a0e7858cb54ce
|
|
| BLAKE2b-256 |
e9065b80fc36af58aacbae39da6f502211ef47754ded48be152eb7a1d6503485
|
File details
Details for the file flet_math-0.1.1-py3-none-any.whl.
File metadata
- Download URL: flet_math-0.1.1-py3-none-any.whl
- Upload date:
- Size: 12.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c410f1a7dae77a13057cd1954e4a467a8e889232fa201261d8ff1b88685e9d93
|
|
| MD5 |
16b16cbdda5c67254f0fd14af4ce58e9
|
|
| BLAKE2b-256 |
b67e1b216071c1d8c6e89486ed8692af68bdc2b5cf0f17780c30657b7df399ee
|