# Measured review sequence · Sequence

Preview

![Measured review sequence](sequence-layout-typography-wide-light.png)

![Measured review sequence](sequence-layout-typography-wide-dark.png)

1000 × 620 pixels

## Create this example

Create a console project, add the ChartForgeX package, and replace Program.cs with this source. Run it to write SVG, PNG and HTML with the default system fonts.

For the same typography as the gallery, [download the gallery-font recipe](sequence-layout-typography-wide-light.gallery.csharp.txt) and copy the gallery’s fonts directory beside your program.

```
#region Setup
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
using ChartForgeX;
using ChartForgeX.Core;
using ChartForgeX.Primitives;
using ChartForgeX.Rendering;
using ChartForgeX.Themes;
using ChartForgeX.Topology;
using ChartForgeX.Typography;
using ChartForgeX.VisualArtifacts;
using ChartForgeX.VisualBlocks;

var mode = ThemeMode.Light;
var theme = VisualTheme.Graphite();
var model = SequenceLayoutTypographyRecipe.Create("wide", mode);
var context = new VisualRenderContext(
    new VisualLayoutOptions(new VisualSize(1000, 620)), theme, mode,
    new VisualFrame("Measured review sequence", "Independent native role typography and spacing", showLegend: false, showSurface: false));
var prepared = model.Prepare(context);
File.WriteAllText("visual.svg", prepared.ToSvg());
File.WriteAllBytes("visual.png", prepared.ToPng());
File.WriteAllText("visual.html", prepared.ToArtifact("example", VisualArtifactKind.Sequence).ToHtmlPage());
#endregion

/// <summary>Creates a native sequence with independent measured role typography and explicit logical spacing.</summary>
public static class SequenceLayoutTypographyRecipe {
    /// <summary>Creates compact 390x620 or wide 1000x620 authored minima; natural exports may grow. No source parser or browser is invoked.</summary>
    public static SequenceArtifact Create(string variant="wide",ThemeMode mode=ThemeMode.Light) {
        if(variant is not ("compact" or "wide"))throw new ArgumentOutOfRangeException(nameof(variant));
        var model=SequenceArtifact.Create("sequence-layout").Width(variant=="compact"?390:1000).Height(620)
            .Title("Measured review sequence").Subtitle("Each role retains its own font and source identity")
            .AddParticipant("A","Review").AddParticipant("B","Store")
            .AddMessage("A","B","Save").AddMessage("B","A","Ready",SequenceArtifactMessageLineStyle.Dashed,SequenceArtifactMessageKind.Return)
            .AddBlock(SequenceArtifactBlockKind.Alt,"Accepted",0,1).AddActivation("B",true,0).AddActivation("B",false,2)
            .AddNote(SequenceArtifactNotePlacement.Over,new[]{"A","B"},"Retain record facts");
        model.Notes[0].StepIndex=1;model.Metadata["mermaid.autonumber"]="true";model.Theme=VisualTheme.Graphite();model.ThemeMode=mode;
        model.Layout=new SequenceLayoutPolicy(participantMinimumWidth:90,participantMinimumHeight:60,participantSpacing:20,messageSpacing:18,
            noteSpacing:12,fragmentMargin:10,fragmentLabelPadding:6,activationWidth:14,wrapPadding:8);
        model.Typography=new SequenceTypography(new TextStyleOverride{FontSize=17,FontWeight=700},new TextStyleOverride{FontSize=16,FontWeight=500},
            new TextStyleOverride{FontSize=14,FontWeight=400},new TextStyleOverride{FontSize=15,FontWeight=600},new TextStyleOverride{FontSize=13,FontWeight=700});
        return model;
    }
}
```

```
#region Setup
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
using ChartForgeX;
using ChartForgeX.Core;
using ChartForgeX.Primitives;
using ChartForgeX.Rendering;
using ChartForgeX.Themes;
using ChartForgeX.Topology;
using ChartForgeX.Typography;
using ChartForgeX.VisualArtifacts;
using ChartForgeX.VisualBlocks;

var mode = ThemeMode.Dark;
var theme = VisualTheme.Graphite();
var model = SequenceLayoutTypographyRecipe.Create("wide", mode);
var context = new VisualRenderContext(
    new VisualLayoutOptions(new VisualSize(1000, 620)), theme, mode,
    new VisualFrame("Measured review sequence", "Independent native role typography and spacing", showLegend: false, showSurface: false));
var prepared = model.Prepare(context);
File.WriteAllText("visual.svg", prepared.ToSvg());
File.WriteAllBytes("visual.png", prepared.ToPng());
File.WriteAllText("visual.html", prepared.ToArtifact("example", VisualArtifactKind.Sequence).ToHtmlPage());
#endregion

/// <summary>Creates a native sequence with independent measured role typography and explicit logical spacing.</summary>
public static class SequenceLayoutTypographyRecipe {
    /// <summary>Creates compact 390x620 or wide 1000x620 authored minima; natural exports may grow. No source parser or browser is invoked.</summary>
    public static SequenceArtifact Create(string variant="wide",ThemeMode mode=ThemeMode.Light) {
        if(variant is not ("compact" or "wide"))throw new ArgumentOutOfRangeException(nameof(variant));
        var model=SequenceArtifact.Create("sequence-layout").Width(variant=="compact"?390:1000).Height(620)
            .Title("Measured review sequence").Subtitle("Each role retains its own font and source identity")
            .AddParticipant("A","Review").AddParticipant("B","Store")
            .AddMessage("A","B","Save").AddMessage("B","A","Ready",SequenceArtifactMessageLineStyle.Dashed,SequenceArtifactMessageKind.Return)
            .AddBlock(SequenceArtifactBlockKind.Alt,"Accepted",0,1).AddActivation("B",true,0).AddActivation("B",false,2)
            .AddNote(SequenceArtifactNotePlacement.Over,new[]{"A","B"},"Retain record facts");
        model.Notes[0].StepIndex=1;model.Metadata["mermaid.autonumber"]="true";model.Theme=VisualTheme.Graphite();model.ThemeMode=mode;
        model.Layout=new SequenceLayoutPolicy(participantMinimumWidth:90,participantMinimumHeight:60,participantSpacing:20,messageSpacing:18,
            noteSpacing:12,fragmentMargin:10,fragmentLabelPadding:6,activationWidth:14,wrapPadding:8);
        model.Typography=new SequenceTypography(new TextStyleOverride{FontSize=17,FontWeight=700},new TextStyleOverride{FontSize=16,FontWeight=500},
            new TextStyleOverride{FontSize=14,FontWeight=400},new TextStyleOverride{FontSize=15,FontWeight=600},new TextStyleOverride{FontSize=13,FontWeight=700});
        return model;
    }
}
```

<!-- PowerForge markdown artifact sha256:009F149F4EE2123F2AABC0A93F359652806A9F08C90F58CE8E8BBEFD86179FC9 -->
