Skip to content

Commit

Permalink
✨ (facets) improve svg structure for figma
Browse files Browse the repository at this point in the history
  • Loading branch information
sophiamersmann committed Feb 6, 2025
1 parent f9e8451 commit bb631a3
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions packages/@ourworldindata/grapher/src/facetChart/FacetChart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import {
HorizontalAlign,
Color,
uniq,
makeIdForHumanConsumption,
} from "@ourworldindata/utils"
import { shortenForTargetWidth } from "@ourworldindata/components"
import { action, computed, observable } from "mobx"
Expand Down Expand Up @@ -143,6 +144,10 @@ export class FacetChart
return this.props.chartTypeName ?? GRAPHER_CHART_TYPES.LineChart
}

@computed get isStatic(): boolean {
return !!this.manager.isStatic
}

@computed get failMessage(): string {
return ""
}
Expand Down Expand Up @@ -267,6 +272,7 @@ export class FacetChart
missingDataStrategy,
backgroundColor,
focusArray,
isStatic,
} = manager

// Use compact labels, e.g. 50k instead of 50,000.
Expand Down Expand Up @@ -324,6 +330,7 @@ export class FacetChart
backgroundColor,
hideNoDataSection,
focusArray,
isStatic,
...series.manager,
xAxisConfig: {
...globalXAxisConfig,
Expand Down Expand Up @@ -896,10 +903,12 @@ export class FacetChart
{shortenedLabel}
<title>{seriesName}</title>
</text>
<ChartClass
bounds={bounds}
manager={facetChart.manager}
/>
<g id={makeIdForHumanConsumption(seriesName)}>
<ChartClass
bounds={bounds}
manager={facetChart.manager}
/>
</g>
</React.Fragment>
)
})}
Expand Down

0 comments on commit bb631a3

Please sign in to comment.