diff options
| author | Fabian Mastenbroek <mail.fabianm@gmail.com> | 2020-11-01 22:08:04 +0100 |
|---|---|---|
| committer | Fabian Mastenbroek <mail.fabianm@gmail.com> | 2020-11-01 22:08:04 +0100 |
| commit | 92b951df1d02e609907dc3f69703ac544fde692c (patch) | |
| tree | 644f7f0ee34fdda1b2347630aefba99a1953544e /frontend/src/components | |
| parent | 42470f1e50e1ca98868f53a70604ae56829d570b (diff) | |
Show full metric names
This change updates the frontend such that metrics are now shown by
their full name instead of a code.
Diffstat (limited to 'frontend/src/components')
| -rw-r--r-- | frontend/src/components/app/results/PortfolioResultsComponent.js | 4 | ||||
| -rw-r--r-- | frontend/src/components/modals/custom-components/NewPortfolioModalComponent.js | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/frontend/src/components/app/results/PortfolioResultsComponent.js b/frontend/src/components/app/results/PortfolioResultsComponent.js index 10b189a6..759acd57 100644 --- a/frontend/src/components/app/results/PortfolioResultsComponent.js +++ b/frontend/src/components/app/results/PortfolioResultsComponent.js @@ -1,7 +1,7 @@ import React from 'react' import PropTypes from 'prop-types' import { Bar, CartesianGrid, ComposedChart, ErrorBar, ResponsiveContainer, Scatter, XAxis, YAxis } from 'recharts' -import { AVAILABLE_METRICS, METRIC_NAMES, METRIC_UNITS } from '../../../util/available-metrics' +import { AVAILABLE_METRICS, METRIC_NAMES_SHORT, METRIC_UNITS } from '../../../util/available-metrics' import { mean, std } from 'mathjs' import Shapes from '../../../shapes/index' import approx from 'approximate-number' @@ -52,7 +52,7 @@ const PortfolioResultsComponent = ({ portfolio, scenarios }) => { <div className="row"> {AVAILABLE_METRICS.map((metric) => ( <div className="col-6 mb-2" key={metric}> - <h4>{METRIC_NAMES[metric]}</h4> + <h4>{METRIC_NAMES_SHORT[metric]}</h4> <ResponsiveContainer aspect={16 / 9} width="100%"> <ComposedChart data={dataPerMetric[metric]} diff --git a/frontend/src/components/modals/custom-components/NewPortfolioModalComponent.js b/frontend/src/components/modals/custom-components/NewPortfolioModalComponent.js index 978ca11d..67646e2c 100644 --- a/frontend/src/components/modals/custom-components/NewPortfolioModalComponent.js +++ b/frontend/src/components/modals/custom-components/NewPortfolioModalComponent.js @@ -2,7 +2,7 @@ import PropTypes from 'prop-types' import React, { useRef } from 'react' import { Form, FormGroup, Input, Label } from 'reactstrap' import Modal from '../Modal' -import { AVAILABLE_METRICS } from '../../../util/available-metrics' +import { AVAILABLE_METRICS, METRIC_NAMES } from '../../../util/available-metrics' const NewPortfolioModalComponent = ({ show, callback }) => { const textInput = useRef(null) @@ -39,7 +39,7 @@ const NewPortfolioModalComponent = ({ show, callback }) => { type="checkbox" innerRef={(ref) => (metricCheckboxes.current[metric] = ref)} /> - <code>{metric}</code> + {METRIC_NAMES[metric]} </Label> </FormGroup> ))} |
