Skip to content

Commit

Permalink
🐛 (scatter) left-align no data section
Browse files Browse the repository at this point in the history
  • Loading branch information
sophiamersmann committed Dec 20, 2024
1 parent cfce1bb commit ae29336
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from "react"
import { Bounds } from "@ourworldindata/utils"
import { Bounds, HorizontalAlign } from "@ourworldindata/utils"
import {
GRAPHER_FONT_SCALE_11,
GRAPHER_FONT_SCALE_12,
Expand All @@ -9,10 +9,12 @@ import { GRAPHER_LIGHT_TEXT } from "../color/ColorConstants"
export function NoDataSection({
seriesNames,
bounds,
align = HorizontalAlign.left,
baseFontSize = 16,
}: {
seriesNames: string[]
bounds: Bounds
align?: HorizontalAlign
baseFontSize?: number
}): React.ReactElement {
{
Expand All @@ -30,7 +32,8 @@ export function NoDataSection({
className="NoDataSection"
{...bounds.toProps()}
style={{
textAlign: "right",
textAlign:
align === HorizontalAlign.right ? "right" : "left",
color: GRAPHER_LIGHT_TEXT,
}}
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ import {
VerticalAlign,
FacetStrategy,
InteractionState,
HorizontalAlign,
} from "@ourworldindata/types"
import { ChartInterface } from "../chart/ChartInterface"
import { ChartManager } from "../chart/ChartManager"
Expand Down Expand Up @@ -1127,6 +1128,7 @@ export class SlopeChart
<NoDataSection
seriesNames={seriesNames}
bounds={bounds}
align={HorizontalAlign.right}
baseFontSize={this.fontSize}
/>
)
Expand Down

0 comments on commit ae29336

Please sign in to comment.