Skip to content

[ENH] Define Triangle Styler #1331

Description

@genedan

Another multi-part issue...

Referencing #1324, it's time to define a Styler for the Triangle. A Styler is a class that enables aesthetic configuration of the Triangle for output to various displays, in HTML, LaTeX, etc. For the Pandas styler, refer to the following tutorial:

https://pandas.pydata.org/docs/user_guide/style.html

This can be accessed via Triangle.to_frame().style.format(...), but challenges remain:

  • The Pandas styler cannot access the actuarial elements of the Triangle, such as latest diagonal, lower triangle (see [ENH] Different background for upper and lower triangles #1324), which puts a high burden on the user to define complex, custom functions to format these elements.
  • No support for origin/development indexes

Concatenation

Another cool feature that we can adapt is the concatenation of stylers. For example, applying this to a Triangle(s) with a compatible table of LDFs should give us the ability to build the exhibits in Friedland, such as:

Image

Builtin styles

The Pandas styler has builtin styles. The Triangle styler can have its own builtins, where we can format things like latest diagonal, lower triangle, upper triangle, origin, development, etc. This can be done via:

Triangle.style.highlight_lower_triangle(color="blue")

Which can be the result of solving #1324.

Activity

  1. added this to the v0.11.0 milestone on Sep 10, 2026
  2. self-assigned this
    on Sep 10, 2026
  3. added theissue type on Sep 10, 2026
  4. updated Scope Both and Effort High on Sep 10, 2026
  5. priyam0k commented on Sep 12, 2026

    @priyam0k
    Contributor

    Really excited to see this coming together.
    I'm working through the Friedland Chapter 12 recreation right now, and having lower triangle and diagonal styling will make those case outstanding exhibits look just like the text.
    I can jump on #1334 (highlight_diagonal) right after #1342 lands.

  6. added a commit that references this issue on Sep 19, 2026
  7. moved this from Not Ready to In progress in Chainladder-Python Project Boardon Sep 20, 2026
  8. added a commit that references this issue on Sep 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Fields

Priority

High

Effort

High

Scope

Both

Projects

Relationships

None yet

Development

No branches or pull requests

Issue actions