Skip to content

Commit

Permalink
🔨 Fix chart loading issues and eslint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
danyx23 committed Feb 2, 2025
1 parent 2ac02cf commit 6e7189a
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 15 deletions.
6 changes: 1 addition & 5 deletions baker/GrapherImageBaker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,9 @@ import {
GrapherProgrammaticInterface,
GrapherState,
} from "@ourworldindata/grapher"
import { MultipleOwidVariableDataDimensionsMap } from "@ourworldindata/utils"
import path from "path"
import * as db from "../db/db.js"
import {
grapherSlugToExportFileKey,
grapherUrlToSlugAndQueryStr,
} from "./GrapherBakingUtils.js"
import { grapherSlugToExportFileKey } from "./GrapherBakingUtils.js"
import { BAKED_GRAPHER_URL } from "../settings/clientSettings.js"
import { DATA_API_URL } from "../settings/serverSettings.js"

Expand Down
2 changes: 1 addition & 1 deletion functions/_common/metadataTools.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Grapher, GrapherState } from "@ourworldindata/grapher"
import { GrapherState } from "@ourworldindata/grapher"
import {
OwidTableSlugs,
OwidOrigin,
Expand Down
2 changes: 0 additions & 2 deletions packages/@ourworldindata/grapher/src/core/Grapher.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,6 @@ import classnames from "classnames"
import { GrapherAnalytics } from "./GrapherAnalytics"
import { legacyToCurrentGrapherQueryParams } from "./GrapherUrlMigrations"
import { ChartInterface } from "../chart/ChartInterface"
import { MarimekkoChartManager } from "../stackedCharts/MarimekkoChartConstants"
import { FacetChartManager } from "../facetChart/FacetChartConstants"
import {
StaticChartRasterizer,
type GrapherExport,
Expand Down
2 changes: 0 additions & 2 deletions site/DataPageV2Content.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,9 @@ import {
import StickyNav from "./blocks/StickyNav.js"
import {
ADMIN_BASE_URL,
BAKED_BASE_URL,
BAKED_GRAPHER_URL,
DATA_API_URL,
} from "../settings/clientSettings.js"
import Image from "./gdocs/components/Image.js"
import AboutThisData from "./AboutThisData.js"
import DataPageResearchAndWriting from "./DataPageResearchAndWriting.js"
import MetadataSection from "./MetadataSection.js"
Expand Down
9 changes: 4 additions & 5 deletions site/gdocs/components/Chart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ export default function Chart({

const url = Url.fromURL(d.url)
const resolvedUrl = linkedChart.resolvedUrl
const resolvedUrlParsed = Url.fromURL(resolvedUrl)
const slug = resolvedUrlParsed.slug!
const isExplorer = linkedChart.configType === ChartConfigType.Explorer
const isMultiDim = linkedChart.configType === ChartConfigType.MultiDim
const hasControls = url.queryParams.hideControls !== "true"
Expand Down Expand Up @@ -137,17 +139,14 @@ export default function Chart({
target="_blank"
rel="noopener"
>
<GrapherImage
slug={resolvedUrl}
alt={d.title}
/>
<GrapherImage url={resolvedUrl} alt={d.title} />
</a>
)
)}
</figure>
) : (
// TODO: 2025-01-05 Daniel - this is a crude first version, this entire control has to be touched again
<GrapherWithFallback slug={resolvedUrl} config={chartConfig} />
<GrapherWithFallback slug={slug} config={chartConfig} />
)}
{d.caption ? (
<figcaption>
Expand Down

0 comments on commit 6e7189a

Please sign in to comment.