@model AnalyticsViewModel @{ ViewData["Title"] = "Story Health"; ViewData["ShellClass"] = "plotline-shell-wide"; ViewData["ProjectSection"] = "Health"; var openThreads = Model.ThreadHealth.Where(x => x.IsOpenStatus).ToList(); var dormantThreads = Model.ThreadHealth.Where(x => x.IsDormant).ToList(); var unresolvedAssets = Model.AssetHealth.Where(x => !x.IsResolved).ToList(); var metricScenes = Model.MetricGraphs .SelectMany(graph => graph.Points) .GroupBy(point => point.SceneID) .Select(group => group.OrderBy(point => point.GlobalSceneIndex).First()) .OrderBy(point => point.GlobalSceneIndex) .Select(point => new { sceneId = point.SceneID, axisLabel = $"{point.ChapterNumber:g}.{point.SceneNumber:g}", chapterLabel = $"Chapter {point.ChapterNumber:g}", sceneNumber = point.SceneNumber.ToString("g"), sceneTitle = point.SceneTitle, bookTitle = point.BookDisplayTitle, timelineUrl = Url.Action("Index", "Timeline", new { ProjectID = Model.Project.ProjectID, BookID = point.BookID, SelectedSceneID = point.SceneID, FocusType = "scene", FocusID = point.SceneID }) }) .ToList(); var metricShapePayload = new { scenes = metricScenes, metrics = Model.MetricGraphs.Select(graph => new { metricName = graph.MetricName, points = graph.Points.Select(point => new { sceneId = point.SceneID, value = point.Value }) }) }; }

Analytics / Story health

@Model.Project.ProjectName

Open threads@openThreads.Count
Dormant threads@dormantThreads.Count
Unresolved assets@unresolvedAssets.Count
Warning hotspots@Model.WarningHotspots.Count

Scene metric shape

@Model.MetricGraphs.Count metric@(Model.MetricGraphs.Count == 1 ? "" : "s")
@if (!Model.MetricGraphs.Any() || !metricScenes.Any()) {

Add scene metrics to begin seeing peaks and troughs across the story.

} else {

Compare selected pacing and emotional metrics across scenes in narrative order. Click a point to open that scene on the timeline.

32 px / scene Scroll horizontally to explore the story.

Metric chart could not load. The raw metric rows are still available below.

Show raw metric rows
@foreach (var graph in Model.MetricGraphs) {
@graph.MetricName
@foreach (var point in graph.Points) { @point.Value }
}
}