Internal API

PowerGraphics._auto_power_unitMethod
_auto_power_unit(peak::Real) -> Tuple{Float64, String}

Pick a power unit and scaling divisor from the peak magnitude of the plotted totals (values are assumed to be in MW): < 1e3 → MW, [1e3, 1e6) → GW, ≥ 1e6 → TW. Returns (divisor, unit_string).

source
PowerGraphics._resolve_power_unitsMethod
_resolve_power_units(
    df::DataFrame,
    kwargs
) -> Tuple{Any, Any}

Resolve the y-axis label and data-scaling divisor for a fuel/generation plot. Honors an explicit :y_label or :power_scale kwarg; otherwise auto-detects MW/GW/TW from the peak stacked total of df, unless :auto_units => false or :bar => true (energy bar plots keep the existing MWh behavior).

source
PowerGraphics._signed_stack_boundsMethod
_signed_stack_bounds(
    data::AbstractMatrix
) -> Tuple{Any, Any}

Per-series (lower, upper) envelopes for a sign-aware stacked-area/line plot. data is time × series. Positive values stack upward from 0, negative values (e.g. storage charging or source input via ActivePowerInVariable) stack downward from 0, so charging renders below the zero axis instead of being folded into the positive generation stack. Returns (lower, upper) matrices the same size as data; band ix is [lower[:,ix], upper[:,ix]].

source