Kit showcase

The page kit's inputs, values, charts and tables on one page: a slider, a number input and a choice drive an exponential decline, shown as values, charts on tabs, a table and a markdown note.

Open in the workbench Open the live page

Live preview

The page kit's inputs, values, charts and tables on one page: a slider, a number input and a choice drive an exponential decline, shown as values, charts on tabs, a table and a markdown note.

Source kit-showcase.dashboard

<Page MaxWidth="Normal">
    <Row>
        <Section Title="PROD1 decline" Icon="inputs">
            <Slider Label="Initial rate" @bind-Value="Qi" Min="100" Max="2000" Step="50" Unit="STB/D" />
            <NumberInput Label="Decline" @bind-Value="D" Unit="1/month" />
            <Choice Label="Case" @bind-Value="Case" Options="Cases" />
        </Section>
        <Section Title="Result" Icon="value">
            <Value Label="EUR" Number="@Eur" Unit="MSTB" Format="N0" />
            <Value Label="Recovery factor" Number="@(Eur / 1500)" Format="P1" />
        </Section>
    </Row>

    <Tabs>
        <Tab Title="Charts">
            <Section Title="Rates" Icon="chart">
                <Chart Rows="Forecast" X="Date" Series="Oil:STB/D + Water:STB/D, Gor:scf/STB" />
            </Section>
        </Tab>
        <Tab Title="Table">
            <Section Title="Forecast" Icon="table">
                <Table Rows="Forecast" Columns="Period, Oil:STB/D, Water:STB/D, Gor:scf/STB" Format="F0" />
            </Section>
        </Tab>
    </Tabs>

    <Columns Count="2">
        <Section Title="Water cut" Icon="chart">
            <Chart Rows="Forecast" X="Index" Series="Cut" LogY="true" />
        </Section>
        <Notes Title="Method" Text="@Method" />
    </Columns>
</Page>

@code {
    // PROD1 at the end of its history, January 2025, from 01-office/excel/production-history.xlsx.
    double Qi = 250;
    double D = 0.05;
    static readonly string[] Cases = ["P90", "P50", "P10"];
    string Case = "P50";

    record Month(int Index, DateOnly Date, double Oil, double Water, double Gor)
    {
        public string Period => Date.ToString("yyyy-MM", System.Globalization.CultureInfo.InvariantCulture);
        public double Cut => Water / (Oil + Water);
    }

    double Factor => Case switch { "P90" => 0.8, "P10" => 1.25, _ => 1.0 };

    // Exponential decline with a rising water rate and GOR: two years, a row a month.
    IReadOnlyList<Month> Forecast => Enumerable.Range(0, 24)
        .Select(m => new Month(m, new DateOnly(2025, 1, 1).AddMonths(m), Qi * Factor * Math.Exp(-D * m), 500 + 10 * m, 760 + 10 * m))
        .ToList();

    // Thousands of stock-tank barrels: a month is 30.44 days on average.
    double Eur => Forecast.Sum(f => f.Oil) * 30.44 / 1000;

    // Razor's parser does not take a raw string literal, and a verbatim one would carry this indentation into the
    // markdown, where four spaces start a code block.
    const string Method =
        "**Exponential decline**, q(t) = qi · exp(−D·t), one row a month for two years.\n\n" +
        "| Case | Factor on qi |\n|------|--------------|\n| P90 | 0.8 |\n| P50 | 1.0 |\n| P10 | 1.25 |\n\n" +
        "The water rate and GOR rise linearly from PROD1's at the end of 2024; the cut is water over liquid.";
}