All files / src/pages/flowsheet-page/economics/results-panel/charts constants.ts

100% Statements 26/26
100% Branches 0/0
100% Functions 4/4
100% Lines 26/26

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93      103x 103x 103x 103x 103x 103x 103x 103x   103x   103x 103x 103x 103x 103x 103x   103x                             103x                     103x             103x                             103x                             103x   1133x 618x   103x 1133x 618x  
import type { ChartConfig } from "@/ahuora-design-system/ui/chart";
import keyFinancialMetricRows from "@/data/economicsKeyFinancialMetrics.json";
 
export const CHART_CASH_FLOW_NPV = "cash_flow_npv";
export const CHART_CAPEX_BREAKDOWN = "capex_breakdown";
export const CHART_OPEX_BREAKDOWN = "opex_breakdown";
export const CHART_MANUAL_BASELINE_COMPARISON = "manual_baseline_comparison";
export const CHART_OPERATING_COST_CUMULATIVE = "operating_cost_cumulative";
export const CHART_OPERATING_COST_PROFILE = "operating_cost_profile";
export const COMPARISON_CHART_CASH_FLOW = "comparison_cash_flow_npv";
export const COMPARISON_CHART_COST_BREAKDOWN = "comparison_cost_breakdown";
export const COMPARISON_CHART_OPERATING_CUMULATIVE =
  "comparison_operating_cost_cumulative";
export const COMPARISON_CHART_OPERATING_PROFILE =
  "comparison_operating_cost_profile";
export const RESULT_CHART_BOTTOM_MARGIN = 36;
export const RESULT_CHART_X_AXIS_LABEL_OFFSET = -22;
export const RESULT_CHART_Y_AXIS_WIDTH = 84;
export const RESULT_CHART_Y_AXIS_LABEL_DY = 54;
export const RESULT_CHART_Y_AXIS_LABEL_OFFSET = 12;
 
export const resultChartColors = {
  green: "hsl(142 72% 42%)",
  blue: "hsl(199 89% 48%)",
  amber: "hsl(35 92% 54%)",
  purple: "hsl(262 83% 66%)",
  rose: "hsl(339 82% 59%)",
  teal: "hsl(188 84% 42%)",
  orange: "hsl(13 86% 58%)",
  indigo: "hsl(221 83% 63%)",
  yellow: "hsl(48 96% 53%)",
  mint: "hsl(160 72% 40%)",
  magenta: "hsl(295 74% 61%)",
  copper: "hsl(24 88% 58%)",
} as const;
 
export const cashFlowChartConfig = {
  annualNetCashFlow: {
    label: "Annual Net Cash Flow",
    color: resultChartColors.green,
  },
  cumulativeDiscountedCashFlow: {
    label: "Cumulative Discounted Cash Flow",
    color: resultChartColors.blue,
  },
} satisfies ChartConfig;
 
export const breakdownChartConfig = {
  value: {
    label: "Amount",
    color: resultChartColors.amber,
  },
} satisfies ChartConfig;
 
export const comparisonChartConfig = {
  target: {
    label: "Target",
    color: resultChartColors.blue,
  },
  baseline: {
    label: "Baseline",
    color: resultChartColors.amber,
  },
  result: {
    label: "Result",
    color: resultChartColors.green,
  },
} satisfies ChartConfig;
 
export const operatingTimelineColors = [
  resultChartColors.green,
  resultChartColors.blue,
  resultChartColors.amber,
  resultChartColors.purple,
  resultChartColors.rose,
  resultChartColors.teal,
  resultChartColors.orange,
  resultChartColors.indigo,
  resultChartColors.yellow,
  resultChartColors.mint,
  resultChartColors.magenta,
  resultChartColors.copper,
];
 
export const DEFAULT_COMPARISON_METRIC_KEYS = new Set(
  keyFinancialMetricRows
    .filter((row) => row.defaultComparisonMetric)
    .map((row) => row.key),
);
export const COMPARISON_METRIC_FILTERS = keyFinancialMetricRows
  .filter((row) => DEFAULT_COMPARISON_METRIC_KEYS.has(row.key))
  .map((row) => ({ value: row.key, label: row.label }));