SPB Git

Repository Public

WhatIfToolList.swift 1.6 KB 30 lines swift

1import SwiftUI2import AnalysisKit34/// What-If tools (inspector pane `whatif`, studio variant `whatif-studio`, one Analyze action per tool).5public enum WhatIfToolList {6    public static var all: [ToolDescriptor] {7        [GoalSeekTool.descriptor, BreakEvenTool.descriptor, DataTableTools.oneVariable, DataTableTools.twoVariable, scenarios,8         TornadoTool.descriptor, MonteCarloTool.descriptor]9    }1011    static let scenarios: ToolDescriptor = {12        var t = ToolDescriptor(13            id: "scenarios", title: L("Scenario Manager"), group: L("Scenarios"), systemImage: "square.stack.3d.up",14            summary: L("Stores named sets of input values, applies them to the model and compares result cells across scenarios."),15            fields: [],16            info: [17                L("Scenarios are saved inside the workbook (attachment “scenarios.json”) and identify sheets by their stable identifier, so they survive renaming and reordering of sheets."),18                L("Applying a scenario is a single undoable edit of its cells. Formulas overwritten by a scenario come back with Undo."),19                L("The summary recalculates a private copy of the workbook for each scenario; the live workbook is not modified."),20            ],21            run: { _ in ToolResult(title: L("Scenario Manager"), blocks: [], canWriteReport: false) })22        t.customPanel = { session in AnyView(ScenarioPanel(session: session)) }23        t.demo = { session, _ in ScenarioStore.installDemo(session) }24        return t25    }()26}2728/// The resource bundle of WhatIfTools (for tests).29public let whatIfBundle = Bundle.module30
Files main
Menu

Theme