diff --git a/src/utils/charts/PROGRAM_CHART_VALUES.js b/src/forms/output/BENEFIT_CHART_VALUES.js similarity index 82% rename from src/utils/charts/PROGRAM_CHART_VALUES.js rename to src/forms/output/BENEFIT_CHART_VALUES.js index 457996be..031764f5 100644 --- a/src/utils/charts/PROGRAM_CHART_VALUES.js +++ b/src/forms/output/BENEFIT_CHART_VALUES.js @@ -1,5 +1,5 @@ -const PROGRAM_CHART_VALUES = { +const BENEFIT_CHART_VALUES = { earned: { name: `Earned`, color: `rgb(136, 187, 236)`, @@ -18,4 +18,4 @@ const PROGRAM_CHART_VALUES = { }, }; -export { PROGRAM_CHART_VALUES }; +export { BENEFIT_CHART_VALUES }; diff --git a/src/forms/output/BenefitsLines.js b/src/forms/output/BenefitsLines.js index 3333348d..88a59fe3 100644 --- a/src/forms/output/BenefitsLines.js +++ b/src/forms/output/BenefitsLines.js @@ -18,8 +18,8 @@ import { // LOGIC import { timescaleMultipliers } from '../../utils/convert-by-timescale'; -import { getChartData } from '../../utils/charts/getChartData'; -import { toFancyMoneyStr } from '../../utils/charts/chartFormatting'; +import { getChartData } from './getChartData'; +import { toFancyMoneyStr } from './chartFormatting'; import { formatMoneyWithK, textFromTranslatedElement, @@ -27,13 +27,13 @@ import { import { zoom } from './zoom'; // DATA -import { PROGRAM_CHART_VALUES } from '../../utils/charts/PROGRAM_CHART_VALUES'; +import { BENEFIT_CHART_VALUES } from './BENEFIT_CHART_VALUES'; // Graphs get things in monthly values, so we'll convert from there let multipliers = timescaleMultipliers.fromMonthly, // Each graph controls its own scaling - limits = PROGRAM_CHART_VALUES.limits; + limits = BENEFIT_CHART_VALUES.limits; /** Graph of each benefit as household income changes. Uses Highchart lib. * @class diff --git a/src/forms/output/ResourcesColumns.js b/src/forms/output/ResourcesColumns.js index 7aae30fa..863ef5c7 100644 --- a/src/forms/output/ResourcesColumns.js +++ b/src/forms/output/ResourcesColumns.js @@ -17,8 +17,8 @@ import { // LOGIC import { timescaleMultipliers } from '../../utils/convert-by-timescale'; -import { getChartData } from '../../utils/charts/getChartData'; -import { toFancyMoneyStr } from '../../utils/charts/chartFormatting'; +import { getChartData } from './getChartData'; +import { toFancyMoneyStr } from './chartFormatting'; import { formatMoneyWithK, textFromTranslatedElement, diff --git a/src/forms/output/StackedResources.js b/src/forms/output/StackedResources.js index 99af73b1..26ee079a 100644 --- a/src/forms/output/StackedResources.js +++ b/src/forms/output/StackedResources.js @@ -18,8 +18,8 @@ import { // LOGIC import { timescaleMultipliers } from '../../utils/convert-by-timescale'; -import { getChartData } from '../../utils/charts/getChartData'; -import { toFancyMoneyStr } from '../../utils/charts/chartFormatting'; +import { getChartData } from './getChartData'; +import { toFancyMoneyStr } from './chartFormatting'; import { formatMoneyWithK, textFromTranslatedElement, @@ -27,13 +27,13 @@ import { import { zoom } from './zoom'; // DATA -import { PROGRAM_CHART_VALUES } from '../../utils/charts/PROGRAM_CHART_VALUES'; +import { BENEFIT_CHART_VALUES } from './BENEFIT_CHART_VALUES'; // Graphs get things in monthly values, so we'll convert from there let multipliers = timescaleMultipliers.fromMonthly, // Each graph controls its own scaling - limits = PROGRAM_CHART_VALUES.limits; + limits = BENEFIT_CHART_VALUES.limits; // Still @todo diff --git a/src/forms/output/Summary.js b/src/forms/output/Summary.js index 44e0ea7c..6f232a3c 100644 --- a/src/forms/output/Summary.js +++ b/src/forms/output/Summary.js @@ -9,7 +9,7 @@ import { // DATA // Colors and text for parts of the chart -import { PROGRAM_CHART_VALUES } from '../../utils/charts/PROGRAM_CHART_VALUES'; +import { BENEFIT_CHART_VALUES } from './BENEFIT_CHART_VALUES'; // DATA MANIPULATION import { cloneDeep } from 'lodash'; @@ -65,8 +65,8 @@ let totalLastItemsOfArraysInObject = function (accumulated) { * accumulate values. * * @example - * // In PROGRAM_CHART_VALUES.js - * let PROGRAM_CHART_VALUES = { + * // In BENEFIT_CHART_VALUES.js + * let BENEFIT_CHART_VALUES = { * benefit1: { name: "B1" }, * benefit2: { name: "B2" }, * }; @@ -99,7 +99,7 @@ let totalLastItemsOfArraysInObject = function (accumulated) { * // } * * Unfortunately, stll relies on an outside value - - * PROGRAM_CHART_VALUES. + * BENEFIT_CHART_VALUES. * * @typedef {object} benefit * @property {string} label Name to be displayed for the benefit @@ -136,7 +136,7 @@ let fillInMoneyValues = (keys, sourceObject, index) => { moneyValues.earned = amount; } else { moneyValues.benefits.push({ - label: PROGRAM_CHART_VALUES[ itemKey ].name, + label: BENEFIT_CHART_VALUES[ itemKey ].name, amount: amount, }); // Add up all benefits (we're not including earned income) diff --git a/src/utils/charts/chartFormatting.js b/src/forms/output/chartFormatting.js similarity index 100% rename from src/utils/charts/chartFormatting.js rename to src/forms/output/chartFormatting.js diff --git a/src/utils/charts/getChartData.js b/src/forms/output/getChartData.js similarity index 95% rename from src/utils/charts/getChartData.js rename to src/forms/output/getChartData.js index 976e5161..c16d84fd 100644 --- a/src/utils/charts/getChartData.js +++ b/src/forms/output/getChartData.js @@ -1,5 +1,5 @@ import _ from 'lodash'; -import { PROGRAM_CHART_VALUES } from '../../utils/charts/PROGRAM_CHART_VALUES'; +import { BENEFIT_CHART_VALUES } from './BENEFIT_CHART_VALUES'; // LOGIC import { applyAndPushBenefits } from '../../programs/applyAndPushBenefits'; @@ -72,7 +72,7 @@ const getChartData = function (incomes, multiplier, client, activeBenefitsInOrde // Return in the same order as it was asked for for (let benefiti = 0; benefiti < benefits.length; benefiti++) { let benefitName = benefits[ benefiti ], - graphFrosting = PROGRAM_CHART_VALUES[ benefitName ]; + graphFrosting = BENEFIT_CHART_VALUES[ benefitName ]; // All the graph info for that benefit benefitDatasets.push({