Skip to content

Commit

Permalink
Use different dataset selector label for Change from Baseline graph
Browse files Browse the repository at this point in the history
  • Loading branch information
eyvorchuk committed Jun 10, 2024
1 parent dda3486 commit 4858c0f
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 3 deletions.
10 changes: 8 additions & 2 deletions src/components/graphs/AnnualCycleGraph/AnnualCycleGraph.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@ import {
errorMessage,
loadingDataGraphSpec,
} from "../graph-helpers";
import { datasetSelectorLabel } from "../../guidance-content/info/InformationItems";
import {
datasetSelectorLabel,
baselineSelectorLabel,
} from "../../guidance-content/info/InformationItems";
import {
representativeValue,
findStartEndDates,
Expand Down Expand Up @@ -174,6 +177,9 @@ export default class AnnualCycleGraph extends React.Component {
replaceInvalidDataSpec = this.props.isAnomalyAnnualCycle
? findStartEndDates("1981", "2010")
: undefined;
selectorLabel = this.props.isAnomalyAnnualCycle
? baselineSelectorLabel
: datasetSelectorLabel;

exportData(format) {
exportDataToWorksheet(
Expand Down Expand Up @@ -220,7 +226,7 @@ export default class AnnualCycleGraph extends React.Component {
<Row>
<Col lg={6} md={6} sm={6}>
<ControlLabel className={styles.selector_label}>
{datasetSelectorLabel}
{this.selectorLabel}
</ControlLabel>
<DataspecSelector
bases={this.props.meta}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@

.selector {
display: inline-block;
width: 80%;
width: 75%;
}
19 changes: 19 additions & 0 deletions src/components/guidance-content/info/InformationItems.js
Original file line number Diff line number Diff line change
Expand Up @@ -492,6 +492,25 @@ export const datasetSelectorLabel = (
</LabelWithInfo>
);

export const baselineSelectorLabel = (
<LabelWithInfo label="Baseline">
<p>
Select a single baseline dataset to display from all of those that match
the Model, Emissions Scenario, Variable, and historical averaging period
selected.
</p>
<p>
On the graph, the datasets with the same Model, Emissions Scenario, and
Variable for all available future periods will be compared with this
selected baseline.
</p>
<p>
Datasets are identified by a combination of model run id (e.g.,{" "}
<code>r1i1p1</code>) and averaging period (e.g., <code>1961-1990</code>).
</p>
</LabelWithInfo>
);

export const timeOfYearSelectorLabel = (
<LabelWithInfo label="Time of Year">
<p>
Expand Down

0 comments on commit 4858c0f

Please sign in to comment.