SL2 Analyzer
Read a FromSoftware .sl2 save and report what is in it
Loading...
Searching...
No Matches
sl2.chart Namespace Reference

Functions

 mm (text)
 Mermaid takes the label between double quotes, so the label may not contain one; #quot; is its own escape.
 
 label (lines)
 
 plural (n, word)
 "1 boss" / "2 bosses".
 
 hms (sec)
 Format a play time as H:MM:SS, or an em dash when the game does not store one.
 
 rank (r)
 The number a game counts progress in, for a snapshot's label or table cell.
 
 rank_cell (r)
 The same value bare, for a table cell whose column is already labelled.
 
 rank_label (game)
 Header for that column, given the run's game.
 
 run_chart (rows, parents, restarts, refs, theme=None)
 One run's snapshot tree, as a Mermaid flowchart.
 
 journey_chart (runs, refs)
 The cross-game journey: one node per run, in the order they were played.
 
 reference_list (order)
 The reference list every chart node points at.
 

Detailed Description

Mermaid flowcharts for the combined document.

Two charts, and they mean two different things, which is exactly why they are two
charts. The JOURNEY chart is real-world time: which game you played, in what order,
by file date. A RUN chart is save lineage inside one character: which snapshot came
from which, by what progress it contains. Drawing both in one picture would leave an
arrow meaning "later that month" in one place and "reloaded and forked" in another.

Every node is one .sl2 file, referred to by its number in the document's reference
list rather than its name — a filename in a box makes the box wider than the chart.

Function Documentation

◆ mm()

sl2.chart.mm (   text)

Mermaid takes the label between double quotes, so the label may not contain one; #quot; is its own escape.

Line breaks inside a node are <br/>. (Both are backticked so Doxygen reads them as literals — bare #quot; is a link request to it, and a bare break tag is parsed as HTML.)

Definition at line 22 of file chart.py.

Referenced by sl2.chart.label().

Here is the caller graph for this function:

◆ label()

sl2.chart.label (   lines)

Definition at line 26 of file chart.py.

References sl2.chart.mm().

Referenced by sl2.chart.journey_chart(), and sl2.chart.run_chart().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ plural()

sl2.chart.plural (   n,
  word 
)

"1 boss" / "2 bosses".

A fresh save really does hold one of things, and a count that reads "1 bosses" makes the whole document look generated.

Definition at line 32 of file chart.py.

◆ hms()

sl2.chart.hms (   sec)

Format a play time as H:MM:SS, or an em dash when the game does not store one.

Definition at line 39 of file chart.py.

◆ rank()

sl2.chart.rank (   r)

The number a game counts progress in, for a snapshot's label or table cell.

Every game but one levels up, so "lv95" is the obvious shorthand — but Sekiro has no level at all, and printing "lv0" for it would state a field the game does not have. Its equivalent is Attack Power, which only ever climbs (one point per Memory consumed), so that is what its charts and tables count in.

Parameters
rA snapshot.
Returns
e.g. "lv95" or "atk 7".

Definition at line 54 of file chart.py.

◆ rank_cell()

sl2.chart.rank_cell (   r)

The same value bare, for a table cell whose column is already labelled.

Definition at line 61 of file chart.py.

◆ rank_label()

sl2.chart.rank_label (   game)

Header for that column, given the run's game.

Definition at line 70 of file chart.py.

◆ run_chart()

sl2.chart.run_chart (   rows,
  parents,
  restarts,
  refs,
  theme = None 
)

One run's snapshot tree, as a Mermaid flowchart.

One node per save file, labelled with its reference number, the level it was at, and what it achieved that its parent had not. A node that achieved nothing still appears — it is a real save and its file is real — but it says so with nothing rather than with filler.

Parameters
rowsThe run's snapshots in order.
parentsParent index per row,
restartsrows that start a fresh line.
refs{filename: reference number}.
themeGame id, used to colour the ending/leaf nodes.
Returns
A list of Markdown lines, fenced as a mermaid block.

Definition at line 85 of file chart.py.

References sl2.chart.label().

Here is the call graph for this function:

◆ journey_chart()

sl2.chart.journey_chart (   runs,
  refs 
)

The cross-game journey: one node per run, in the order they were played.

Ordered and linked by FILE DATE, because that is the only clock shared across games — a Dark Souls II play time and a Dark Souls III one are unrelated numbers. Each node carries the run's span in files and where it got to, so the chart answers "what have I actually played" on its own.

Parameters
runs{(game, name): [snapshot, ...]},
refs{filename: number}.

Definition at line 132 of file chart.py.

References sl2.chart.label().

Here is the call graph for this function:

◆ reference_list()

sl2.chart.reference_list (   order)

The reference list every chart node points at.

Wiki-style [[links]] because that is what the owner reads these in, and ordered earliest to latest by file date so the numbering itself carries the history.

Definition at line 162 of file chart.py.