sim_chart#

Draws a gear sim’s results as a PNG bar chart that reads at a glance: better to the right, worse to the left.

Each Panel is one gear option; inside it each MetricGroup (threat, damage taken, DPS…) has one Bar per fight. Bars are already oriented by the caller (positive = better for the player, so less damage taken points right) and coloured by Effect, with grey for changes inside the sim’s margin of error. Every option shares one scale, so bar lengths compare across options. Pillow’s bundled font has no arrows or dashes, so all chart text must be plain ASCII.

sidequest_bot.lib.sim_chart.Effect#
class sidequest_bot.lib.sim_chart.Bar[source]#

One fight’s change: value is the % change oriented so positive is better; text is drawn beside it.

label: str#
value: float#
text: str#
effect: Effect#
class sidequest_bot.lib.sim_chart.MetricGroup[source]#

One metric’s bars, under a title like Threat.

title: str#
bars: list[Bar]#
class sidequest_bot.lib.sim_chart.Panel[source]#

One gear option: a title like Quel'Serrar vs Eater of the Dead and its metric groups.

title: str#
groups: list[MetricGroup]#
sidequest_bot.lib.sim_chart.SCALE = 2#

Drawn at twice the layout size so the chart stays sharp when Discord scales it down.

sidequest_bot.lib.sim_chart.WIDTH = 640#
sidequest_bot.lib.sim_chart.PAD = 20#
sidequest_bot.lib.sim_chart.LABEL_WIDTH = 150#
sidequest_bot.lib.sim_chart.TEXT_ROOM = 90#

Room kept beside the longest bar for its value text.

sidequest_bot.lib.sim_chart.BAR_HEIGHT = 18#
sidequest_bot.lib.sim_chart.ROW_HEIGHT = 28#
sidequest_bot.lib.sim_chart.GROUP_TITLE_HEIGHT = 26#
sidequest_bot.lib.sim_chart.PANEL_TITLE_HEIGHT = 30#
sidequest_bot.lib.sim_chart.AXIS_HEADER_HEIGHT = 22#
sidequest_bot.lib.sim_chart.PANEL_GAP = 22#
sidequest_bot.lib.sim_chart.MIN_SCALE_PCT = 2.0#

The smallest full-bar scale, so a 0.3% change doesn’t fill the chart and look huge.

sidequest_bot.lib.sim_chart.MIN_BAR_WIDTH = 3#
sidequest_bot.lib.sim_chart.BACKGROUND = (43, 45, 49)#
sidequest_bot.lib.sim_chart.TEXT = (242, 243, 245)#
sidequest_bot.lib.sim_chart.MUTED = (181, 186, 193)#
sidequest_bot.lib.sim_chart.AXIS = (90, 93, 102)#
sidequest_bot.lib.sim_chart.COLORS: dict[Effect, tuple[int, int, int]]#
sidequest_bot.lib.sim_chart.render_chart(panels: collections.abc.Sequence[Panel]) → bytes[source]#

panels drawn top to bottom as one PNG.