Skip to content

Commit

Permalink
🔨 fix eslint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
danyx23 committed Jan 22, 2025
1 parent 2abf5d5 commit 51bf04b
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 31 deletions.
2 changes: 1 addition & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"--watch"
],
"console": "integratedTerminal",
"runtimeExecutable": "/run/user/1000/fnm_multishells/6623_1737371412748/bin/node"
"runtimeExecutable": "/run/user/1000/fnm_multishells/1917_1737561874408/bin/node"
// "internalConsoleOptions": "neverOpen"
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ export function FetchingGrapher(

// update grapherState when the config from props changes
React.useEffect(() => {
console.log("updating grapherState bounds", props.config?.bounds)
if (props.config?.bounds)
grapherState.current.externalBounds = props.config.bounds
}, [props.config?.bounds])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,7 @@ import {
OwidDistinctLinesColorScheme,
} from "../color/CustomSchemes"
import { latestGrapherConfigSchema } from "./GrapherConstants.js"
import {
legacyToOwidTableAndDimensions,
legacyToOwidTableAndDimensionsWithMandatorySlug,
} from "./LegacyToOwidTable.js"
import { legacyToOwidTableAndDimensionsWithMandatorySlug } from "./LegacyToOwidTable.js"

const TestGrapherConfig = (): {
table: OwidTable
Expand Down
32 changes: 16 additions & 16 deletions packages/@ourworldindata/grapher/src/core/Grapher.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ import { FullScreen } from "../fullScreen/FullScreen"
import { isOnTheMap } from "../mapCharts/EntitiesOnTheMap"
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome/index.js"
import { faExclamationTriangle } from "@fortawesome/free-solid-svg-icons"
import { SettingsMenu, SettingsMenuManager } from "../controls/SettingsMenu"
import { SettingsMenu } from "../controls/SettingsMenu"
import { TooltipContainer } from "../tooltip/Tooltip"
import { EntitySelectorModal } from "../modal/EntitySelectorModal"
import { DownloadModal } from "../modal/DownloadModal"
Expand Down Expand Up @@ -1880,13 +1880,13 @@ export class GrapherState {
}

@computed get isEntitySelectorPanelActive(): boolean {
console.log("isEntitySelectorPanelActive", {
hideEntityControls: this.hideEntityControls,
canChangeAddOrHighlightEntities:
this.canChangeAddOrHighlightEntities,
isOnChartTab: this.isOnChartTab,
showEntitySelectorAs: this.showEntitySelectorAs,
})
// console.log("isEntitySelectorPanelActive", {
// hideEntityControls: this.hideEntityControls,
// canChangeAddOrHighlightEntities:
// this.canChangeAddOrHighlightEntities,
// isOnChartTab: this.isOnChartTab,
// showEntitySelectorAs: this.showEntitySelectorAs,
// })
return (
!this.hideEntityControls &&
this.canChangeAddOrHighlightEntities &&
Expand All @@ -1899,14 +1899,14 @@ export class GrapherState {
private framePaddingVertical = GRAPHER_FRAME_PADDING_VERTICAL

@computed get showEntitySelectorAs(): GrapherWindowType {
console.log("showEntitySelectorAs", {
isEmbeddedInAnOwidPage: this.isEmbeddedInAnOwidPage,
isEmbeddedInADataPage: this.isEmbeddedInADataPage,
isSemiNarrow: this.isSemiNarrow,
isInFullScreenMode: this.isInFullScreenMode,
frameBounds: this.frameBounds,
isIFrame: this.isInIFrame,
})
// console.log("showEntitySelectorAs", {
// isEmbeddedInAnOwidPage: this.isEmbeddedInAnOwidPage,
// isEmbeddedInADataPage: this.isEmbeddedInADataPage,
// isSemiNarrow: this.isSemiNarrow,
// isInFullScreenMode: this.isInFullScreenMode,
// frameBounds: this.frameBounds,
// isIFrame: this.isInIFrame,
// })
if (
//this.frameBounds.width > 940 &&
// don't use the panel if the grapher is embedded
Expand Down
25 changes: 17 additions & 8 deletions packages/@ourworldindata/grapher/src/dataTable/DataTable.sample.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,14 +138,19 @@ export const GrapherWithAggregates = (
property: DimensionProperty.y,
},
]
const inputTable = legacyToOwidTableAndDimensionsWithMandatorySlug(
createOwidTestDataset([
{ metadata: childMortalityMetadata, data: childMortalityData },
]),
dimensions,
{}
)
return new GrapherState({
tab: GRAPHER_TAB_OPTIONS.table,
dimensions,
selectedEntityNames: ["Afghanistan", "Iceland", "World"],
...props,
owidDataset: createOwidTestDataset([
{ metadata: childMortalityMetadata, data: childMortalityData },
]),
table: inputTable,
})
}

Expand Down Expand Up @@ -182,14 +187,18 @@ export const GrapherWithMultipleVariablesAndMultipleYears = (
{ year: 2019, entity: fakeEntities.World, value: 10 },
],
}

const inputTable = legacyToOwidTableAndDimensionsWithMandatorySlug(
createOwidTestDataset([
abovePovertyLineDataset,
belowPovertyLineDataset,
]),
dimensions,
{}
)
return new GrapherState({
tab: GRAPHER_TAB_OPTIONS.table,
dimensions,
...props,
owidDataset: createOwidTestDataset([
abovePovertyLineDataset,
belowPovertyLineDataset,
]),
table: inputTable,
})
}
1 change: 0 additions & 1 deletion site/GrapherFigureView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ export function GrapherFigureView(props: GrapherFigureViewProps): JSX.Element {

const base = useRef<HTMLDivElement>(null)
const bounds = useElementBounds(base)
console.log("bounds", bounds)

const config: GrapherProgrammaticInterface = {
...props.config,
Expand Down

0 comments on commit 51bf04b

Please sign in to comment.