Diff stat
Lines added and removed, with a row of green and red blocks, as in the git panel of a code editor.
ui.diff_stat · Category: Data · Full reference →


pz.column([ pz.row([ui.label("render.rs", mono=True), pz.hspace(), ui.diff_stat(42, 9)], align="center"), pz.row([ui.label("app.py", mono=True), pz.hspace(), ui.diff_stat(3, 27)], align="center"), pz.row([ui.label("README.md", mono=True), pz.hspace(), ui.diff_stat(12, 0)], align="center"),], spacing=10, width=320)When to use
Section titled “When to use”- Next to a file, commit or pull request in a list of changes.
import pyzed as pzfrom pyzed import ui
pz.column([ pz.row([ui.label("render.rs", mono=True), pz.hspace(), ui.diff_stat(42, 9)], align="center"), pz.row([ui.label("app.py", mono=True), pz.hspace(), ui.diff_stat(3, 27)], align="center"), pz.row([ui.label("README.md", mono=True), pz.hspace(), ui.diff_stat(12, 0)], align="center"),], spacing=10, width=320)Variants
Section titled “Variants”Options
Section titled “Options”

Code
ui.diff_stat(42, 3)

Code
ui.diff_stat(2, 57)

Code
ui.diff_stat(12, 0)

blocks=10Code
ui.diff_stat(120, 40, blocks=10)Events
Section titled “Events”Diff stat has no events of its own: it shows what you give it. Like every widget it also has the 18 common events (click, double_click, right_click, mouse_enter, drag, key_down, resize…), attached with .on(...): see Events and Events of every component.
Properties and API
Section titled “Properties and API”ui.diff_stat
Section titled “ui.diff_stat”diff_stat(added, removed, *, blocks=5, theme=None)+12 −3 with GitHub-style colored blocks.
| Property | Default | Description |
|---|---|---|
added |
required | Lines added. |
removed |
required | Lines removed. |
blocks |
5 |
Number of blocks. |
theme |
None |
Theme to use instead of the current one (pyzed.theme.current()). |