From 245737c5e46eda38f1c51f5025a863fc18759f99 Mon Sep 17 00:00:00 2001 From: sophiamersmann Date: Wed, 20 Nov 2024 09:00:25 +0100 Subject: [PATCH 01/52] =?UTF-8?q?=E2=9C=A8=20(slope)=20show=20selected=20e?= =?UTF-8?q?ntities=20only?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- adminSiteClient/EditorBasicTab.tsx | 2 +- baker/updateChartEntities.ts | 2 +- .../@ourworldindata/grapher/src/slopeCharts/SlopeChart.tsx | 4 ++++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/adminSiteClient/EditorBasicTab.tsx b/adminSiteClient/EditorBasicTab.tsx index 04f05a9cead..9e3464f4d9f 100644 --- a/adminSiteClient/EditorBasicTab.tsx +++ b/adminSiteClient/EditorBasicTab.tsx @@ -109,7 +109,7 @@ class DimensionSlotView< const { selection } = grapher const { availableEntityNames, availableEntityNameSet } = selection - if (grapher.isScatter || grapher.isSlopeChart || grapher.isMarimekko) { + if (grapher.isScatter || grapher.isMarimekko) { // chart types that display all entities by default shouldn't select any by default selection.clearSelection() } else if ( diff --git a/baker/updateChartEntities.ts b/baker/updateChartEntities.ts index 49e582a71d8..cbaf6a74107 100644 --- a/baker/updateChartEntities.ts +++ b/baker/updateChartEntities.ts @@ -106,7 +106,7 @@ const obtainAvailableEntitiesForGrapherConfig = async ( // In these chart types, an unselected entity is still shown const chartTypeShowsUnselectedEntities = - grapher.isScatter || grapher.isSlopeChart || grapher.isMarimekko + grapher.isScatter || grapher.isMarimekko if (canChangeEntities || chartTypeShowsUnselectedEntities) return grapher.tableForSelection.availableEntityNames as string[] diff --git a/packages/@ourworldindata/grapher/src/slopeCharts/SlopeChart.tsx b/packages/@ourworldindata/grapher/src/slopeCharts/SlopeChart.tsx index 8b865b803d6..4254f7cee3c 100644 --- a/packages/@ourworldindata/grapher/src/slopeCharts/SlopeChart.tsx +++ b/packages/@ourworldindata/grapher/src/slopeCharts/SlopeChart.tsx @@ -100,6 +100,10 @@ export class SlopeChart transformTable(table: OwidTable) { if (!table.has(this.yColumnSlug)) return table + table = table.filterByEntityNames( + this.selectionArray.selectedEntityNames + ) + // TODO: remove this filter once we don't have mixed type columns in datasets table = table.replaceNonNumericCellsWithErrorValues([this.yColumnSlug]) From cea23f95ab8c07adfbb50cf0d6015478ab89ae24 Mon Sep 17 00:00:00 2001 From: sophiamersmann Date: Wed, 20 Nov 2024 09:34:42 +0100 Subject: [PATCH 02/52] =?UTF-8?q?=E2=9C=A8=20(slope)=20support=20relative?= =?UTF-8?q?=20mode?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../grapher/src/controls/SettingsMenu.tsx | 2 ++ .../grapher/src/slopeCharts/SlopeChart.tsx | 16 +++++++++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/packages/@ourworldindata/grapher/src/controls/SettingsMenu.tsx b/packages/@ourworldindata/grapher/src/controls/SettingsMenu.tsx index 30cbd370147..fb7f4351ce7 100644 --- a/packages/@ourworldindata/grapher/src/controls/SettingsMenu.tsx +++ b/packages/@ourworldindata/grapher/src/controls/SettingsMenu.tsx @@ -51,6 +51,7 @@ const { StackedDiscreteBar, StackedBar, Marimekko, + SlopeChart, } = GRAPHER_CHART_TYPES export interface SettingsMenuManager @@ -170,6 +171,7 @@ export class SettingsMenu extends React.Component<{ ScatterPlot, LineChart, Marimekko, + SlopeChart, ].includes(this.chartType as any) } diff --git a/packages/@ourworldindata/grapher/src/slopeCharts/SlopeChart.tsx b/packages/@ourworldindata/grapher/src/slopeCharts/SlopeChart.tsx index 4254f7cee3c..e83ffb961bf 100644 --- a/packages/@ourworldindata/grapher/src/slopeCharts/SlopeChart.tsx +++ b/packages/@ourworldindata/grapher/src/slopeCharts/SlopeChart.tsx @@ -471,13 +471,27 @@ export class SlopeChart return this.inputTable.get(this.manager.colorColumnSlug) } - @computed get transformedTable() { + @computed get transformedTableFromGrapher(): OwidTable { return ( this.manager.transformedTable ?? this.transformTable(this.inputTable) ) } + @computed get transformedTable(): OwidTable { + let table = this.transformedTableFromGrapher + // The % growth transform cannot be applied in transformTable() because it will filter out + // any rows before startHandleTimeBound and change the timeline bounds. + const { isRelativeMode, startHandleTimeBound } = this.manager + if (isRelativeMode && startHandleTimeBound !== undefined) { + table = table.toTotalGrowthForEachColumnComparedToStartTime( + startHandleTimeBound, + this.yColumnSlug ? [this.yColumnSlug] : [] + ) + } + return table + } + @computed get inputTable() { return this.manager.table } From e3d156aed74dbc7a4a64c8cbfaa68043ae0ff873 Mon Sep 17 00:00:00 2001 From: sophiamersmann Date: Wed, 20 Nov 2024 10:22:10 +0100 Subject: [PATCH 03/52] =?UTF-8?q?=E2=9C=A8=20(slope)=20only=20allow=20sele?= =?UTF-8?q?ction=20using=20the=20entity=20selector?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../grapher/src/slopeCharts/SlopeChart.tsx | 80 +------------------ .../src/slopeCharts/SlopeChartConstants.ts | 2 +- 2 files changed, 2 insertions(+), 80 deletions(-) diff --git a/packages/@ourworldindata/grapher/src/slopeCharts/SlopeChart.tsx b/packages/@ourworldindata/grapher/src/slopeCharts/SlopeChart.tsx index e83ffb961bf..9adc4b2f7bf 100644 --- a/packages/@ourworldindata/grapher/src/slopeCharts/SlopeChart.tsx +++ b/packages/@ourworldindata/grapher/src/slopeCharts/SlopeChart.tsx @@ -3,7 +3,6 @@ import { Bounds, DEFAULT_BOUNDS, intersection, - without, uniq, isEmpty, last, @@ -53,11 +52,7 @@ import { SlopeEntryProps, } from "./SlopeChartConstants" import { OwidTable } from "@ourworldindata/core-table" -import { - autoDetectYColumnSlugs, - makeSelectionArray, - isElementInteractive, -} from "../chart/ChartUtils" +import { autoDetectYColumnSlugs, makeSelectionArray } from "../chart/ChartUtils" import { AxisConfig, AxisManager } from "../axis/AxisConfig" import { VerticalAxis } from "../axis/Axis" import { VerticalAxisComponent } from "../axis/AxisViews" @@ -95,8 +90,6 @@ export class SlopeChart // currently hovered legend color @observable hoverColor?: string - private hasInteractedWithChart = false - transformTable(table: OwidTable) { if (!table.has(this.yColumnSlug)) return table @@ -169,15 +162,6 @@ export class SlopeChart this.hoverKey = undefined } - @action.bound onSlopeClick() { - const { hoverKey, isEntitySelectionEnabled } = this - if (!isEntitySelectionEnabled || hoverKey === undefined) { - return - } - this.hasInteractedWithChart = true - this.selectionArray.toggleSelection(hoverKey) - } - // Both legend managers accept a `onLegendMouseOver` property, but define different signatures. // The component expects a string, // the component expects a ColorScaleBin. @@ -206,29 +190,6 @@ export class SlopeChart ) } - // When the color legend is clicked, toggle selection fo all associated keys - @action.bound onLegendClick() { - const { hoverColor, isEntitySelectionEnabled } = this - if (!isEntitySelectionEnabled || hoverColor === undefined) return - - this.hasInteractedWithChart = true - - const seriesNamesToToggle = this.series - .filter((g) => g.color === hoverColor) - .map((g) => g.seriesName) - const areAllSeriesActive = - intersection(seriesNamesToToggle, this.selectedEntityNames) - .length === seriesNamesToToggle.length - if (areAllSeriesActive) - this.selectionArray.setSelectedEntities( - without(this.selectedEntityNames, ...seriesNamesToToggle) - ) - else - this.selectionArray.setSelectedEntities( - this.selectedEntityNames.concat(seriesNamesToToggle) - ) - } - // Colors on the legend for which every matching group is focused @computed get focusColors() { const { colorsInUse } = this @@ -407,7 +368,6 @@ export class SlopeChart hoverKeys={hoverKeys} onMouseOver={this.onSlopeMouseOver} onMouseLeave={this.onSlopeMouseLeave} - onClick={this.onSlopeClick} isPortrait={this.isPortrait} /> {showLegend && legend} @@ -519,48 +479,10 @@ export class SlopeChart return colorByEntity } - // click anywhere inside the Grapher frame to dismiss the current selection - @action.bound onGrapherClick(e: Event): void { - const target = e.target as HTMLElement - const isTargetInteractive = isElementInteractive(target) - if ( - this.isEntitySelectionEnabled && - this.hasInteractedWithChart && - !this.hoverKey && - !this.hoverColor && - !this.manager.isModalOpen && - !isTargetInteractive - ) { - this.selectionArray.clearSelection() - } - } - - @computed private get grapherElement() { - return this.manager.base?.current - } - componentDidMount() { - if (this.grapherElement) { - // listening to "mousedown" instead of "click" fixes a bug - // where the current selection was incorrectly dismissed - // when the user drags the slider but releases the drag outside of the timeline - this.grapherElement.addEventListener( - "mousedown", - this.onGrapherClick - ) - } exposeInstanceOnWindow(this) } - componentWillUnmount(): void { - if (this.grapherElement) { - this.grapherElement.removeEventListener( - "mousedown", - this.onGrapherClick - ) - } - } - @computed get series() { const column = this.yColumn if (!column) return [] diff --git a/packages/@ourworldindata/grapher/src/slopeCharts/SlopeChartConstants.ts b/packages/@ourworldindata/grapher/src/slopeCharts/SlopeChartConstants.ts index bb52f727212..91eda0418be 100644 --- a/packages/@ourworldindata/grapher/src/slopeCharts/SlopeChartConstants.ts +++ b/packages/@ourworldindata/grapher/src/slopeCharts/SlopeChartConstants.ts @@ -48,7 +48,7 @@ export interface LabelledSlopesProps { hoverKeys: string[] onMouseOver: (slopeProps: SlopeEntryProps) => void onMouseLeave: () => void - onClick: () => void + onClick?: () => void isPortrait: boolean } From e8c89cbbb46da7c2e836de902e9badfe08d4b801 Mon Sep 17 00:00:00 2001 From: sophiamersmann Date: Wed, 20 Nov 2024 14:38:55 +0100 Subject: [PATCH 04/52] =?UTF-8?q?=E2=9C=A8=20(slope)=20drop=20support=20fo?= =?UTF-8?q?r=20color=20dim=20and=20focus=20state?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../grapher/src/core/Grapher.tsx | 2 +- .../grapher/src/slopeCharts/SlopeChart.tsx | 420 ++++-------------- .../src/slopeCharts/SlopeChartConstants.ts | 5 +- 3 files changed, 97 insertions(+), 330 deletions(-) diff --git a/packages/@ourworldindata/grapher/src/core/Grapher.tsx b/packages/@ourworldindata/grapher/src/core/Grapher.tsx index 07a0e552c02..3b794c5a2dc 100644 --- a/packages/@ourworldindata/grapher/src/core/Grapher.tsx +++ b/packages/@ourworldindata/grapher/src/core/Grapher.tsx @@ -1408,7 +1408,7 @@ export class Grapher if (this.isLineChart || this.isDiscreteBar) return [yAxis, color] else if (this.isScatter) return [yAxis, xAxis, size, color] else if (this.isMarimekko) return [yAxis, xAxis, color] - else if (this.isSlopeChart) return [yAxis, color] + else if (this.isSlopeChart) return [yAxis] return [yAxis] } diff --git a/packages/@ourworldindata/grapher/src/slopeCharts/SlopeChart.tsx b/packages/@ourworldindata/grapher/src/slopeCharts/SlopeChart.tsx index 9adc4b2f7bf..3ae9f2c5e67 100644 --- a/packages/@ourworldindata/grapher/src/slopeCharts/SlopeChart.tsx +++ b/packages/@ourworldindata/grapher/src/slopeCharts/SlopeChart.tsx @@ -2,10 +2,7 @@ import React from "react" import { Bounds, DEFAULT_BOUNDS, - intersection, - uniq, isEmpty, - last, sortBy, max, getRelativeMouse, @@ -14,7 +11,6 @@ import { exposeInstanceOnWindow, PointVector, clamp, - HorizontalAlign, difference, makeIdForHumanConsumption, } from "@ourworldindata/utils" @@ -22,11 +18,7 @@ import { TextWrap } from "@ourworldindata/components" import { observable, computed, action } from "mobx" import { observer } from "mobx-react" import { NoDataModal } from "../noDataModal/NoDataModal" -import { - VerticalColorLegend, - VerticalColorLegendManager, -} from "../verticalColorLegend/VerticalColorLegend" -import { ColorScale, ColorScaleManager } from "../color/ColorScale" +import { ColorScaleManager } from "../color/ColorScale" import { BASE_FONT_SIZE, GRAPHER_DARK_TEXT, @@ -36,32 +28,34 @@ import { import { ScaleType, EntitySelectionMode, - Color, SeriesName, ColorSchemeName, + SeriesStrategy, + EntityName, } from "@ourworldindata/types" import { ChartInterface } from "../chart/ChartInterface" import { ChartManager } from "../chart/ChartManager" import { scaleLinear, ScaleLinear } from "d3-scale" import { select } from "d3-selection" import { - DEFAULT_SLOPE_CHART_COLOR, LabelledSlopesProps, SlopeChartSeries, SlopeChartValue, SlopeEntryProps, } from "./SlopeChartConstants" import { OwidTable } from "@ourworldindata/core-table" -import { autoDetectYColumnSlugs, makeSelectionArray } from "../chart/ChartUtils" +import { + autoDetectSeriesStrategy, + autoDetectYColumnSlugs, + makeSelectionArray, +} from "../chart/ChartUtils" import { AxisConfig, AxisManager } from "../axis/AxisConfig" import { VerticalAxis } from "../axis/Axis" import { VerticalAxisComponent } from "../axis/AxisViews" -import { - HorizontalCategoricalColorLegend, - HorizontalColorLegendManager, -} from "../horizontalColorLegend/HorizontalColorLegends" -import { CategoricalBin, ColorScaleBin } from "../color/ColorScaleBin" import { NoDataSection } from "../scatterCharts/NoDataSection" +import { CategoricalColorAssigner } from "../color/CategoricalColorAssigner" +import { ColorScheme } from "../color/ColorScheme" +import { ColorSchemes } from "../color/ColorSchemes" export interface SlopeChartManager extends ChartManager { isModalOpen?: boolean @@ -79,16 +73,10 @@ export class SlopeChart bounds?: Bounds manager: SlopeChartManager }> - implements - ChartInterface, - VerticalColorLegendManager, - HorizontalColorLegendManager, - ColorScaleManager + implements ChartInterface, ColorScaleManager { // currently hovered individual series key @observable hoverKey?: string - // currently hovered legend color - @observable hoverColor?: string transformTable(table: OwidTable) { if (!table.has(this.yColumnSlug)) return table @@ -125,35 +113,6 @@ export class SlopeChart return !!(this.manager.isNarrow || this.manager.isStaticAndSmall) } - @computed private get showHorizontalLegend(): boolean { - return !!(this.manager.isSemiNarrow || this.manager.isStaticAndSmall) - } - - // used by the component - @computed get legendItems() { - return this.colorScale.legendBins - .filter((bin) => this.colorsInUse.includes(bin.color)) - .map((bin) => { - return { - key: bin.label ?? "", - label: bin.label ?? "", - color: bin.color, - } - }) - } - - // used by the component - @computed get categoricalLegendData(): CategoricalBin[] { - return this.legendItems.map( - (legendItem, index) => - new CategoricalBin({ - ...legendItem, - index, - value: legendItem.label, - }) - ) - } - @action.bound onSlopeMouseOver(slopeProps: SlopeEntryProps) { this.hoverKey = slopeProps.seriesName } @@ -162,18 +121,6 @@ export class SlopeChart this.hoverKey = undefined } - // Both legend managers accept a `onLegendMouseOver` property, but define different signatures. - // The component expects a string, - // the component expects a ColorScaleBin. - @action.bound onLegendMouseOver(binOrColor: string | ColorScaleBin) { - this.hoverColor = - typeof binOrColor === "string" ? binOrColor : binOrColor.color - } - - @action.bound onLegendMouseLeave() { - this.hoverColor = undefined - } - @computed private get selectionArray() { return makeSelectionArray(this.manager.selection) } @@ -182,127 +129,19 @@ export class SlopeChart return this.selectionArray.selectedEntityNames } - @computed get isEntitySelectionEnabled(): boolean { - const { manager } = this - return !!( - manager.addCountryMode !== EntitySelectionMode.Disabled && - manager.addCountryMode - ) - } - - // Colors on the legend for which every matching group is focused - @computed get focusColors() { - const { colorsInUse } = this - return colorsInUse.filter((color) => { - const matchingSeriesNames = this.series - .filter((g) => g.color === color) - .map((g) => g.seriesName) - return ( - intersection(matchingSeriesNames, this.selectedEntityNames) - .length === matchingSeriesNames.length - ) - }) - } - - @computed get focusKeys() { - return this.selectedEntityNames - } - - // All currently hovered group keys, combining the legend and the main UI - @computed.struct get hoverKeys() { - const { hoverColor, hoverKey } = this - - const hoverKeys = - hoverColor === undefined - ? [] - : uniq( - this.series - .filter((g) => g.color === hoverColor) - .map((g) => g.seriesName) - ) - - if (hoverKey !== undefined) hoverKeys.push(hoverKey) - - return hoverKeys - } - - // Colors currently on the chart and not greyed out - @computed get activeColors() { - const { hoverKeys, focusKeys } = this - const activeKeys = hoverKeys.concat(focusKeys) - - if (activeKeys.length === 0) - // No hover or focus means they're all active by default - return uniq(this.series.map((g) => g.color)) - - return uniq( - this.series - .filter((g) => activeKeys.indexOf(g.seriesName) !== -1) - .map((g) => g.color) - ) - } - - // Only show colors on legend that are actually in use - @computed private get colorsInUse() { - return uniq(this.series.map((series) => series.color)) - } - - @computed get legendAlign(): HorizontalAlign { - return HorizontalAlign.left - } - - @computed get verticalColorLegend(): VerticalColorLegend { - return new VerticalColorLegend({ manager: this }) - } - - @computed get horizontalColorLegend(): HorizontalCategoricalColorLegend { - return new HorizontalCategoricalColorLegend({ manager: this }) - } - - @computed get legendHeight(): number { - return this.showHorizontalLegend - ? this.horizontalColorLegend.height - : this.verticalColorLegend.height - } - - @computed get legendWidth(): number { - return this.showHorizontalLegend - ? this.bounds.width - : this.verticalColorLegend.width - } - - @computed get maxLegendWidth(): number { - return this.showHorizontalLegend - ? this.bounds.width - : this.bounds.width * 0.5 - } - @computed private get sidebarWidth(): number { - // the min width is set to prevent the "No data" title from line breaking - return clamp(this.legendWidth, 51, this.maxLegendWidth) + return Math.min(120, 0.15 * this.bounds.width) } - // correction is to account for the space taken by the legend @computed private get innerBounds() { - const { sidebarWidth, showLegend, legendHeight } = this + const { sidebarWidth } = this let bounds = this.bounds - if (showLegend) { - bounds = this.showHorizontalLegend - ? bounds.padTop(legendHeight + 8) - : bounds.padRight(sidebarWidth + 16) + if (this.showNoDataSection) { + bounds = bounds.padRight(sidebarWidth + 16) } return bounds } - // verify the validity of data used to show legend - // this is for backwards compatibility with charts that were added without legend - // eg: https://ourworldindata.org/grapher/mortality-rate-improvement-by-cohort - @computed private get showLegend() { - const { colorsInUse } = this - const { legendBins } = this.colorScale - return legendBins.some((bin) => colorsInUse.includes(bin.color)) - } - @computed private get selectedEntitiesWithoutData(): string[] { return difference( @@ -311,12 +150,16 @@ export class SlopeChart ) } + @computed private get showNoDataSection(): boolean { + return this.selectedEntitiesWithoutData.length > 0 + } + @computed private get noDataSection(): React.ReactElement { const bounds = new Bounds( - this.legendX, - this.legendY + this.legendHeight + 12, + this.bounds.right - this.sidebarWidth, + this.bounds.top, this.sidebarWidth, - this.bounds.height - this.legendHeight - 12 + this.bounds.height ) return ( - ) : ( - - ) + const { series, hoverKey, innerBounds } = this return ( - {showLegend && legend} - {/* only show the "No data" section if there is space */} - {showLegend && - !showHorizontalLegend && - selectedEntitiesWithoutData.length > 0 && - this.noDataSection} + {this.showNoDataSection && this.noDataSection} ) } - @computed get categoryLegendY(): number { - return this.bounds.top - } - - @computed get legendY() { - return this.bounds.top - } - - @computed get legendX(): number { - return this.showHorizontalLegend - ? this.bounds.left - : this.bounds.right - this.sidebarWidth - } - @computed get failMessage() { if (this.yColumn.isMissing) return "Missing Y column" else if (isEmpty(this.series)) return "No matching data" return "" } - colorScale = this.props.manager.colorScaleOverride ?? new ColorScale(this) - - @computed get colorScaleConfig() { - return this.manager.colorScale - } - - @computed get colorScaleColumn() { - return ( - // For faceted charts, we have to get the values of inputTable before it's filtered by - // the faceting logic. - this.manager.colorScaleColumnOverride ?? this.colorColumn - ) - } - - defaultBaseColorScheme = ColorSchemeName.continents + defaultBaseColorScheme = ColorSchemeName.OwidDistinctLines @computed private get yColumn() { return this.transformedTable.get(this.yColumnSlug) @@ -424,13 +219,6 @@ export class SlopeChart return autoDetectYColumnSlugs(this.manager)[0] } - @computed private get colorColumn() { - // NB: This is tricky. Often it seems we use the Continent variable (123) for colors, but we only have 1 year for that variable, which - // would likely get filtered by any time filtering. So we need to jump up to the root table to get the color values we want. - // We should probably refactor this as part of a bigger color refactoring. - return this.inputTable.get(this.manager.colorColumnSlug) - } - @computed get transformedTableFromGrapher(): OwidTable { return ( this.manager.transformedTable ?? @@ -456,48 +244,66 @@ export class SlopeChart return this.manager.table } - // helper method to directly get the associated color value given an Entity - // dimension data saves color a level deeper. eg: { Afghanistan => { 2015: Asia|Color }} - // this returns that data in the form { Afghanistan => Asia } - @computed private get colorBySeriesName(): Map< - SeriesName, - Color | undefined - > { - const { colorScale, colorColumn } = this - if (colorColumn.isMissing) return new Map() - - const colorByEntity = new Map() + componentDidMount() { + exposeInstanceOnWindow(this) + } - colorColumn.valueByEntityNameAndOriginalTime.forEach( - (timeToColorMap, seriesName) => { - const values = Array.from(timeToColorMap.values()) - const key = last(values) - colorByEntity.set(seriesName, colorScale.getColor(key)) - } + @computed private get colorScheme(): ColorScheme { + return ( + (this.manager.baseColorScheme + ? ColorSchemes.get(this.manager.baseColorScheme) + : null) ?? ColorSchemes.get(this.defaultBaseColorScheme) ) + } - return colorByEntity + @computed get seriesStrategy(): SeriesStrategy { + return autoDetectSeriesStrategy(this.manager, true) } - componentDidMount() { - exposeInstanceOnWindow(this) + @computed private get categoricalColorAssigner(): CategoricalColorAssigner { + return new CategoricalColorAssigner({ + colorScheme: this.colorScheme, + invertColorScheme: this.manager.invertColorScheme, + colorMap: + this.seriesStrategy === SeriesStrategy.entity + ? this.inputTable.entityNameColorIndex + : this.inputTable.columnDisplayNameToColorMap, + autoColorMapCache: this.manager.seriesColorMap, + }) + } + + private getColorKey( + entityName: EntityName, + columnName: string, + entityCount: number + ): SeriesName { + if (this.seriesStrategy === SeriesStrategy.entity) { + return entityName + } + // If only one entity is plotted, we want to use the column colors. + // Unlike in `getSeriesName`, we don't care whether the user can select + // multiple entities, only whether more than one is plotted. + if (entityCount > 1) { + return `${entityName} - ${columnName}` + } else { + return columnName + } } @computed get series() { const column = this.yColumn if (!column) return [] - const { colorBySeriesName } = this const { minTime, maxTime } = column - const table = this.inputTable - + const totalEntityCount = + this.transformedTable.availableEntityNames.length return column.uniqEntityNames - .map((seriesName) => { + .map((entityName) => { const values: SlopeChartValue[] = [] const yValues = - column.valueByEntityNameAndOriginalTime.get(seriesName)! || + column.valueByEntityNameAndOriginalTime.get(entityName)! || [] yValues.forEach((value, time) => { @@ -512,13 +318,16 @@ export class SlopeChart // sort values by time const sortedValues = sortBy(values, (v) => v.x) - const color = - table.getColorForEntityName(seriesName) ?? - colorBySeriesName.get(seriesName) ?? - DEFAULT_SLOPE_CHART_COLOR + const color = this.categoricalColorAssigner.assign( + this.getColorKey( + entityName, + column.displayName, + totalEntityCount + ) + ) return { - seriesName, + seriesName: entityName, color, values: sortedValues, } as SlopeChartSeries @@ -532,11 +341,11 @@ class SlopeEntry extends React.Component { line: SVGElement | null = null @computed get isInBackground() { - const { isLayerMode, isHovered, isFocused } = this.props + const { isLayerMode, isHovered } = this.props if (!isLayerMode) return false - return !(isHovered || isFocused) + return !isHovered } render() { @@ -554,22 +363,19 @@ class SlopeEntry extends React.Component { rightEntityLabel, leftEntityLabelBounds, rightEntityLabelBounds, - isFocused, isHovered, - isMultiHoverMode, seriesName, } = this.props const { isInBackground } = this const lineColor = isInBackground ? "#e2e2e2" : color const labelColor = isInBackground ? "#ccc" : GRAPHER_DARK_TEXT - const opacity = isHovered ? 1 : isFocused ? 0.7 : 0.5 - const lineStrokeWidth = - isHovered && !isMultiHoverMode ? 4 : isFocused ? 3 : 2 + const opacity = isHovered ? 1 : 0.5 + const lineStrokeWidth = isHovered ? 4 : 2 - const showDots = isFocused || isHovered - const showValueLabels = isFocused || isHovered - const showLeftEntityLabel = isFocused || (isHovered && isMultiHoverMode) + const showDots = isHovered + const showValueLabels = isHovered + const showLeftEntityLabel = isHovered const sharedLabelProps = { fill: labelColor, @@ -656,8 +462,7 @@ class SlopeEntry extends React.Component { { textProps: { ...sharedLabelProps, - fontWeight: - isFocused || isHovered ? "bold" : undefined, + fontWeight: isHovered ? "bold" : undefined, }, } )} @@ -693,35 +498,14 @@ class LabelledSlopes return this.manager.fontSize ?? BASE_FONT_SIZE } - @computed private get focusedSeriesNames() { - return intersection( - this.props.focusKeys || [], - this.data.map((g) => g.seriesName) - ) - } - - @computed private get hoveredSeriesNames() { - return intersection( - this.props.hoverKeys || [], - this.data.map((g) => g.seriesName) - ) + @computed private get hoveredSeriesName() { + return this.props.hoverKey } // Layered mode occurs when any entity on the chart is hovered or focused // Then, a special "foreground" set of entities is rendered over the background @computed private get isLayerMode() { - return ( - this.hoveredSeriesNames.length > 0 || - this.focusedSeriesNames.length > 0 || - // if the user has selected entities that are not in the chart, - // we want to move all entities into the background - (this.props.focusKeys?.length > 0 && - this.focusedSeriesNames.length === 0) - ) - } - - @computed private get isMultiHoverMode() { - return this.hoveredSeriesNames.length > 1 + return this.hoveredSeriesName !== undefined } @computed get isPortrait(): boolean { @@ -917,7 +701,6 @@ class LabelledSlopes y2, color: series.color, seriesName: series.seriesName, - isFocused: false, isHovered: false, hasLeftLabel: true, hasRightLabel: true, @@ -928,20 +711,16 @@ class LabelledSlopes } @computed get backgroundGroups() { - return this.slopeData.filter( - (group) => !(group.isHovered || group.isFocused) - ) + return this.slopeData.filter((group) => !group.isHovered) } @computed get foregroundGroups() { - return this.slopeData.filter( - (group) => !!(group.isHovered || group.isFocused) - ) + return this.slopeData.filter((group) => !!group.isHovered) } // Get the final slope data with hover focusing and collision detection @computed get slopeData(): SlopeEntryProps[] { - const { focusedSeriesNames, hoveredSeriesNames } = this + const { hoveredSeriesName } = this let slopeData = this.initialSlopeData @@ -966,14 +745,12 @@ class LabelledSlopes ) // used to determine priority for labelling conflicts - const isFocused = focusedSeriesNames.includes(slope.seriesName) - const isHovered = hoveredSeriesNames.includes(slope.seriesName) + const isHovered = hoveredSeriesName === slope.seriesName return { ...slope, leftEntityLabelBounds, rightEntityLabelBounds, - isFocused, isHovered, } }) @@ -984,10 +761,6 @@ class LabelledSlopes // Hovered slopes always have priority return s1 else if (!s1.isHovered && s2.isHovered) return s2 - else if (s1.isFocused && !s2.isFocused) - // Focused slopes are next in priority - return s1 - else if (!s1.isFocused && s2.isFocused) return s2 else if (s1.hasRightLabel && !s2.hasRightLabel) // Slopes which already have one label are prioritized for the other side return s1 @@ -1033,9 +806,7 @@ class LabelledSlopes }) // Order by focus/hover for draw order - slopeData = sortBy(slopeData, (slope) => - slope.isFocused || slope.isHovered ? 1 : 0 - ) + slopeData = sortBy(slopeData, (slope) => (slope.isHovered ? 1 : 0)) return slopeData } @@ -1148,14 +919,13 @@ class LabelledSlopes } renderGroups(groups: SlopeEntryProps[]) { - const { isLayerMode, isMultiHoverMode } = this + const { isLayerMode } = this return groups.map((slope) => ( )) } diff --git a/packages/@ourworldindata/grapher/src/slopeCharts/SlopeChartConstants.ts b/packages/@ourworldindata/grapher/src/slopeCharts/SlopeChartConstants.ts index 91eda0418be..0d8eaf0464b 100644 --- a/packages/@ourworldindata/grapher/src/slopeCharts/SlopeChartConstants.ts +++ b/packages/@ourworldindata/grapher/src/slopeCharts/SlopeChartConstants.ts @@ -19,7 +19,6 @@ export const DEFAULT_SLOPE_CHART_COLOR = "#ff7f0e" export interface SlopeEntryProps extends ChartSeries { isLayerMode: boolean - isMultiHoverMode: boolean x1: number y1: number x2: number @@ -35,7 +34,6 @@ export interface SlopeEntryProps extends ChartSeries { rightEntityLabelBounds: Bounds rightValueLabel: TextWrap - isFocused: boolean isHovered: boolean } @@ -44,8 +42,7 @@ export interface LabelledSlopesProps { yColumn: CoreColumn bounds: Bounds seriesArr: SlopeChartSeries[] - focusKeys: string[] - hoverKeys: string[] + hoverKey?: string onMouseOver: (slopeProps: SlopeEntryProps) => void onMouseLeave: () => void onClick?: () => void From d92bdb5b89b236e47a27434ce6c1d8ac55147b19 Mon Sep 17 00:00:00 2001 From: sophiamersmann Date: Wed, 20 Nov 2024 14:55:33 +0100 Subject: [PATCH 05/52] =?UTF-8?q?=E2=9C=A8=20(slope)=20support=20multiple?= =?UTF-8?q?=20y-dimensions?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../core-table/src/OwidTable.ts | 3 +- .../grapher/src/core/Grapher.tsx | 2 +- .../grapher/src/slopeCharts/SlopeChart.tsx | 177 ++++++++++++------ .../src/slopeCharts/SlopeChartConstants.ts | 2 +- 4 files changed, 126 insertions(+), 58 deletions(-) diff --git a/packages/@ourworldindata/core-table/src/OwidTable.ts b/packages/@ourworldindata/core-table/src/OwidTable.ts index 529aff908b1..4e53ae9cc24 100644 --- a/packages/@ourworldindata/core-table/src/OwidTable.ts +++ b/packages/@ourworldindata/core-table/src/OwidTable.ts @@ -124,7 +124,8 @@ export class OwidTable extends CoreTable { return min(this.allTimes) as Time } - @imemo get maxTime(): number | undefined { + // TODO: remove undefined? + @imemo get maxTime(): Time | undefined { return max(this.allTimes) } diff --git a/packages/@ourworldindata/grapher/src/core/Grapher.tsx b/packages/@ourworldindata/grapher/src/core/Grapher.tsx index 3b794c5a2dc..af37f90b2be 100644 --- a/packages/@ourworldindata/grapher/src/core/Grapher.tsx +++ b/packages/@ourworldindata/grapher/src/core/Grapher.tsx @@ -2025,7 +2025,7 @@ export class Grapher } @computed get supportsMultipleYColumns(): boolean { - return !(this.isScatter || this.isSlopeChart) + return !this.isScatter } @computed private get xDimension(): ChartDimension | undefined { diff --git a/packages/@ourworldindata/grapher/src/slopeCharts/SlopeChart.tsx b/packages/@ourworldindata/grapher/src/slopeCharts/SlopeChart.tsx index 3ae9f2c5e67..2846f2515db 100644 --- a/packages/@ourworldindata/grapher/src/slopeCharts/SlopeChart.tsx +++ b/packages/@ourworldindata/grapher/src/slopeCharts/SlopeChart.tsx @@ -27,9 +27,11 @@ import { } from "../core/GrapherConstants" import { ScaleType, - EntitySelectionMode, SeriesName, ColorSchemeName, + ColumnSlug, + MissingDataStrategy, + Time, SeriesStrategy, EntityName, } from "@ourworldindata/types" @@ -43,10 +45,11 @@ import { SlopeChartValue, SlopeEntryProps, } from "./SlopeChartConstants" -import { OwidTable } from "@ourworldindata/core-table" +import { CoreColumn, OwidTable } from "@ourworldindata/core-table" import { autoDetectSeriesStrategy, autoDetectYColumnSlugs, + getDefaultFailMessage, makeSelectionArray, } from "../chart/ChartUtils" import { AxisConfig, AxisManager } from "../axis/AxisConfig" @@ -59,6 +62,7 @@ import { ColorSchemes } from "../color/ColorSchemes" export interface SlopeChartManager extends ChartManager { isModalOpen?: boolean + canSelectMultipleEntities?: boolean } const LABEL_SLOPE_PADDING = 8 @@ -79,18 +83,44 @@ export class SlopeChart @observable hoverKey?: string transformTable(table: OwidTable) { - if (!table.has(this.yColumnSlug)) return table - table = table.filterByEntityNames( this.selectionArray.selectedEntityNames ) // TODO: remove this filter once we don't have mixed type columns in datasets - table = table.replaceNonNumericCellsWithErrorValues([this.yColumnSlug]) + table = table.replaceNonNumericCellsWithErrorValues(this.yColumnSlugs) + + // drop all data when the author chose to hide entities with missing data and + // at least one of the variables has no data for the current entity + if ( + this.missingDataStrategy === MissingDataStrategy.hide && + table.hasAnyColumnNoValidValue(this.yColumnSlugs) + ) { + table = table.dropAllRows() + } + + return table + + // TODO: re-enable? + // return table + // .dropRowsWithErrorValuesForColumn(this.yColumnSlug) + // .interpolateColumnWithTolerance(this.yColumnSlug) + } + + transformTableForSelection(table: OwidTable): OwidTable { + // if entities with partial data are not plotted, + // make sure they don't show up in the entity selector + if (this.missingDataStrategy === MissingDataStrategy.hide) { + table = table.replaceNonNumericCellsWithErrorValues( + this.yColumnSlugs + ) + + table = table.dropEntitiesThatHaveNoDataInSomeColumn( + this.yColumnSlugs + ) + } return table - .dropRowsWithErrorValuesForColumn(this.yColumnSlug) - .interpolateColumnWithTolerance(this.yColumnSlug) } @computed get manager() { @@ -113,6 +143,10 @@ export class SlopeChart return !!(this.manager.isNarrow || this.manager.isStaticAndSmall) } + @computed private get missingDataStrategy(): MissingDataStrategy { + return this.manager.missingDataStrategy || MissingDataStrategy.auto + } + @action.bound onSlopeMouseOver(slopeProps: SlopeEntryProps) { this.hoverKey = slopeProps.seriesName } @@ -151,7 +185,11 @@ export class SlopeChart } @computed private get showNoDataSection(): boolean { - return this.selectedEntitiesWithoutData.length > 0 + // TODO: for now, only show missing data section for entities + return ( + this.seriesStrategy === SeriesStrategy.entity && + this.selectedEntitiesWithoutData.length > 0 + ) } @computed private get noDataSection(): React.ReactElement { @@ -191,7 +229,7 @@ export class SlopeChart this.transformedTable.get(slug)) } - @computed protected get yColumnSlug() { - return autoDetectYColumnSlugs(this.manager)[0] + @computed protected get yColumnSlugs(): ColumnSlug[] { + return autoDetectYColumnSlugs(this.manager) } @computed get transformedTableFromGrapher(): OwidTable { @@ -234,7 +273,7 @@ export class SlopeChart if (isRelativeMode && startHandleTimeBound !== undefined) { table = table.toTotalGrowthForEachColumnComparedToStartTime( startHandleTimeBound, - this.yColumnSlug ? [this.yColumnSlug] : [] + this.yColumnSlugs ?? [] ) } return table @@ -256,6 +295,14 @@ export class SlopeChart ) } + @computed private get startTime(): Time { + return this.transformedTable.minTime + } + + @computed private get endTime(): Time { + return this.transformedTable.maxTime! // TODO: remove the ! when we have a better way to handle missing maxTime + } + @computed get seriesStrategy(): SeriesStrategy { return autoDetectSeriesStrategy(this.manager, true) } @@ -272,6 +319,21 @@ export class SlopeChart }) } + private getSeriesName( + entityName: EntityName, + columnName: string, + entityCount: number + ): SeriesName { + if (this.seriesStrategy === SeriesStrategy.entity) { + return entityName + } + if (entityCount > 1 || this.manager.canSelectMultipleEntities) { + return `${entityName} - ${columnName}` + } else { + return columnName + } + } + private getColorKey( entityName: EntityName, columnName: string, @@ -291,48 +353,53 @@ export class SlopeChart } @computed get series() { - const column = this.yColumn - if (!column) return [] - - const { minTime, maxTime } = column - + const { startTime, endTime } = this const totalEntityCount = this.transformedTable.availableEntityNames.length - return column.uniqEntityNames - .map((entityName) => { - const values: SlopeChartValue[] = [] + return this.yColumns.flatMap((column) => + column.uniqEntityNames + .map((entityName) => { + const seriesName = this.getSeriesName( + entityName, + column.displayName || "Missing name", + totalEntityCount + ) + + const values: SlopeChartValue[] = [] - const yValues = - column.valueByEntityNameAndOriginalTime.get(entityName)! || - [] + const yValues = + column.valueByEntityNameAndOriginalTime.get( + entityName + )! || [] - yValues.forEach((value, time) => { - if (time !== minTime && time !== maxTime) return + yValues.forEach((value, time) => { + if (time !== startTime && time !== endTime) return - values.push({ - x: time, - y: value, + values.push({ + x: time, + y: value, + }) }) - }) - // sort values by time - const sortedValues = sortBy(values, (v) => v.x) + // sort values by time + const sortedValues = sortBy(values, (v) => v.x) - const color = this.categoricalColorAssigner.assign( - this.getColorKey( - entityName, - column.displayName, - totalEntityCount + const color = this.categoricalColorAssigner.assign( + this.getColorKey( + entityName, + column.displayName, + totalEntityCount + ) ) - ) - return { - seriesName: entityName, - color, - values: sortedValues, - } as SlopeChartSeries - }) - .filter((series) => series.values.length >= 2) + return { + seriesName, + color, + values: sortedValues, + } as SlopeChartSeries + }) + .filter((series) => series.values.length >= 2) + ) } } @@ -482,8 +549,8 @@ class LabelledSlopes return this.props.seriesArr } - @computed private get yColumn() { - return this.props.yColumn + @computed private get formatColumn() { + return this.props.formatColumn } @computed private get manager() { @@ -531,7 +598,7 @@ class LabelledSlopes const axis = this.yAxisConfig.toVerticalAxis() axis.domain = this.yDomain axis.range = this.yRange - axis.formatColumn = this.yColumn + axis.formatColumn = this.formatColumn axis.label = "" return axis } @@ -621,7 +688,7 @@ class LabelledSlopes } @computed private get slopeLabels() { - const { isPortrait, yColumn, allowedLabelWidth: maxWidth } = this + const { isPortrait, formatColumn, allowedLabelWidth: maxWidth } = this return this.data.map((series) => { const text = series.seriesName @@ -630,8 +697,8 @@ class LabelledSlopes (isPortrait ? GRAPHER_FONT_SCALE_9_6 : GRAPHER_FONT_SCALE_10_5) * this.fontSize - const leftValueStr = yColumn.formatValueShort(v1.y) - const rightValueStr = yColumn.formatValueShort(v2.y) + const leftValueStr = formatColumn.formatValueShort(v1.y) + const rightValueStr = formatColumn.formatValueShort(v2.y) // value labels const valueLabelProps = { @@ -1008,7 +1075,7 @@ class LabelledSlopes fill={GRAPHER_DARK_TEXT} fontSize={this.yAxis.tickFontSize} > - {this.yColumn.formatTime(xDomain[0])} + {this.formatColumn.formatTime(xDomain[0])} - {this.yColumn.formatTime(xDomain[1])} + {this.formatColumn.formatTime(xDomain[1])} {this.renderGroups(this.backgroundGroups)} diff --git a/packages/@ourworldindata/grapher/src/slopeCharts/SlopeChartConstants.ts b/packages/@ourworldindata/grapher/src/slopeCharts/SlopeChartConstants.ts index 0d8eaf0464b..1869e0a89aa 100644 --- a/packages/@ourworldindata/grapher/src/slopeCharts/SlopeChartConstants.ts +++ b/packages/@ourworldindata/grapher/src/slopeCharts/SlopeChartConstants.ts @@ -39,7 +39,7 @@ export interface SlopeEntryProps extends ChartSeries { export interface LabelledSlopesProps { manager: ChartManager - yColumn: CoreColumn + formatColumn: CoreColumn bounds: Bounds seriesArr: SlopeChartSeries[] hoverKey?: string From 8feef993def967f30388bba8a7e98f067c012101 Mon Sep 17 00:00:00 2001 From: sophiamersmann Date: Wed, 20 Nov 2024 15:10:18 +0100 Subject: [PATCH 06/52] =?UTF-8?q?=E2=9C=A8=20(slope)=20drop=20non-positive?= =?UTF-8?q?=20values=20in=20log=20mode?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../@ourworldindata/grapher/src/slopeCharts/SlopeChart.tsx | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/packages/@ourworldindata/grapher/src/slopeCharts/SlopeChart.tsx b/packages/@ourworldindata/grapher/src/slopeCharts/SlopeChart.tsx index 2846f2515db..fc391493fff 100644 --- a/packages/@ourworldindata/grapher/src/slopeCharts/SlopeChart.tsx +++ b/packages/@ourworldindata/grapher/src/slopeCharts/SlopeChart.tsx @@ -90,6 +90,9 @@ export class SlopeChart // TODO: remove this filter once we don't have mixed type columns in datasets table = table.replaceNonNumericCellsWithErrorValues(this.yColumnSlugs) + if (this.isLogScale) + table = table.replaceNonPositiveCellsForLogScale(this.yColumnSlugs) + // drop all data when the author chose to hide entities with missing data and // at least one of the variables has no data for the current entity if ( @@ -143,6 +146,10 @@ export class SlopeChart return !!(this.manager.isNarrow || this.manager.isStaticAndSmall) } + @computed get isLogScale(): boolean { + return this.props.manager.yAxisConfig?.scaleType === ScaleType.log + } + @computed private get missingDataStrategy(): MissingDataStrategy { return this.manager.missingDataStrategy || MissingDataStrategy.auto } From b88a64b67010eec82bab3303df4b7f918b7c63f7 Mon Sep 17 00:00:00 2001 From: sophiamersmann Date: Wed, 20 Nov 2024 16:09:27 +0100 Subject: [PATCH 07/52] =?UTF-8?q?=E2=9C=A8=20(slope)=20use=20line=20legend?= =?UTF-8?q?=20instead=20of=20custom=20labels?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../grapher/src/slopeCharts/SlopeChart.tsx | 997 +++++++----------- .../src/slopeCharts/SlopeChartConstants.ts | 13 +- 2 files changed, 380 insertions(+), 630 deletions(-) diff --git a/packages/@ourworldindata/grapher/src/slopeCharts/SlopeChart.tsx b/packages/@ourworldindata/grapher/src/slopeCharts/SlopeChart.tsx index fc391493fff..87e5c7ef1b6 100644 --- a/packages/@ourworldindata/grapher/src/slopeCharts/SlopeChart.tsx +++ b/packages/@ourworldindata/grapher/src/slopeCharts/SlopeChart.tsx @@ -4,7 +4,6 @@ import { DEFAULT_BOUNDS, isEmpty, sortBy, - max, getRelativeMouse, domainExtent, minBy, @@ -14,17 +13,11 @@ import { difference, makeIdForHumanConsumption, } from "@ourworldindata/utils" -import { TextWrap } from "@ourworldindata/components" import { observable, computed, action } from "mobx" import { observer } from "mobx-react" import { NoDataModal } from "../noDataModal/NoDataModal" import { ColorScaleManager } from "../color/ColorScale" -import { - BASE_FONT_SIZE, - GRAPHER_DARK_TEXT, - GRAPHER_FONT_SCALE_9_6, - GRAPHER_FONT_SCALE_10_5, -} from "../core/GrapherConstants" +import { BASE_FONT_SIZE, GRAPHER_DARK_TEXT } from "../core/GrapherConstants" import { ScaleType, SeriesName, @@ -40,7 +33,6 @@ import { ChartManager } from "../chart/ChartManager" import { scaleLinear, ScaleLinear } from "d3-scale" import { select } from "d3-selection" import { - LabelledSlopesProps, SlopeChartSeries, SlopeChartValue, SlopeEntryProps, @@ -52,22 +44,20 @@ import { getDefaultFailMessage, makeSelectionArray, } from "../chart/ChartUtils" -import { AxisConfig, AxisManager } from "../axis/AxisConfig" +import { AxisConfig } from "../axis/AxisConfig" import { VerticalAxis } from "../axis/Axis" import { VerticalAxisComponent } from "../axis/AxisViews" import { NoDataSection } from "../scatterCharts/NoDataSection" import { CategoricalColorAssigner } from "../color/CategoricalColorAssigner" import { ColorScheme } from "../color/ColorScheme" import { ColorSchemes } from "../color/ColorSchemes" +import { LineLabelSeries, LineLegend } from "../lineLegend/LineLegend" export interface SlopeChartManager extends ChartManager { isModalOpen?: boolean canSelectMultipleEntities?: boolean } -const LABEL_SLOPE_PADDING = 8 -const LABEL_LABEL_PADDING = 2 - const TOP_PADDING = 6 const BOTTOM_PADDING = 20 @@ -79,6 +69,8 @@ export class SlopeChart }> implements ChartInterface, ColorScaleManager { + base: React.RefObject = React.createRef() + // currently hovered individual series key @observable hoverKey?: string @@ -215,6 +207,291 @@ export class SlopeChart ) } + // used by LineLegend + @computed get focusedSeriesNames(): string[] { + return this.hoverKey ? [this.hoverKey] : [] + } + + // Layered mode occurs when any entity on the chart is hovered or focused + // Then, a special "foreground" set of entities is rendered over the background + @computed private get isLayerMode() { + return this.hoverKey !== undefined + } + + @computed private get formatColumn() { + return this.yColumns[0] + } + + @computed get allowedLabelWidth() { + return this.bounds.width * 0.2 + } + + @computed get maxLabelWidth(): number { + // const maxLabelWidths = this.series.map((slope) => { + // const entityLabelWidth = slope.leftEntityLabel.width + // const maxValueLabelWidth = Math.max( + // slope.leftValueLabel.width, + // slope.rightValueLabel.width + // ) + // return ( + // entityLabelWidth + + // maxValueLabelWidth + + // LABEL_SLOPE_PADDING + + // LABEL_LABEL_PADDING + // ) + // }) + // return max(maxLabelWidths) ?? 0 + return 100 // TODO: remove? + } + + @computed private get initialSlopeData() { + const { series, xScale, yAxis, yDomain } = this + + const slopeData: SlopeEntryProps[] = [] + + series.forEach((series) => { + // Ensure values fit inside the chart + if ( + !series.values.every( + (d) => d.y >= yDomain[0] && d.y <= yDomain[1] + ) + ) + return + + const [v1, v2] = series.values + const [x1, x2] = [xScale(v1.x), xScale(v2.x)] + const [y1, y2] = [yAxis.place(v1.y), yAxis.place(v2.y)] + + slopeData.push({ + x1, + y1, + x2, + y2, + color: series.color, + seriesName: series.seriesName, + isHovered: false, + } as SlopeEntryProps) + }) + + return slopeData + } + + mouseFrame?: number + @action.bound onMouseLeave() { + if (this.mouseFrame !== undefined) cancelAnimationFrame(this.mouseFrame) + + this.onSlopeMouseLeave() + } + + @action.bound onMouseMove( + ev: React.MouseEvent | React.TouchEvent + ) { + if (this.base.current) { + const mouse = getRelativeMouse(this.base.current, ev.nativeEvent) + + this.mouseFrame = requestAnimationFrame(() => { + if (this.innerBounds.contains(mouse)) { + if (this.slopeData.length === 0) return + + const { x1: startX, x2: endX } = this.slopeData[0] + + // whether the mouse is over the chart area, + // the left label area, or the right label area + const mousePosition = + mouse.x < startX + ? "left" + : mouse.x > endX + ? "right" + : "chart" + + // don't track mouse movements when hovering over labels on the left or right + if (mousePosition === "left" || mousePosition === "right") { + this.onSlopeMouseLeave() + return + } + + const distToSlopeOrLabel = new Map< + SlopeEntryProps, + number + >() + for (const s of this.slopeData) { + // start and end point of a line + const p1 = new PointVector(s.x1, s.y1) + const p2 = new PointVector(s.x2, s.y2) + + // calculate the distance to the slope or label + const dist = + PointVector.distanceFromPointToLineSegmentSq( + mouse, + p1, + p2 + ) + distToSlopeOrLabel.set(s, dist) + } + + const closestSlope = minBy(this.slopeData, (s) => + distToSlopeOrLabel.get(s) + ) + const distanceSq = distToSlopeOrLabel.get(closestSlope!)! + const tolerance = mousePosition === "chart" ? 20 : 10 + const toleranceSq = tolerance * tolerance + + if (closestSlope && distanceSq < toleranceSq) { + this.onSlopeMouseOver(closestSlope) + } else { + this.onSlopeMouseLeave() + } + } + }) + } + } + + // Get the final slope data with hover focusing and collision detection + @computed get slopeData(): SlopeEntryProps[] { + let slopeData = this.initialSlopeData + + slopeData = slopeData.map((slope) => { + // used to determine priority for labelling conflicts + const isHovered = this.hoverKey === slope.seriesName + + return { + ...slope, + isHovered, + } + }) + + // Order by focus/hover for draw order + slopeData = sortBy(slopeData, (slope) => (slope.isHovered ? 1 : 0)) + + return slopeData + } + + private renderGroups(groups: SlopeEntryProps[]) { + const { isLayerMode } = this + + return groups.map((slope) => ( + + )) + } + + private renderLabelledSlopes() { + const { bounds, slopeData, xDomain, yAxis, yRange, onMouseMove } = this + + if (isEmpty(slopeData)) + return + + const { x1, x2 } = slopeData[0] + const [y1, y2] = yRange + + return ( + + + + {this.yAxis.tickLabels.map((tick) => { + const y = yAxis.place(tick.value) + return ( + + {/* grid lines connecting the chart area to the axis */} + + {/* grid lines within the chart area */} + + + ) + })} + + + + + + {this.formatColumn.formatTime(xDomain[0])} + + + {this.formatColumn.formatTime(xDomain[1])} + + + {this.renderGroups(this.backgroundGroups)} + {this.renderGroups(this.foregroundGroups)} + + + ) + } + + @computed get backgroundGroups() { + return this.slopeData.filter((group) => !group.isHovered) + } + + @computed get foregroundGroups() { + return this.slopeData.filter((group) => !!group.isHovered) + } + + private playIntroAnimation() { + // Nice little intro animation + select(this.base.current) + .select(".slopes") + .attr("stroke-dasharray", "100%") + .attr("stroke-dashoffset", "100%") + .transition() + .attr("stroke-dashoffset", "0%") + } + render() { if (this.failMessage) return ( @@ -226,23 +503,14 @@ export class SlopeChart ) const { manager } = this.props - const { series, hoverKey, innerBounds } = this return ( - + {this.renderLabelledSlopes()} + {manager.showLegend && } {this.showNoDataSection && this.noDataSection} ) @@ -292,7 +560,11 @@ export class SlopeChart componentDidMount() { exposeInstanceOnWindow(this) - } + + if (!this.manager.disableIntroAnimation) { + this.playIntroAnimation() + } + } @computed private get colorScheme(): ColorScheme { return ( @@ -408,206 +680,32 @@ export class SlopeChart .filter((series) => series.values.length >= 2) ) } -} - -@observer -class SlopeEntry extends React.Component { - line: SVGElement | null = null - - @computed get isInBackground() { - const { isLayerMode, isHovered } = this.props - - if (!isLayerMode) return false - - return !isHovered - } - - render() { - const { - x1, - y1, - x2, - y2, - color, - hasLeftLabel, - hasRightLabel, - leftValueLabel, - leftEntityLabel, - rightValueLabel, - rightEntityLabel, - leftEntityLabelBounds, - rightEntityLabelBounds, - isHovered, - seriesName, - } = this.props - const { isInBackground } = this - - const lineColor = isInBackground ? "#e2e2e2" : color - const labelColor = isInBackground ? "#ccc" : GRAPHER_DARK_TEXT - const opacity = isHovered ? 1 : 0.5 - const lineStrokeWidth = isHovered ? 4 : 2 - - const showDots = isHovered - const showValueLabels = isHovered - const showLeftEntityLabel = isHovered - - const sharedLabelProps = { - fill: labelColor, - style: { cursor: "default" }, - } - - return ( - - (this.line = el)} - x1={x1} - y1={y1} - x2={x2} - y2={y2} - stroke={lineColor} - strokeWidth={lineStrokeWidth} - opacity={opacity} - /> - {showDots && ( - <> - - - - )} - {/* value label on the left */} - {hasLeftLabel && - showValueLabels && - leftValueLabel.render( - x1 - LABEL_SLOPE_PADDING, - leftEntityLabelBounds.y, - { - textProps: { - ...sharedLabelProps, - textAnchor: "end", - }, - } - )} - {/* entity label on the left */} - {hasLeftLabel && - showLeftEntityLabel && - leftEntityLabel.render( - // -2px is a minor visual correction - leftEntityLabelBounds.x - 2, - leftEntityLabelBounds.y, - { - textProps: { - ...sharedLabelProps, - textAnchor: "end", - }, - } - )} - {/* value label on the right */} - {hasRightLabel && - showValueLabels && - rightValueLabel.render( - rightEntityLabelBounds.x + - rightEntityLabel.width + - LABEL_LABEL_PADDING, - rightEntityLabelBounds.y, - { - textProps: sharedLabelProps, - } - )} - {/* entity label on the right */} - {hasRightLabel && - rightEntityLabel.render( - rightEntityLabelBounds.x, - rightEntityLabelBounds.y, - { - textProps: { - ...sharedLabelProps, - fontWeight: isHovered ? "bold" : undefined, - }, - } - )} - - ) - } -} -@observer -class LabelledSlopes - extends React.Component - implements AxisManager -{ - base: React.RefObject = React.createRef() + @observable private hoverTimer?: NodeJS.Timeout - @computed private get data() { - return this.props.seriesArr + @action.bound onLineLegendMouseOver(seriesName: SeriesName): void { + clearTimeout(this.hoverTimer) + this.hoverKey = seriesName } - @computed private get formatColumn() { - return this.props.formatColumn - } - - @computed private get manager() { - return this.props.manager - } - - @computed private get bounds() { - return this.props.bounds - } - - @computed get fontSize() { - return this.manager.fontSize ?? BASE_FONT_SIZE + @action.bound clearHighlightedSeries(): void { + clearTimeout(this.hoverTimer) + this.hoverTimer = setTimeout(() => { + // wait before clearing selection in case the mouse is moving quickly over neighboring labels + this.hoverKey = undefined + }, 200) } - @computed private get hoveredSeriesName() { - return this.props.hoverKey - } - - // Layered mode occurs when any entity on the chart is hovered or focused - // Then, a special "foreground" set of entities is rendered over the background - @computed private get isLayerMode() { - return this.hoveredSeriesName !== undefined - } - - @computed get isPortrait(): boolean { - return this.props.isPortrait - } - - @computed private get allValues() { - return this.props.seriesArr.flatMap((g) => g.values) - } - - @computed private get xDomainDefault(): [number, number] { - return domainExtent( - this.allValues.map((v) => v.x), - ScaleType.linear - ) + @action.bound onLineLegendMouseLeave(): void { + this.clearHighlightedSeries() } @computed private get yAxisConfig(): AxisConfig { return new AxisConfig(this.manager.yAxisConfig, this) } - @computed get yAxis(): VerticalAxis { - const axis = this.yAxisConfig.toVerticalAxis() - axis.domain = this.yDomain - axis.range = this.yRange - axis.formatColumn = this.formatColumn - axis.label = "" - return axis + @computed private get allValues() { + return this.series.flatMap((g) => g.values) } @computed private get yScaleType() { @@ -621,10 +719,6 @@ class LabelledSlopes ) } - @computed private get xDomain(): [number, number] { - return this.xDomainDefault - } - @computed private get yDomain(): [number, number] { const domain = this.yAxisConfig.domain || [Infinity, -Infinity] const domainDefault = this.yDomainDefault @@ -641,6 +735,15 @@ class LabelledSlopes .yRange() } + @computed get yAxis(): VerticalAxis { + const axis = this.yAxisConfig.toVerticalAxis() + axis.domain = this.yDomain + axis.range = this.yRange + axis.formatColumn = this.yColumns[0] + axis.label = "" + return axis + } + @computed get yAxisWidth(): number { return this.yAxis.width + 5 // 5px account for the tick marks } @@ -672,431 +775,89 @@ class LabelledSlopes return scaleLinear().domain(xDomain).range(xRange) } - @computed get maxLabelWidth(): number { - const { slopeLabels } = this - const maxLabelWidths = slopeLabels.map((slope) => { - const entityLabelWidth = slope.leftEntityLabel.width - const maxValueLabelWidth = Math.max( - slope.leftValueLabel.width, - slope.rightValueLabel.width - ) - return ( - entityLabelWidth + - maxValueLabelWidth + - LABEL_SLOPE_PADDING + - LABEL_LABEL_PADDING - ) - }) - return max(maxLabelWidths) ?? 0 - } - - @computed get allowedLabelWidth() { - return this.bounds.width * 0.2 - } - - @computed private get slopeLabels() { - const { isPortrait, formatColumn, allowedLabelWidth: maxWidth } = this - - return this.data.map((series) => { - const text = series.seriesName - const [v1, v2] = series.values - const fontSize = - (isPortrait - ? GRAPHER_FONT_SCALE_9_6 - : GRAPHER_FONT_SCALE_10_5) * this.fontSize - const leftValueStr = formatColumn.formatValueShort(v1.y) - const rightValueStr = formatColumn.formatValueShort(v2.y) - - // value labels - const valueLabelProps = { - maxWidth: Infinity, // no line break - fontSize, - lineHeight: 1, - } - const leftValueLabel = new TextWrap({ - text: leftValueStr, - ...valueLabelProps, - }) - const rightValueLabel = new TextWrap({ - text: rightValueStr, - ...valueLabelProps, - }) - - // entity labels - const entityLabelProps = { - ...valueLabelProps, - maxWidth, - fontWeight: 700, - separators: [" ", "-"], - } - const leftEntityLabel = new TextWrap({ - text, - ...entityLabelProps, - }) - const rightEntityLabel = new TextWrap({ - text, - ...entityLabelProps, - }) - - return { - seriesName: series.seriesName, - leftValueLabel, - leftEntityLabel, - rightValueLabel, - rightEntityLabel, - } - }) - } - - @computed private get initialSlopeData() { - const { data, slopeLabels, xScale, yAxis, yDomain } = this - - const slopeData: SlopeEntryProps[] = [] - - data.forEach((series, i) => { - // Ensure values fit inside the chart - if ( - !series.values.every( - (d) => d.y >= yDomain[0] && d.y <= yDomain[1] - ) - ) - return - - const labels = slopeLabels[i] - const [v1, v2] = series.values - const [x1, x2] = [xScale(v1.x), xScale(v2.x)] - const [y1, y2] = [yAxis.place(v1.y), yAxis.place(v2.y)] - - slopeData.push({ - ...labels, - x1, - y1, - x2, - y2, - color: series.color, - seriesName: series.seriesName, - isHovered: false, - hasLeftLabel: true, - hasRightLabel: true, - } as SlopeEntryProps) - }) - - return slopeData + @computed private get xDomain(): [number, number] { + return this.xDomainDefault } - @computed get backgroundGroups() { - return this.slopeData.filter((group) => !group.isHovered) + @computed private get xDomainDefault(): [number, number] { + return domainExtent( + this.allValues.map((v) => v.x), + ScaleType.linear + ) } - @computed get foregroundGroups() { - return this.slopeData.filter((group) => !!group.isHovered) + @computed get lineLegendX(): number { + return this.bounds.right - 240 } - // Get the final slope data with hover focusing and collision detection - @computed get slopeData(): SlopeEntryProps[] { - const { hoveredSeriesName } = this - - let slopeData = this.initialSlopeData - - slopeData = slopeData.map((slope) => { - // used for collision detection - const leftEntityLabelBounds = new Bounds( - // labels on the left are placed like this: | - slope.x1 - - LABEL_SLOPE_PADDING - - slope.leftValueLabel.width - - LABEL_LABEL_PADDING, - slope.y1 - slope.leftEntityLabel.lines[0].height / 2, - slope.leftEntityLabel.width, - slope.leftEntityLabel.height - ) - const rightEntityLabelBounds = new Bounds( - // labels on the left are placed like this: | - slope.x2 + LABEL_SLOPE_PADDING, - slope.y2 - slope.rightEntityLabel.height / 2, - slope.rightEntityLabel.width, - slope.rightEntityLabel.height - ) - - // used to determine priority for labelling conflicts - const isHovered = hoveredSeriesName === slope.seriesName - + @computed get labelSeries(): LineLabelSeries[] { + return this.series.map((series) => { + const { seriesName, color, values } = series return { - ...slope, - leftEntityLabelBounds, - rightEntityLabelBounds, - isHovered, + color, + seriesName, + label: seriesName, + yValue: values[1].y, } }) - - // How to work out which of two slopes to prioritize for labelling conflicts - function chooseLabel(s1: SlopeEntryProps, s2: SlopeEntryProps) { - if (s1.isHovered && !s2.isHovered) - // Hovered slopes always have priority - return s1 - else if (!s1.isHovered && s2.isHovered) return s2 - else if (s1.hasRightLabel && !s2.hasRightLabel) - // Slopes which already have one label are prioritized for the other side - return s1 - else if (!s1.hasRightLabel && s2.hasRightLabel) return s2 - else return s1 // Equal priority, just do the first one - } - - // Eliminate overlapping labels, one pass for each side - slopeData.forEach((s1) => { - slopeData.forEach((s2) => { - if ( - s1 !== s2 && - s1.hasRightLabel && - s2.hasRightLabel && - // entity labels don't necessarily share the same x position. - // that's why we check for vertical intersection only - s1.rightEntityLabelBounds.hasVerticalOverlap( - s2.rightEntityLabelBounds - ) - ) { - if (chooseLabel(s1, s2) === s1) s2.hasRightLabel = false - else s1.hasRightLabel = false - } - }) - }) - - slopeData.forEach((s1) => { - slopeData.forEach((s2) => { - if ( - s1 !== s2 && - s1.hasLeftLabel && - s2.hasLeftLabel && - // entity labels don't necessarily share the same x position. - // that's why we check for vertical intersection only - s1.leftEntityLabelBounds.hasVerticalOverlap( - s2.leftEntityLabelBounds - ) - ) { - if (chooseLabel(s1, s2) === s1) s2.hasLeftLabel = false - else s1.hasLeftLabel = false - } - }) - }) - - // Order by focus/hover for draw order - slopeData = sortBy(slopeData, (slope) => (slope.isHovered ? 1 : 0)) - - return slopeData - } - - mouseFrame?: number - @action.bound onMouseLeave() { - if (this.mouseFrame !== undefined) cancelAnimationFrame(this.mouseFrame) - - if (this.props.onMouseLeave) this.props.onMouseLeave() - } - - @action.bound onMouseMove( - ev: React.MouseEvent | React.TouchEvent - ) { - if (this.base.current) { - const mouse = getRelativeMouse(this.base.current, ev.nativeEvent) - - this.mouseFrame = requestAnimationFrame(() => { - if (this.props.bounds.contains(mouse)) { - if (this.slopeData.length === 0) return - - const { x1: startX, x2: endX } = this.slopeData[0] - - // whether the mouse is over the chart area, - // the left label area, or the right label area - const mousePosition = - mouse.x < startX - ? "left" - : mouse.x > endX - ? "right" - : "chart" - - // don't track mouse movements when hovering over labels on the left - if (mousePosition === "left") { - this.props.onMouseLeave() - return - } - - const distToSlopeOrLabel = new Map< - SlopeEntryProps, - number - >() - for (const s of this.slopeData) { - // start and end point of a line - let p1: PointVector - let p2: PointVector - - if (mousePosition === "chart") { - // points define the slope line - p1 = new PointVector(s.x1, s.y1) - p2 = new PointVector(s.x2, s.y2) - } else { - const labelBox = s.rightEntityLabelBounds.toProps() - // points define a "strike-through" line that stretches from - // the end point of the slopes to the right side of the right label - const y = labelBox.y + labelBox.height / 2 - p1 = new PointVector(endX, y) - p2 = new PointVector(labelBox.x + labelBox.width, y) - } - - // calculate the distance to the slope or label - const dist = - PointVector.distanceFromPointToLineSegmentSq( - mouse, - p1, - p2 - ) - distToSlopeOrLabel.set(s, dist) - } - - const closestSlope = minBy(this.slopeData, (s) => - distToSlopeOrLabel.get(s) - ) - const distanceSq = distToSlopeOrLabel.get(closestSlope!)! - const tolerance = mousePosition === "chart" ? 20 : 10 - const toleranceSq = tolerance * tolerance - - if ( - closestSlope && - distanceSq < toleranceSq && - this.props.onMouseOver - ) { - this.props.onMouseOver(closestSlope) - } else { - this.props.onMouseLeave() - } - } - }) - } - } - - @action.bound onClick() { - if (this.props.onClick) this.props.onClick() } +} - componentDidMount() { - if (!this.manager.disableIntroAnimation) { - this.playIntroAnimation() - } - } +@observer +class SlopeEntry extends React.Component { + line: SVGElement | null = null - private playIntroAnimation() { - // Nice little intro animation - select(this.base.current) - .select(".slopes") - .attr("stroke-dasharray", "100%") - .attr("stroke-dashoffset", "100%") - .transition() - .attr("stroke-dashoffset", "0%") - } + @computed get isInBackground() { + const { isLayerMode, isHovered } = this.props - renderGroups(groups: SlopeEntryProps[]) { - const { isLayerMode } = this + if (!isLayerMode) return false - return groups.map((slope) => ( - - )) + return !isHovered } render() { - const { bounds, slopeData, xDomain, yAxis, yRange, onMouseMove } = this + const { x1, y1, x2, y2, color, isHovered, seriesName } = this.props + const { isInBackground } = this - if (isEmpty(slopeData)) - return + const lineColor = isInBackground ? "#e2e2e2" : color + const opacity = isHovered ? 1 : 0.5 + const lineStrokeWidth = isHovered ? 4 : 2 - const { x1, x2 } = slopeData[0] - const [y1, y2] = yRange + const showDots = isHovered return ( - - - {this.yAxis.tickLabels.map((tick) => { - const y = yAxis.place(tick.value) - return ( - - {/* grid lines connecting the chart area to the axis */} - - {/* grid lines within the chart area */} - - - ) - })} - - (this.line = el)} + x1={x1} + y1={y1} + x2={x2} + y2={y2} + stroke={lineColor} + strokeWidth={lineStrokeWidth} + opacity={opacity} /> - - - - {this.formatColumn.formatTime(xDomain[0])} - - - {this.formatColumn.formatTime(xDomain[1])} - - - {this.renderGroups(this.backgroundGroups)} - {this.renderGroups(this.foregroundGroups)} - + {showDots && ( + <> + + + + )} ) } diff --git a/packages/@ourworldindata/grapher/src/slopeCharts/SlopeChartConstants.ts b/packages/@ourworldindata/grapher/src/slopeCharts/SlopeChartConstants.ts index 1869e0a89aa..6c271390a20 100644 --- a/packages/@ourworldindata/grapher/src/slopeCharts/SlopeChartConstants.ts +++ b/packages/@ourworldindata/grapher/src/slopeCharts/SlopeChartConstants.ts @@ -3,7 +3,6 @@ import { ChartSeries } from "../chart/ChartInterface" import { ChartManager } from "../chart/ChartManager" import { ScaleType } from "@ourworldindata/types" import { Bounds } from "@ourworldindata/utils" -import { TextWrap } from "@ourworldindata/components" export interface SlopeChartValue { x: number @@ -18,22 +17,12 @@ export interface SlopeChartSeries extends ChartSeries { export const DEFAULT_SLOPE_CHART_COLOR = "#ff7f0e" export interface SlopeEntryProps extends ChartSeries { - isLayerMode: boolean x1: number y1: number x2: number y2: number - hasLeftLabel: boolean - leftEntityLabel: TextWrap - leftValueLabel: TextWrap - leftEntityLabelBounds: Bounds - - hasRightLabel: boolean - rightEntityLabel: TextWrap - rightEntityLabelBounds: Bounds - rightValueLabel: TextWrap - + isLayerMode: boolean isHovered: boolean } From fd20f96dcc349f12cd0534cfb127233d47910771 Mon Sep 17 00:00:00 2001 From: sophiamersmann Date: Wed, 20 Nov 2024 16:14:14 +0100 Subject: [PATCH 08/52] =?UTF-8?q?=E2=9C=A8=20(slope)=20add=20support=20for?= =?UTF-8?q?=20entity=20name=20annotations?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../grapher/src/slopeCharts/SlopeChart.tsx | 29 ++++++++++++++++++- .../src/slopeCharts/SlopeChartConstants.ts | 1 + 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/packages/@ourworldindata/grapher/src/slopeCharts/SlopeChart.tsx b/packages/@ourworldindata/grapher/src/slopeCharts/SlopeChart.tsx index 87e5c7ef1b6..677edd06bf0 100644 --- a/packages/@ourworldindata/grapher/src/slopeCharts/SlopeChart.tsx +++ b/packages/@ourworldindata/grapher/src/slopeCharts/SlopeChart.tsx @@ -27,6 +27,7 @@ import { Time, SeriesStrategy, EntityName, + PrimitiveType, } from "@ourworldindata/types" import { ChartInterface } from "../chart/ChartInterface" import { ChartManager } from "../chart/ChartManager" @@ -613,6 +614,28 @@ export class SlopeChart } } + // todo: for now just works with 1 y column + @computed private get annotationsMap(): Map< + PrimitiveType, + Set + > { + return this.inputTable + .getAnnotationColumnForColumn(this.yColumnSlugs[0]) + ?.getUniqueValuesGroupedBy(this.inputTable.entityNameSlug) + } + + private getAnnotationsForSeries( + seriesName: SeriesName + ): string | undefined { + const annotationsMap = this.annotationsMap + const annos = annotationsMap?.get(seriesName) + return annos + ? Array.from(annos.values()) + .filter((anno) => anno) + .join(" & ") + : undefined + } + private getColorKey( entityName: EntityName, columnName: string, @@ -671,10 +694,13 @@ export class SlopeChart ) ) + const annotation = this.getAnnotationsForSeries(seriesName) + return { seriesName, color, values: sortedValues, + annotation, } as SlopeChartSeries }) .filter((series) => series.values.length >= 2) @@ -792,11 +818,12 @@ export class SlopeChart @computed get labelSeries(): LineLabelSeries[] { return this.series.map((series) => { - const { seriesName, color, values } = series + const { seriesName, color, values, annotation } = series return { color, seriesName, label: seriesName, + annotation, yValue: values[1].y, } }) diff --git a/packages/@ourworldindata/grapher/src/slopeCharts/SlopeChartConstants.ts b/packages/@ourworldindata/grapher/src/slopeCharts/SlopeChartConstants.ts index 6c271390a20..16d767bd113 100644 --- a/packages/@ourworldindata/grapher/src/slopeCharts/SlopeChartConstants.ts +++ b/packages/@ourworldindata/grapher/src/slopeCharts/SlopeChartConstants.ts @@ -12,6 +12,7 @@ export interface SlopeChartValue { export interface SlopeChartSeries extends ChartSeries { size: number values: SlopeChartValue[] + annotation?: string } export const DEFAULT_SLOPE_CHART_COLOR = "#ff7f0e" From f43c02dd3f801ebe4a2ae2468df6fa03b45fe4a5 Mon Sep 17 00:00:00 2001 From: sophiamersmann Date: Wed, 20 Nov 2024 16:32:54 +0100 Subject: [PATCH 09/52] =?UTF-8?q?=E2=9C=A8=20(grapher)=20disallow=20switch?= =?UTF-8?q?ing=20to=20a=20slope=20chart=20for=20projections?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../grapher/src/chart/ChartUtils.tsx | 15 ++++++++++- .../grapher/src/core/Grapher.tsx | 27 ++++++++++++------- 2 files changed, 32 insertions(+), 10 deletions(-) diff --git a/packages/@ourworldindata/grapher/src/chart/ChartUtils.tsx b/packages/@ourworldindata/grapher/src/chart/ChartUtils.tsx index 375e9816c7a..501d646456d 100644 --- a/packages/@ourworldindata/grapher/src/chart/ChartUtils.tsx +++ b/packages/@ourworldindata/grapher/src/chart/ChartUtils.tsx @@ -1,5 +1,5 @@ import React from "react" -import { Box, getCountryByName } from "@ourworldindata/utils" +import { areSetsEqual, Box, getCountryByName } from "@ourworldindata/utils" import { SeriesStrategy, EntityName, @@ -15,6 +15,7 @@ import { GRAPHER_SIDE_PANEL_CLASS, GRAPHER_TIMELINE_CLASS, GRAPHER_SETTINGS_CLASS, + validChartTypeCombinations, } from "../core/GrapherConstants" export const autoDetectYColumnSlugs = (manager: ChartManager): string[] => { @@ -175,3 +176,15 @@ export function mapChartTypeNameToQueryParam( return GRAPHER_TAB_QUERY_PARAMS.marimekko } } + +export function findValidChartTypeCombination( + chartTypes: GrapherChartType[] +): GrapherChartType[] | undefined { + const chartTypeSet = new Set(chartTypes) + for (const validCombination of validChartTypeCombinations) { + const validCombinationSet = new Set(validCombination) + if (areSetsEqual(chartTypeSet, validCombinationSet)) + return validCombination + } + return undefined +} diff --git a/packages/@ourworldindata/grapher/src/core/Grapher.tsx b/packages/@ourworldindata/grapher/src/core/Grapher.tsx index af37f90b2be..990b082b640 100644 --- a/packages/@ourworldindata/grapher/src/core/Grapher.tsx +++ b/packages/@ourworldindata/grapher/src/core/Grapher.tsx @@ -66,7 +66,6 @@ import { extractDetailsFromSyntax, omit, isTouchDevice, - areSetsEqual, } from "@ourworldindata/utils" import { MarkdownTextWrap, @@ -138,7 +137,6 @@ import { GRAPHER_FRAME_PADDING_HORIZONTAL, GRAPHER_FRAME_PADDING_VERTICAL, latestGrapherConfigSchema, - validChartTypeCombinations, GRAPHER_SQUARE_SIZE, } from "../core/GrapherConstants" import { loadVariableDataAndMetadata } from "./loadVariable" @@ -198,6 +196,7 @@ import { ScatterPlotManager } from "../scatterCharts/ScatterPlotChartConstants" import { autoDetectSeriesStrategy, autoDetectYColumnSlugs, + findValidChartTypeCombination, mapChartTypeNameToQueryParam, mapQueryParamToChartTypeName, } from "../chart/ChartUtils" @@ -1524,21 +1523,31 @@ export class Grapher }) } + @computed get hasProjectedData(): boolean { + return this.inputTable.numericColumnSlugs.some( + (slug) => this.inputTable.get(slug).isProjection + ) + } + @computed get validChartTypes(): GrapherChartType[] { const { chartTypes } = this // all single-chart Graphers are valid if (chartTypes.length <= 1) return chartTypes - const chartTypeSet = new Set(chartTypes) - for (const validCombination of validChartTypeCombinations) { - const validCombinationSet = new Set(validCombination) - if (areSetsEqual(chartTypeSet, validCombinationSet)) - return validCombination - } + // find valid combination in a pre-defined list + const validChartTypes = findValidChartTypeCombination(chartTypes) // if the given combination is not valid, then ignore all but the first chart type - return chartTypes.slice(0, 1) + if (!validChartTypes) return chartTypes.slice(0, 1) + + // projected data is only supported for line charts + const isLineChart = validChartTypes[0] === GRAPHER_CHART_TYPES.LineChart + if (isLineChart && this.hasProjectedData) { + return [GRAPHER_CHART_TYPES.LineChart] + } + + return validChartTypes } @computed get validChartTypeSet(): Set { From 1782794b50c01e8f384f6691bb66bb77148f88fc Mon Sep 17 00:00:00 2001 From: sophiamersmann Date: Wed, 20 Nov 2024 17:17:49 +0100 Subject: [PATCH 10/52] =?UTF-8?q?=E2=9C=A8=20(slope)=20add=20tooltips?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../grapher/src/slopeCharts/SlopeChart.tsx | 92 +++++++++++++++++++ .../src/slopeCharts/SlopeChartConstants.ts | 2 + 2 files changed, 94 insertions(+) diff --git a/packages/@ourworldindata/grapher/src/slopeCharts/SlopeChart.tsx b/packages/@ourworldindata/grapher/src/slopeCharts/SlopeChart.tsx index 677edd06bf0..563cfbaa568 100644 --- a/packages/@ourworldindata/grapher/src/slopeCharts/SlopeChart.tsx +++ b/packages/@ourworldindata/grapher/src/slopeCharts/SlopeChart.tsx @@ -12,6 +12,8 @@ import { clamp, difference, makeIdForHumanConsumption, + guid, + excludeUndefined, } from "@ourworldindata/utils" import { observable, computed, action } from "mobx" import { observer } from "mobx-react" @@ -53,6 +55,13 @@ import { CategoricalColorAssigner } from "../color/CategoricalColorAssigner" import { ColorScheme } from "../color/ColorScheme" import { ColorSchemes } from "../color/ColorSchemes" import { LineLabelSeries, LineLegend } from "../lineLegend/LineLegend" +import { + makeTooltipRoundingNotice, + Tooltip, + TooltipState, + TooltipValueRange, +} from "../tooltip/Tooltip" +import { TooltipFooterIcon } from "../tooltip/TooltipProps" export interface SlopeChartManager extends ChartManager { isModalOpen?: boolean @@ -75,6 +84,10 @@ export class SlopeChart // currently hovered individual series key @observable hoverKey?: string + @observable tooltipState = new TooltipState<{ + series: SlopeChartSeries + }>() + transformTable(table: OwidTable) { table = table.filterByEntityNames( this.selectionArray.selectedEntityNames @@ -149,10 +162,14 @@ export class SlopeChart @action.bound onSlopeMouseOver(slopeProps: SlopeEntryProps) { this.hoverKey = slopeProps.seriesName + this.tooltipState.target = { + series: slopeProps.series, + } } @action.bound onSlopeMouseLeave() { this.hoverKey = undefined + this.tooltipState.target = null } @computed private get selectionArray() { @@ -269,6 +286,7 @@ export class SlopeChart x2, y2, color: series.color, + series: series, seriesName: series.seriesName, isHovered: false, } as SlopeEntryProps) @@ -287,6 +305,11 @@ export class SlopeChart @action.bound onMouseMove( ev: React.MouseEvent | React.TouchEvent ) { + const ref = this.manager.base?.current + if (ref) { + this.tooltipState.position = getRelativeMouse(ref, ev) + } + if (this.base.current) { const mouse = getRelativeMouse(this.base.current, ev.nativeEvent) @@ -493,6 +516,74 @@ export class SlopeChart .attr("stroke-dashoffset", "0%") } + @computed get renderUid(): number { + return guid() + } + + @computed get tooltip(): React.ReactElement | undefined { + const { + tooltipState: { target, position, fading }, + } = this + + const { series } = target || {} + if (!series) return + + const { isRelativeMode } = this.manager, + timeRange = [this.startTime, this.endTime] + .map((t) => this.formatColumn.formatTime(t)) + .join(" to "), + timeLabel = timeRange + (isRelativeMode ? " (relative change)" : "") + + const columns = this.yColumns + const allRoundedToSigFigs = columns.every( + (column) => column.roundsToSignificantFigures + ) + const anyRoundedToSigFigs = columns.some( + (column) => column.roundsToSignificantFigures + ) + const sigFigs = excludeUndefined( + columns.map((column) => + column.roundsToSignificantFigures + ? column.numSignificantFigures + : undefined + ) + ) + + const roundingNotice = anyRoundedToSigFigs + ? { + icon: allRoundedToSigFigs + ? TooltipFooterIcon.none + : TooltipFooterIcon.significance, + text: makeTooltipRoundingNotice(sigFigs, { + plural: sigFigs.length > 1, + }), + } + : undefined + const footer = excludeUndefined([roundingNotice]) + + return ( + (this.tooltipState.target = null)} + > + v.y)} + /> + + ) + } + render() { if (this.failMessage) return ( @@ -513,6 +604,7 @@ export class SlopeChart {this.renderLabelledSlopes()} {manager.showLegend && } {this.showNoDataSection && this.noDataSection} + {this.tooltip} ) } diff --git a/packages/@ourworldindata/grapher/src/slopeCharts/SlopeChartConstants.ts b/packages/@ourworldindata/grapher/src/slopeCharts/SlopeChartConstants.ts index 16d767bd113..9b27bf3110b 100644 --- a/packages/@ourworldindata/grapher/src/slopeCharts/SlopeChartConstants.ts +++ b/packages/@ourworldindata/grapher/src/slopeCharts/SlopeChartConstants.ts @@ -18,6 +18,8 @@ export interface SlopeChartSeries extends ChartSeries { export const DEFAULT_SLOPE_CHART_COLOR = "#ff7f0e" export interface SlopeEntryProps extends ChartSeries { + series: SlopeChartSeries + x1: number y1: number x2: number From e5bc37e721b9e3e6082f235e464bdfd61e4c04b6 Mon Sep 17 00:00:00 2001 From: sophiamersmann Date: Thu, 21 Nov 2024 12:21:34 +0100 Subject: [PATCH 11/52] =?UTF-8?q?=E2=9C=A8=20(slope)=20refactor?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../core-table/src/CoreTableColumns.ts | 12 +- .../core-table/src/OwidTable.ts | 5 +- .../grapher/src/lineCharts/LineChart.tsx | 108 +- .../src/lineCharts/lineChartHelpers.ts | 75 + .../src/scatterCharts/NoDataSection.tsx | 22 +- .../src/scatterCharts/ScatterPlotChart.tsx | 2 +- .../src/slopeCharts/SlopeChart.test.ts | 6 +- .../grapher/src/slopeCharts/SlopeChart.tsx | 1305 ++++++++--------- .../src/slopeCharts/SlopeChartConstants.ts | 53 +- .../src/stackedCharts/StackedAreaChart.tsx | 44 +- .../types/src/grapherTypes/GrapherTypes.ts | 7 + packages/@ourworldindata/types/src/index.ts | 1 + 12 files changed, 794 insertions(+), 846 deletions(-) create mode 100644 packages/@ourworldindata/grapher/src/lineCharts/lineChartHelpers.ts diff --git a/packages/@ourworldindata/core-table/src/CoreTableColumns.ts b/packages/@ourworldindata/core-table/src/CoreTableColumns.ts index 40da7cba3dc..390dfb88bcd 100644 --- a/packages/@ourworldindata/core-table/src/CoreTableColumns.ts +++ b/packages/@ourworldindata/core-table/src/CoreTableColumns.ts @@ -305,12 +305,22 @@ export abstract class AbstractCoreColumn { @imemo get displayName(): string { return ( this.display?.name ?? - this.def.presentation?.titlePublic ?? // this is a bit of an unusual fallback - if display.name is not given, titlePublic is the next best thing before name + // this is a bit of an unusual fallback - if display.name is not given, titlePublic is the next best thing before name + this.def.presentation?.titlePublic ?? this.name ?? "" ) } + @imemo get nonEmptyDisplayName(): string { + return ( + this.display?.name || + // this is a bit of an unusual fallback - if display.name is not given, titlePublic is the next best thing before name + this.def.presentation?.titlePublic || + this.nonEmptyName + ) + } + @imemo get titlePublicOrDisplayName(): IndicatorTitleWithFragments { return this.def.presentation?.titlePublic ? { diff --git a/packages/@ourworldindata/core-table/src/OwidTable.ts b/packages/@ourworldindata/core-table/src/OwidTable.ts index 4e53ae9cc24..fe35387ae20 100644 --- a/packages/@ourworldindata/core-table/src/OwidTable.ts +++ b/packages/@ourworldindata/core-table/src/OwidTable.ts @@ -124,9 +124,8 @@ export class OwidTable extends CoreTable { return min(this.allTimes) as Time } - // TODO: remove undefined? - @imemo get maxTime(): Time | undefined { - return max(this.allTimes) + @imemo get maxTime(): Time { + return max(this.allTimes) as Time } @imemo private get allTimes(): Time[] { diff --git a/packages/@ourworldindata/grapher/src/lineCharts/LineChart.tsx b/packages/@ourworldindata/grapher/src/lineCharts/LineChart.tsx index 876a49b57bf..d48ddcdd868 100644 --- a/packages/@ourworldindata/grapher/src/lineCharts/LineChart.tsx +++ b/packages/@ourworldindata/grapher/src/lineCharts/LineChart.tsx @@ -102,6 +102,13 @@ import { HorizontalColorLegendManager, HorizontalNumericColorLegend, } from "../horizontalColorLegend/HorizontalColorLegends" +import { + AnnotationsMap, + getAnnotationsForSeries, + getAnnotationsMap, + getColorKey, + getSeriesName, +} from "./lineChartHelpers" const LINE_CHART_CLASS_NAME = "LineChart" @@ -707,7 +714,10 @@ export class LineChart rows={sortedData.map((series) => { const { seriesName: name, isProjection: striped } = series - const annotation = this.getAnnotationsForSeries(name) + const annotation = getAnnotationsForSeries( + this.annotationsMap, + name + ) const point = series.points.find( (point) => point.x === target.x @@ -1148,24 +1158,8 @@ export class LineChart // End of color legend props - // todo: for now just works with 1 y column - @computed private get annotationsMap(): Map< - PrimitiveType, - Set - > { - return this.inputTable - .getAnnotationColumnForColumn(this.yColumnSlugs[0]) - ?.getUniqueValuesGroupedBy(this.inputTable.entityNameSlug) - } - - getAnnotationsForSeries(seriesName: SeriesName): string | undefined { - const annotationsMap = this.annotationsMap - const annos = annotationsMap?.get(seriesName) - return annos - ? Array.from(annos.values()) - .filter((anno) => anno) - .join(" & ") - : undefined + @computed private get annotationsMap(): AnnotationsMap | undefined { + return getAnnotationsMap(this.inputTable, this.yColumnSlugs[0]) } @computed private get colorScheme(): ColorScheme { @@ -1196,39 +1190,6 @@ export class LineChart }) } - private getSeriesName( - entityName: EntityName, - columnName: string, - entityCount: number - ): SeriesName { - if (this.seriesStrategy === SeriesStrategy.entity) { - return entityName - } - if (entityCount > 1 || this.manager.canSelectMultipleEntities) { - return `${entityName} - ${columnName}` - } else { - return columnName - } - } - - private getColorKey( - entityName: EntityName, - columnName: string, - entityCount: number - ): SeriesName { - if (this.seriesStrategy === SeriesStrategy.entity) { - return entityName - } - // If only one entity is plotted, we want to use the column colors. - // Unlike in `getSeriesName`, we don't care whether the user can select - // multiple entities, only whether more than one is plotted. - if (entityCount > 1) { - return `${entityName} - ${columnName}` - } else { - return columnName - } - } - // cache value for performance @computed private get rowIndicesByEntityName(): Map { return this.transformedTable.rowIndex([ @@ -1237,14 +1198,20 @@ export class LineChart } private constructSingleSeries( - entityName: string, - col: CoreColumn + entityName: EntityName, + column: CoreColumn ): LineChartSeries { - const { hasColorScale, transformedTable, colorColumn } = this + const { + manager: { canSelectMultipleEntities = false }, + transformedTable: { availableEntityNames }, + seriesStrategy, + hasColorScale, + colorColumn, + } = this // Construct the points - const timeValues = col.originalTimeColumn.valuesIncludingErrorValues - const values = col.valuesIncludingErrorValues + const timeValues = column.originalTimeColumn.valuesIncludingErrorValues + const values = column.valuesIncludingErrorValues const colorValues = colorColumn.valuesIncludingErrorValues // If Y and Color are the same column, we need to get rid of any duplicate rows. // Duplicates occur because Y doesn't have tolerance applied, but Color does. @@ -1269,26 +1236,34 @@ export class LineChart }) // Construct series properties - const totalEntityCount = transformedTable.availableEntityNames.length - const seriesName = this.getSeriesName( + const columnName = column.nonEmptyDisplayName + const seriesName = getSeriesName({ entityName, - col.displayName, - totalEntityCount - ) + columnName, + seriesStrategy, + availableEntityNames, + canSelectMultipleEntities, + }) + let seriesColor: Color if (hasColorScale) { const colorValue = last(points)?.colorValue seriesColor = this.getColorScaleColor(colorValue) } else { seriesColor = this.categoricalColorAssigner.assign( - this.getColorKey(entityName, col.displayName, totalEntityCount) + getColorKey({ + entityName, + columnName, + seriesStrategy, + availableEntityNames, + }) ) } return { points, seriesName, - isProjection: col.isProjection, + isProjection: column.isProjection, color: seriesColor, } } @@ -1350,7 +1325,10 @@ export class LineChart seriesName, // E.g. https://ourworldindata.org/grapher/size-poverty-gap-world label: !this.manager.showLegend ? "" : `${seriesName}`, - annotation: this.getAnnotationsForSeries(seriesName), + annotation: getAnnotationsForSeries( + this.annotationsMap, + seriesName + ), yValue: lastValue, } }) diff --git a/packages/@ourworldindata/grapher/src/lineCharts/lineChartHelpers.ts b/packages/@ourworldindata/grapher/src/lineCharts/lineChartHelpers.ts new file mode 100644 index 00000000000..5296a3a3eca --- /dev/null +++ b/packages/@ourworldindata/grapher/src/lineCharts/lineChartHelpers.ts @@ -0,0 +1,75 @@ +import { OwidTable } from "@ourworldindata/core-table" +import { + ColumnSlug, + EntityName, + PrimitiveType, + SeriesName, + SeriesStrategy, +} from "@ourworldindata/types" + +export type AnnotationsMap = Map> + +export function getSeriesName({ + entityName, + columnName, + seriesStrategy, + availableEntityNames, + canSelectMultipleEntities, +}: { + entityName: EntityName + columnName: string + seriesStrategy: SeriesStrategy + availableEntityNames: EntityName[] + canSelectMultipleEntities: boolean +}): SeriesName { + // if entities are plotted, use the entity name + if (seriesStrategy === SeriesStrategy.entity) return entityName + + // if columns are plotted, use the column name + // and prepend the entity name if multiple entities can be selected + return availableEntityNames.length > 1 && canSelectMultipleEntities + ? `${entityName} - ${columnName}` + : columnName +} + +export function getColorKey({ + entityName, + columnName, + seriesStrategy, + availableEntityNames, +}: { + entityName: EntityName + columnName: string + seriesStrategy: SeriesStrategy + availableEntityNames: EntityName[] +}): SeriesName { + // if entities are plotted, use the entity name + if (seriesStrategy === SeriesStrategy.entity) return entityName + + // If only one entity is plotted, we want to use the column colors. + // Unlike in `getSeriesName`, we don't care whether the user can select + // multiple entities, only whether more than one is plotted. + return availableEntityNames.length > 1 + ? `${entityName} - ${columnName}` + : columnName +} + +export function getAnnotationsMap( + table: OwidTable, + slug: ColumnSlug +): AnnotationsMap | undefined { + return table + .getAnnotationColumnForColumn(slug) + ?.getUniqueValuesGroupedBy(table.entityNameSlug) +} + +export function getAnnotationsForSeries( + annotationsMap: AnnotationsMap | undefined, + seriesName: SeriesName +): string | undefined { + const annotations = annotationsMap?.get(seriesName) + if (!annotations) return undefined + return Array.from(annotations.values()) + .filter((anno) => anno) + .join(" & ") +} diff --git a/packages/@ourworldindata/grapher/src/scatterCharts/NoDataSection.tsx b/packages/@ourworldindata/grapher/src/scatterCharts/NoDataSection.tsx index 6ccac9dd108..bf9dfb192f3 100644 --- a/packages/@ourworldindata/grapher/src/scatterCharts/NoDataSection.tsx +++ b/packages/@ourworldindata/grapher/src/scatterCharts/NoDataSection.tsx @@ -6,19 +6,19 @@ import { } from "../core/GrapherConstants" export function NoDataSection({ - entityNames, + seriesNames, bounds, baseFontSize = 16, }: { - entityNames: string[] + seriesNames: string[] bounds: Bounds baseFontSize?: number }): React.ReactElement { { - const displayedEntities = entityNames.slice(0, 5) - const numRemainingEntities = Math.max( + const displayedNames = seriesNames.slice(0, 5) + const remaining = Math.max( 0, - entityNames.length - displayedEntities.length + seriesNames.length - displayedNames.length ) return ( @@ -40,7 +40,7 @@ export function NoDataSection({ No data
    - {displayedEntities.map((entityName) => ( + {displayedNames.map((entityName) => (
  • ))}
- {numRemainingEntities > 0 && ( -
- &{" "} - {numRemainingEntities === 1 - ? "one" - : numRemainingEntities}{" "} - more -
+ {remaining > 0 && ( +
& {remaining === 1 ? "one" : remaining} more
)} ) diff --git a/packages/@ourworldindata/grapher/src/scatterCharts/ScatterPlotChart.tsx b/packages/@ourworldindata/grapher/src/scatterCharts/ScatterPlotChart.tsx index e4688cad8ee..fc505bb6459 100644 --- a/packages/@ourworldindata/grapher/src/scatterCharts/ScatterPlotChart.tsx +++ b/packages/@ourworldindata/grapher/src/scatterCharts/ScatterPlotChart.tsx @@ -871,7 +871,7 @@ export class ScatterPlotChart {!this.manager.isStatic && separatorLine(noDataSectionBounds.top)} diff --git a/packages/@ourworldindata/grapher/src/slopeCharts/SlopeChart.test.ts b/packages/@ourworldindata/grapher/src/slopeCharts/SlopeChart.test.ts index 7d7e4ae8d80..9a22d9c08a6 100755 --- a/packages/@ourworldindata/grapher/src/slopeCharts/SlopeChart.test.ts +++ b/packages/@ourworldindata/grapher/src/slopeCharts/SlopeChart.test.ts @@ -48,10 +48,8 @@ it("filters non-numeric values", () => { const chart = new SlopeChart({ manager }) expect(chart.series.length).toEqual(1) expect( - chart.series.every((series) => - series.values.every( - (value) => isNumber(value.x) && isNumber(value.y) - ) + chart.series.every( + (series) => isNumber(series.startValue) && isNumber(series.endValue) ) ).toBeTruthy() }) diff --git a/packages/@ourworldindata/grapher/src/slopeCharts/SlopeChart.tsx b/packages/@ourworldindata/grapher/src/slopeCharts/SlopeChart.tsx index 563cfbaa568..2a54bcf579a 100644 --- a/packages/@ourworldindata/grapher/src/slopeCharts/SlopeChart.tsx +++ b/packages/@ourworldindata/grapher/src/slopeCharts/SlopeChart.tsx @@ -3,23 +3,27 @@ import { Bounds, DEFAULT_BOUNDS, isEmpty, - sortBy, - getRelativeMouse, domainExtent, - minBy, exposeInstanceOnWindow, PointVector, clamp, - difference, makeIdForHumanConsumption, guid, excludeUndefined, + partition, + max, + getRelativeMouse, + minBy, } from "@ourworldindata/utils" import { observable, computed, action } from "mobx" import { observer } from "mobx-react" import { NoDataModal } from "../noDataModal/NoDataModal" import { ColorScaleManager } from "../color/ColorScale" -import { BASE_FONT_SIZE, GRAPHER_DARK_TEXT } from "../core/GrapherConstants" +import { + BASE_FONT_SIZE, + GRAPHER_DARK_TEXT, + GRAPHER_FONT_SCALE_12, +} from "../core/GrapherConstants" import { ScaleType, SeriesName, @@ -30,15 +34,16 @@ import { SeriesStrategy, EntityName, PrimitiveType, + RenderMode, } from "@ourworldindata/types" import { ChartInterface } from "../chart/ChartInterface" import { ChartManager } from "../chart/ChartManager" import { scaleLinear, ScaleLinear } from "d3-scale" import { select } from "d3-selection" import { + PlacedSlopeChartSeries, + RawSlopeChartSeries, SlopeChartSeries, - SlopeChartValue, - SlopeEntryProps, } from "./SlopeChartConstants" import { CoreColumn, OwidTable } from "@ourworldindata/core-table" import { @@ -62,15 +67,25 @@ import { TooltipValueRange, } from "../tooltip/Tooltip" import { TooltipFooterIcon } from "../tooltip/TooltipProps" +import { + AnnotationsMap, + getAnnotationsForSeries, + getAnnotationsMap, + getColorKey, + getSeriesName, +} from "../lineCharts/lineChartHelpers" export interface SlopeChartManager extends ChartManager { isModalOpen?: boolean + canChangeEntity?: boolean canSelectMultipleEntities?: boolean } const TOP_PADDING = 6 const BOTTOM_PADDING = 20 +const LINE_LEGEND_PADDING = 4 + @observer export class SlopeChart extends React.Component<{ @@ -80,13 +95,12 @@ export class SlopeChart implements ChartInterface, ColorScaleManager { base: React.RefObject = React.createRef() + defaultBaseColorScheme = ColorSchemeName.OwidDistinctLines - // currently hovered individual series key - @observable hoverKey?: string - + @observable hoveredSeriesName?: string @observable tooltipState = new TooltipState<{ series: SlopeChartSeries - }>() + }>({ fade: "immediate" }) transformTable(table: OwidTable) { table = table.filterByEntityNames( @@ -109,50 +123,58 @@ export class SlopeChart } return table - - // TODO: re-enable? - // return table - // .dropRowsWithErrorValuesForColumn(this.yColumnSlug) - // .interpolateColumnWithTolerance(this.yColumnSlug) } transformTableForSelection(table: OwidTable): OwidTable { // if entities with partial data are not plotted, // make sure they don't show up in the entity selector if (this.missingDataStrategy === MissingDataStrategy.hide) { - table = table.replaceNonNumericCellsWithErrorValues( - this.yColumnSlugs - ) + table = table + .replaceNonNumericCellsWithErrorValues(this.yColumnSlugs) + .dropEntitiesThatHaveNoDataInSomeColumn(this.yColumnSlugs) + } + + return table + } + + @computed get transformedTableFromGrapher(): OwidTable { + return ( + this.manager.transformedTable ?? + this.transformTable(this.inputTable) + ) + } - table = table.dropEntitiesThatHaveNoDataInSomeColumn( - this.yColumnSlugs + @computed get transformedTable(): OwidTable { + let table = this.transformedTableFromGrapher + // The % growth transform cannot be applied in transformTable() because it will filter out + // any rows before startHandleTimeBound and change the timeline bounds. + const { isRelativeMode, startHandleTimeBound } = this.manager + if (isRelativeMode && startHandleTimeBound !== undefined) { + table = table.toTotalGrowthForEachColumnComparedToStartTime( + startHandleTimeBound, + this.yColumnSlugs ?? [] ) } - return table } - @computed get manager() { + @computed private get manager(): SlopeChartManager { return this.props.manager } - @computed.struct get bounds() { - return this.props.bounds ?? DEFAULT_BOUNDS + @computed get inputTable(): OwidTable { + return this.manager.table } - @computed get isStatic(): boolean { - return this.manager.isStatic ?? false + @computed private get bounds(): Bounds { + return this.props.bounds ?? DEFAULT_BOUNDS } @computed get fontSize() { return this.manager.fontSize ?? BASE_FONT_SIZE } - @computed private get isPortrait(): boolean { - return !!(this.manager.isNarrow || this.manager.isStaticAndSmall) - } - - @computed get isLogScale(): boolean { + @computed private get isLogScale(): boolean { return this.props.manager.yAxisConfig?.scaleType === ScaleType.log } @@ -160,350 +182,338 @@ export class SlopeChart return this.manager.missingDataStrategy || MissingDataStrategy.auto } - @action.bound onSlopeMouseOver(slopeProps: SlopeEntryProps) { - this.hoverKey = slopeProps.seriesName - this.tooltipState.target = { - series: slopeProps.series, - } + @computed private get selectionArray() { + return makeSelectionArray(this.manager.selection) } - @action.bound onSlopeMouseLeave() { - this.hoverKey = undefined - this.tooltipState.target = null + @computed private get formatColumn() { + return this.yColumns[0] } - @computed private get selectionArray() { - return makeSelectionArray(this.manager.selection) + @computed private get sidebarWidth(): number { + return this.showNoDataSection + ? clamp(this.bounds.width * 0.125, 60, 140) + : 0 } - @computed private get selectedEntityNames() { - return this.selectionArray.selectedEntityNames + // used by LineLegend + @computed get focusedSeriesNames(): SeriesName[] { + return this.hoveredSeriesName ? [this.hoveredSeriesName] : [] } - @computed private get sidebarWidth(): number { - return Math.min(120, 0.15 * this.bounds.width) + @computed private get isFocusModeActive(): boolean { + return this.hoveredSeriesName !== undefined } - @computed private get innerBounds() { - const { sidebarWidth } = this - let bounds = this.bounds - if (this.showNoDataSection) { - bounds = bounds.padRight(sidebarWidth + 16) - } - return bounds + @computed private get startX(): number { + return this.xScale(this.startTime) } - @computed - private get selectedEntitiesWithoutData(): string[] { - return difference( - this.selectedEntityNames, - this.series.map((s) => s.seriesName) - ) + @computed private get endX(): number { + return this.xScale(this.endTime) } - @computed private get showNoDataSection(): boolean { - // TODO: for now, only show missing data section for entities - return ( - this.seriesStrategy === SeriesStrategy.entity && - this.selectedEntitiesWithoutData.length > 0 - ) + private updateTooltipPosition( + event: React.MouseEvent | React.TouchEvent + ) { + const ref = this.manager.base?.current + if (ref) this.tooltipState.position = getRelativeMouse(ref, event) } - @computed private get noDataSection(): React.ReactElement { - const bounds = new Bounds( - this.bounds.right - this.sidebarWidth, - this.bounds.top, - this.sidebarWidth, - this.bounds.height - ) + private detectHoveredSlope( + event: React.MouseEvent | React.TouchEvent + ) { + const ref = this.base.current + if (!ref) return + + const mouse = getRelativeMouse(ref, event) + this.mouseFrame = requestAnimationFrame(() => { + if (this.placedSeries.length === 0) return + + const distToSlope = new Map() + for (const series of this.placedSeries) { + distToSlope.set( + series, + PointVector.distanceFromPointToLineSegmentSq( + mouse, + series.startPoint, + series.endPoint + ) + ) + } + + const closestSlope = minBy(this.placedSeries, (s) => + distToSlope.get(s) + ) + const distanceSq = distToSlope.get(closestSlope!)! + const tolerance = 10 + const toleranceSq = tolerance * tolerance + + if (closestSlope && distanceSq < toleranceSq) { + this.onSlopeMouseOver(closestSlope) + } else { + this.onSlopeMouseLeave() + } + }) + } + + @computed get failMessage() { + const message = getDefaultFailMessage(this.manager) + if (message) return message + else if (isEmpty(this.series)) return "No matching data" + return "" + } + + @computed private get yColumns(): CoreColumn[] { + return this.yColumnSlugs.map((slug) => this.transformedTable.get(slug)) + } + + @computed protected get yColumnSlugs(): ColumnSlug[] { + return autoDetectYColumnSlugs(this.manager) + } + + @computed private get colorScheme(): ColorScheme { return ( - + (this.manager.baseColorScheme + ? ColorSchemes.get(this.manager.baseColorScheme) + : null) ?? ColorSchemes.get(this.defaultBaseColorScheme) ) } - // used by LineLegend - @computed get focusedSeriesNames(): string[] { - return this.hoverKey ? [this.hoverKey] : [] + @computed private get startTime(): Time { + return this.transformedTable.minTime } - // Layered mode occurs when any entity on the chart is hovered or focused - // Then, a special "foreground" set of entities is rendered over the background - @computed private get isLayerMode() { - return this.hoverKey !== undefined + @computed private get endTime(): Time { + return this.transformedTable.maxTime } - @computed private get formatColumn() { - return this.yColumns[0] + @computed get seriesStrategy(): SeriesStrategy { + return autoDetectSeriesStrategy(this.manager, true) } - @computed get allowedLabelWidth() { - return this.bounds.width * 0.2 + @computed private get categoricalColorAssigner(): CategoricalColorAssigner { + return new CategoricalColorAssigner({ + colorScheme: this.colorScheme, + invertColorScheme: this.manager.invertColorScheme, + colorMap: + this.seriesStrategy === SeriesStrategy.entity + ? this.inputTable.entityNameColorIndex + : this.inputTable.columnDisplayNameToColorMap, + autoColorMapCache: this.manager.seriesColorMap, + }) } - @computed get maxLabelWidth(): number { - // const maxLabelWidths = this.series.map((slope) => { - // const entityLabelWidth = slope.leftEntityLabel.width - // const maxValueLabelWidth = Math.max( - // slope.leftValueLabel.width, - // slope.rightValueLabel.width - // ) - // return ( - // entityLabelWidth + - // maxValueLabelWidth + - // LABEL_SLOPE_PADDING + - // LABEL_LABEL_PADDING - // ) - // }) - // return max(maxLabelWidths) ?? 0 - return 100 // TODO: remove? + @computed private get annotationsMap(): AnnotationsMap | undefined { + return getAnnotationsMap(this.inputTable, this.yColumnSlugs[0]) } - @computed private get initialSlopeData() { - const { series, xScale, yAxis, yDomain } = this + private constructSingleSeries( + entityName: EntityName, + column: CoreColumn + ): RawSlopeChartSeries | undefined { + const { startTime, endTime, seriesStrategy } = this + const { canSelectMultipleEntities = false } = this.manager + const { availableEntityNames } = this.transformedTable + + const columnName = column.nonEmptyDisplayName + const seriesName = getSeriesName({ + entityName, + columnName, + seriesStrategy, + availableEntityNames, + canSelectMultipleEntities, + }) + + const valueByTime = + column.valueByEntityNameAndOriginalTime.get(entityName) + const startValue = valueByTime?.get(startTime) + const endValue = valueByTime?.get(endTime) + + const colorKey = getColorKey({ + entityName, + columnName, + seriesStrategy, + availableEntityNames, + }) + const color = this.categoricalColorAssigner.assign(colorKey) + + const annotation = getAnnotationsForSeries( + this.annotationsMap, + seriesName + ) + + return { + seriesName, + color, + startValue, + endValue, + annotation, + } + } - const slopeData: SlopeEntryProps[] = [] + private isSeriesValid( + series: RawSlopeChartSeries + ): series is SlopeChartSeries { + return series.startValue !== undefined && series.endValue !== undefined + } - series.forEach((series) => { - // Ensure values fit inside the chart - if ( - !series.values.every( - (d) => d.y >= yDomain[0] && d.y <= yDomain[1] + @computed get rawSeries(): RawSlopeChartSeries[] { + return excludeUndefined( + this.yColumns.flatMap((column) => + column.uniqEntityNames.map((entityName) => + this.constructSingleSeries(entityName, column) ) ) - return - - const [v1, v2] = series.values - const [x1, x2] = [xScale(v1.x), xScale(v2.x)] - const [y1, y2] = [yAxis.place(v1.y), yAxis.place(v2.y)] - - slopeData.push({ - x1, - y1, - x2, - y2, - color: series.color, - series: series, - seriesName: series.seriesName, - isHovered: false, - } as SlopeEntryProps) + ) + } + + @computed get series(): SlopeChartSeries[] { + return this.rawSeries.filter(this.isSeriesValid) + } + + @computed private get placedSeries(): PlacedSlopeChartSeries[] { + const { yAxis, startX, endX } = this + + return this.series.map((series) => { + const startPoint = new PointVector( + startX, + yAxis.place(series.startValue) + ) + const endPoint = new PointVector(endX, yAxis.place(series.endValue)) + return { ...series, startPoint, endPoint } }) + } - return slopeData + @computed + private get noDataSeries(): RawSlopeChartSeries[] { + return this.rawSeries.filter((series) => !this.isSeriesValid(series)) } - mouseFrame?: number - @action.bound onMouseLeave() { - if (this.mouseFrame !== undefined) cancelAnimationFrame(this.mouseFrame) + @computed private get showNoDataSection(): boolean { + return this.noDataSeries.length > 0 + } - this.onSlopeMouseLeave() + @computed private get yAxisConfig(): AxisConfig { + return new AxisConfig(this.manager.yAxisConfig, this) } - @action.bound onMouseMove( - ev: React.MouseEvent | React.TouchEvent - ) { - const ref = this.manager.base?.current - if (ref) { - this.tooltipState.position = getRelativeMouse(ref, ev) - } + @computed private get allValues(): number[] { + return this.series.flatMap((series) => [ + series.startValue, + series.endValue, + ]) + } - if (this.base.current) { - const mouse = getRelativeMouse(this.base.current, ev.nativeEvent) - - this.mouseFrame = requestAnimationFrame(() => { - if (this.innerBounds.contains(mouse)) { - if (this.slopeData.length === 0) return - - const { x1: startX, x2: endX } = this.slopeData[0] - - // whether the mouse is over the chart area, - // the left label area, or the right label area - const mousePosition = - mouse.x < startX - ? "left" - : mouse.x > endX - ? "right" - : "chart" - - // don't track mouse movements when hovering over labels on the left or right - if (mousePosition === "left" || mousePosition === "right") { - this.onSlopeMouseLeave() - return - } - - const distToSlopeOrLabel = new Map< - SlopeEntryProps, - number - >() - for (const s of this.slopeData) { - // start and end point of a line - const p1 = new PointVector(s.x1, s.y1) - const p2 = new PointVector(s.x2, s.y2) - - // calculate the distance to the slope or label - const dist = - PointVector.distanceFromPointToLineSegmentSq( - mouse, - p1, - p2 - ) - distToSlopeOrLabel.set(s, dist) - } - - const closestSlope = minBy(this.slopeData, (s) => - distToSlopeOrLabel.get(s) - ) - const distanceSq = distToSlopeOrLabel.get(closestSlope!)! - const tolerance = mousePosition === "chart" ? 20 : 10 - const toleranceSq = tolerance * tolerance - - if (closestSlope && distanceSq < toleranceSq) { - this.onSlopeMouseOver(closestSlope) - } else { - this.onSlopeMouseLeave() - } - } - }) - } + @computed private get yScaleType(): ScaleType { + return this.yAxisConfig.scaleType ?? ScaleType.linear } - // Get the final slope data with hover focusing and collision detection - @computed get slopeData(): SlopeEntryProps[] { - let slopeData = this.initialSlopeData + @computed private get yDomainDefault(): [number, number] { + return domainExtent(this.allValues, this.yScaleType) + } - slopeData = slopeData.map((slope) => { - // used to determine priority for labelling conflicts - const isHovered = this.hoverKey === slope.seriesName + @computed private get yDomain(): [number, number] { + const domain = this.yAxisConfig.domain || [Infinity, -Infinity] + const domainDefault = this.yDomainDefault + return [ + Math.min(domain[0], domainDefault[0]), + Math.max(domain[1], domainDefault[1]), + ] + } - return { - ...slope, - isHovered, - } - }) + @computed get yRange(): [number, number] { + return this.bounds + .padTop(TOP_PADDING) + .padBottom(BOTTOM_PADDING) + .yRange() + } - // Order by focus/hover for draw order - slopeData = sortBy(slopeData, (slope) => (slope.isHovered ? 1 : 0)) + @computed get yAxis(): VerticalAxis { + const axis = this.yAxisConfig.toVerticalAxis() + axis.domain = this.yDomain + axis.range = this.yRange + axis.formatColumn = this.yColumns[0] + axis.label = "" + return axis + } - return slopeData + @computed get yAxisWidth(): number { + return this.yAxis.width + 5 // 5px account for the tick marks } - private renderGroups(groups: SlopeEntryProps[]) { - const { isLayerMode } = this + @computed private get xScale(): ScaleLinear { + const { xDomain, xRange } = this + return scaleLinear().domain(xDomain).range(xRange) + } - return groups.map((slope) => ( - - )) + @computed private get xDomain(): [number, number] { + return [this.startTime, this.endTime] } - private renderLabelledSlopes() { - const { bounds, slopeData, xDomain, yAxis, yRange, onMouseMove } = this + @computed private get maxLabelWidth(): number { + // TODO: copied from line legend + const fontSize = + GRAPHER_FONT_SCALE_12 * (this.manager.fontSize ?? BASE_FONT_SIZE) + return max( + this.series.map( + (series) => + Bounds.forText(series.seriesName, { fontSize }).width + ) + )! + } - if (isEmpty(slopeData)) - return + @computed get maxLineLegendWidth(): number { + // todo: copied from line legend (left padding, marker margin) + return Math.min(this.maxLabelWidth + 35 + 4, this.bounds.width / 3) + } - const { x1, x2 } = slopeData[0] - const [y1, y2] = yRange + @computed get xRange(): [number, number] { + const lineLegendWidth = this.maxLineLegendWidth + LINE_LEGEND_PADDING - return ( - - - - {this.yAxis.tickLabels.map((tick) => { - const y = yAxis.place(tick.value) - return ( - - {/* grid lines connecting the chart area to the axis */} - - {/* grid lines within the chart area */} - - - ) - })} - - - - - - {this.formatColumn.formatTime(xDomain[0])} - - - {this.formatColumn.formatTime(xDomain[1])} - - - {this.renderGroups(this.backgroundGroups)} - {this.renderGroups(this.foregroundGroups)} - - - ) + // pick a reasonable width based on an ideal aspect ratio + const idealAspectRatio = 0.6 + const chartAreaWidth = this.bounds.width - this.sidebarWidth + const availableWidth = + chartAreaWidth - this.yAxisWidth - lineLegendWidth + const idealWidth = idealAspectRatio * this.bounds.height + const maxSlopeWidth = Math.min(idealWidth, availableWidth) + + let startX = + this.bounds.x + Math.max(0.25 * chartAreaWidth, this.yAxisWidth + 4) + let endX = + this.bounds.x + + Math.min( + chartAreaWidth - 0.25 * chartAreaWidth, + chartAreaWidth - lineLegendWidth + ) + + const currentSlopeWidth = endX - startX + if (currentSlopeWidth > maxSlopeWidth) { + const padding = currentSlopeWidth - maxSlopeWidth + startX += padding / 2 + endX -= padding / 2 + } + + return [startX, endX] } - @computed get backgroundGroups() { - return this.slopeData.filter((group) => !group.isHovered) + @computed get lineLegendX(): number { + return this.xRange[1] + LINE_LEGEND_PADDING } - @computed get foregroundGroups() { - return this.slopeData.filter((group) => !!group.isHovered) + // used in LineLegend + @computed get labelSeries(): LineLabelSeries[] { + return this.series.map((series) => { + const { seriesName, color, endValue, annotation } = series + return { + color, + seriesName, + label: seriesName, + annotation, + yValue: endValue, + } + }) } private playIntroAnimation() { @@ -516,22 +526,68 @@ export class SlopeChart .attr("stroke-dashoffset", "0%") } - @computed get renderUid(): number { - return guid() + componentDidMount() { + exposeInstanceOnWindow(this) + + if (!this.manager.disableIntroAnimation) { + this.playIntroAnimation() + } } - @computed get tooltip(): React.ReactElement | undefined { - const { - tooltipState: { target, position, fading }, - } = this + private hoverTimer?: NodeJS.Timeout + @action.bound onLineLegendMouseOver(seriesName: SeriesName): void { + clearTimeout(this.hoverTimer) + this.hoveredSeriesName = seriesName + } - const { series } = target || {} - if (!series) return + @action.bound onLineLegendMouseLeave(): void { + clearTimeout(this.hoverTimer) + this.hoverTimer = setTimeout(() => { + // wait before clearing selection in case the mouse is moving quickly over neighboring labels + this.hoveredSeriesName = undefined + }, 200) + } - const { isRelativeMode } = this.manager, - timeRange = [this.startTime, this.endTime] - .map((t) => this.formatColumn.formatTime(t)) - .join(" to "), + @action.bound onSlopeMouseOver(series: SlopeChartSeries) { + this.hoveredSeriesName = series.seriesName + this.tooltipState.target = { series } + } + + @action.bound onSlopeMouseLeave() { + this.hoveredSeriesName = undefined + this.tooltipState.target = null + } + + mouseFrame?: number + @action.bound onMouseMove( + ev: React.MouseEvent | React.TouchEvent + ) { + this.updateTooltipPosition(ev) + this.detectHoveredSlope(ev) + } + + @action.bound onMouseLeave() { + if (this.mouseFrame !== undefined) cancelAnimationFrame(this.mouseFrame) + + this.onSlopeMouseLeave() + } + + @computed get renderUid(): number { + return guid() + } + + @computed get tooltip(): React.ReactElement | undefined { + const { + tooltipState: { target, position, fading }, + } = this + + const { series } = target || {} + if (!series) return + + const { isRelativeMode } = this.manager, + timeRange = [this.startTime, this.endTime] + .map((t) => this.formatColumn.formatTime(t)) + .join(" to "), timeLabel = timeRange + (isRelativeMode ? " (relative change)" : "") const columns = this.yColumns @@ -578,406 +634,267 @@ export class SlopeChart > v.y)} + values={[series.startValue, series.endValue]} /> ) } - render() { - if (this.failMessage) - return ( - - ) - - const { manager } = this.props - - return ( - - {this.renderLabelledSlopes()} - {manager.showLegend && } - {this.showNoDataSection && this.noDataSection} - {this.tooltip} - + private renderNoDataSection(): React.ReactElement { + const seriesNames = this.noDataSeries.map((series) => series.seriesName) + const bounds = new Bounds( + this.bounds.right - this.sidebarWidth, + this.bounds.top, + this.sidebarWidth, + this.bounds.height ) - } - @computed get failMessage() { - const message = getDefaultFailMessage(this.manager) - if (message) return message - else if (isEmpty(this.series)) return "No matching data" - return "" - } - - defaultBaseColorScheme = ColorSchemeName.OwidDistinctLines - - @computed private get yColumns(): CoreColumn[] { - return this.yColumnSlugs.map((slug) => this.transformedTable.get(slug)) - } - - @computed protected get yColumnSlugs(): ColumnSlug[] { - return autoDetectYColumnSlugs(this.manager) - } - - @computed get transformedTableFromGrapher(): OwidTable { return ( - this.manager.transformedTable ?? - this.transformTable(this.inputTable) + ) } - @computed get transformedTable(): OwidTable { - let table = this.transformedTableFromGrapher - // The % growth transform cannot be applied in transformTable() because it will filter out - // any rows before startHandleTimeBound and change the timeline bounds. - const { isRelativeMode, startHandleTimeBound } = this.manager - if (isRelativeMode && startHandleTimeBound !== undefined) { - table = table.toTotalGrowthForEachColumnComparedToStartTime( - startHandleTimeBound, - this.yColumnSlugs ?? [] - ) - } - return table - } - - @computed get inputTable() { - return this.manager.table - } - - componentDidMount() { - exposeInstanceOnWindow(this) - - if (!this.manager.disableIntroAnimation) { - this.playIntroAnimation() - } - } - - @computed private get colorScheme(): ColorScheme { + private renderSlope( + series: PlacedSlopeChartSeries, + mode?: RenderMode + ): React.ReactElement { return ( - (this.manager.baseColorScheme - ? ColorSchemes.get(this.manager.baseColorScheme) - : null) ?? ColorSchemes.get(this.defaultBaseColorScheme) + ) } - @computed private get startTime(): Time { - return this.transformedTable.minTime - } - - @computed private get endTime(): Time { - return this.transformedTable.maxTime! // TODO: remove the ! when we have a better way to handle missing maxTime - } - - @computed get seriesStrategy(): SeriesStrategy { - return autoDetectSeriesStrategy(this.manager, true) - } - - @computed private get categoricalColorAssigner(): CategoricalColorAssigner { - return new CategoricalColorAssigner({ - colorScheme: this.colorScheme, - invertColorScheme: this.manager.invertColorScheme, - colorMap: - this.seriesStrategy === SeriesStrategy.entity - ? this.inputTable.entityNameColorIndex - : this.inputTable.columnDisplayNameToColorMap, - autoColorMapCache: this.manager.seriesColorMap, - }) - } - - private getSeriesName( - entityName: EntityName, - columnName: string, - entityCount: number - ): SeriesName { - if (this.seriesStrategy === SeriesStrategy.entity) { - return entityName - } - if (entityCount > 1 || this.manager.canSelectMultipleEntities) { - return `${entityName} - ${columnName}` - } else { - return columnName - } - } - - // todo: for now just works with 1 y column - @computed private get annotationsMap(): Map< - PrimitiveType, - Set - > { - return this.inputTable - .getAnnotationColumnForColumn(this.yColumnSlugs[0]) - ?.getUniqueValuesGroupedBy(this.inputTable.entityNameSlug) - } - - private getAnnotationsForSeries( - seriesName: SeriesName - ): string | undefined { - const annotationsMap = this.annotationsMap - const annos = annotationsMap?.get(seriesName) - return annos - ? Array.from(annos.values()) - .filter((anno) => anno) - .join(" & ") - : undefined - } - - private getColorKey( - entityName: EntityName, - columnName: string, - entityCount: number - ): SeriesName { - if (this.seriesStrategy === SeriesStrategy.entity) { - return entityName + private renderSlopes() { + if (!this.isFocusModeActive) { + return this.placedSeries.map((series) => this.renderSlope(series)) } - // If only one entity is plotted, we want to use the column colors. - // Unlike in `getSeriesName`, we don't care whether the user can select - // multiple entities, only whether more than one is plotted. - if (entityCount > 1) { - return `${entityName} - ${columnName}` - } else { - return columnName - } - } - - @computed get series() { - const { startTime, endTime } = this - const totalEntityCount = - this.transformedTable.availableEntityNames.length - return this.yColumns.flatMap((column) => - column.uniqEntityNames - .map((entityName) => { - const seriesName = this.getSeriesName( - entityName, - column.displayName || "Missing name", - totalEntityCount - ) - const values: SlopeChartValue[] = [] - - const yValues = - column.valueByEntityNameAndOriginalTime.get( - entityName - )! || [] - - yValues.forEach((value, time) => { - if (time !== startTime && time !== endTime) return - - values.push({ - x: time, - y: value, - }) - }) - - // sort values by time - const sortedValues = sortBy(values, (v) => v.x) - - const color = this.categoricalColorAssigner.assign( - this.getColorKey( - entityName, - column.displayName, - totalEntityCount - ) - ) - - const annotation = this.getAnnotationsForSeries(seriesName) - - return { - seriesName, - color, - values: sortedValues, - annotation, - } as SlopeChartSeries - }) - .filter((series) => series.values.length >= 2) + const [focusedSeries, backgroundSeries] = partition( + this.placedSeries, + (series) => series.seriesName === this.hoveredSeriesName ) - } - - @observable private hoverTimer?: NodeJS.Timeout - @action.bound onLineLegendMouseOver(seriesName: SeriesName): void { - clearTimeout(this.hoverTimer) - this.hoverKey = seriesName - } - - @action.bound clearHighlightedSeries(): void { - clearTimeout(this.hoverTimer) - this.hoverTimer = setTimeout(() => { - // wait before clearing selection in case the mouse is moving quickly over neighboring labels - this.hoverKey = undefined - }, 200) - } - - @action.bound onLineLegendMouseLeave(): void { - this.clearHighlightedSeries() - } - - @computed private get yAxisConfig(): AxisConfig { - return new AxisConfig(this.manager.yAxisConfig, this) - } - - @computed private get allValues() { - return this.series.flatMap((g) => g.values) - } - - @computed private get yScaleType() { - return this.yAxisConfig.scaleType || ScaleType.linear - } - - @computed private get yDomainDefault(): [number, number] { - return domainExtent( - this.allValues.map((v) => v.y), - this.yScaleType || ScaleType.linear + return ( + <> + {backgroundSeries.map((series) => + this.renderSlope(series, RenderMode.mute) + )} + {focusedSeries.map((series) => + this.renderSlope(series, RenderMode.focus) + )} + ) } - @computed private get yDomain(): [number, number] { - const domain = this.yAxisConfig.domain || [Infinity, -Infinity] - const domainDefault = this.yDomainDefault - return [ - Math.min(domain[0], domainDefault[0]), - Math.max(domain[1], domainDefault[1]), - ] - } - - @computed get yRange(): [number, number] { - return this.bounds - .padTop(TOP_PADDING) - .padBottom(BOTTOM_PADDING) - .yRange() - } - - @computed get yAxis(): VerticalAxis { - const axis = this.yAxisConfig.toVerticalAxis() - axis.domain = this.yDomain - axis.range = this.yRange - axis.formatColumn = this.yColumns[0] - axis.label = "" - return axis - } - - @computed get yAxisWidth(): number { - return this.yAxis.width + 5 // 5px account for the tick marks - } - - @computed get xRange(): [number, number] { - // take into account the space taken by the yAxis and slope labels - const bounds = this.bounds - .padLeft(this.yAxisWidth + 4) - .padLeft(this.maxLabelWidth) - .padRight(this.maxLabelWidth) - - // pick a reasonable width based on an ideal aspect ratio - const idealAspectRatio = 0.9 - const availableWidth = bounds.width - const idealWidth = idealAspectRatio * bounds.height - const slopeWidth = this.isPortrait - ? availableWidth - : clamp(idealWidth, 220, availableWidth) - - const leftRightPadding = (availableWidth - slopeWidth) / 2 - return bounds - .padLeft(leftRightPadding) - .padRight(leftRightPadding) - .xRange() - } + private renderChartArea() { + const { bounds, xDomain, yRange, startX, endX } = this - @computed private get xScale(): ScaleLinear { - const { xDomain, xRange } = this - return scaleLinear().domain(xDomain).range(xRange) - } + const [bottom, top] = yRange - @computed private get xDomain(): [number, number] { - return this.xDomainDefault - } - - @computed private get xDomainDefault(): [number, number] { - return domainExtent( - this.allValues.map((v) => v.x), - ScaleType.linear + return ( + + + + + + + + + {this.renderSlopes()} + + ) } - @computed get lineLegendX(): number { - return this.bounds.right - 240 - } + render() { + if (this.failMessage) + return ( + + ) - @computed get labelSeries(): LineLabelSeries[] { - return this.series.map((series) => { - const { seriesName, color, values, annotation } = series - return { - color, - seriesName, - label: seriesName, - annotation, - yValue: values[1].y, - } - }) + return ( + + {this.renderChartArea()} + {this.manager.showLegend && } + {this.showNoDataSection && this.renderNoDataSection()} + {this.tooltip} + + ) } } -@observer -class SlopeEntry extends React.Component { - line: SVGElement | null = null - - @computed get isInBackground() { - const { isLayerMode, isHovered } = this.props - - if (!isLayerMode) return false - - return !isHovered - } - - render() { - const { x1, y1, x2, y2, color, isHovered, seriesName } = this.props - const { isInBackground } = this +interface SlopeProps { + series: PlacedSlopeChartSeries + color: string + mode?: RenderMode + onMouseOver?: (series: SlopeChartSeries) => void + onMouseLeave?: () => void +} - const lineColor = isInBackground ? "#e2e2e2" : color - const opacity = isHovered ? 1 : 0.5 - const lineStrokeWidth = isHovered ? 4 : 2 +function Slope({ + series, + color, + mode = RenderMode.default, + onMouseOver, + onMouseLeave, +}: SlopeProps) { + const { seriesName, startPoint, endPoint } = series + + const usedColor = { + [RenderMode.default]: color, + [RenderMode.focus]: color, + [RenderMode.mute]: "#e2e2e2", + [RenderMode.background]: "#e2e2e2", + }[mode] + + return ( + onMouseOver?.(series)} + onMouseLeave={() => onMouseLeave?.()} + > + + + + + ) +} - const showDots = isHovered +interface GridLinesProps { + bounds: Bounds + yAxis: VerticalAxis + startX: number + endX: number +} - return ( - - (this.line = el)} - x1={x1} - y1={y1} - x2={x2} - y2={y2} - stroke={lineColor} - strokeWidth={lineStrokeWidth} - opacity={opacity} - /> - {showDots && ( - <> - + {yAxis.tickLabels.map((tick) => { + const y = yAxis.place(tick.value) + return ( + + {/* grid lines connecting the chart area to the axis */} + - - - )} - - ) - } + + ) + })} + + ) +} + +function MarkX({ + label, + x, + top, + bottom, + fontSize, +}: { + label: string + x: number + top: number + bottom: number + fontSize: number +}) { + return ( + <> + + + {label} + + + ) } diff --git a/packages/@ourworldindata/grapher/src/slopeCharts/SlopeChartConstants.ts b/packages/@ourworldindata/grapher/src/slopeCharts/SlopeChartConstants.ts index 9b27bf3110b..290259fd0f0 100644 --- a/packages/@ourworldindata/grapher/src/slopeCharts/SlopeChartConstants.ts +++ b/packages/@ourworldindata/grapher/src/slopeCharts/SlopeChartConstants.ts @@ -1,51 +1,20 @@ -import { CoreColumn } from "@ourworldindata/core-table" +import { PartialBy, PointVector } from "@ourworldindata/utils" import { ChartSeries } from "../chart/ChartInterface" -import { ChartManager } from "../chart/ChartManager" -import { ScaleType } from "@ourworldindata/types" -import { Bounds } from "@ourworldindata/utils" - -export interface SlopeChartValue { - x: number - y: number -} export interface SlopeChartSeries extends ChartSeries { - size: number - values: SlopeChartValue[] + startValue: number + endValue: number annotation?: string } -export const DEFAULT_SLOPE_CHART_COLOR = "#ff7f0e" - -export interface SlopeEntryProps extends ChartSeries { - series: SlopeChartSeries - - x1: number - y1: number - x2: number - y2: number +export type RawSlopeChartSeries = PartialBy< + SlopeChartSeries, + "startValue" | "endValue" +> - isLayerMode: boolean - isHovered: boolean +export interface PlacedSlopeChartSeries extends SlopeChartSeries { + startPoint: PointVector + endPoint: PointVector } -export interface LabelledSlopesProps { - manager: ChartManager - formatColumn: CoreColumn - bounds: Bounds - seriesArr: SlopeChartSeries[] - hoverKey?: string - onMouseOver: (slopeProps: SlopeEntryProps) => void - onMouseLeave: () => void - onClick?: () => void - isPortrait: boolean -} - -export interface SlopeAxisProps { - bounds: Bounds - orient: "left" | "right" - column: CoreColumn - scale: any - scaleType: ScaleType - fontSize: number -} +export const DEFAULT_SLOPE_CHART_COLOR = "#ff7f0e" diff --git a/packages/@ourworldindata/grapher/src/stackedCharts/StackedAreaChart.tsx b/packages/@ourworldindata/grapher/src/stackedCharts/StackedAreaChart.tsx index e218c1950c9..58eb7020266 100644 --- a/packages/@ourworldindata/grapher/src/stackedCharts/StackedAreaChart.tsx +++ b/packages/@ourworldindata/grapher/src/stackedCharts/StackedAreaChart.tsx @@ -18,7 +18,7 @@ import { max, } from "@ourworldindata/utils" import { computed, action, observable } from "mobx" -import { SeriesName } from "@ourworldindata/types" +import { RenderMode, SeriesName } from "@ourworldindata/types" import { GRAPHER_AREA_OPACITY_DEFAULT, GRAPHER_AREA_OPACITY_MUTE, @@ -68,21 +68,21 @@ interface AreasProps extends React.SVGAttributes { const STACKED_AREA_CHART_CLASS_NAME = "StackedArea" -const AREA_OPACITY = { - DEFAULT: GRAPHER_AREA_OPACITY_DEFAULT, - FOCUS: GRAPHER_AREA_OPACITY_FOCUS, - MUTE: GRAPHER_AREA_OPACITY_MUTE, +const AREA_OPACITY: Partial> = { + default: GRAPHER_AREA_OPACITY_DEFAULT, + focus: GRAPHER_AREA_OPACITY_FOCUS, + mute: GRAPHER_AREA_OPACITY_MUTE, } -const BORDER_OPACITY = { - DEFAULT: 0.7, - HOVER: 1, - MUTE: 0.3, +const BORDER_OPACITY: Partial> = { + default: 0.7, + focus: 1, + mute: 0.3, } -const BORDER_WIDTH = { - DEFAULT: 0.5, - HOVER: 1.5, +const BORDER_WIDTH: Partial> = { + default: 0.5, + mute: 1.5, } @observer @@ -183,10 +183,10 @@ class Areas extends React.Component { } const points = [...placedPoints, ...reverse(clone(prevPoints))] const opacity = !this.isFocusModeActive - ? AREA_OPACITY.DEFAULT // normal opacity + ? AREA_OPACITY.default // normal opacity : focusedSeriesName === series.seriesName - ? AREA_OPACITY.FOCUS // hovered - : AREA_OPACITY.MUTE // non-hovered + ? AREA_OPACITY.focus // hovered + : AREA_OPACITY.mute // non-hovered return ( { return placedSeriesArr.map((placedSeries) => { const opacity = !this.isFocusModeActive - ? BORDER_OPACITY.DEFAULT // normal opacity + ? BORDER_OPACITY.default // normal opacity : focusedSeriesName === placedSeries.seriesName - ? BORDER_OPACITY.HOVER // hovered - : BORDER_OPACITY.MUTE // non-hovered + ? BORDER_OPACITY.focus // hovered + : BORDER_OPACITY.mute // non-hovered const strokeWidth = focusedSeriesName === placedSeries.seriesName - ? BORDER_WIDTH.HOVER - : BORDER_WIDTH.DEFAULT + ? BORDER_WIDTH.focus + : BORDER_WIDTH.default return ( Date: Thu, 21 Nov 2024 14:36:34 +0100 Subject: [PATCH 12/52] =?UTF-8?q?=F0=9F=94=A8=20(slope)=20remove=20color?= =?UTF-8?q?=20dimension?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- adminSiteClient/EditorBasicTab.tsx | 7 ++--- ...407-RemoveColorDimensionFromSlopeCharts.ts | 30 +++++++++++++++++++ 2 files changed, 32 insertions(+), 5 deletions(-) create mode 100644 db/migration/1732195571407-RemoveColorDimensionFromSlopeCharts.ts diff --git a/adminSiteClient/EditorBasicTab.tsx b/adminSiteClient/EditorBasicTab.tsx index 9e3464f4d9f..fa60a83d82d 100644 --- a/adminSiteClient/EditorBasicTab.tsx +++ b/adminSiteClient/EditorBasicTab.tsx @@ -372,8 +372,8 @@ export class EditorBasicTab< grapher.stackMode = StackMode.relative } - // Give scatterplots and slope charts a default color dimension if they don't have one - if (grapher.isScatter || grapher.isSlopeChart) { + // Give scatterplots a default color and size dimensions + if (grapher.isScatter) { const hasColor = grapher.dimensions.find( (d) => d.property === DimensionProperty.color ) @@ -382,10 +382,7 @@ export class EditorBasicTab< variableId: CONTINENTS_INDICATOR_ID, property: DimensionProperty.color, }) - } - // Give scatterplots a default size dimension if they don't have one - if (grapher.isScatter) { const hasSize = grapher.dimensions.find( (d) => d.property === DimensionProperty.size ) diff --git a/db/migration/1732195571407-RemoveColorDimensionFromSlopeCharts.ts b/db/migration/1732195571407-RemoveColorDimensionFromSlopeCharts.ts new file mode 100644 index 00000000000..bbd12966c7d --- /dev/null +++ b/db/migration/1732195571407-RemoveColorDimensionFromSlopeCharts.ts @@ -0,0 +1,30 @@ +import { MigrationInterface, QueryRunner } from "typeorm" + +export class RemoveColorDimensionFromSlopeCharts1732195571407 + implements MigrationInterface +{ + public async up(queryRunner: QueryRunner): Promise { + // update dimensions field in chart configs + await queryRunner.query(` + -- sql + UPDATE chart_configs + SET + patch = JSON_REPLACE(patch, '$.dimensions', JSON_ARRAY(patch -> '$.dimensions[0]')), + full = JSON_REPLACE(full, '$.dimensions', JSON_ARRAY(full -> '$.dimensions[0]')) + WHERE + chartType = 'SlopeChart' + `) + + // remove from chart_dimensions table + await queryRunner.query(` + -- sql + DELETE cd FROM chart_dimensions cd + JOIN charts c ON c.id = cd.chartId + JOIN chart_configs cc ON c.configId = cc.id + WHERE cc.chartType = 'SlopeChart' AND cd.property = 'color' + `) + } + + // eslint-disable-next-line @typescript-eslint/no-empty-function + public async down(): Promise {} +} From d4ca6cf64ad6ec170b28f59b1abe49d4835d4114 Mon Sep 17 00:00:00 2001 From: sophiamersmann Date: Thu, 21 Nov 2024 15:38:37 +0100 Subject: [PATCH 13/52] =?UTF-8?q?=E2=9C=A8=20(slope)=20allow=20to=20hide?= =?UTF-8?q?=20legend?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- adminSiteClient/EditorFeatures.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/adminSiteClient/EditorFeatures.tsx b/adminSiteClient/EditorFeatures.tsx index 2d9761add1c..d7e16563dee 100644 --- a/adminSiteClient/EditorFeatures.tsx +++ b/adminSiteClient/EditorFeatures.tsx @@ -62,6 +62,7 @@ export class EditorFeatures { @computed get hideLegend() { return ( this.grapher.isLineChart || + this.grapher.isSlopeChart || this.grapher.isStackedArea || this.grapher.isStackedDiscreteBar ) From df3f87d2536c39147a88be825ef0e64caef4bbc2 Mon Sep 17 00:00:00 2001 From: sophiamersmann Date: Thu, 21 Nov 2024 15:39:12 +0100 Subject: [PATCH 14/52] =?UTF-8?q?=F0=9F=90=9B=20(slope)=20fix=20start/end?= =?UTF-8?q?=20time=20selection?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../@ourworldindata/grapher/src/core/Grapher.tsx | 8 ++++---- .../grapher/src/slopeCharts/SlopeChart.tsx | 14 ++++++-------- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/packages/@ourworldindata/grapher/src/core/Grapher.tsx b/packages/@ourworldindata/grapher/src/core/Grapher.tsx index 990b082b640..7c470176ae9 100644 --- a/packages/@ourworldindata/grapher/src/core/Grapher.tsx +++ b/packages/@ourworldindata/grapher/src/core/Grapher.tsx @@ -1643,7 +1643,7 @@ export class Grapher if (this.shouldAddChangeInPrefixToTitle) text = "Change in " + lowerCaseFirstLetterUnlessAbbreviation(text) - if (this.shouldAddTimeSuffixToTitle) + if (this.shouldAddTimeSuffixToTitle && this.timeTitleSuffix) text = appendAnnotationField(text, this.timeTitleSuffix) return text.trim() @@ -1746,11 +1746,11 @@ export class Grapher return this.xAxis.scaleType } - @computed private get timeTitleSuffix(): string { + @computed private get timeTitleSuffix(): string | undefined { const timeColumn = this.table.timeColumn - if (timeColumn.isMissing) return "" // Do not show year until data is loaded + if (timeColumn.isMissing) return undefined // Do not show year until data is loaded const { startTime, endTime } = this - if (startTime === undefined || endTime === undefined) return "" + if (startTime === undefined || endTime === undefined) return undefined const time = startTime === endTime diff --git a/packages/@ourworldindata/grapher/src/slopeCharts/SlopeChart.tsx b/packages/@ourworldindata/grapher/src/slopeCharts/SlopeChart.tsx index 2a54bcf579a..bdd4b3efabc 100644 --- a/packages/@ourworldindata/grapher/src/slopeCharts/SlopeChart.tsx +++ b/packages/@ourworldindata/grapher/src/slopeCharts/SlopeChart.tsx @@ -281,11 +281,11 @@ export class SlopeChart } @computed private get startTime(): Time { - return this.transformedTable.minTime + return this.manager.startTime! } @computed private get endTime(): Time { - return this.transformedTable.maxTime + return this.manager.endTime! } @computed get seriesStrategy(): SeriesStrategy { @@ -311,7 +311,7 @@ export class SlopeChart private constructSingleSeries( entityName: EntityName, column: CoreColumn - ): RawSlopeChartSeries | undefined { + ): RawSlopeChartSeries { const { startTime, endTime, seriesStrategy } = this const { canSelectMultipleEntities = false } = this.manager const { availableEntityNames } = this.transformedTable @@ -359,11 +359,9 @@ export class SlopeChart } @computed get rawSeries(): RawSlopeChartSeries[] { - return excludeUndefined( - this.yColumns.flatMap((column) => - column.uniqEntityNames.map((entityName) => - this.constructSingleSeries(entityName, column) - ) + return this.yColumns.flatMap((column) => + this.selectionArray.selectedEntityNames.map((entityName) => + this.constructSingleSeries(entityName, column) ) ) } From b9cd1e2d00c816bf00e19a498eedf5ae170d3a72 Mon Sep 17 00:00:00 2001 From: sophiamersmann Date: Thu, 21 Nov 2024 15:56:32 +0100 Subject: [PATCH 15/52] =?UTF-8?q?=F0=9F=90=9B=20(slope)=20error=20out=20wh?= =?UTF-8?q?en=20start=20and=20end=20time=20are=20the=20same?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/@ourworldindata/grapher/src/slopeCharts/SlopeChart.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/@ourworldindata/grapher/src/slopeCharts/SlopeChart.tsx b/packages/@ourworldindata/grapher/src/slopeCharts/SlopeChart.tsx index bdd4b3efabc..7dc29b809e7 100644 --- a/packages/@ourworldindata/grapher/src/slopeCharts/SlopeChart.tsx +++ b/packages/@ourworldindata/grapher/src/slopeCharts/SlopeChart.tsx @@ -260,6 +260,7 @@ export class SlopeChart @computed get failMessage() { const message = getDefaultFailMessage(this.manager) if (message) return message + else if (this.startTime === this.endTime) return "No matching data" else if (isEmpty(this.series)) return "No matching data" return "" } From 25837a4ef6dced3a4d263e1595b6379f7a741881 Mon Sep 17 00:00:00 2001 From: sophiamersmann Date: Fri, 22 Nov 2024 13:34:19 +0100 Subject: [PATCH 16/52] =?UTF-8?q?=F0=9F=90=9B=20(slope)=20fix=20No=20Data?= =?UTF-8?q?=20section=20when=20missing=20data=20strategy=20is=20hide?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- adminSiteClient/EditorFeatures.tsx | 4 +- .../grapher/src/slopeCharts/SlopeChart.tsx | 72 ++++++++++++++----- .../src/slopeCharts/SlopeChartConstants.ts | 3 +- 3 files changed, 58 insertions(+), 21 deletions(-) diff --git a/adminSiteClient/EditorFeatures.tsx b/adminSiteClient/EditorFeatures.tsx index d7e16563dee..70adfd194bf 100644 --- a/adminSiteClient/EditorFeatures.tsx +++ b/adminSiteClient/EditorFeatures.tsx @@ -119,9 +119,9 @@ export class EditorFeatures { return true } - // for line charts, specifying a missing data strategy only makes sense + // for line and slope charts, specifying a missing data strategy only makes sense // if there are multiple entities - if (this.grapher.isLineChart) { + if (this.grapher.isLineChart || this.grapher.isSlopeChart) { return ( this.grapher.canChangeEntity || this.grapher.canSelectMultipleEntities diff --git a/packages/@ourworldindata/grapher/src/slopeCharts/SlopeChart.tsx b/packages/@ourworldindata/grapher/src/slopeCharts/SlopeChart.tsx index 7dc29b809e7..b2f3cf0f243 100644 --- a/packages/@ourworldindata/grapher/src/slopeCharts/SlopeChart.tsx +++ b/packages/@ourworldindata/grapher/src/slopeCharts/SlopeChart.tsx @@ -113,15 +113,6 @@ export class SlopeChart if (this.isLogScale) table = table.replaceNonPositiveCellsForLogScale(this.yColumnSlugs) - // drop all data when the author chose to hide entities with missing data and - // at least one of the variables has no data for the current entity - if ( - this.missingDataStrategy === MissingDataStrategy.hide && - table.hasAnyColumnNoValidValue(this.yColumnSlugs) - ) { - table = table.dropAllRows() - } - return table } @@ -315,8 +306,8 @@ export class SlopeChart ): RawSlopeChartSeries { const { startTime, endTime, seriesStrategy } = this const { canSelectMultipleEntities = false } = this.manager - const { availableEntityNames } = this.transformedTable + const { availableEntityNames } = this.selectionArray const columnName = column.nonEmptyDisplayName const seriesName = getSeriesName({ entityName, @@ -346,6 +337,7 @@ export class SlopeChart return { seriesName, + entityName, color, startValue, endValue, @@ -359,7 +351,35 @@ export class SlopeChart return series.startValue !== undefined && series.endValue !== undefined } - @computed get rawSeries(): RawSlopeChartSeries[] { + /** + * Usually we drop rows with missing data in the transformTable function. + * But slope charts have a "No data" section. If slopes that have data + * but shouldn't be plotted because a "sibling" slope of the same entity + * doesn't have data are dropped from the transformed table, then we + * would have no way of knowing whether a slope has been dropped because + * it actually had no data or a sibling slope had no data. That's why we + * filter out slopes that are valid but shouldn't be plotted here, so + * that the noDataSeries is populated correctly. + */ + private shouldSeriesBePlotted( + series: RawSlopeChartSeries + ): series is SlopeChartSeries { + if (!this.isSeriesValid(series)) return false + + if ( + this.seriesStrategy === SeriesStrategy.column && + this.missingDataStrategy === MissingDataStrategy.hide + ) { + const entitySeries = this.rawSeriesByEntityName.get( + series.entityName + ) + return !!entitySeries?.every((series) => this.isSeriesValid(series)) + } + + return true + } + + @computed private get rawSeries(): RawSlopeChartSeries[] { return this.yColumns.flatMap((column) => this.selectionArray.selectedEntityNames.map((entityName) => this.constructSingleSeries(entityName, column) @@ -367,19 +387,35 @@ export class SlopeChart ) } - @computed get series(): SlopeChartSeries[] { - return this.rawSeries.filter(this.isSeriesValid) + @computed private get rawSeriesByEntityName(): Map< + SeriesName, + RawSlopeChartSeries[] + > { + const map = new Map() + this.rawSeries.forEach((series) => { + const { entityName } = series + if (!map.has(entityName)) map.set(entityName, []) + map.get(entityName)!.push(series) + }) + return map + } + + @computed private get series(): SlopeChartSeries[] { + return this.rawSeries.filter((series) => + this.shouldSeriesBePlotted(series) + ) } @computed private get placedSeries(): PlacedSlopeChartSeries[] { const { yAxis, startX, endX } = this return this.series.map((series) => { - const startPoint = new PointVector( - startX, - yAxis.place(series.startValue) - ) - const endPoint = new PointVector(endX, yAxis.place(series.endValue)) + const startY = yAxis.place(series.startValue) + const endY = yAxis.place(series.endValue) + + const startPoint = new PointVector(startX, startY) + const endPoint = new PointVector(endX, endY) + return { ...series, startPoint, endPoint } }) } diff --git a/packages/@ourworldindata/grapher/src/slopeCharts/SlopeChartConstants.ts b/packages/@ourworldindata/grapher/src/slopeCharts/SlopeChartConstants.ts index 290259fd0f0..544410718b7 100644 --- a/packages/@ourworldindata/grapher/src/slopeCharts/SlopeChartConstants.ts +++ b/packages/@ourworldindata/grapher/src/slopeCharts/SlopeChartConstants.ts @@ -1,7 +1,8 @@ -import { PartialBy, PointVector } from "@ourworldindata/utils" +import { EntityName, PartialBy, PointVector } from "@ourworldindata/utils" import { ChartSeries } from "../chart/ChartInterface" export interface SlopeChartSeries extends ChartSeries { + entityName: EntityName startValue: number endValue: number annotation?: string From b25082aacc882ef07f4dd2f1f4440e5c7bdfac58 Mon Sep 17 00:00:00 2001 From: sophiamersmann Date: Fri, 22 Nov 2024 13:43:17 +0100 Subject: [PATCH 17/52] =?UTF-8?q?=F0=9F=90=9B=20(slope)=20fix=20tabs=20for?= =?UTF-8?q?=20line=20chart=20that=20turned=20into=20discrete=20bar?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/captionedChart/CaptionedChart.tsx | 4 ++-- .../grapher/src/controls/ContentSwitchers.tsx | 16 ++++++++++++---- .../@ourworldindata/grapher/src/core/Grapher.tsx | 8 +++++++- 3 files changed, 21 insertions(+), 7 deletions(-) diff --git a/packages/@ourworldindata/grapher/src/captionedChart/CaptionedChart.tsx b/packages/@ourworldindata/grapher/src/captionedChart/CaptionedChart.tsx index 2238dc78e8f..23fabd65955 100644 --- a/packages/@ourworldindata/grapher/src/captionedChart/CaptionedChart.tsx +++ b/packages/@ourworldindata/grapher/src/captionedChart/CaptionedChart.tsx @@ -83,7 +83,7 @@ export interface CaptionedChartManager isOnMapTab?: boolean isOnTableTab?: boolean activeChartType?: GrapherChartType - isLineChartThatTurnedIntoDiscreteBar?: boolean + isLineChartThatTurnedIntoDiscreteBarActive?: boolean showEntitySelectionToggle?: boolean isExportingForSocialMedia?: boolean @@ -197,7 +197,7 @@ export class CaptionedChart extends React.Component { if (manager.isOnTableTab) return undefined if (manager.isOnMapTab) return GRAPHER_MAP_TYPE if (manager.isOnChartTab) { - return manager.isLineChartThatTurnedIntoDiscreteBar + return manager.isLineChartThatTurnedIntoDiscreteBarActive ? GRAPHER_CHART_TYPES.DiscreteBar : manager.activeChartType } diff --git a/packages/@ourworldindata/grapher/src/controls/ContentSwitchers.tsx b/packages/@ourworldindata/grapher/src/controls/ContentSwitchers.tsx index 6c0eaa289a5..8d947e5bb62 100644 --- a/packages/@ourworldindata/grapher/src/controls/ContentSwitchers.tsx +++ b/packages/@ourworldindata/grapher/src/controls/ContentSwitchers.tsx @@ -175,9 +175,11 @@ function TabIcon({ case GRAPHER_TAB_NAMES.WorldMap: return default: - const chartIcon = isLineChartThatTurnedIntoDiscreteBar - ? chartIcons[GRAPHER_CHART_TYPES.DiscreteBar] - : chartIcons[tab] + const chartIcon = + tab === GRAPHER_TAB_NAMES.LineChart && + isLineChartThatTurnedIntoDiscreteBar + ? chartIcons[GRAPHER_CHART_TYPES.DiscreteBar] + : chartIcons[tab] return chartIcon } } @@ -193,9 +195,15 @@ function makeTabLabelText( if (tab === GRAPHER_TAB_NAMES.WorldMap) return "Map" if (!options.hasMultipleChartTypes) return "Chart" + if ( + tab === GRAPHER_TAB_NAMES.LineChart && + options.isLineChartThatTurnedIntoDiscreteBar + ) + return "Bar" + switch (tab) { case GRAPHER_TAB_NAMES.LineChart: - return options.isLineChartThatTurnedIntoDiscreteBar ? "Bar" : "Line" + return "Line" case GRAPHER_TAB_NAMES.SlopeChart: return "Slope" diff --git a/packages/@ourworldindata/grapher/src/core/Grapher.tsx b/packages/@ourworldindata/grapher/src/core/Grapher.tsx index 7c470176ae9..f2f1cf50588 100644 --- a/packages/@ourworldindata/grapher/src/core/Grapher.tsx +++ b/packages/@ourworldindata/grapher/src/core/Grapher.tsx @@ -1942,7 +1942,7 @@ export class Grapher @computed get typeExceptWhenLineChartAndSingleTimeThenWillBeBarChart(): GrapherChartType { - return this.isLineChartThatTurnedIntoDiscreteBar + return this.isLineChartThatTurnedIntoDiscreteBarActive ? GRAPHER_CHART_TYPES.DiscreteBar : (this.activeChartType ?? GRAPHER_CHART_TYPES.LineChart) } @@ -2001,6 +2001,12 @@ export class Grapher return closestMinTime !== undefined && closestMinTime === closestMaxTime } + @computed get isLineChartThatTurnedIntoDiscreteBarActive(): boolean { + return ( + this.isOnLineChartTab && this.isLineChartThatTurnedIntoDiscreteBar + ) + } + @computed get isOnLineChartTab(): boolean { return this.activeChartType === GRAPHER_CHART_TYPES.LineChart } From 16000a937dcf8d1ba662d495187d37696e2059a5 Mon Sep 17 00:00:00 2001 From: sophiamersmann Date: Fri, 22 Nov 2024 13:43:52 +0100 Subject: [PATCH 18/52] =?UTF-8?q?=F0=9F=90=9B=20(slope)=20fix=20entity=20s?= =?UTF-8?q?elector=20title?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/@ourworldindata/grapher/src/core/Grapher.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/@ourworldindata/grapher/src/core/Grapher.tsx b/packages/@ourworldindata/grapher/src/core/Grapher.tsx index f2f1cf50588..a625db70a41 100644 --- a/packages/@ourworldindata/grapher/src/core/Grapher.tsx +++ b/packages/@ourworldindata/grapher/src/core/Grapher.tsx @@ -3537,6 +3537,7 @@ export class Grapher this.hasChartTab && this.canSelectMultipleEntities && (this.isOnLineChartTab || + this.isOnSlopeChartTab || this.isOnStackedAreaTab || this.isOnStackedBarTab || this.isOnDiscreteBarTab || From 889194a4da6c5e2d68ac4a052cdd4159e1d928d5 Mon Sep 17 00:00:00 2001 From: sophiamersmann Date: Fri, 22 Nov 2024 13:44:23 +0100 Subject: [PATCH 19/52] =?UTF-8?q?=F0=9F=94=A8=20(slope)=20cleanup?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...407-RemoveColorDimensionFromSlopeCharts.ts | 6 ++- .../core-table/src/OwidTable.ts | 4 +- .../src/barCharts/DiscreteBarChart.tsx | 14 ++++-- .../grapher/src/lineCharts/LineChart.tsx | 1 - .../grapher/src/slopeCharts/SlopeChart.tsx | 48 ++++++++----------- 5 files changed, 36 insertions(+), 37 deletions(-) diff --git a/db/migration/1732195571407-RemoveColorDimensionFromSlopeCharts.ts b/db/migration/1732195571407-RemoveColorDimensionFromSlopeCharts.ts index bbd12966c7d..1750d7e2576 100644 --- a/db/migration/1732195571407-RemoveColorDimensionFromSlopeCharts.ts +++ b/db/migration/1732195571407-RemoveColorDimensionFromSlopeCharts.ts @@ -4,7 +4,9 @@ export class RemoveColorDimensionFromSlopeCharts1732195571407 implements MigrationInterface { public async up(queryRunner: QueryRunner): Promise { - // update dimensions field in chart configs + // remove color dimension for all slope charts + // the y-dimension always comes first and the color dimension second, + // so it's safe to keep the first dimension only await queryRunner.query(` -- sql UPDATE chart_configs @@ -15,7 +17,7 @@ export class RemoveColorDimensionFromSlopeCharts1732195571407 chartType = 'SlopeChart' `) - // remove from chart_dimensions table + // remove the color dimension for slope charts from the chart_dimensions table await queryRunner.query(` -- sql DELETE cd FROM chart_dimensions cd diff --git a/packages/@ourworldindata/core-table/src/OwidTable.ts b/packages/@ourworldindata/core-table/src/OwidTable.ts index fe35387ae20..529aff908b1 100644 --- a/packages/@ourworldindata/core-table/src/OwidTable.ts +++ b/packages/@ourworldindata/core-table/src/OwidTable.ts @@ -124,8 +124,8 @@ export class OwidTable extends CoreTable { return min(this.allTimes) as Time } - @imemo get maxTime(): Time { - return max(this.allTimes) as Time + @imemo get maxTime(): number | undefined { + return max(this.allTimes) } @imemo private get allTimes(): Time[] { diff --git a/packages/@ourworldindata/grapher/src/barCharts/DiscreteBarChart.tsx b/packages/@ourworldindata/grapher/src/barCharts/DiscreteBarChart.tsx index 144ed286209..242ddc08248 100644 --- a/packages/@ourworldindata/grapher/src/barCharts/DiscreteBarChart.tsx +++ b/packages/@ourworldindata/grapher/src/barCharts/DiscreteBarChart.tsx @@ -409,11 +409,14 @@ export class DiscreteBarChart {this.placedSeries.map((series) => { return ( - series.label && - series.label.render( - series.entityLabelX, - series.barY - series.label.height / 2, - { textProps: style } + series.label && ( + + {series.label.render( + series.entityLabelX, + series.barY - series.label.height / 2, + { textProps: style } + )} + ) ) })} @@ -990,6 +993,7 @@ function makeProjectedDataPattern(color: string): React.ReactElement { const size = 7 return ( + | React.TouchEvent + export interface SlopeChartManager extends ChartManager { - isModalOpen?: boolean - canChangeEntity?: boolean canSelectMultipleEntities?: boolean } @@ -92,9 +92,9 @@ export class SlopeChart bounds?: Bounds manager: SlopeChartManager }> - implements ChartInterface, ColorScaleManager + implements ChartInterface { - base: React.RefObject = React.createRef() + slopeAreaRef: React.RefObject = React.createRef() defaultBaseColorScheme = ColorSchemeName.OwidDistinctLines @observable hoveredSeriesName?: string @@ -166,7 +166,7 @@ export class SlopeChart } @computed private get isLogScale(): boolean { - return this.props.manager.yAxisConfig?.scaleType === ScaleType.log + return this.yScaleType === ScaleType.log } @computed private get missingDataStrategy(): MissingDataStrategy { @@ -204,26 +204,22 @@ export class SlopeChart return this.xScale(this.endTime) } - private updateTooltipPosition( - event: React.MouseEvent | React.TouchEvent - ) { + private updateTooltipPosition(event: SVGMouseOrTouchEvent) { const ref = this.manager.base?.current if (ref) this.tooltipState.position = getRelativeMouse(ref, event) } - private detectHoveredSlope( - event: React.MouseEvent | React.TouchEvent - ) { - const ref = this.base.current + private detectHoveredSlope(event: SVGMouseOrTouchEvent) { + const ref = this.slopeAreaRef.current if (!ref) return const mouse = getRelativeMouse(ref, event) this.mouseFrame = requestAnimationFrame(() => { if (this.placedSeries.length === 0) return - const distToSlope = new Map() + const distanceMap = new Map() for (const series of this.placedSeries) { - distToSlope.set( + distanceMap.set( series, PointVector.distanceFromPointToLineSegmentSq( mouse, @@ -234,9 +230,9 @@ export class SlopeChart } const closestSlope = minBy(this.placedSeries, (s) => - distToSlope.get(s) - ) - const distanceSq = distToSlope.get(closestSlope!)! + distanceMap.get(s) + )! + const distanceSq = distanceMap.get(closestSlope)! const tolerance = 10 const toleranceSq = tolerance * tolerance @@ -506,7 +502,7 @@ export class SlopeChart @computed get xRange(): [number, number] { const lineLegendWidth = this.maxLineLegendWidth + LINE_LEGEND_PADDING - // pick a reasonable width based on an ideal aspect ratio + // pick a reasonable max width based on an ideal aspect ratio const idealAspectRatio = 0.6 const chartAreaWidth = this.bounds.width - this.sidebarWidth const availableWidth = @@ -553,7 +549,7 @@ export class SlopeChart private playIntroAnimation() { // Nice little intro animation - select(this.base.current) + select(this.slopeAreaRef.current) .select(".slopes") .attr("stroke-dasharray", "100%") .attr("stroke-dashoffset", "100%") @@ -594,11 +590,9 @@ export class SlopeChart } mouseFrame?: number - @action.bound onMouseMove( - ev: React.MouseEvent | React.TouchEvent - ) { - this.updateTooltipPosition(ev) - this.detectHoveredSlope(ev) + @action.bound onMouseMove(event: SVGMouseOrTouchEvent) { + this.updateTooltipPosition(event) + this.detectHoveredSlope(event) } @action.bound onMouseLeave() { @@ -771,7 +765,7 @@ export class SlopeChart /> Date: Fri, 22 Nov 2024 14:06:19 +0100 Subject: [PATCH 20/52] =?UTF-8?q?=F0=9F=A7=AA=20(slope)=20fix=20tests?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../grapher/src/lineCharts/lineChartHelpers.ts | 2 +- .../grapher/src/slopeCharts/SlopeChart.test.ts | 14 ++------------ .../grapher/src/slopeCharts/SlopeChart.tsx | 6 +++--- 3 files changed, 6 insertions(+), 16 deletions(-) diff --git a/packages/@ourworldindata/grapher/src/lineCharts/lineChartHelpers.ts b/packages/@ourworldindata/grapher/src/lineCharts/lineChartHelpers.ts index 5296a3a3eca..74fdccc4c52 100644 --- a/packages/@ourworldindata/grapher/src/lineCharts/lineChartHelpers.ts +++ b/packages/@ourworldindata/grapher/src/lineCharts/lineChartHelpers.ts @@ -27,7 +27,7 @@ export function getSeriesName({ // if columns are plotted, use the column name // and prepend the entity name if multiple entities can be selected - return availableEntityNames.length > 1 && canSelectMultipleEntities + return availableEntityNames.length > 1 || canSelectMultipleEntities ? `${entityName} - ${columnName}` : columnName } diff --git a/packages/@ourworldindata/grapher/src/slopeCharts/SlopeChart.test.ts b/packages/@ourworldindata/grapher/src/slopeCharts/SlopeChart.test.ts index 9a22d9c08a6..660f64c2953 100755 --- a/packages/@ourworldindata/grapher/src/slopeCharts/SlopeChart.test.ts +++ b/packages/@ourworldindata/grapher/src/slopeCharts/SlopeChart.test.ts @@ -7,13 +7,13 @@ import { SynthesizeGDPTable, } from "@ourworldindata/core-table" import { ChartManager } from "../chart/ChartManager" -import { DEFAULT_SLOPE_CHART_COLOR } from "./SlopeChartConstants" -import { isNumber, OwidTableSlugs } from "@ourworldindata/utils" +import { isNumber } from "@ourworldindata/utils" const table = SynthesizeGDPTable({ timeRange: [2000, 2010] }) const manager: ChartManager = { table, yColumnSlug: SampleColumnSlugs.Population, + selection: table.availableEntityNames, } it("can create a new slope chart", () => { @@ -21,16 +21,6 @@ it("can create a new slope chart", () => { expect(chart.series.length).toEqual(2) }) -it("slope charts can have different colors", () => { - const manager: ChartManager = { - table, - yColumnSlug: SampleColumnSlugs.Population, - colorColumnSlug: OwidTableSlugs.entityName, - } - const chart = new SlopeChart({ manager }) - expect(chart.series[0].color).not.toEqual(DEFAULT_SLOPE_CHART_COLOR) -}) - it("filters non-numeric values", () => { const table = SynthesizeFruitTableWithStringValues( { diff --git a/packages/@ourworldindata/grapher/src/slopeCharts/SlopeChart.tsx b/packages/@ourworldindata/grapher/src/slopeCharts/SlopeChart.tsx index 44720736c34..57f0e0f2fcb 100644 --- a/packages/@ourworldindata/grapher/src/slopeCharts/SlopeChart.tsx +++ b/packages/@ourworldindata/grapher/src/slopeCharts/SlopeChart.tsx @@ -269,11 +269,11 @@ export class SlopeChart } @computed private get startTime(): Time { - return this.manager.startTime! + return this.transformedTable.minTime ?? 0 } @computed private get endTime(): Time { - return this.manager.endTime! + return this.transformedTable.maxTime ?? 0 } @computed get seriesStrategy(): SeriesStrategy { @@ -396,7 +396,7 @@ export class SlopeChart return map } - @computed private get series(): SlopeChartSeries[] { + @computed get series(): SlopeChartSeries[] { return this.rawSeries.filter((series) => this.shouldSeriesBePlotted(series) ) From a9a6d01f12c4a05ecdc39409b14072d89e16ccbc Mon Sep 17 00:00:00 2001 From: sophiamersmann Date: Fri, 22 Nov 2024 16:01:57 +0100 Subject: [PATCH 21/52] =?UTF-8?q?=E2=9C=A8=20(slope)=20visual=20changes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../grapher/src/slopeCharts/SlopeChart.tsx | 102 +++++++++++++++--- 1 file changed, 87 insertions(+), 15 deletions(-) diff --git a/packages/@ourworldindata/grapher/src/slopeCharts/SlopeChart.tsx b/packages/@ourworldindata/grapher/src/slopeCharts/SlopeChart.tsx index 57f0e0f2fcb..a44eb151e31 100644 --- a/packages/@ourworldindata/grapher/src/slopeCharts/SlopeChart.tsx +++ b/packages/@ourworldindata/grapher/src/slopeCharts/SlopeChart.tsx @@ -1,4 +1,4 @@ -import React from "react" +import React, { SVGProps } from "react" import { Bounds, DEFAULT_BOUNDS, @@ -20,6 +20,7 @@ import { observer } from "mobx-react" import { NoDataModal } from "../noDataModal/NoDataModal" import { BASE_FONT_SIZE, + GRAPHER_BACKGROUND_DEFAULT, GRAPHER_DARK_TEXT, GRAPHER_FONT_SCALE_12, } from "../core/GrapherConstants" @@ -601,6 +602,15 @@ export class SlopeChart this.onSlopeMouseLeave() } + @computed private get lineStrokeWidth(): number { + const factor = this.manager.isStaticAndSmall ? 2 : 1 + return factor * 2 + } + + @computed private get backgroundColor(): string { + return this.manager.backgroundColor ?? GRAPHER_BACKGROUND_DEFAULT + } + @computed get renderUid(): number { return guid() } @@ -697,6 +707,9 @@ export class SlopeChart series={series} color={series.color} mode={mode} + strokeWidth={this.lineStrokeWidth} + outlineWidth={0.25} + outlineStroke={this.backgroundColor} /> ) } @@ -809,6 +822,10 @@ interface SlopeProps { series: PlacedSlopeChartSeries color: string mode?: RenderMode + dotRadius?: number + strokeWidth?: number + outlineWidth?: number + outlineStroke?: string onMouseOver?: (series: SlopeChartSeries) => void onMouseLeave?: () => void } @@ -817,16 +834,20 @@ function Slope({ series, color, mode = RenderMode.default, + dotRadius = 3.5, + strokeWidth = 2, + outlineWidth = 0.5, + outlineStroke = "#fff", onMouseOver, onMouseLeave, }: SlopeProps) { const { seriesName, startPoint, endPoint } = series - const usedColor = { - [RenderMode.default]: color, - [RenderMode.focus]: color, - [RenderMode.mute]: "#e2e2e2", - [RenderMode.background]: "#e2e2e2", + const opacity = { + [RenderMode.default]: 1, + [RenderMode.focus]: 1, + [RenderMode.mute]: 0.3, + [RenderMode.background]: 0.3, }[mode] return ( @@ -835,22 +856,72 @@ function Slope({ onMouseOver={() => onMouseOver?.(series)} onMouseLeave={() => onMouseLeave?.()} > + + + + + ) +} + +interface HaloLineProps extends SVGProps { + startPoint: PointVector + endPoint: PointVector + strokeWidth?: number + outlineWidth?: number + outlineStroke?: string +} + +function HaloLine(props: HaloLineProps): React.ReactElement { + const { + startPoint, + endPoint, + outlineWidth = 0.5, + outlineStroke = "#fff", + ...styleProps + } = props + return ( + <> - - - + ) } @@ -921,6 +992,7 @@ function MarkX({ textAnchor="middle" fill={GRAPHER_DARK_TEXT} fontSize={fontSize} + fontWeight={600} > {label} From ad7a2b334b44b3c2faf1aef7d51f58c08643fb8e Mon Sep 17 00:00:00 2001 From: sophiamersmann Date: Wed, 27 Nov 2024 11:40:07 +0100 Subject: [PATCH 22/52] =?UTF-8?q?=F0=9F=94=A8=20always=20apply=20transform?= =?UTF-8?q?s=20of=20the=20main=20chart=20type=20for=20the=20entity=20selec?= =?UTF-8?q?tor=20table?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../grapher/src/core/Grapher.tsx | 18 +++++++++++++++--- .../grapher/src/lineCharts/LineChart.tsx | 10 +++------- 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/packages/@ourworldindata/grapher/src/core/Grapher.tsx b/packages/@ourworldindata/grapher/src/core/Grapher.tsx index a625db70a41..466a736f59b 100644 --- a/packages/@ourworldindata/grapher/src/core/Grapher.tsx +++ b/packages/@ourworldindata/grapher/src/core/Grapher.tsx @@ -789,13 +789,15 @@ export class Grapher ? this.tableAfterAuthorTimelineAndActiveChartTransform : this.inputTable - if (!this.isReady) return table + if (!this.isReady || !this.mainChartInstance) return table // Some chart types (e.g. stacked area charts) choose not to show an entity // with incomplete data. Such chart types define a custom transform function // to ensure that the entity selector only offers entities that are actually plotted. - if (this.chartInstance.transformTableForSelection) { - table = this.chartInstance.transformTableForSelection(table) + // We apply the `tranformTableForSelection` method of the main chart type, + // so that the entity selector doesn't update when switching between chart types. + if (this.mainChartInstance.transformTableForSelection) { + table = this.mainChartInstance.transformTableForSelection(table) } return table @@ -836,6 +838,16 @@ export class Grapher return transformedTable } + // Chart instance of the "main" chart type, which is the first chart type + // in the list of valid chart types. Doesn't take into account that line + // charts might turn into discrete bar charts. Undefined for map-only Graphers. + @computed private get mainChartInstance(): ChartInterface | undefined { + if (!this.chartType) return undefined + const ChartClass = + ChartComponentClassMap.get(this.chartType) ?? DefaultChartClass + return new ChartClass({ manager: this }) + } + @computed get chartInstance(): ChartInterface { // Note: when timeline handles on a LineChart are collapsed into a single handle, the // LineChart turns into a DiscreteBar. diff --git a/packages/@ourworldindata/grapher/src/lineCharts/LineChart.tsx b/packages/@ourworldindata/grapher/src/lineCharts/LineChart.tsx index 6def600bb85..a6674903be0 100644 --- a/packages/@ourworldindata/grapher/src/lineCharts/LineChart.tsx +++ b/packages/@ourworldindata/grapher/src/lineCharts/LineChart.tsx @@ -408,13 +408,9 @@ export class LineChart // if entities with partial data are not plotted, // make sure they don't show up in the entity selector if (this.missingDataStrategy === MissingDataStrategy.hide) { - table = table.replaceNonNumericCellsWithErrorValues( - this.yColumnSlugs - ) - - table = table.dropEntitiesThatHaveNoDataInSomeColumn( - this.yColumnSlugs - ) + table = table + .replaceNonNumericCellsWithErrorValues(this.yColumnSlugs) + .dropEntitiesThatHaveNoDataInSomeColumn(this.yColumnSlugs) } return table From 3138296e6c789c71f8310106258577b867db6c2e Mon Sep 17 00:00:00 2001 From: sophiamersmann Date: Wed, 27 Nov 2024 12:06:48 +0100 Subject: [PATCH 23/52] =?UTF-8?q?=E2=9C=A8=20(slope)=20add=20Change=20in?= =?UTF-8?q?=20to=20title=20in=20relative=20mode?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- adminSiteClient/EditorFeatures.tsx | 2 +- packages/@ourworldindata/grapher/src/core/Grapher.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/adminSiteClient/EditorFeatures.tsx b/adminSiteClient/EditorFeatures.tsx index 70adfd194bf..5d0f91f5301 100644 --- a/adminSiteClient/EditorFeatures.tsx +++ b/adminSiteClient/EditorFeatures.tsx @@ -133,7 +133,7 @@ export class EditorFeatures { @computed get showChangeInPrefixToggle() { return ( - this.grapher.isLineChart && + (this.grapher.isLineChart || this.grapher.isSlopeChart) && (this.grapher.isRelativeMode || this.grapher.canToggleRelativeMode) ) } diff --git a/packages/@ourworldindata/grapher/src/core/Grapher.tsx b/packages/@ourworldindata/grapher/src/core/Grapher.tsx index 466a736f59b..d1c6407c228 100644 --- a/packages/@ourworldindata/grapher/src/core/Grapher.tsx +++ b/packages/@ourworldindata/grapher/src/core/Grapher.tsx @@ -1626,7 +1626,7 @@ export class Grapher !this.hideAnnotationFieldsInTitle?.changeInPrefix return ( !this.forceHideAnnotationFieldsInTitle?.changeInPrefix && - this.isOnLineChartTab && + (this.isOnLineChartTab || this.isOnSlopeChartTab) && this.isRelativeMode && showChangeInPrefix ) From beb3099943bf2e8fdaa80cedcf864db7af29baa7 Mon Sep 17 00:00:00 2001 From: sophiamersmann Date: Wed, 27 Nov 2024 13:54:49 +0100 Subject: [PATCH 24/52] =?UTF-8?q?=E2=9C=A8=20(admin)=20show=20relative=20t?= =?UTF-8?q?oggle=20for=20slope=20charts?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- adminSiteClient/EditorFeatures.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/adminSiteClient/EditorFeatures.tsx b/adminSiteClient/EditorFeatures.tsx index 5d0f91f5301..0fefaa9c693 100644 --- a/adminSiteClient/EditorFeatures.tsx +++ b/adminSiteClient/EditorFeatures.tsx @@ -78,6 +78,7 @@ export class EditorFeatures { this.grapher.isStackedBar || this.grapher.isStackedDiscreteBar || this.grapher.isLineChart || + this.grapher.isSlopeChart || this.grapher.isScatter || this.grapher.isMarimekko ) From 8243fbce2058f9e0a22d8b36202588654b76ac0d Mon Sep 17 00:00:00 2001 From: sophiamersmann Date: Mon, 25 Nov 2024 12:21:15 +0100 Subject: [PATCH 25/52] =?UTF-8?q?=F0=9F=94=A8=20migrate=20slope=20charts?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../1732291572062-MigrateSlopeCharts.ts | 413 ++++++++++++++++++ 1 file changed, 413 insertions(+) create mode 100644 db/migration/1732291572062-MigrateSlopeCharts.ts diff --git a/db/migration/1732291572062-MigrateSlopeCharts.ts b/db/migration/1732291572062-MigrateSlopeCharts.ts new file mode 100644 index 00000000000..aed3e83855c --- /dev/null +++ b/db/migration/1732291572062-MigrateSlopeCharts.ts @@ -0,0 +1,413 @@ +import { GrapherInterface } from "@ourworldindata/types" +import { MigrationInterface, QueryRunner } from "typeorm" + +export class MigrateSlopeCharts1732291572062 implements MigrationInterface { + public async up(queryRunner: QueryRunner): Promise { + const slopeCharts = await queryRunner.query(` + -- sql + SELECT c.id, cc.id AS configId, cc.patch, cc.full + FROM charts c + JOIN chart_configs cc ON cc.id = c.configId + WHERE cc.chartType = 'SlopeChart' + `) + + const configUpdatesById = new Map( + configUpdates.map(({ id, config }) => [id, config]) + ) + + for (const chart of slopeCharts) { + const migrationConfig = configUpdatesById.get(chart.id) + if (!migrationConfig) continue + + const patchConfig = JSON.parse(chart.patch) + const fullConfig = JSON.parse(chart.full) + + const newPatchConfig = { + ...patchConfig, + ...migrationConfig, + } + const newFullConfig = { + ...fullConfig, + ...migrationConfig, + } + + await queryRunner.query( + ` + -- sql + UPDATE chart_configs + SET + patch = ?, + full = ? + WHERE id = ? + `, + [ + JSON.stringify(newPatchConfig), + JSON.stringify(newFullConfig), + chart.configId, + ] + ) + } + } + + // eslint-disable-next-line @typescript-eslint/no-empty-function + public async down(): Promise {} +} + +const configUpdates: { id: number; config: GrapherInterface }[] = [ + { + id: 414, + config: { + title: "Top marginal income tax rate", + selectedEntityNames: [ + "Colombia", + "Guatemala", + "Indonesia", + "Iran", + "Jamaica", + "Pakistan", + "Trinidad and Tobago", + "Botswana", + "Bolivia", + "Japan", + "United States", + "Sweden", + "Germany", + "Netherlands", + "Belgium", + "France", + "Ireland", + "United Kingdom", + ], + hideRelativeToggle: true, + }, + }, + { + id: 415, + config: { + selectedEntityNames: [ + "Cirrhosis and other chronic liver diseases", + "Neonatal disorders", + "Congenital heart anomalies", + "Diphtheria", + ], + entityType: "cause", + entityTypePlural: "causes", + hideRelativeToggle: true, + }, + }, + { + id: 679, + config: { + selectedEntityNames: [ + "Chad", + "Iraq", + "Benin", + "Kenya", + "Brazil", + "Hungary", + ], + hideRelativeToggle: true, + }, + }, + { + id: 874, + config: { + selectedEntityNames: [ + "North America (WB)", + "South Asia (WB)", + "Europe and Central Asia (WB)", + "Latin America and Caribbean (WB)", + ], + hideRelativeToggle: true, + }, + }, + { + id: 875, + config: { + selectedEntityNames: [ + "North America (WB)", + "South Asia (WB)", + "Latin America and Caribbean (WB)", + ], + hideRelativeToggle: true, + }, + }, + { + id: 1004, + config: { + selectedEntityNames: [ + "Palau", + "Afghanistan", + "Curacao", + "Wallis and Futuna", + ], + }, + }, + { id: 1459, config: {} }, + { id: 1975, config: { selectedEntityNames: ["World"] } }, + { + id: 2832, + config: { + selectedEntityNames: ["Norway", "Italy", "France", "Finland"], + hideTimeline: true, + }, + }, + { + id: 2833, + config: { + selectedEntityNames: ["Belgium", "Poland", "Italy", "Germany"], + hideTimeline: true, + }, + }, + { + id: 2834, + config: { + selectedEntityNames: ["Belgium", "Italy", "Spain", "Norway"], + }, + }, + { + id: 2835, + config: { + selectedEntityNames: [ + "Estonia", + "Norway", + "Poland", + "United Kingdom", + ], + hideTimeline: true, + }, + }, + { + id: 2975, + config: { + selectedEntityNames: [ + "Germany", + "Poland", + "United Kingdom", + "Finland", + ], + hideTimeline: true, + }, + }, + { + id: 2976, + config: { + selectedEntityNames: ["Poland", "Italy", "Spain", "Belgium"], + hideTimeline: true, + }, + }, + { + id: 2977, + config: { + selectedEntityNames: ["Poland", "Norway", "Estonia", "Finland"], + hideTimeline: true, + }, + }, + { + id: 2978, + config: { + selectedEntityNames: [ + "Poland", + "Norway", + "Belgium", + "Estonia", + "Italy", + ], + hideTimeline: true, + }, + }, + { + id: 2979, + config: { + selectedEntityNames: [ + "United Kingdom", + "Estonia", + "Belgium", + "Italy", + ], + hideTimeline: true, + }, + }, + { + id: 3249, + config: { + selectedEntityNames: [ + "France", + "Italy", + "Japan", + "Portugal", + "Germany", + "Mexico", + "Norway", + "Sweden", + "Taiwan", + "Sri Lanka", + "United Kingdom", + "United States", + ], + }, + }, + { + id: 3359, + config: { + selectedEntityNames: [ + "Mali", + "South Africa", + "Nigeria", + "Niger", + "Chad", + "Ethiopia", + "Kenya", + "Uganda", + "Rwanda", + "Burundi", + "Tanzania", + "Mozambique", + "Madagascar", + "Zambia", + "Congo", + "Democratic Republic of Congo", + "Central African Republic", + "Cameroon", + "Togo", + "Benin", + "Sierra Leone", + "Cote d'Ivoire", + "Burkina Faso", + "Guinea-Bissau", + "Papua New Guinea", + "Senegal", + "Angola", + ], + }, + }, + { + id: 3364, + config: { + selectedEntityNames: [ + "India", + "Indonesia", + "United States", + "Antigua and Barbuda", + ], + }, + }, + { + id: 3433, + config: {}, + }, + { + id: 3434, + config: {}, + }, + { + id: 3580, + config: { + entityTypePlural: "species", + }, + }, + { + id: 3620, + config: { + selectedEntityNames: ["Romania", "Benin", "Libya", "Suriname"], + }, + }, + { + id: 3627, + config: { + selectedEntityNames: [ + "Syrian Arab Republic", + "East Asia & Pacific", + "Costa Rica", + "Malta", + ], + }, + }, + { + id: 4408, + config: { + selectedEntityNames: [ + "East Asia (MPD)", + "Latin America (MPD)", + "Eastern Europe (MPD)", + "Western Europe (MPD)", + "Western offshoots (MPD)", + "Sub Saharan Africa (MPD)", + "South and South East Asia (MPD)", + "Middle East and North Africa (MPD)", + "World", + ], + }, + }, + { + id: 4764, + config: { + entityTypePlural: "species", + }, + }, + { + id: 6219, + config: { + hideRelativeToggle: true, + }, + }, + { + id: 6529, + config: { + selectedEntityNames: ["United States", "Russia", "China"], + }, + }, + { + id: 7150, + config: { + selectedEntityNames: ["Burundi", "Togo", "Ethiopia", "Myanmar"], + }, + }, + { + id: 7206, + config: {}, + }, + { + id: 7220, + config: {}, + }, + { + id: 7221, + config: {}, + }, + { + id: 7226, + config: {}, + }, + { + id: 7344, + config: { + selectedEntityNames: [ + "Suriname", + "Malta", + "Australia", + "Guatemala", + ], + }, + }, + { + id: 7448, + config: { + hideRelativeToggle: true, + }, + }, + { + id: 8157, + config: { + selectedEntityNames: [ + "South Asia (WB)", + "North America (WB)", + "Sub-Saharan Africa (WB)", + "East Asia and Pacific (WB)", + "Europe and Central Asia (WB)", + "Latin America and Caribbean (WB)", + "Middle East and North Africa (WB)", + ], + }, + }, +] From 8fa86dc8d70a5673265ddf84f3043f57cb0b19ad Mon Sep 17 00:00:00 2001 From: sophiamersmann Date: Wed, 27 Nov 2024 14:23:24 +0100 Subject: [PATCH 26/52] =?UTF-8?q?=E2=9C=A8=20(slope)=20improve=20tooltip?= =?UTF-8?q?=20in=20relative=20mode?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../grapher/src/slopeCharts/SlopeChart.tsx | 30 ++++++++++++------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/packages/@ourworldindata/grapher/src/slopeCharts/SlopeChart.tsx b/packages/@ourworldindata/grapher/src/slopeCharts/SlopeChart.tsx index a44eb151e31..6cfea0d35ad 100644 --- a/packages/@ourworldindata/grapher/src/slopeCharts/SlopeChart.tsx +++ b/packages/@ourworldindata/grapher/src/slopeCharts/SlopeChart.tsx @@ -617,17 +617,26 @@ export class SlopeChart @computed get tooltip(): React.ReactElement | undefined { const { + manager: { isRelativeMode }, tooltipState: { target, position, fading }, + formatColumn, + startTime, + endTime, } = this const { series } = target || {} if (!series) return - const { isRelativeMode } = this.manager, - timeRange = [this.startTime, this.endTime] - .map((t) => this.formatColumn.formatTime(t)) - .join(" to "), - timeLabel = timeRange + (isRelativeMode ? " (relative change)" : "") + const title = isRelativeMode + ? `${series.seriesName}, ${formatColumn.formatTime(endTime)}` + : series.seriesName + + const timeRange = [startTime, endTime] + .map((t) => formatColumn.formatTime(t)) + .join(" to ") + const timeLabel = isRelativeMode + ? `% change since ${formatColumn.formatTime(startTime)}` + : timeRange const columns = this.yColumns const allRoundedToSigFigs = columns.every( @@ -656,6 +665,10 @@ export class SlopeChart : undefined const footer = excludeUndefined([roundingNotice]) + const values = isRelativeMode + ? [series.endValue] + : [series.startValue, series.endValue] + return ( (this.tooltipState.target = null)} > - + ) } From a4090692cb0f586d58a3af940e0982462ac09378 Mon Sep 17 00:00:00 2001 From: sophiamersmann Date: Wed, 27 Nov 2024 15:18:44 +0100 Subject: [PATCH 27/52] =?UTF-8?q?=E2=9C=A8=20(slope)=20improve=20No=20Data?= =?UTF-8?q?=20section?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../grapher/src/noDataModal/NoDataModal.tsx | 4 +- .../grapher/src/slopeCharts/SlopeChart.tsx | 71 +++++++++++++------ 2 files changed, 52 insertions(+), 23 deletions(-) diff --git a/packages/@ourworldindata/grapher/src/noDataModal/NoDataModal.tsx b/packages/@ourworldindata/grapher/src/noDataModal/NoDataModal.tsx index 8502da6e0fe..a63ea9999b1 100644 --- a/packages/@ourworldindata/grapher/src/noDataModal/NoDataModal.tsx +++ b/packages/@ourworldindata/grapher/src/noDataModal/NoDataModal.tsx @@ -30,6 +30,7 @@ export interface NoDataModalManager { export class NoDataModal extends React.Component<{ bounds?: Bounds message?: string + helpText?: string manager: NoDataModalManager }> { @computed private get bounds(): Bounds { @@ -55,11 +56,12 @@ export class NoDataModal extends React.Component<{ isStatic, } = this.manager - const helpText = canAddEntities + const defaultHelpText = canAddEntities ? `Try adding ${entityTypePlural} to display data.` : canChangeEntity ? `Try choosing ${a(entityType)} to display data.` : undefined + const helpText = this.props.helpText ?? defaultHelpText const center = bounds.centerPos const padding = 0.75 * this.fontSize diff --git a/packages/@ourworldindata/grapher/src/slopeCharts/SlopeChart.tsx b/packages/@ourworldindata/grapher/src/slopeCharts/SlopeChart.tsx index 6cfea0d35ad..5bda0407757 100644 --- a/packages/@ourworldindata/grapher/src/slopeCharts/SlopeChart.tsx +++ b/packages/@ourworldindata/grapher/src/slopeCharts/SlopeChart.tsx @@ -245,14 +245,22 @@ export class SlopeChart }) } - @computed get failMessage() { + @computed get failMessage(): string { const message = getDefaultFailMessage(this.manager) if (message) return message - else if (this.startTime === this.endTime) return "No matching data" - else if (isEmpty(this.series)) return "No matching data" + else if (this.startTime === this.endTime) + return "No data to display for the selected time period" return "" } + @computed get helpMessage(): string | undefined { + if ( + this.failMessage === + "No data to display for the selected time period" + ) + return "Try dragging the time slider to display data." + } + @computed private get yColumns(): CoreColumn[] { return this.yColumnSlugs.map((slug) => this.transformedTable.get(slug)) } @@ -348,29 +356,29 @@ export class SlopeChart return series.startValue !== undefined && series.endValue !== undefined } - /** - * Usually we drop rows with missing data in the transformTable function. - * But slope charts have a "No data" section. If slopes that have data - * but shouldn't be plotted because a "sibling" slope of the same entity - * doesn't have data are dropped from the transformed table, then we - * would have no way of knowing whether a slope has been dropped because - * it actually had no data or a sibling slope had no data. That's why we - * filter out slopes that are valid but shouldn't be plotted here, so - * that the noDataSeries is populated correctly. - */ + // Usually we drop rows with missing data in the transformTable function. + // But if we did that for slope charts, we wouldn't know whether a slope + // has been dropped because it actually had no data or a sibling slope had + // no data. But we need that information for the "No data" section. That's + // why the filtering happens here, so that the noDataSeries can be populated + // correctly. private shouldSeriesBePlotted( series: RawSlopeChartSeries ): series is SlopeChartSeries { if (!this.isSeriesValid(series)) return false + // when the missing data strategy is set to "hide", we might + // choose not to plot a valid series if ( this.seriesStrategy === SeriesStrategy.column && this.missingDataStrategy === MissingDataStrategy.hide ) { - const entitySeries = this.rawSeriesByEntityName.get( + const allSeriesForEntity = this.rawSeriesByEntityName.get( series.entityName ) - return !!entitySeries?.every((series) => this.isSeriesValid(series)) + return !!allSeriesForEntity?.every((series) => + this.isSeriesValid(series) + ) } return true @@ -487,12 +495,14 @@ export class SlopeChart // TODO: copied from line legend const fontSize = GRAPHER_FONT_SCALE_12 * (this.manager.fontSize ?? BASE_FONT_SIZE) - return max( - this.series.map( - (series) => - Bounds.forText(series.seriesName, { fontSize }).width - ) - )! + return ( + max( + this.series.map( + (series) => + Bounds.forText(series.seriesName, { fontSize }).width + ) + ) ?? 0 + ) } @computed get maxLineLegendWidth(): number { @@ -689,14 +699,30 @@ export class SlopeChart ) } + private makeMissingDataLabel(series: RawSlopeChartSeries): string { + const { seriesName } = series + const startTime = this.formatColumn.formatTime(this.startTime) + const endTime = this.formatColumn.formatTime(this.endTime) + if (series.startValue === undefined && series.endValue === undefined) { + return `${seriesName} (${startTime} & ${endTime})` + } else if (series.startValue === undefined) { + return `${seriesName} (${startTime})` + } else if (series.endValue === undefined) { + return `${seriesName} (${endTime})` + } + return seriesName + } + private renderNoDataSection(): React.ReactElement { - const seriesNames = this.noDataSeries.map((series) => series.seriesName) const bounds = new Bounds( this.bounds.right - this.sidebarWidth, this.bounds.top, this.sidebarWidth, this.bounds.height ) + const seriesNames = this.noDataSeries.map((series) => + this.makeMissingDataLabel(series) + ) return ( ) From f2b593bfb464bc0d1dcfcafb579f941406513c61 Mon Sep 17 00:00:00 2001 From: sophiamersmann Date: Wed, 27 Nov 2024 15:20:04 +0100 Subject: [PATCH 28/52] =?UTF-8?q?=E2=9C=A8=20nicer=20entity/column=20label?= =?UTF-8?q?s?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../grapher/src/lineCharts/LineChart.test.ts | 6 +++--- .../grapher/src/lineCharts/lineChartHelpers.ts | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/@ourworldindata/grapher/src/lineCharts/LineChart.test.ts b/packages/@ourworldindata/grapher/src/lineCharts/LineChart.test.ts index c825a821719..3655c9b83e3 100755 --- a/packages/@ourworldindata/grapher/src/lineCharts/LineChart.test.ts +++ b/packages/@ourworldindata/grapher/src/lineCharts/LineChart.test.ts @@ -100,7 +100,7 @@ describe("series naming in multi-column mode", () => { selection: [table.availableEntityNames[0]], } const chart = new LineChart({ manager }) - expect(chart.series[0].seriesName).not.toContain(" - ") + expect(chart.series[0].seriesName).not.toContain(" – ") }) it("combines entity and column name if only one entity is selected and multi entity selection is enabled", () => { @@ -110,7 +110,7 @@ describe("series naming in multi-column mode", () => { selection: [table.availableEntityNames[0]], } const chart = new LineChart({ manager }) - expect(chart.series[0].seriesName).toContain(" - ") + expect(chart.series[0].seriesName).toContain(" – ") }) it("combines entity and column name if multiple entities are selected and multi entity selection is disabled", () => { @@ -120,7 +120,7 @@ describe("series naming in multi-column mode", () => { selection: table.availableEntityNames, } const chart = new LineChart({ manager }) - expect(chart.series[0].seriesName).toContain(" - ") + expect(chart.series[0].seriesName).toContain(" – ") }) }) diff --git a/packages/@ourworldindata/grapher/src/lineCharts/lineChartHelpers.ts b/packages/@ourworldindata/grapher/src/lineCharts/lineChartHelpers.ts index 74fdccc4c52..49a1f81597a 100644 --- a/packages/@ourworldindata/grapher/src/lineCharts/lineChartHelpers.ts +++ b/packages/@ourworldindata/grapher/src/lineCharts/lineChartHelpers.ts @@ -28,7 +28,7 @@ export function getSeriesName({ // if columns are plotted, use the column name // and prepend the entity name if multiple entities can be selected return availableEntityNames.length > 1 || canSelectMultipleEntities - ? `${entityName} - ${columnName}` + ? `${entityName} – ${columnName}` : columnName } From 99a8c6e148c3cc24023b8aff4a61a2c1888cdc48 Mon Sep 17 00:00:00 2001 From: sophiamersmann Date: Wed, 27 Nov 2024 15:39:00 +0100 Subject: [PATCH 29/52] =?UTF-8?q?=F0=9F=94=A8=20(slope)=20clean=20up=20cod?= =?UTF-8?q?e?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/lineCharts/LineChartConstants.ts | 2 +- .../grapher/src/slopeCharts/SlopeChart.tsx | 164 +++++++++--------- 2 files changed, 83 insertions(+), 83 deletions(-) diff --git a/packages/@ourworldindata/grapher/src/lineCharts/LineChartConstants.ts b/packages/@ourworldindata/grapher/src/lineCharts/LineChartConstants.ts index e7e9a01cf7e..fe5d5a258bb 100644 --- a/packages/@ourworldindata/grapher/src/lineCharts/LineChartConstants.ts +++ b/packages/@ourworldindata/grapher/src/lineCharts/LineChartConstants.ts @@ -46,5 +46,5 @@ export interface LinesProps { export interface LineChartManager extends ChartManager { entityYearHighlight?: EntityYearHighlight lineStrokeWidth?: number - canSelectMultipleEntities?: boolean + canSelectMultipleEntities?: boolean // used to pick an appropriate series name } diff --git a/packages/@ourworldindata/grapher/src/slopeCharts/SlopeChart.tsx b/packages/@ourworldindata/grapher/src/slopeCharts/SlopeChart.tsx index 5bda0407757..60e49f80593 100644 --- a/packages/@ourworldindata/grapher/src/slopeCharts/SlopeChart.tsx +++ b/packages/@ourworldindata/grapher/src/slopeCharts/SlopeChart.tsx @@ -2,7 +2,6 @@ import React, { SVGProps } from "react" import { Bounds, DEFAULT_BOUNDS, - isEmpty, domainExtent, exposeInstanceOnWindow, PointVector, @@ -79,11 +78,11 @@ type SVGMouseOrTouchEvent = | React.TouchEvent export interface SlopeChartManager extends ChartManager { - canSelectMultipleEntities?: boolean + canSelectMultipleEntities?: boolean // used to pick an appropriate series name } -const TOP_PADDING = 6 -const BOTTOM_PADDING = 20 +const TOP_PADDING = 6 // leave room for overflowing dots +const BOTTOM_PADDING = 20 // leave room for the x-axis const LINE_LEGEND_PADDING = 4 @@ -182,85 +181,19 @@ export class SlopeChart return this.yColumns[0] } - @computed private get sidebarWidth(): number { - return this.showNoDataSection - ? clamp(this.bounds.width * 0.125, 60, 140) - : 0 + @computed private get lineStrokeWidth(): number { + const factor = this.manager.isStaticAndSmall ? 2 : 1 + return factor * 2 } - // used by LineLegend - @computed get focusedSeriesNames(): SeriesName[] { - return this.hoveredSeriesName ? [this.hoveredSeriesName] : [] + @computed private get backgroundColor(): string { + return this.manager.backgroundColor ?? GRAPHER_BACKGROUND_DEFAULT } @computed private get isFocusModeActive(): boolean { return this.hoveredSeriesName !== undefined } - @computed private get startX(): number { - return this.xScale(this.startTime) - } - - @computed private get endX(): number { - return this.xScale(this.endTime) - } - - private updateTooltipPosition(event: SVGMouseOrTouchEvent) { - const ref = this.manager.base?.current - if (ref) this.tooltipState.position = getRelativeMouse(ref, event) - } - - private detectHoveredSlope(event: SVGMouseOrTouchEvent) { - const ref = this.slopeAreaRef.current - if (!ref) return - - const mouse = getRelativeMouse(ref, event) - this.mouseFrame = requestAnimationFrame(() => { - if (this.placedSeries.length === 0) return - - const distanceMap = new Map() - for (const series of this.placedSeries) { - distanceMap.set( - series, - PointVector.distanceFromPointToLineSegmentSq( - mouse, - series.startPoint, - series.endPoint - ) - ) - } - - const closestSlope = minBy(this.placedSeries, (s) => - distanceMap.get(s) - )! - const distanceSq = distanceMap.get(closestSlope)! - const tolerance = 10 - const toleranceSq = tolerance * tolerance - - if (closestSlope && distanceSq < toleranceSq) { - this.onSlopeMouseOver(closestSlope) - } else { - this.onSlopeMouseLeave() - } - }) - } - - @computed get failMessage(): string { - const message = getDefaultFailMessage(this.manager) - if (message) return message - else if (this.startTime === this.endTime) - return "No data to display for the selected time period" - return "" - } - - @computed get helpMessage(): string | undefined { - if ( - this.failMessage === - "No data to display for the selected time period" - ) - return "Try dragging the time slider to display data." - } - @computed private get yColumns(): CoreColumn[] { return this.yColumnSlugs.map((slug) => this.transformedTable.get(slug)) } @@ -285,6 +218,14 @@ export class SlopeChart return this.transformedTable.maxTime ?? 0 } + @computed private get startX(): number { + return this.xScale(this.startTime) + } + + @computed private get endX(): number { + return this.xScale(this.endTime) + } + @computed get seriesStrategy(): SeriesStrategy { return autoDetectSeriesStrategy(this.manager, true) } @@ -462,7 +403,7 @@ export class SlopeChart ] } - @computed get yRange(): [number, number] { + @computed private get yRange(): [number, number] { return this.bounds .padTop(TOP_PADDING) .padBottom(BOTTOM_PADDING) @@ -478,7 +419,7 @@ export class SlopeChart return axis } - @computed get yAxisWidth(): number { + @computed private get yAxisWidth(): number { return this.yAxis.width + 5 // 5px account for the tick marks } @@ -491,6 +432,12 @@ export class SlopeChart return [this.startTime, this.endTime] } + @computed private get sidebarWidth(): number { + return this.showNoDataSection + ? clamp(this.bounds.width * 0.125, 60, 140) + : 0 + } + @computed private get maxLabelWidth(): number { // TODO: copied from line legend const fontSize = @@ -544,6 +491,11 @@ export class SlopeChart return this.xRange[1] + LINE_LEGEND_PADDING } + // used by LineLegend + @computed get focusedSeriesNames(): SeriesName[] { + return this.hoveredSeriesName ? [this.hoveredSeriesName] : [] + } + // used in LineLegend @computed get labelSeries(): LineLabelSeries[] { return this.series.map((series) => { @@ -576,6 +528,46 @@ export class SlopeChart } } + private updateTooltipPosition(event: SVGMouseOrTouchEvent) { + const ref = this.manager.base?.current + if (ref) this.tooltipState.position = getRelativeMouse(ref, event) + } + + private detectHoveredSlope(event: SVGMouseOrTouchEvent) { + const ref = this.slopeAreaRef.current + if (!ref) return + + const mouse = getRelativeMouse(ref, event) + this.mouseFrame = requestAnimationFrame(() => { + if (this.placedSeries.length === 0) return + + const distanceMap = new Map() + for (const series of this.placedSeries) { + distanceMap.set( + series, + PointVector.distanceFromPointToLineSegmentSq( + mouse, + series.startPoint, + series.endPoint + ) + ) + } + + const closestSlope = minBy(this.placedSeries, (s) => + distanceMap.get(s) + )! + const distanceSq = distanceMap.get(closestSlope)! + const tolerance = 10 + const toleranceSq = tolerance * tolerance + + if (closestSlope && distanceSq < toleranceSq) { + this.onSlopeMouseOver(closestSlope) + } else { + this.onSlopeMouseLeave() + } + }) + } + private hoverTimer?: NodeJS.Timeout @action.bound onLineLegendMouseOver(seriesName: SeriesName): void { clearTimeout(this.hoverTimer) @@ -612,13 +604,21 @@ export class SlopeChart this.onSlopeMouseLeave() } - @computed private get lineStrokeWidth(): number { - const factor = this.manager.isStaticAndSmall ? 2 : 1 - return factor * 2 + @computed get failMessage(): string { + const message = getDefaultFailMessage(this.manager) + if (message) return message + else if (this.startTime === this.endTime) + return "No data to display for the selected time period" + return "" } - @computed private get backgroundColor(): string { - return this.manager.backgroundColor ?? GRAPHER_BACKGROUND_DEFAULT + @computed get helpMessage(): string | undefined { + if ( + this.failMessage === + "No data to display for the selected time period" + ) + return "Try dragging the time slider to display data." + return undefined } @computed get renderUid(): number { From 47d65d07855db7f1e1995c2456e8d33982cc0a02 Mon Sep 17 00:00:00 2001 From: sophiamersmann Date: Thu, 28 Nov 2024 09:47:27 +0100 Subject: [PATCH 30/52] =?UTF-8?q?=F0=9F=94=A8=20update=20slope=20migration?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../1732291572062-MigrateSlopeCharts.ts | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/db/migration/1732291572062-MigrateSlopeCharts.ts b/db/migration/1732291572062-MigrateSlopeCharts.ts index aed3e83855c..84e7693269c 100644 --- a/db/migration/1732291572062-MigrateSlopeCharts.ts +++ b/db/migration/1732291572062-MigrateSlopeCharts.ts @@ -8,7 +8,9 @@ export class MigrateSlopeCharts1732291572062 implements MigrationInterface { SELECT c.id, cc.id AS configId, cc.patch, cc.full FROM charts c JOIN chart_configs cc ON cc.id = c.configId - WHERE cc.chartType = 'SlopeChart' + WHERE + cc.chartType = 'SlopeChart' + AND cc.full ->> '$.isPublished' = 'true' `) const configUpdatesById = new Map( @@ -93,6 +95,7 @@ const configUpdates: { id: number; config: GrapherInterface }[] = [ entityType: "cause", entityTypePlural: "causes", hideRelativeToggle: true, + hideLegend: false, }, }, { @@ -144,7 +147,17 @@ const configUpdates: { id: number; config: GrapherInterface }[] = [ }, }, { id: 1459, config: {} }, - { id: 1975, config: { selectedEntityNames: ["World"] } }, + { + id: 1975, + config: { + selectedEntityNames: [ + "North America", + "South America", + "Europe", + "Asia", + ], + }, + }, { id: 2832, config: { From 30d6b7cf68fcad7029b0dc34ba21bb9cc23e66dd Mon Sep 17 00:00:00 2001 From: sophiamersmann Date: Thu, 28 Nov 2024 10:49:45 +0100 Subject: [PATCH 31/52] =?UTF-8?q?=F0=9F=A7=AA=20(slope)=20add=20tests?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/slopeCharts/SlopeChart.test.ts | 221 +++++++++++++++++- .../grapher/src/slopeCharts/SlopeChart.tsx | 2 +- 2 files changed, 220 insertions(+), 3 deletions(-) diff --git a/packages/@ourworldindata/grapher/src/slopeCharts/SlopeChart.test.ts b/packages/@ourworldindata/grapher/src/slopeCharts/SlopeChart.test.ts index 660f64c2953..fdc342b3b43 100755 --- a/packages/@ourworldindata/grapher/src/slopeCharts/SlopeChart.test.ts +++ b/packages/@ourworldindata/grapher/src/slopeCharts/SlopeChart.test.ts @@ -1,13 +1,23 @@ #! /usr/bin/env jest -import { SlopeChart } from "./SlopeChart" +import { SlopeChart, SlopeChartManager } from "./SlopeChart" import { + ErrorValueTypes, + OwidTable, SampleColumnSlugs, + SynthesizeFruitTableWithNonPositives, SynthesizeFruitTableWithStringValues, SynthesizeGDPTable, } from "@ourworldindata/core-table" import { ChartManager } from "../chart/ChartManager" -import { isNumber } from "@ourworldindata/utils" +import { + ColumnTypeNames, + FacetStrategy, + isNumber, + ScaleType, + SeriesStrategy, +} from "@ourworldindata/utils" +import { SelectionArray } from "../selection/SelectionArray" const table = SynthesizeGDPTable({ timeRange: [2000, 2010] }) const manager: ChartManager = { @@ -43,3 +53,210 @@ it("filters non-numeric values", () => { ) ).toBeTruthy() }) + +it("can filter points with negative values when using a log scale", () => { + const table = SynthesizeFruitTableWithNonPositives( + { + entityCount: 2, + timeRange: [2000, 2002], + }, + 1, + 1 + ) + + const manager: ChartManager = { + table, + yColumnSlugs: [SampleColumnSlugs.Fruit], + selection: table.availableEntityNames, + } + const chart = new SlopeChart({ manager }) + // expect(chart.series.length).toEqual(2) + expect(chart.allValues.length).toEqual(4) + + const logScaleManager = { + ...manager, + yAxisConfig: { + scaleType: ScaleType.log, + }, + } + const logChart = new SlopeChart({ manager: logScaleManager }) + expect(logChart.yAxis.domain[0]).toBeGreaterThan(0) + // expect(logChart.series.length).toEqual(2) + expect(logChart.allValues.length).toEqual(2) +}) + +describe("series naming in multi-column mode", () => { + const table = SynthesizeGDPTable() + + it("only displays column name if only one entity is selected and multi entity selection is disabled", () => { + const manager = { + table, + canSelectMultipleEntities: false, + selection: [table.availableEntityNames[0]], + } + const chart = new SlopeChart({ manager }) + expect(chart.series[0].seriesName).not.toContain(" – ") + }) + + it("combines entity and column name if only one entity is selected and multi entity selection is enabled", () => { + const manager = { + table, + canSelectMultipleEntities: true, + selection: [table.availableEntityNames[0]], + } + const chart = new SlopeChart({ manager }) + expect(chart.series[0].seriesName).toContain(" – ") + }) + + it("combines entity and column name if multiple entities are selected and multi entity selection is disabled", () => { + const selection = new SelectionArray( + table.availableEntityNames, + table.availableEntities + ) + const manager = { + table, + canSelectMultipleEntities: false, + selection, + } + const chart = new SlopeChart({ manager }) + expect(chart.series[0].seriesName).toContain(" – ") + }) +}) + +describe("colors", () => { + const table = new OwidTable({ + entityName: ["usa", "canada", "usa", "canada"], + year: [2000, 2000, 2001, 2001], + gdp: [100, 200, 200, 300], + entityColor: ["blue", "red", "blue", "red"], + }) + const selection = ["usa", "canada"] + it("can add custom colors", () => { + const manager = { + yColumnSlugs: ["gdp"], + table, + selection, + } + const chart = new SlopeChart({ manager }) + expect(chart.series.map((series) => series.color)).toEqual([ + "blue", + "red", + ]) + }) + + it("uses column color selections when series strategy is column", () => { + const table = new OwidTable( + { + entityName: ["usa", "usa"], + year: [2000, 2001], + gdp: [100, 200], + entityColor: ["blue", "blue"], + }, + [{ slug: "gdp", color: "green", type: ColumnTypeNames.Numeric }] + ) + + const manager: ChartManager = { + yColumnSlugs: ["gdp"], + table: table, + selection, + seriesStrategy: SeriesStrategy.column, + } + const chart = new SlopeChart({ manager }) + const series = chart.series + + expect(series).toHaveLength(1) + expect(series[0].color).toEqual("green") + }) + + it("can assign colors to selected entities and preserve those colors when selection changes when using a color map", () => { + const selection = new SelectionArray(["usa", "canada"]) + const manager: ChartManager = { + yColumnSlugs: ["gdp"], + table: table.dropColumns(["entityColor"]), + selection, + seriesColorMap: new Map(), + } + const chart = new SlopeChart({ manager }) + const series = chart.series + expect(series).toHaveLength(2) + + selection.deselectEntity("usa") + + const newSeries = chart.series + expect(newSeries).toHaveLength(1) + expect(newSeries[0].color).toEqual(series[1].color) + }) + + it("uses variable colors when only one entity selected (even if multiple can be selected with controls)", () => { + const table = new OwidTable( + { + entityName: ["usa", "usa", "canada"], + year: [2000, 2001, 2000], + gdp: [100, 200, 100], + pop: [100, 200, 100], + }, + [ + { slug: "gdp", color: "green", type: ColumnTypeNames.Numeric }, + { slug: "pop", color: "orange", type: ColumnTypeNames.Numeric }, + ] + ) + + const manager: SlopeChartManager = { + yColumnSlugs: ["gdp", "pop"], + table: table, + selection: ["usa"], + seriesStrategy: SeriesStrategy.column, + facetStrategy: FacetStrategy.entity, + canSelectMultipleEntities: true, + } + const chart = new SlopeChart({ manager }) + const series = chart.series + + expect(series).toHaveLength(2) + expect(series[0].color).toEqual("green") + expect(series[1].color).toEqual("orange") + }) + + it("doesn't use variable colors if 2 variables have single entities which are different", () => { + const table = new OwidTable( + { + entityName: ["usa", "usa", "canada", "canada"], + year: [2000, 2001, 2000, 2001], + gdp: [ + 100, + 200, + ErrorValueTypes.MissingValuePlaceholder, + ErrorValueTypes.MissingValuePlaceholder, + ], + pop: [ + ErrorValueTypes.MissingValuePlaceholder, + ErrorValueTypes.MissingValuePlaceholder, + 100, + 200, + ], + }, + [ + { slug: "gdp", color: "green", type: ColumnTypeNames.Numeric }, + { slug: "pop", color: "orange", type: ColumnTypeNames.Numeric }, + ] + ) + + const selection = new SelectionArray( + ["usa", "canada"], + [{ entityName: "usa" }, { entityName: "canada" }] + ) + const manager: SlopeChartManager = { + yColumnSlugs: ["gdp", "pop"], + table: table, + selection, + seriesStrategy: SeriesStrategy.column, + canSelectMultipleEntities: true, + } + const chart = new SlopeChart({ manager }) + const series = chart.series + + expect(series).toHaveLength(2) + expect(series[0].color).not.toEqual("green") + expect(series[1].color).not.toEqual("orange") + }) +}) diff --git a/packages/@ourworldindata/grapher/src/slopeCharts/SlopeChart.tsx b/packages/@ourworldindata/grapher/src/slopeCharts/SlopeChart.tsx index 60e49f80593..8949584092d 100644 --- a/packages/@ourworldindata/grapher/src/slopeCharts/SlopeChart.tsx +++ b/packages/@ourworldindata/grapher/src/slopeCharts/SlopeChart.tsx @@ -379,7 +379,7 @@ export class SlopeChart return new AxisConfig(this.manager.yAxisConfig, this) } - @computed private get allValues(): number[] { + @computed get allValues(): number[] { return this.series.flatMap((series) => [ series.startValue, series.endValue, From 378e6193cdc597c7daf0220190a0ab9ec057bd9c Mon Sep 17 00:00:00 2001 From: sophiamersmann Date: Thu, 28 Nov 2024 12:38:32 +0100 Subject: [PATCH 32/52] =?UTF-8?q?=E2=9C=A8=20(slope)=20drop=20entities=20f?= =?UTF-8?q?rom=20selector=20if=20time=20selection=20disabled?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../core-table/src/OwidTable.ts | 89 +++++ .../grapher/src/slopeCharts/SlopeChart.tsx | 11 + ....timestamp-1732790803730-c1bc0b6a7ecde.mjs | 351 ++++++++++++++++++ 3 files changed, 451 insertions(+) create mode 100644 vite.config-site.mts.timestamp-1732790803730-c1bc0b6a7ecde.mjs diff --git a/packages/@ourworldindata/core-table/src/OwidTable.ts b/packages/@ourworldindata/core-table/src/OwidTable.ts index 529aff908b1..234bdb733d4 100644 --- a/packages/@ourworldindata/core-table/src/OwidTable.ts +++ b/packages/@ourworldindata/core-table/src/OwidTable.ts @@ -325,6 +325,95 @@ export class OwidTable extends CoreTable { ) } + // Drop _all rows_ for an entity if all columns have at least one invalid or missing value for that entity. + dropEntitiesThatHaveSomeMissingOrErrorValueInAllColumns( + columnSlugs: ColumnSlug[] + ): this { + const indexesByEntityName = this.rowIndicesByEntityName + const uniqTimes = new Set(this.allTimes) + + // entity names to iterate over + const entityNamesToIterateOver = new Set(indexesByEntityName.keys()) + + // set of entities we want to keep + const entityNamesToKeep = new Set() + + // total number of entities + const entityCount = entityNamesToIterateOver.size + + // helper function to generate operation name + const makeOpName = (entityNamesToKeep: Set): string => { + const entityNamesToDrop = differenceOfSets([ + this.availableEntityNameSet, + entityNamesToKeep, + ]) + const droppedEntitiesStr = + entityNamesToDrop.size > 0 + ? [...entityNamesToDrop].join(", ") + : "(None)" + return `Drop entities that have some missing or error value in all column: ${columnSlugs.join(", ")}.\nDropped entities: ${droppedEntitiesStr}` + } + + // Optimization: if there is a column that has a valid data entry for + // every entity and every time, we are done + for (let i = 0; i <= columnSlugs.length; i++) { + const slug = columnSlugs[i] + const col = this.get(slug) + + if ( + col.numValues === entityCount * uniqTimes.size && + col.numErrorValues === 0 + ) { + const entityNamesToKeep = new Set(indexesByEntityName.keys()) + + return this.columnFilter( + this.entityNameSlug, + (rowEntityName) => + entityNamesToKeep.has(rowEntityName as string), + makeOpName(entityNamesToKeep) + ) + } + } + + for (let i = 0; i <= columnSlugs.length; i++) { + const slug = columnSlugs[i] + const col = this.get(slug) + + for (const entityName of entityNamesToIterateOver) { + const indicesForEntityName = indexesByEntityName.get(entityName) + if (!indicesForEntityName) + throw new Error("Unexpected: entity not found in index map") + + // Optimization: If the column is missing values for the entity, + // we know we can't make a decision yet, so we skip this entity + if (indicesForEntityName.length < uniqTimes.size) continue + + // Optimization: We don't care about the number of valid/error + // values, we just need to know if there is at least one invalid value + const hasSomeInvalidValueForEntityInCol = + indicesForEntityName.some( + (index) => + !isNotErrorValue( + col.valuesIncludingErrorValues[index] + ) + ) + + // Optimization: If all values are valid, we know we want to keep this entity, + // so we remove it from the entities to iterate over + if (!hasSomeInvalidValueForEntityInCol) { + entityNamesToKeep.add(entityName) + entityNamesToIterateOver.delete(entityName) + } + } + } + + return this.columnFilter( + this.entityNameSlug, + (rowEntityName) => entityNamesToKeep.has(rowEntityName as string), + makeOpName(entityNamesToKeep) + ) + } + private sumsByTime(columnSlug: ColumnSlug): Map { const timeValues = this.timeColumn.values const values = this.get(columnSlug).values as number[] diff --git a/packages/@ourworldindata/grapher/src/slopeCharts/SlopeChart.tsx b/packages/@ourworldindata/grapher/src/slopeCharts/SlopeChart.tsx index 8949584092d..74cc8addef9 100644 --- a/packages/@ourworldindata/grapher/src/slopeCharts/SlopeChart.tsx +++ b/packages/@ourworldindata/grapher/src/slopeCharts/SlopeChart.tsx @@ -79,6 +79,7 @@ type SVGMouseOrTouchEvent = export interface SlopeChartManager extends ChartManager { canSelectMultipleEntities?: boolean // used to pick an appropriate series name + hasTimeline?: boolean // used to filter the table for the entity selector } const TOP_PADDING = 6 // leave room for overflowing dots @@ -117,6 +118,16 @@ export class SlopeChart } transformTableForSelection(table: OwidTable): OwidTable { + // if time selection is disabled, then filter all entities that + // don't have data for the current time period + if (!this.manager.hasTimeline) { + table = table + .filterByTargetTimes([this.startTime, this.endTime]) + .dropEntitiesThatHaveSomeMissingOrErrorValueInAllColumns( + this.yColumnSlugs + ) + } + // if entities with partial data are not plotted, // make sure they don't show up in the entity selector if (this.missingDataStrategy === MissingDataStrategy.hide) { diff --git a/vite.config-site.mts.timestamp-1732790803730-c1bc0b6a7ecde.mjs b/vite.config-site.mts.timestamp-1732790803730-c1bc0b6a7ecde.mjs new file mode 100644 index 00000000000..9ef808f81c3 --- /dev/null +++ b/vite.config-site.mts.timestamp-1732790803730-c1bc0b6a7ecde.mjs @@ -0,0 +1,351 @@ +var __defProp = Object.defineProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; + +// site/viteUtils.tsx +import React from "file:///Users/sophia/code/owid/owid-grapher/node_modules/react/index.js"; + +// settings/findBaseDir.ts +import path from "path"; +import fs from "fs"; +function findProjectBaseDir(from) { + if (!fs.existsSync) return void 0; + let dir = path.dirname(from); + while (dir.length) { + if (fs.existsSync(path.resolve(dir, "package.json"))) return dir; + const parentDir = path.resolve(dir, ".."); + if (parentDir === dir) break; + else dir = parentDir; + } + return void 0; +} + +// site/viteUtils.tsx +import fs3 from "file:///Users/sophia/code/owid/owid-grapher/node_modules/fs-extra/lib/index.js"; + +// settings/serverSettings.ts +import path2 from "path"; +import dotenv2 from "file:///Users/sophia/code/owid/owid-grapher/node_modules/dotenv/lib/main.js"; +import fs2 from "fs"; +import ini from "file:///Users/sophia/code/owid/owid-grapher/node_modules/ini/lib/ini.js"; +import os from "os"; + +// settings/clientSettings.ts +var clientSettings_exports = {}; +__export(clientSettings_exports, { + ADMIN_BASE_URL: () => ADMIN_BASE_URL, + ADMIN_SERVER_HOST: () => ADMIN_SERVER_HOST, + ADMIN_SERVER_PORT: () => ADMIN_SERVER_PORT, + ALGOLIA_ID: () => ALGOLIA_ID, + ALGOLIA_INDEX_PREFIX: () => ALGOLIA_INDEX_PREFIX, + ALGOLIA_SEARCH_KEY: () => ALGOLIA_SEARCH_KEY, + BAKED_BASE_URL: () => BAKED_BASE_URL, + BAKED_GRAPHER_EXPORTS_BASE_URL: () => BAKED_GRAPHER_EXPORTS_BASE_URL, + BAKED_GRAPHER_URL: () => BAKED_GRAPHER_URL, + BAKED_SITE_EXPORTS_BASE_URL: () => BAKED_SITE_EXPORTS_BASE_URL, + BUGSNAG_API_KEY: () => BUGSNAG_API_KEY, + DATA_API_URL: () => DATA_API_URL, + DONATE_API_URL: () => DONATE_API_URL, + ENV: () => ENV, + ETL_API_URL: () => ETL_API_URL, + ETL_WIZARD_URL: () => ETL_WIZARD_URL, + EXPLORER_DYNAMIC_THUMBNAIL_URL: () => EXPLORER_DYNAMIC_THUMBNAIL_URL, + FEATURE_FLAGS: () => FEATURE_FLAGS, + FeatureFlagFeature: () => FeatureFlagFeature, + GDOCS_BASIC_ARTICLE_TEMPLATE_URL: () => GDOCS_BASIC_ARTICLE_TEMPLATE_URL, + GDOCS_CLIENT_EMAIL: () => GDOCS_CLIENT_EMAIL, + GDOCS_DETAILS_ON_DEMAND_ID: () => GDOCS_DETAILS_ON_DEMAND_ID, + GOOGLE_TAG_MANAGER_ID: () => GOOGLE_TAG_MANAGER_ID, + GRAPHER_DYNAMIC_CONFIG_URL: () => GRAPHER_DYNAMIC_CONFIG_URL, + GRAPHER_DYNAMIC_THUMBNAIL_URL: () => GRAPHER_DYNAMIC_THUMBNAIL_URL, + IMAGE_HOSTING_R2_BUCKET_PATH: () => IMAGE_HOSTING_R2_BUCKET_PATH, + IMAGE_HOSTING_R2_BUCKET_SUBFOLDER_PATH: () => IMAGE_HOSTING_R2_BUCKET_SUBFOLDER_PATH, + IMAGE_HOSTING_R2_CDN_URL: () => IMAGE_HOSTING_R2_CDN_URL, + MULTI_DIM_DYNAMIC_CONFIG_URL: () => MULTI_DIM_DYNAMIC_CONFIG_URL, + PUBLISHED_AT_FORMAT: () => PUBLISHED_AT_FORMAT, + RECAPTCHA_SITE_KEY: () => RECAPTCHA_SITE_KEY, + SENTRY_DSN: () => SENTRY_DSN, + TOPICS_CONTENT_GRAPH: () => TOPICS_CONTENT_GRAPH +}); +import dotenv from "file:///Users/sophia/code/owid/owid-grapher/node_modules/dotenv/lib/main.js"; +import { parseIntOrUndefined } from "file:///Users/sophia/code/owid/owid-grapher/packages/@ourworldindata/utils/dist/index.js"; +var __vite_injected_original_dirname2 = "/Users/sophia/code/owid/owid-grapher/settings"; +if (typeof __vite_injected_original_dirname2 !== "undefined") { + const baseDir2 = findProjectBaseDir(__vite_injected_original_dirname2); + if (baseDir2) dotenv.config({ path: `${baseDir2}/.env` }); +} +var ENV = process.env.ENV === "production" ? "production" : "development"; +var BUGSNAG_API_KEY = process.env.BUGSNAG_API_KEY; +var SENTRY_DSN = process.env.SENTRY_DSN; +var ADMIN_SERVER_PORT = parseIntOrUndefined(process.env.ADMIN_SERVER_PORT) ?? 3030; +var ADMIN_SERVER_HOST = process.env.ADMIN_SERVER_HOST ?? "localhost"; +var BAKED_BASE_URL = process.env.BAKED_BASE_URL ?? `http://${ADMIN_SERVER_HOST}:${ADMIN_SERVER_PORT}`; +var BAKED_GRAPHER_URL = process.env.BAKED_GRAPHER_URL ?? `${BAKED_BASE_URL}/grapher`; +var BAKED_GRAPHER_EXPORTS_BASE_URL = process.env.BAKED_GRAPHER_EXPORTS_BASE_URL ?? `${BAKED_GRAPHER_URL}/exports`; +var BAKED_SITE_EXPORTS_BASE_URL = process.env.BAKED_SITE_EXPORTS_BASE_URL ?? `${BAKED_BASE_URL}/exports`; +var GRAPHER_DYNAMIC_THUMBNAIL_URL = process.env.GRAPHER_DYNAMIC_THUMBNAIL_URL ?? `${BAKED_GRAPHER_URL}`; +var EXPLORER_DYNAMIC_THUMBNAIL_URL = process.env.EXPLORER_DYNAMIC_THUMBNAIL_URL ?? `${BAKED_BASE_URL}/explorers`; +var GRAPHER_DYNAMIC_CONFIG_URL = process.env.GRAPHER_DYNAMIC_CONFIG_URL ?? `${BAKED_GRAPHER_URL}`; +var MULTI_DIM_DYNAMIC_CONFIG_URL = process.env.MULTI_DIM_DYNAMIC_CONFIG_URL ?? `${BAKED_BASE_URL}/multi-dim`; +var ADMIN_BASE_URL = process.env.ADMIN_BASE_URL ?? `http://${ADMIN_SERVER_HOST}:${ADMIN_SERVER_PORT}`; +var DATA_API_URL = process.env.DATA_API_URL ?? "https://api.ourworldindata.org/v1/indicators/"; +var ALGOLIA_ID = process.env.ALGOLIA_ID ?? ""; +var ALGOLIA_SEARCH_KEY = process.env.ALGOLIA_SEARCH_KEY ?? ""; +var ALGOLIA_INDEX_PREFIX = process.env.ALGOLIA_INDEX_PREFIX ?? ""; +var DONATE_API_URL = process.env.DONATE_API_URL ?? "http://localhost:8788/donation/donate"; +var RECAPTCHA_SITE_KEY = process.env.RECAPTCHA_SITE_KEY ?? "6LcJl5YUAAAAAATQ6F4vl9dAWRZeKPBm15MAZj4Q"; +var GOOGLE_TAG_MANAGER_ID = process.env.GOOGLE_TAG_MANAGER_ID ?? ""; +var TOPICS_CONTENT_GRAPH = process.env.TOPICS_CONTENT_GRAPH === "true"; +var GDOCS_CLIENT_EMAIL = process.env.GDOCS_CLIENT_EMAIL ?? ""; +var GDOCS_BASIC_ARTICLE_TEMPLATE_URL = process.env.GDOCS_BASIC_ARTICLE_TEMPLATE_URL ?? ""; +var IMAGE_HOSTING_R2_CDN_URL = process.env.IMAGE_HOSTING_R2_CDN_URL || ""; +var IMAGE_HOSTING_R2_BUCKET_PATH = process.env.IMAGE_HOSTING_R2_BUCKET_PATH || ""; +var IMAGE_HOSTING_R2_BUCKET_SUBFOLDER_PATH = IMAGE_HOSTING_R2_BUCKET_PATH.slice( + IMAGE_HOSTING_R2_BUCKET_PATH.indexOf("/") + 1 +); +var ETL_WIZARD_URL = process.env.ETL_WIZARD_URL ?? `http://${ADMIN_SERVER_HOST}:8053/`; +var ETL_API_URL = process.env.ETL_API_URL ?? `http://${ADMIN_SERVER_HOST}:8081/api/v1`; +var GDOCS_DETAILS_ON_DEMAND_ID = process.env.GDOCS_DETAILS_ON_DEMAND_ID ?? ""; +var PUBLISHED_AT_FORMAT = "ddd, MMM D, YYYY HH:mm"; +var FeatureFlagFeature = /* @__PURE__ */ ((FeatureFlagFeature2) => { + FeatureFlagFeature2["MultiDimDataPage"] = "MultiDimDataPage"; + return FeatureFlagFeature2; +})(FeatureFlagFeature || {}); +var featureFlagsRaw = typeof process.env.FEATURE_FLAGS === "string" && process.env.FEATURE_FLAGS.trim()?.split(",") || []; +var FEATURE_FLAGS = new Set( + Object.keys(FeatureFlagFeature).filter( + (key) => featureFlagsRaw.includes(key) + ) +); + +// settings/serverSettings.ts +import { parseIntOrUndefined as parseIntOrUndefined2 } from "file:///Users/sophia/code/owid/owid-grapher/packages/@ourworldindata/utils/dist/index.js"; +var __vite_injected_original_dirname3 = "/Users/sophia/code/owid/owid-grapher/settings"; +var baseDir = findProjectBaseDir(__vite_injected_original_dirname3); +if (baseDir === void 0) throw new Error("could not locate base package.json"); +dotenv2.config({ path: `${baseDir}/.env` }); +var serverSettings = process.env ?? {}; +var BASE_DIR = baseDir; +var DATA_API_FOR_ADMIN_UI = serverSettings.DATA_API_FOR_ADMIN_UI; +var BAKED_BASE_URL2 = BAKED_BASE_URL; +var VITE_PREVIEW = serverSettings.VITE_PREVIEW === "true"; +var ADMIN_BASE_URL2 = ADMIN_BASE_URL; +var BAKED_GRAPHER_URL2 = serverSettings.BAKED_GRAPHER_URL ?? `${BAKED_BASE_URL2}/grapher`; +var OPTIMIZE_SVG_EXPORTS = serverSettings.OPTIMIZE_SVG_EXPORTS === "true"; +var GITHUB_USERNAME = serverSettings.GITHUB_USERNAME ?? "owid-test"; +var GIT_DEFAULT_USERNAME = serverSettings.GIT_DEFAULT_USERNAME ?? "Our World in Data"; +var GIT_DEFAULT_EMAIL = serverSettings.GIT_DEFAULT_EMAIL ?? "info@ourworldindata.org"; +var BUGSNAG_API_KEY2 = serverSettings.BUGSNAG_API_KEY; +var BUGSNAG_NODE_API_KEY = serverSettings.BUGSNAG_NODE_API_KEY; +var BLOG_POSTS_PER_PAGE = parseIntOrUndefined2(serverSettings.BLOG_POSTS_PER_PAGE) ?? 21; +var BLOG_SLUG = serverSettings.BLOG_SLUG ?? "latest"; +var GRAPHER_DB_NAME = serverSettings.GRAPHER_DB_NAME ?? "owid"; +var GRAPHER_DB_USER = serverSettings.GRAPHER_DB_USER ?? "root"; +var GRAPHER_DB_PASS = serverSettings.GRAPHER_DB_PASS ?? ""; +var GRAPHER_DB_HOST = serverSettings.GRAPHER_DB_HOST ?? "localhost"; +var GRAPHER_DB_PORT = parseIntOrUndefined2(serverSettings.GRAPHER_DB_PORT) ?? 3306; +var GRAPHER_TEST_DB_NAME = serverSettings.GRAPHER_TEST_DB_NAME ?? "owid"; +var GRAPHER_TEST_DB_USER = serverSettings.GRAPHER_TEST_DB_USER ?? "root"; +var GRAPHER_TEST_DB_PASS = serverSettings.GRAPHER_TEST_DB_PASS ?? ""; +var GRAPHER_TEST_DB_HOST = serverSettings.GRAPHER_TEST_DB_HOST ?? "localhost"; +var GRAPHER_TEST_DB_PORT = parseIntOrUndefined2(serverSettings.GRAPHER_TEST_DB_PORT) ?? 3306; +var BAKED_SITE_DIR = serverSettings.BAKED_SITE_DIR ?? path2.resolve(BASE_DIR, "bakedSite"); +var SECRET_KEY = serverSettings.SECRET_KEY ?? "fejwiaof jewiafo jeioa fjieowajf isa fjidosajfgj"; +var SESSION_COOKIE_AGE = parseIntOrUndefined2(serverSettings.SESSION_COOKIE_AGE) ?? 1209600; +var ALGOLIA_SECRET_KEY = serverSettings.ALGOLIA_SECRET_KEY ?? ""; +var ALGOLIA_INDEXING = serverSettings.ALGOLIA_INDEXING === "true"; +var HTTPS_ONLY = serverSettings.HTTPS_ONLY !== "false"; +var GIT_DATASETS_DIR = serverSettings.GIT_DATASETS_DIR ?? `${BASE_DIR}/datasetsExport`; +var TMP_DIR = serverSettings.TMP_DIR ?? "/tmp"; +var UNCATEGORIZED_TAG_ID = parseIntOrUndefined2(serverSettings.UNCATEGORIZED_TAG_ID) ?? 375; +var BAKE_ON_CHANGE = serverSettings.BAKE_ON_CHANGE === "true"; +var DEPLOY_QUEUE_FILE_PATH = serverSettings.DEPLOY_QUEUE_FILE_PATH ?? `${BASE_DIR}/.queue`; +var DEPLOY_PENDING_FILE_PATH = serverSettings.DEPLOY_PENDING_FILE_PATH ?? `${BASE_DIR}/.pending`; +var CLOUDFLARE_AUD = serverSettings.CLOUDFLARE_AUD ?? ""; +var CATALOG_PATH = serverSettings.CATALOG_PATH ?? ""; +var GDOCS_PRIVATE_KEY = (serverSettings.GDOCS_PRIVATE_KEY ?? "").replaceAll('"', "").replaceAll("'", ""); +var GDOCS_CLIENT_ID = serverSettings.GDOCS_CLIENT_ID ?? ""; +var GDOCS_BACKPORTING_TARGET_FOLDER = serverSettings.GDOCS_BACKPORTING_TARGET_FOLDER ?? ""; +var GDOCS_IMAGES_BACKPORTING_TARGET_FOLDER = serverSettings.GDOCS_IMAGES_BACKPORTING_TARGET_FOLDER ?? ""; +var GDOCS_DONATE_FAQS_DOCUMENT_ID = serverSettings.GDOCS_DONATE_FAQS_DOCUMENT_ID ?? "194PNSFjgSlt9Zm5xYuDOF0l_GLKZbVxH2co3zCok_cE"; +var GDOCS_SHARED_DRIVE_ID = serverSettings.GDOCS_SHARED_DRIVE_ID ?? ""; +var GDOCS_DETAILS_ON_DEMAND_ID2 = serverSettings.GDOCS_DETAILS_ON_DEMAND_ID ?? ""; +var rcloneConfig = {}; +var rcloneConfigPath = path2.join(os.homedir(), ".config/rclone/rclone.conf"); +if (fs2.existsSync(rcloneConfigPath)) { + rcloneConfig = ini.parse(fs2.readFileSync(rcloneConfigPath, "utf-8")); +} +var IMAGE_HOSTING_R2_CDN_URL2 = serverSettings.IMAGE_HOSTING_R2_CDN_URL || ""; +var IMAGE_HOSTING_R2_BUCKET_PATH2 = serverSettings.IMAGE_HOSTING_R2_BUCKET_PATH || ""; +var IMAGE_HOSTING_R2_BUCKET_SUBFOLDER_PATH2 = IMAGE_HOSTING_R2_BUCKET_PATH2.slice( + IMAGE_HOSTING_R2_BUCKET_PATH2.indexOf("/") + 1 +); +var R2_ENDPOINT = serverSettings.R2_ENDPOINT || rcloneConfig["owid-r2"]?.endpoint || "https://078fcdfed9955087315dd86792e71a7e.r2.cloudflarestorage.com"; +var R2_ACCESS_KEY_ID = serverSettings.R2_ACCESS_KEY_ID || rcloneConfig["owid-r2"]?.access_key_id || ""; +var R2_SECRET_ACCESS_KEY = serverSettings.R2_SECRET_ACCESS_KEY || rcloneConfig["owid-r2"]?.secret_access_key || ""; +var R2_REGION = serverSettings.R2_REGION || rcloneConfig["owid-r2"]?.region || "auto"; +var GRAPHER_CONFIG_R2_BUCKET = serverSettings.GRAPHER_CONFIG_R2_BUCKET; +var GRAPHER_CONFIG_R2_BUCKET_PATH = serverSettings.GRAPHER_CONFIG_R2_BUCKET_PATH; +var BUILDKITE_API_ACCESS_TOKEN = serverSettings.BUILDKITE_API_ACCESS_TOKEN ?? ""; +var BUILDKITE_DEPLOY_CONTENT_PIPELINE_SLUG = serverSettings.BUILDKITE_DEPLOY_CONTENT_PIPELINE_SLUG || "owid-deploy-content-master"; +var BUILDKITE_BRANCH = serverSettings.BUILDKITE_BRANCH || "master"; +var BUILDKITE_DEPLOY_CONTENT_SLACK_CHANNEL = serverSettings.BUILDKITE_DEPLOY_CONTENT_SLACK_CHANNEL || "C06EWA0DK4H"; +var OPENAI_API_KEY = serverSettings.OPENAI_API_KEY ?? ""; +var SLACK_BOT_OAUTH_TOKEN = serverSettings.SLACK_BOT_OAUTH_TOKEN ?? ""; +var LEGACY_WORDPRESS_IMAGE_URL = serverSettings.LEGACY_WORDPRESS_IMAGE_URL ?? "https://assets.ourworldindata.org/uploads"; +var ENV_IS_STAGING = ADMIN_BASE_URL2.includes( + "http://staging-site" +); + +// site/SiteConstants.ts +import { faRss } from "file:///Users/sophia/code/owid/owid-grapher/node_modules/@fortawesome/free-solid-svg-icons/index.mjs"; +import { + faXTwitter, + faFacebookSquare, + faInstagram, + faThreads, + faLinkedin, + faBluesky +} from "file:///Users/sophia/code/owid/owid-grapher/node_modules/@fortawesome/free-brands-svg-icons/index.mjs"; +var polyfillFeatures = [ + "es2021", + // String.replaceAll, Promise.any, ... + "es2022", + // Array.at, String.at, ... + "es2023", + // Array.findLast, Array.toReversed, Array.toSorted, Array.with, ... + "IntersectionObserver", + "IntersectionObserverEntry" +]; +var POLYFILL_VERSION = "4.8.0"; +var POLYFILL_URL = `https://cdnjs.cloudflare.com/polyfill/v3/polyfill.min.js?version=${POLYFILL_VERSION}&features=${polyfillFeatures.join( + "," +)}`; +var DATA_INSIGHTS_ATOM_FEED_NAME = "atom-data-insights.xml"; +var DATA_INSIGHT_ATOM_FEED_PROPS = { + title: "Atom feed for Daily Data Insights", + href: `https://ourworldindata.org/${DATA_INSIGHTS_ATOM_FEED_NAME}` +}; +var RSS_FEEDS = [ + { + title: "Research & Writing RSS Feed", + url: "/atom.xml", + icon: faRss + }, + { + title: "Daily Data Insights RSS Feed", + url: `/${DATA_INSIGHTS_ATOM_FEED_NAME}`, + icon: faRss + } +]; + +// site/viteUtils.tsx +import { sortBy } from "file:///Users/sophia/code/owid/owid-grapher/packages/@ourworldindata/utils/dist/index.js"; +import urljoin from "file:///Users/sophia/code/owid/owid-grapher/node_modules/url-join/lib/url-join.js"; +var VITE_DEV_URL = process.env.VITE_DEV_URL ?? "http://localhost:8090"; +var VITE_ASSET_SITE_ENTRY = "site/owid.entry.ts"; +var VITE_ASSET_ADMIN_ENTRY = "adminSiteClient/admin.entry.ts"; +var VITE_ENTRYPOINT_INFO = { + ["site" /* Site */]: { + entryPointFile: VITE_ASSET_SITE_ENTRY, + outDir: "assets", + outName: "owid" + }, + ["admin" /* Admin */]: { + entryPointFile: VITE_ASSET_ADMIN_ENTRY, + outDir: "assets-admin", + outName: "admin" + } +}; + +// vite.config-common.mts +import { defineConfig } from "file:///Users/sophia/code/owid/owid-grapher/node_modules/vite/dist/node/index.js"; +import pluginReact from "file:///Users/sophia/code/owid/owid-grapher/node_modules/@vitejs/plugin-react/dist/index.mjs"; +import pluginChecker from "file:///Users/sophia/code/owid/owid-grapher/node_modules/vite-plugin-checker/dist/esm/main.js"; +var defineViteConfigForEntrypoint = (entrypoint) => { + const entrypointInfo = VITE_ENTRYPOINT_INFO[entrypoint]; + return defineConfig({ + publicDir: false, + // don't copy public folder to dist + resolve: { + // prettier-ignore + alias: { + "@ourworldindata/grapher/src": "@ourworldindata/grapher/src", + // need this for imports of @ourworldindata/grapher/src/core/grapher.scss to work + // we alias to the packages source files in dev and prod: + // this means we get instant dev updates when we change one of them, + // and the prod build builds them all as esm modules, which helps with tree shaking + // Idea from https://github.com/LinusBorg/vue-lib-template/blob/3775e49b20a7c3349dd49321cad2ed7f9d575057/packages/playground/vite.config.ts + "@ourworldindata/components": "@ourworldindata/components/src/index.ts", + "@ourworldindata/core-table": "@ourworldindata/core-table/src/index.ts", + "@ourworldindata/explorer": "@ourworldindata/explorer/src/index.ts", + "@ourworldindata/grapher": "@ourworldindata/grapher/src/index.ts", + "@ourworldindata/types": "@ourworldindata/types/src/index.ts", + "@ourworldindata/utils": "@ourworldindata/utils/src/index.ts" + } + }, + css: { + devSourcemap: true + }, + define: { + // Replace all clientSettings with their respective values, i.e. assign e.g. BUGSNAG_API_KEY to process.env.BUGSNAG_API_KEY + // it's important to note that we only expose values that are present in the clientSettings file - not any other things that are stored in .env + ...Object.fromEntries( + Object.entries(clientSettings_exports).map(([key, value]) => [ + `process.env.${key}`, + JSON.stringify(value) + ]) + ) + }, + build: { + manifest: true, + // creates a manifest.json file, which we use to determine which files to load in prod + emptyOutDir: true, + outDir: `dist/${entrypointInfo.outDir}`, + sourcemap: true, + target: ["chrome80", "firefox78", "safari13.1"], + // see docs/browser-support.md + rollupOptions: { + input: { + [entrypointInfo.outName]: entrypointInfo.entryPointFile + }, + output: { + assetFileNames: `${entrypointInfo.outName}.css`, + entryFileNames: `${entrypointInfo.outName}.mjs` + } + } + }, + plugins: [ + pluginReact({ + babel: { + parserOpts: { + plugins: ["decorators-legacy"] + // needed so mobx decorators work correctly + } + } + }), + pluginChecker({ + typescript: { + buildMode: true, + tsconfigPath: "tsconfig.vite-checker.json" + } + }) + ], + server: { + port: 8090, + warmup: { clientFiles: [VITE_ASSET_SITE_ENTRY] } + }, + preview: { + port: 8090 + } + }); +}; + +// vite.config-site.mts +var vite_config_site_default = defineViteConfigForEntrypoint("site" /* Site */); +export { + vite_config_site_default as default +}; +//# sourceMappingURL=data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jcmlwdCxcbiAgICAgICAgICAgIDxzY3JpcHRcbiAgICAgICAgICAgICAgICBrZXk9XCJ2aXRlLXJlYWN0LXByZWFtYmxlXCIgLy8gaHR0cHM6Ly92aXRlanMuZGV2L2d1aWRlL2JhY2tlbmQtaW50ZWdyYXRpb24uaHRtbFxuICAgICAgICAgICAgICAgIHR5cGU9XCJtb2R1bGVcIlxuICAgICAgICAgICAgICAgIGRhbmdlcm91c2x5U2V0SW5uZXJIVE1MPXt7XG4gICAgICAgICAgICAgICAgICAgIF9faHRtbDogYGltcG9ydCBSZWZyZXNoUnVudGltZSBmcm9tICcke2Jhc2VVcmx9L0ByZWFjdC1yZWZyZXNoJ1xuICBSZWZyZXNoUnVudGltZS5pbmplY3RJbnRvR2xvYmFsSG9vayh3aW5kb3cpXG4gIHdpbmRvdy4kUmVmcmVzaFJlZyQgPSAoKSA9PiB7fVxuICB3aW5kb3cuJFJlZnJlc2hTaWckID0gKCkgPT4gKHR5cGUpID0+IHR5cGVcbiAgd2luZG93Ll9fdml0ZV9wbHVnaW5fcmVhY3RfcHJlYW1ibGVfaW5zdGFsbGVkX18gPSB0cnVlYCxcbiAgICAgICAgICAgICAgICB9fVxuICAgICAgICAgICAgLz4sXG4gICAgICAgICAgICA8c2NyaXB0XG4gICAgICAgICAgICAgICAga2V5PVwidml0ZS1wbHVnaW4tY2hlY2tlclwiXG4gICAgICAgICAgICAgICAgdHlwZT1cIm1vZHVsZVwiXG4gICAgICAgICAgICAgICAgc3JjPXtgJHtiYXNlVXJsfS9Adml0ZS1wbHVnaW4tY2hlY2tlci1ydW50aW1lLWVudHJ5YH1cbiAgICAgICAgICAgIC8+LFxuICAgICAgICAgICAgPHNjcmlwdFxuICAgICAgICAgICAgICAgIGtleT1cInZpdGUtY2xpZW50XCJcbiAgICAgICAgICAgICAgICB0eXBlPVwibW9kdWxlXCJcbiAgICAgICAgICAgICAgICBzcmM9e2Ake2Jhc2VVcmx9L0B2aXRlL2NsaWVudGB9XG4gICAgICA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1lbnRbXVxuXG4gICAgICAgIGlmICghbWFuaWZlc3RFbnRyeSAmJiAhZW50cnkuZW5kc1dpdGgoXCIuY3NzXCIpKVxuICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKGBDb3VsZCBub3QgZmluZCBtYW5pZmVzdCBlbnRyeSBmb3IgJHtlbnRyeX1gKVxuXG4gICAgICAgIGNvbnN0IGFzc2V0VXJsID0gdXJsam9pbihhc3NldEJhc2VVcmwsIG1hbmlmZXN0RW50cnk/LmZpbGUgPz8gZW50cnkpXG5cbiAgICAgICAgaWYgKGVudHJ5LmVuZHNXaXRoKFwiLmNzc1wiKSkge1xuICAgICAgICAgICAgYXNzZXRzID0gW1xuICAgICAgICAgICAgICAgIC4uLmFzc2V0cyxcbiAgICAgICAgICAgICAgICA8bGlua1xuICAgICAgICAgICAgICAgICAgICBrZXk9e2Ake2VudHJ5fS1wcmVsb2FkYH1cbiAgICAgICAgICAgICAgICAgICAgcmVsPVwicHJlbG9hZFwiXG4gICAgICAgICAgICAgICAgICAgIGhyZWY9e2Fzc2V0VXJsfVxuICAgICAgICAgICAgICAgICAgICBhcz1cInN0eWxlXCJcbiAgICAgICAgICAgICAgICAvPixcbiAgICAgICAgICAgICAgICA8bGluayBrZXk9e2VudHJ5fSByZWw9XCJzdHlsZXNoZWV0XCIgaHJlZj17YXNzZXRVcmx9IC8+LFxuICAgICAgICAgICAgXVxuICAgICAgICB9IGVsc2UgaWYgKGVudHJ5Lm1hdGNoKC9cXC5bY21dPyhqc3xqc3h8dHN8dHN4KSQvKSkge1xuICAgICAgICAgICAgLy8gZXhwbGljaXRseSByZWZlcmVuY2UgdGhlIGVudHJ5OyBwcmVsb2FkIGl0IGFuZCBpdHMgZGVwZW5kZW5jaWVzXG4gICAgICAgICAgICBpZiAobWFuaWZlc3RFbnRyeT8uaXNFbnRyeSkge1xuICAgICAgICAgICAgICAgIGFzc2V0cyA9IFtcbiAgICAgICAgICAgICAgICAgICAgLi4uYXNzZXRzLFxuICAgICAgICAgICAgICAgICAgICA8c2NyaXB0XG4gICAgICAgICAgICAgICAgICAgICAgICBrZXk9e2VudHJ5fVxuICAgICAgICAgICAgICAgICAgICAgICAgdHlwZT1cIm1vZHVsZVwiXG4gICAgICAgICAgICAgICAgICAgICAgICBzcmM9e2Fzc2V0VXJsfVxuICAgICAgICAgICAgICAgICAgICAgICAgZGF0YS1hdHRhY2gtb3dpZC1lcnJvci1oYW5kbGVyXG4gICAgICAgICAgICAgICAgICAgIC8+LFxuICAgICAgICAgICAgICAgIF1cbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgYXNzZXRzID0gW1xuICAgICAgICAgICAgICAgIC4uLmFzc2V0cyxcbiAgICAgICAgICAgICAgICA8bGlua1xuICAgICAgICAgICAgICAgICAgICBrZXk9e2Ake2VudHJ5fS1wcmVsb2FkYH1cbiAgICAgICAgICAgICAgICAgICAgcmVsPVwibW9kdWxlcHJlbG9hZFwiIC8vIHNlZSBodHRwczovL2RldmVsb3Blci5jaHJvbWUuY29tL2Jsb2cvbW9kdWxlcHJlbG9hZC9cbiAgICAgICAgICAgICAgICAgICAgaHJlZj17YXNzZXRVcmx9XG4gICAgICAgICAgICAgICAgLz4sXG4gICAgICAgICAgICBdXG4gICAgICAgIH1cblxuICAgICAgICAvLyB3ZSBuZWVkIHRvIHJlY3Vyc2UgaW50byBib3RoIHRoZSBtb2R1bGUgaW1wb3J0cyBhbmQgaW1wb3J0ZWQgY3NzIGZpbGVzLCBhbmQgYWRkIHRhZ3MgZm9yIHRoZW0gYXMgd2VsbFxuICAgICAgICAvLyBhbHNvLCB3ZSBuZWVkIHRvIHRha2UgY2FyZSBvZiB0aGUgb3JkZXIgaGVyZSwgc28gdGhlIGltcG9ydGVkIGZpbGUgaXMgbG9hZGVkIGJlZm9yZSB0aGUgaW1wb3J0aW5nIGZpbGVcbiAgICAgICAgaWYgKG1hbmlmZXN0RW50cnk/LmNzcykge1xuICAgICAgICAgICAgYXNzZXRzID0gWy4uLm1hbmlm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FxuICAgICAgICAgICAgICAgIFwiQG91cndvcmxkaW5kYXRhL2dyYXBoZXJcIjogXCJAb3Vyd29ybGRpbmRhdGEvZ3JhcGhlci9zcmMvaW5kZXgudHNcIixcbiAgICAgICAgICAgICAgICBcIkBvdXJ3b3JsZGluZGF0YS90eXBlc1wiOiBcIkBvdXJ3b3JsZGluZGF0YS90eXBlcy9zcmMvaW5kZXgudHNcIixcbiAgICAgICAgICAgICAgICBcIkBvdXJ3b3JsZGluZGF0YS91dGlsc1wiOiBcIkBvdXJ3b3JsZGluZGF0YS91dGlscy9zcmMvaW5kZXgudHNcIixcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0sXG4gICAgICAgIGNzczoge1xuICAgICAgICAgICAgZGV2U291cmNlbWFwOiB0cnVlLFxuICAgICAgICB9LFxuICAgICAgICBkZWZpbmU6IHtcbiAgICAgICAgICAgIC8vIFJlcGxhY2UgYWxsIGNsaWVudFNldHRpbmdzIHdpdGggdGhlaXIgcmVzcGVjdGl2ZSB2YWx1ZXMsIGkuZS4gYXNzaWduIGUuZy4gQlVHU05BR19BUElfS0VZIHRvIHByb2Nlc3MuZW52LkJVR1NOQUdfQVBJX0tFWVxuICAgICAgICAgICAgLy8gaXQncyBpbXBvcnRhbnQgdG8gbm90ZSB0aGF0IHdlIG9ubHkgZXhwb3NlIHZhbHVlcyB0aGF0IGFyZSBwcmVzZW50IGluIHRoZSBjbGllbnRTZXR0aW5ncyBmaWxlIC0gbm90IGFueSBvdGhlciB0aGluZ3MgdGhhdCBhcmUgc3RvcmVkIGluIC5lbnZcbiAgICAgICAgICAgIC4uLk9iamVjdC5mcm9tRW50cmllcyhcbiAgICAgICAgICAgICAgICBPYmplY3QuZW50cmllcyhjbGllbnRTZXR0aW5ncykubWFwKChba2V5LCB2YWx1ZV0pID0+IFtcbiAgICAgICAgICAgICAgICAgICAgYHByb2Nlc3MuZW52LiR7a2V5fWAsXG4gICAgICAgICAgICAgICAgICAgIEpTT04uc3RyaW5naWZ5KHZhbHVlKSxcbiAgICAgICAgICAgICAgICBdKVxuICAgICAgICAgICAgKSxcbiAgICAgICAgfSxcbiAgICAgICAgYnVpbGQ6IHtcbiAgICAgICAgICAgIG1hbmlmZXN0OiB0cnVlLCAvLyBjcmVhdGVzIGEgbWFuaWZlc3QuanNvbiBmaWxlLCB3aGljaCB3ZSB1c2UgdG8gZGV0ZXJtaW5lIHdoaWNoIGZpbGVzIHRvIGxvYWQgaW4gcHJvZFxuICAgICAgICAgICAgZW1wdHlPdXREaXI6IHRydWUsXG4gICAgICAgICAgICBvdXREaXI6IGBkaXN0LyR7ZW50cnlwb2ludEluZm8ub3V0RGlyfWAsXG4gICAgICAgICAgICBzb3VyY2VtYXA6IHRydWUsXG4gICAgICAgICAgICB0YXJnZXQ6IFtcImNocm9tZTgwXCIsIFwiZmlyZWZveDc4XCIsIFwic2FmYXJpMTMuMVwiXSwgLy8gc2VlIGRvY3MvYnJvd3Nlci1zdXBwb3J0Lm1kXG4gICAgICAgICAgICByb2xsdXBPcHRpb25zOiB7XG4gICAgICAgICAgICAgICAgaW5wdXQ6IHtcbiAgICAgICAgICAgICAgICAgICAgW2VudHJ5cG9pbnRJbmZvLm91dE5hbWVdOiBlbnRyeXBvaW50SW5mby5lbnRyeVBvaW50RmlsZSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIG91dHB1dDoge1xuICAgICAgICAgICAgICAgICAgICBhc3NldEZpbGVOYW1lczogYCR7ZW50cnlwb2ludEluZm8ub3V0TmFtZX0uY3NzYCxcbiAgICAgICAgICAgICAgICAgICAgZW50cnlGaWxlTmFtZXM6IGAke2VudHJ5cG9pbnRJbmZvLm91dE5hbWV9Lm1qc2AsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0sXG4gICAgICAgIHBsdWdpbnM6IFtcbiAgICAgICAgICAgIHBsdWdpblJlYWN0KHtcbiAgICAgICAgICAgICAgICBiYWJlbDoge1xuICAgICAgICAgICAgICAgICAgICBwYXJzZXJPcHRzOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICBwbHVnaW5zOiBbXCJkZWNvcmF0b3JzLWxlZ2FjeVwiXSwgLy8gbmVlZGVkIHNvIG1vYnggZGVjb3JhdG9ycyB3b3JrIGNvcnJlY3RseVxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9KSxcbiAgICAgICAgICAgIHBsdWdpbkNoZWNrZXIoe1xuICAgICAgICAgICAgICAgIHR5cGVzY3JpcHQ6IHtcbiAgICAgICAgICAgICAgICAgICAgYnVpbGRNb2RlOiB0cnVlLFxuICAgICAgICAgICAgICAgICAgICB0c2NvbmZpZ1BhdGg6IFwidHNjb25maWcudml0ZS1jaGVja2VyLmpzb25cIixcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSksXG4gICAgICAgIF0sXG4gICAgICAgIHNlcnZlcjoge1xuICAgICAgICAgICAgcG9ydDogODA5MCxcbiAgICAgICAgICAgIHdhcm11cDogeyBjbGllbnRGaWxlczogW1ZJVEVfQVNTRVRfU0lURV9FTlRSWV0gfSxcbiAgICAgICAgfSxcbiAgICAgICAgcHJldmlldzoge1xuICAgICAgICAgICAgcG9ydDogODA5MCxcbiAgICAgICAgfSxcbiAgICB9KVxufVxuIiwgImNvbnN0IF9fdml0ZV9pbmplY3RlZF9vcmlnaW5hbF9kaXJuYW1lID0gXCIvVXNlcnMvc29waGlhL2NvZGUvb3dpZC9vd2lkLWdyYXBoZXJcIjtjb25zdCBfX3ZpdGVfaW5qZWN0ZWRfb3JpZ2luYWxfZmlsZW5hbWUgPSBcIi9Vc2Vycy9zb3BoaWEvY29kZS9vd2lkL293aWQtZ3JhcGhlci92aXRlLmNvbmZpZy1zaXRlLm10c1wiO2NvbnN0IF9fdml0ZV9pbmplY3RlZF9vcmlnaW5hbF9pbXBvcnRfbWV0YV91cmwgPSBcImZpbGU6Ly8vVXNlcnMvc29waG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yJmcyIsICJwYXRoIiwgImRvdGVudiIsICJmcyIsICJfX3ZpdGVfaW5qZWN0ZWRfb3JpZ2luYWxfZGlybmFtZSIsICJfX3ZpdGVfaW5qZWN0ZWRfb3JpZ2luYWxfZGlybmFtZSIsICJiYXNlRGlyIiwgIkZlYXR1cmVGbGFnRmVhdHVyZSIsICJwYXJzZUludE9yVW5kZWZpbmVkIiwgIl9fdml0ZV9pbmplY3RlZF9vcmlnaW5hbF9kaXJuYW1lIiwgIl9fdml0ZV9pbmplY3RlZF9vcmlnaW5hbF9kaXJuYW1lIiwgImRvdGVudiIsICJCQUtFRF9CQVNFX1VSTCIsICJBRE1JTl9CQVNFX1VSTCIsICJCQUtFRF9HUkFQSEVSX1VSTCIsICJCVUdTTkFHX0FQSV9LRVkiLCAicGFyc2VJbnRPclVuZGVmaW5lZCIsICJwYXRoIiwgIkdET0NTX0RFVEFJTFNfT05fREVNQU5EX0lEIiwgInBhdGgiLCAiZnMiLCAiSU1BR0VfSE9TVElOR19SMl9DRE5fVVJMIiwgIklNQUdFX0hPU1RJTkdfUjJfQlVDS0VUX1BBVEgiLCAiSU1BR0VfSE9TVElOR19SMl9CVUNLRVRfU1VCRk9MREVSX1BBVEgiLCAiQURNSU5fQkFTRV9VUkwiXQp9Cg== From 19b63c65d4841a93a905337e0d4cf9fe2c915f4e Mon Sep 17 00:00:00 2001 From: sophiamersmann Date: Thu, 28 Nov 2024 12:39:20 +0100 Subject: [PATCH 33/52] =?UTF-8?q?=F0=9F=90=9B=20(slope)=20fix=20relative?= =?UTF-8?q?=20value=20calculation?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../grapher/src/slopeCharts/SlopeChart.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/@ourworldindata/grapher/src/slopeCharts/SlopeChart.tsx b/packages/@ourworldindata/grapher/src/slopeCharts/SlopeChart.tsx index 74cc8addef9..39d00d6b166 100644 --- a/packages/@ourworldindata/grapher/src/slopeCharts/SlopeChart.tsx +++ b/packages/@ourworldindata/grapher/src/slopeCharts/SlopeChart.tsx @@ -149,11 +149,11 @@ export class SlopeChart @computed get transformedTable(): OwidTable { let table = this.transformedTableFromGrapher // The % growth transform cannot be applied in transformTable() because it will filter out - // any rows before startHandleTimeBound and change the timeline bounds. - const { isRelativeMode, startHandleTimeBound } = this.manager - if (isRelativeMode && startHandleTimeBound !== undefined) { + // any rows before startTime and change the timeline bounds. + const { isRelativeMode, startTime } = this.manager + if (isRelativeMode && startTime !== undefined) { table = table.toTotalGrowthForEachColumnComparedToStartTime( - startHandleTimeBound, + startTime, this.yColumnSlugs ?? [] ) } From 9b4e8b0ccb63cdf03c5562c7efe386be61ef5aa3 Mon Sep 17 00:00:00 2001 From: sophiamersmann Date: Thu, 28 Nov 2024 12:45:56 +0100 Subject: [PATCH 34/52] =?UTF-8?q?=F0=9F=90=9B=20(slope)=20hide=20relative?= =?UTF-8?q?=20toggle=20for=20log=20scale?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/@ourworldindata/grapher/src/core/Grapher.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/@ourworldindata/grapher/src/core/Grapher.tsx b/packages/@ourworldindata/grapher/src/core/Grapher.tsx index d1c6407c228..1e7214050a1 100644 --- a/packages/@ourworldindata/grapher/src/core/Grapher.tsx +++ b/packages/@ourworldindata/grapher/src/core/Grapher.tsx @@ -2195,6 +2195,7 @@ export class Grapher @computed get canToggleRelativeMode(): boolean { const { isOnLineChartTab, + isOnSlopeChartTab, hideRelativeToggle, areHandlesOnSameTime, yScaleType, @@ -2205,7 +2206,7 @@ export class Grapher isStackedChartSplitByMetric, } = this - if (isOnLineChartTab) + if (isOnLineChartTab || isOnSlopeChartTab) return ( !hideRelativeToggle && !areHandlesOnSameTime && From 4984f4121e07aeef25a63e54495706417d253c16 Mon Sep 17 00:00:00 2001 From: sophiamersmann Date: Thu, 28 Nov 2024 14:52:24 +0100 Subject: [PATCH 35/52] =?UTF-8?q?=F0=9F=90=9B=20(line)=20use=20startTime?= =?UTF-8?q?=20for=20relative=20mode=20calculation?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../@ourworldindata/grapher/src/lineCharts/LineChart.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/@ourworldindata/grapher/src/lineCharts/LineChart.tsx b/packages/@ourworldindata/grapher/src/lineCharts/LineChart.tsx index a6674903be0..87c2cb800c6 100644 --- a/packages/@ourworldindata/grapher/src/lineCharts/LineChart.tsx +++ b/packages/@ourworldindata/grapher/src/lineCharts/LineChart.tsx @@ -439,10 +439,10 @@ export class LineChart let table = this.transformedTableFromGrapher // The % growth transform cannot be applied in transformTable() because it will filter out // any rows before startHandleTimeBound and change the timeline bounds. - const { isRelativeMode, startHandleTimeBound } = this.manager - if (isRelativeMode && startHandleTimeBound !== undefined) { + const { isRelativeMode, startTime } = this.manager + if (isRelativeMode && startTime !== undefined) { table = table.toTotalGrowthForEachColumnComparedToStartTime( - startHandleTimeBound, + startTime, this.manager.yColumnSlugs ?? [] ) } From 2d22a263bbebc4d6e010604e5a8f1948de2f66f8 Mon Sep 17 00:00:00 2001 From: sophiamersmann Date: Thu, 28 Nov 2024 16:24:14 +0100 Subject: [PATCH 36/52] =?UTF-8?q?=F0=9F=94=A8=20update=20slope=20migration?= =?UTF-8?q?=20after=20feedback?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../1732291572062-MigrateSlopeCharts.ts | 193 +++++++++++++++--- 1 file changed, 159 insertions(+), 34 deletions(-) diff --git a/db/migration/1732291572062-MigrateSlopeCharts.ts b/db/migration/1732291572062-MigrateSlopeCharts.ts index 84e7693269c..e58500bb004 100644 --- a/db/migration/1732291572062-MigrateSlopeCharts.ts +++ b/db/migration/1732291572062-MigrateSlopeCharts.ts @@ -1,4 +1,8 @@ -import { GrapherInterface } from "@ourworldindata/types" +import { + EntitySelectionMode, + GrapherInterface, + ScaleType, +} from "@ourworldindata/types" import { MigrationInterface, QueryRunner } from "typeorm" export class MigrateSlopeCharts1732291572062 implements MigrationInterface { @@ -87,10 +91,12 @@ const configUpdates: { id: number; config: GrapherInterface }[] = [ id: 415, config: { selectedEntityNames: [ - "Cirrhosis and other chronic liver diseases", - "Neonatal disorders", "Congenital heart anomalies", - "Diphtheria", + "Neonatal preterm birth", + "Neonatal encephalopathy due to birth asphyxia and trauma", + "Congenital birth defects", + "Diarrheal diseases", + "Malaria", ], entityType: "cause", entityTypePlural: "causes", @@ -102,14 +108,15 @@ const configUpdates: { id: number; config: GrapherInterface }[] = [ id: 679, config: { selectedEntityNames: [ - "Chad", - "Iraq", - "Benin", - "Kenya", - "Brazil", - "Hungary", + "Low-income countries", + "High-income countries", + "Lower-middle-income countries", + "Upper-middle-income countries", ], hideRelativeToggle: true, + yAxis: { + scaleType: ScaleType.linear, + }, }, }, { @@ -128,9 +135,11 @@ const configUpdates: { id: number; config: GrapherInterface }[] = [ id: 875, config: { selectedEntityNames: [ - "North America (WB)", - "South Asia (WB)", - "Latin America and Caribbean (WB)", + "India", + "United States", + "Indonesia", + "Pakistan", + "Nigeria", ], hideRelativeToggle: true, }, @@ -139,10 +148,12 @@ const configUpdates: { id: number; config: GrapherInterface }[] = [ id: 1004, config: { selectedEntityNames: [ - "Palau", - "Afghanistan", - "Curacao", - "Wallis and Futuna", + "Europe (UN)", + "Asia (UN)", + "Africa (UN)", + "Oceania (UN)", + "Northern America (UN)", + "Latin America and the Caribbean (UN)", ], }, }, @@ -155,27 +166,64 @@ const configUpdates: { id: number; config: GrapherInterface }[] = [ "South America", "Europe", "Asia", + "Oceania", + "Africa", ], }, }, { id: 2832, config: { - selectedEntityNames: ["Norway", "Italy", "France", "Finland"], + selectedEntityNames: [ + "Italy", + "France", + "Finland", + "Norway", + "Estonia", + "United Kingdom", + "Spain", + "Germany", + "Belgium", + ], hideTimeline: true, + addCountryMode: EntitySelectionMode.Disabled, }, }, { id: 2833, config: { - selectedEntityNames: ["Belgium", "Poland", "Italy", "Germany"], + selectedEntityNames: [ + "Belgium", + "Poland", + "Italy", + "Germany", + "Norway", + "Spain", + "France", + "Finland", + "United Kingdom", + "Estonia", + ], hideTimeline: true, + addCountryMode: EntitySelectionMode.Disabled, }, }, { id: 2834, config: { - selectedEntityNames: ["Belgium", "Italy", "Spain", "Norway"], + selectedEntityNames: [ + "Belgium", + "Italy", + "Spain", + "Norway", + "France", + "Poland", + "Estonia", + "United Kingdom", + "Finland", + "Germany", + ], + addCountryMode: EntitySelectionMode.Disabled, }, }, { @@ -186,8 +234,15 @@ const configUpdates: { id: number; config: GrapherInterface }[] = [ "Norway", "Poland", "United Kingdom", + "France", + "Finland", + "Germany", + "Belgium", + "Italy", + "Spain", ], hideTimeline: true, + addCountryMode: EntitySelectionMode.Disabled, }, }, { @@ -198,22 +253,52 @@ const configUpdates: { id: number; config: GrapherInterface }[] = [ "Poland", "United Kingdom", "Finland", + "Estonia", + "Spain", + "Italy", + "Norway", + "France", ], hideTimeline: true, + addCountryMode: EntitySelectionMode.Disabled, }, }, { id: 2976, config: { - selectedEntityNames: ["Poland", "Italy", "Spain", "Belgium"], + selectedEntityNames: [ + "Poland", + "Italy", + "Spain", + "Estonia", + "France", + "Germany", + "Belgium", + "United Kingdom", + "Norway", + "Finland", + ], hideTimeline: true, + addCountryMode: EntitySelectionMode.Disabled, }, }, { id: 2977, config: { - selectedEntityNames: ["Poland", "Norway", "Estonia", "Finland"], + selectedEntityNames: [ + "Poland", + "Norway", + "Estonia", + "Finland", + "Germany", + "Belgium", + "United Kingdom", + "Spain", + "Italy", + "France", + ], hideTimeline: true, + addCountryMode: EntitySelectionMode.Disabled, }, }, { @@ -225,8 +310,14 @@ const configUpdates: { id: number; config: GrapherInterface }[] = [ "Belgium", "Estonia", "Italy", + "Finland", + "Germany", + "United Kingdom", + "Spain", + "France", ], hideTimeline: true, + addCountryMode: EntitySelectionMode.Disabled, }, }, { @@ -237,8 +328,15 @@ const configUpdates: { id: number; config: GrapherInterface }[] = [ "Estonia", "Belgium", "Italy", + "France", + "Spain", + "Germany", + "Poland", + "Finland", + "Norway", ], hideTimeline: true, + addCountryMode: EntitySelectionMode.Disabled, }, }, { @@ -301,7 +399,7 @@ const configUpdates: { id: number; config: GrapherInterface }[] = [ "India", "Indonesia", "United States", - "Antigua and Barbuda", + "Pakistan", ], }, }, @@ -322,17 +420,26 @@ const configUpdates: { id: number; config: GrapherInterface }[] = [ { id: 3620, config: { - selectedEntityNames: ["Romania", "Benin", "Libya", "Suriname"], + selectedEntityNames: [ + "Low income", + "High income", + "Middle income", + "Low & middle income", + "Lower middle income", + "Upper middle income", + ], }, }, { id: 3627, config: { selectedEntityNames: [ - "Syrian Arab Republic", - "East Asia & Pacific", - "Costa Rica", - "Malta", + "Low income", + "High income", + "Middle income", + "Low & middle income", + "Lower middle income", + "Upper middle income", ], }, }, @@ -367,13 +474,28 @@ const configUpdates: { id: number; config: GrapherInterface }[] = [ { id: 6529, config: { - selectedEntityNames: ["United States", "Russia", "China"], + selectedEntityNames: [ + "North America", + "Europe", + "Asia", + "South America", + "Oceania", + "Africa", + ], }, }, { id: 7150, config: { - selectedEntityNames: ["Burundi", "Togo", "Ethiopia", "Myanmar"], + selectedEntityNames: [ + "Ethiopia", + "Myanmar", + "Niger", + "Chad", + "Colombia", + "Indonesia", + "Nigeria", + ], }, }, { @@ -396,10 +518,13 @@ const configUpdates: { id: number; config: GrapherInterface }[] = [ id: 7344, config: { selectedEntityNames: [ - "Suriname", - "Malta", - "Australia", - "Guatemala", + "United States", + "Romania", + "France", + "United Kingdom", + "Colombia", + "Mexico", + "Japan", ], }, }, From c8c26eb8dc901bb559be72d811576d1a04eac428 Mon Sep 17 00:00:00 2001 From: sophiamersmann Date: Thu, 28 Nov 2024 16:31:29 +0100 Subject: [PATCH 37/52] =?UTF-8?q?=F0=9F=94=A8=20(slope)=20drop=20non-numer?= =?UTF-8?q?ic=20data=20in=20any=20case?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../grapher/src/slopeCharts/SlopeChart.tsx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/@ourworldindata/grapher/src/slopeCharts/SlopeChart.tsx b/packages/@ourworldindata/grapher/src/slopeCharts/SlopeChart.tsx index 39d00d6b166..128a8b398dc 100644 --- a/packages/@ourworldindata/grapher/src/slopeCharts/SlopeChart.tsx +++ b/packages/@ourworldindata/grapher/src/slopeCharts/SlopeChart.tsx @@ -118,6 +118,8 @@ export class SlopeChart } transformTableForSelection(table: OwidTable): OwidTable { + table = table.replaceNonNumericCellsWithErrorValues(this.yColumnSlugs) + // if time selection is disabled, then filter all entities that // don't have data for the current time period if (!this.manager.hasTimeline) { @@ -131,9 +133,9 @@ export class SlopeChart // if entities with partial data are not plotted, // make sure they don't show up in the entity selector if (this.missingDataStrategy === MissingDataStrategy.hide) { - table = table - .replaceNonNumericCellsWithErrorValues(this.yColumnSlugs) - .dropEntitiesThatHaveNoDataInSomeColumn(this.yColumnSlugs) + table = table.dropEntitiesThatHaveNoDataInSomeColumn( + this.yColumnSlugs + ) } return table From c4fb3e5712bdd0801b324d44a76fbb1d5dd89bd4 Mon Sep 17 00:00:00 2001 From: sophiamersmann Date: Thu, 28 Nov 2024 16:32:12 +0100 Subject: [PATCH 38/52] =?UTF-8?q?=F0=9F=90=9B=20(slope)=20show=20correct?= =?UTF-8?q?=20label=20for=20relative=20toggle?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- db/migration/1732291572062-MigrateSlopeCharts.ts | 1 - packages/@ourworldindata/grapher/src/core/Grapher.tsx | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/db/migration/1732291572062-MigrateSlopeCharts.ts b/db/migration/1732291572062-MigrateSlopeCharts.ts index e58500bb004..92674e2e219 100644 --- a/db/migration/1732291572062-MigrateSlopeCharts.ts +++ b/db/migration/1732291572062-MigrateSlopeCharts.ts @@ -63,7 +63,6 @@ const configUpdates: { id: number; config: GrapherInterface }[] = [ { id: 414, config: { - title: "Top marginal income tax rate", selectedEntityNames: [ "Colombia", "Guatemala", diff --git a/packages/@ourworldindata/grapher/src/core/Grapher.tsx b/packages/@ourworldindata/grapher/src/core/Grapher.tsx index 1e7214050a1..7bbd5baa762 100644 --- a/packages/@ourworldindata/grapher/src/core/Grapher.tsx +++ b/packages/@ourworldindata/grapher/src/core/Grapher.tsx @@ -1419,7 +1419,6 @@ export class Grapher if (this.isLineChart || this.isDiscreteBar) return [yAxis, color] else if (this.isScatter) return [yAxis, xAxis, size, color] else if (this.isMarimekko) return [yAxis, xAxis, color] - else if (this.isSlopeChart) return [yAxis] return [yAxis] } @@ -2175,7 +2174,8 @@ export class Grapher @computed get relativeToggleLabel(): string { if (this.isOnScatterTab) return "Display average annual change" - else if (this.isOnLineChartTab) return "Display relative change" + else if (this.isOnLineChartTab || this.isOnSlopeChartTab) + return "Display relative change" return "Display relative values" } From dd7384d01430f429d350ffa670dceeff6fc0d1c2 Mon Sep 17 00:00:00 2001 From: sophiamersmann Date: Fri, 29 Nov 2024 09:59:31 +0100 Subject: [PATCH 39/52] =?UTF-8?q?=F0=9F=94=A8=20use=20current=20chart=20in?= =?UTF-8?q?stance=20for=20table=20for=20selection?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../grapher/src/core/Grapher.tsx | 16 +- ....timestamp-1732870709594-73b494fdbcb7f.mjs | 351 ++++++++++++++++++ 2 files changed, 354 insertions(+), 13 deletions(-) create mode 100644 vite.config-site.mts.timestamp-1732870709594-73b494fdbcb7f.mjs diff --git a/packages/@ourworldindata/grapher/src/core/Grapher.tsx b/packages/@ourworldindata/grapher/src/core/Grapher.tsx index 7bbd5baa762..f74c6d44f60 100644 --- a/packages/@ourworldindata/grapher/src/core/Grapher.tsx +++ b/packages/@ourworldindata/grapher/src/core/Grapher.tsx @@ -789,15 +789,15 @@ export class Grapher ? this.tableAfterAuthorTimelineAndActiveChartTransform : this.inputTable - if (!this.isReady || !this.mainChartInstance) return table + if (!this.isReady) return table // Some chart types (e.g. stacked area charts) choose not to show an entity // with incomplete data. Such chart types define a custom transform function // to ensure that the entity selector only offers entities that are actually plotted. // We apply the `tranformTableForSelection` method of the main chart type, // so that the entity selector doesn't update when switching between chart types. - if (this.mainChartInstance.transformTableForSelection) { - table = this.mainChartInstance.transformTableForSelection(table) + if (this.chartInstance.transformTableForSelection) { + table = this.chartInstance.transformTableForSelection(table) } return table @@ -838,16 +838,6 @@ export class Grapher return transformedTable } - // Chart instance of the "main" chart type, which is the first chart type - // in the list of valid chart types. Doesn't take into account that line - // charts might turn into discrete bar charts. Undefined for map-only Graphers. - @computed private get mainChartInstance(): ChartInterface | undefined { - if (!this.chartType) return undefined - const ChartClass = - ChartComponentClassMap.get(this.chartType) ?? DefaultChartClass - return new ChartClass({ manager: this }) - } - @computed get chartInstance(): ChartInterface { // Note: when timeline handles on a LineChart are collapsed into a single handle, the // LineChart turns into a DiscreteBar. diff --git a/vite.config-site.mts.timestamp-1732870709594-73b494fdbcb7f.mjs b/vite.config-site.mts.timestamp-1732870709594-73b494fdbcb7f.mjs new file mode 100644 index 00000000000..9ef808f81c3 --- /dev/null +++ b/vite.config-site.mts.timestamp-1732870709594-73b494fdbcb7f.mjs @@ -0,0 +1,351 @@ +var __defProp = Object.defineProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; + +// site/viteUtils.tsx +import React from "file:///Users/sophia/code/owid/owid-grapher/node_modules/react/index.js"; + +// settings/findBaseDir.ts +import path from "path"; +import fs from "fs"; +function findProjectBaseDir(from) { + if (!fs.existsSync) return void 0; + let dir = path.dirname(from); + while (dir.length) { + if (fs.existsSync(path.resolve(dir, "package.json"))) return dir; + const parentDir = path.resolve(dir, ".."); + if (parentDir === dir) break; + else dir = parentDir; + } + return void 0; +} + +// site/viteUtils.tsx +import fs3 from "file:///Users/sophia/code/owid/owid-grapher/node_modules/fs-extra/lib/index.js"; + +// settings/serverSettings.ts +import path2 from "path"; +import dotenv2 from "file:///Users/sophia/code/owid/owid-grapher/node_modules/dotenv/lib/main.js"; +import fs2 from "fs"; +import ini from "file:///Users/sophia/code/owid/owid-grapher/node_modules/ini/lib/ini.js"; +import os from "os"; + +// settings/clientSettings.ts +var clientSettings_exports = {}; +__export(clientSettings_exports, { + ADMIN_BASE_URL: () => ADMIN_BASE_URL, + ADMIN_SERVER_HOST: () => ADMIN_SERVER_HOST, + ADMIN_SERVER_PORT: () => ADMIN_SERVER_PORT, + ALGOLIA_ID: () => ALGOLIA_ID, + ALGOLIA_INDEX_PREFIX: () => ALGOLIA_INDEX_PREFIX, + ALGOLIA_SEARCH_KEY: () => ALGOLIA_SEARCH_KEY, + BAKED_BASE_URL: () => BAKED_BASE_URL, + BAKED_GRAPHER_EXPORTS_BASE_URL: () => BAKED_GRAPHER_EXPORTS_BASE_URL, + BAKED_GRAPHER_URL: () => BAKED_GRAPHER_URL, + BAKED_SITE_EXPORTS_BASE_URL: () => BAKED_SITE_EXPORTS_BASE_URL, + BUGSNAG_API_KEY: () => BUGSNAG_API_KEY, + DATA_API_URL: () => DATA_API_URL, + DONATE_API_URL: () => DONATE_API_URL, + ENV: () => ENV, + ETL_API_URL: () => ETL_API_URL, + ETL_WIZARD_URL: () => ETL_WIZARD_URL, + EXPLORER_DYNAMIC_THUMBNAIL_URL: () => EXPLORER_DYNAMIC_THUMBNAIL_URL, + FEATURE_FLAGS: () => FEATURE_FLAGS, + FeatureFlagFeature: () => FeatureFlagFeature, + GDOCS_BASIC_ARTICLE_TEMPLATE_URL: () => GDOCS_BASIC_ARTICLE_TEMPLATE_URL, + GDOCS_CLIENT_EMAIL: () => GDOCS_CLIENT_EMAIL, + GDOCS_DETAILS_ON_DEMAND_ID: () => GDOCS_DETAILS_ON_DEMAND_ID, + GOOGLE_TAG_MANAGER_ID: () => GOOGLE_TAG_MANAGER_ID, + GRAPHER_DYNAMIC_CONFIG_URL: () => GRAPHER_DYNAMIC_CONFIG_URL, + GRAPHER_DYNAMIC_THUMBNAIL_URL: () => GRAPHER_DYNAMIC_THUMBNAIL_URL, + IMAGE_HOSTING_R2_BUCKET_PATH: () => IMAGE_HOSTING_R2_BUCKET_PATH, + IMAGE_HOSTING_R2_BUCKET_SUBFOLDER_PATH: () => IMAGE_HOSTING_R2_BUCKET_SUBFOLDER_PATH, + IMAGE_HOSTING_R2_CDN_URL: () => IMAGE_HOSTING_R2_CDN_URL, + MULTI_DIM_DYNAMIC_CONFIG_URL: () => MULTI_DIM_DYNAMIC_CONFIG_URL, + PUBLISHED_AT_FORMAT: () => PUBLISHED_AT_FORMAT, + RECAPTCHA_SITE_KEY: () => RECAPTCHA_SITE_KEY, + SENTRY_DSN: () => SENTRY_DSN, + TOPICS_CONTENT_GRAPH: () => TOPICS_CONTENT_GRAPH +}); +import dotenv from "file:///Users/sophia/code/owid/owid-grapher/node_modules/dotenv/lib/main.js"; +import { parseIntOrUndefined } from "file:///Users/sophia/code/owid/owid-grapher/packages/@ourworldindata/utils/dist/index.js"; +var __vite_injected_original_dirname2 = "/Users/sophia/code/owid/owid-grapher/settings"; +if (typeof __vite_injected_original_dirname2 !== "undefined") { + const baseDir2 = findProjectBaseDir(__vite_injected_original_dirname2); + if (baseDir2) dotenv.config({ path: `${baseDir2}/.env` }); +} +var ENV = process.env.ENV === "production" ? "production" : "development"; +var BUGSNAG_API_KEY = process.env.BUGSNAG_API_KEY; +var SENTRY_DSN = process.env.SENTRY_DSN; +var ADMIN_SERVER_PORT = parseIntOrUndefined(process.env.ADMIN_SERVER_PORT) ?? 3030; +var ADMIN_SERVER_HOST = process.env.ADMIN_SERVER_HOST ?? "localhost"; +var BAKED_BASE_URL = process.env.BAKED_BASE_URL ?? `http://${ADMIN_SERVER_HOST}:${ADMIN_SERVER_PORT}`; +var BAKED_GRAPHER_URL = process.env.BAKED_GRAPHER_URL ?? `${BAKED_BASE_URL}/grapher`; +var BAKED_GRAPHER_EXPORTS_BASE_URL = process.env.BAKED_GRAPHER_EXPORTS_BASE_URL ?? `${BAKED_GRAPHER_URL}/exports`; +var BAKED_SITE_EXPORTS_BASE_URL = process.env.BAKED_SITE_EXPORTS_BASE_URL ?? `${BAKED_BASE_URL}/exports`; +var GRAPHER_DYNAMIC_THUMBNAIL_URL = process.env.GRAPHER_DYNAMIC_THUMBNAIL_URL ?? `${BAKED_GRAPHER_URL}`; +var EXPLORER_DYNAMIC_THUMBNAIL_URL = process.env.EXPLORER_DYNAMIC_THUMBNAIL_URL ?? `${BAKED_BASE_URL}/explorers`; +var GRAPHER_DYNAMIC_CONFIG_URL = process.env.GRAPHER_DYNAMIC_CONFIG_URL ?? `${BAKED_GRAPHER_URL}`; +var MULTI_DIM_DYNAMIC_CONFIG_URL = process.env.MULTI_DIM_DYNAMIC_CONFIG_URL ?? `${BAKED_BASE_URL}/multi-dim`; +var ADMIN_BASE_URL = process.env.ADMIN_BASE_URL ?? `http://${ADMIN_SERVER_HOST}:${ADMIN_SERVER_PORT}`; +var DATA_API_URL = process.env.DATA_API_URL ?? "https://api.ourworldindata.org/v1/indicators/"; +var ALGOLIA_ID = process.env.ALGOLIA_ID ?? ""; +var ALGOLIA_SEARCH_KEY = process.env.ALGOLIA_SEARCH_KEY ?? ""; +var ALGOLIA_INDEX_PREFIX = process.env.ALGOLIA_INDEX_PREFIX ?? ""; +var DONATE_API_URL = process.env.DONATE_API_URL ?? "http://localhost:8788/donation/donate"; +var RECAPTCHA_SITE_KEY = process.env.RECAPTCHA_SITE_KEY ?? "6LcJl5YUAAAAAATQ6F4vl9dAWRZeKPBm15MAZj4Q"; +var GOOGLE_TAG_MANAGER_ID = process.env.GOOGLE_TAG_MANAGER_ID ?? ""; +var TOPICS_CONTENT_GRAPH = process.env.TOPICS_CONTENT_GRAPH === "true"; +var GDOCS_CLIENT_EMAIL = process.env.GDOCS_CLIENT_EMAIL ?? ""; +var GDOCS_BASIC_ARTICLE_TEMPLATE_URL = process.env.GDOCS_BASIC_ARTICLE_TEMPLATE_URL ?? ""; +var IMAGE_HOSTING_R2_CDN_URL = process.env.IMAGE_HOSTING_R2_CDN_URL || ""; +var IMAGE_HOSTING_R2_BUCKET_PATH = process.env.IMAGE_HOSTING_R2_BUCKET_PATH || ""; +var IMAGE_HOSTING_R2_BUCKET_SUBFOLDER_PATH = IMAGE_HOSTING_R2_BUCKET_PATH.slice( + IMAGE_HOSTING_R2_BUCKET_PATH.indexOf("/") + 1 +); +var ETL_WIZARD_URL = process.env.ETL_WIZARD_URL ?? `http://${ADMIN_SERVER_HOST}:8053/`; +var ETL_API_URL = process.env.ETL_API_URL ?? `http://${ADMIN_SERVER_HOST}:8081/api/v1`; +var GDOCS_DETAILS_ON_DEMAND_ID = process.env.GDOCS_DETAILS_ON_DEMAND_ID ?? ""; +var PUBLISHED_AT_FORMAT = "ddd, MMM D, YYYY HH:mm"; +var FeatureFlagFeature = /* @__PURE__ */ ((FeatureFlagFeature2) => { + FeatureFlagFeature2["MultiDimDataPage"] = "MultiDimDataPage"; + return FeatureFlagFeature2; +})(FeatureFlagFeature || {}); +var featureFlagsRaw = typeof process.env.FEATURE_FLAGS === "string" && process.env.FEATURE_FLAGS.trim()?.split(",") || []; +var FEATURE_FLAGS = new Set( + Object.keys(FeatureFlagFeature).filter( + (key) => featureFlagsRaw.includes(key) + ) +); + +// settings/serverSettings.ts +import { parseIntOrUndefined as parseIntOrUndefined2 } from "file:///Users/sophia/code/owid/owid-grapher/packages/@ourworldindata/utils/dist/index.js"; +var __vite_injected_original_dirname3 = "/Users/sophia/code/owid/owid-grapher/settings"; +var baseDir = findProjectBaseDir(__vite_injected_original_dirname3); +if (baseDir === void 0) throw new Error("could not locate base package.json"); +dotenv2.config({ path: `${baseDir}/.env` }); +var serverSettings = process.env ?? {}; +var BASE_DIR = baseDir; +var DATA_API_FOR_ADMIN_UI = serverSettings.DATA_API_FOR_ADMIN_UI; +var BAKED_BASE_URL2 = BAKED_BASE_URL; +var VITE_PREVIEW = serverSettings.VITE_PREVIEW === "true"; +var ADMIN_BASE_URL2 = ADMIN_BASE_URL; +var BAKED_GRAPHER_URL2 = serverSettings.BAKED_GRAPHER_URL ?? `${BAKED_BASE_URL2}/grapher`; +var OPTIMIZE_SVG_EXPORTS = serverSettings.OPTIMIZE_SVG_EXPORTS === "true"; +var GITHUB_USERNAME = serverSettings.GITHUB_USERNAME ?? "owid-test"; +var GIT_DEFAULT_USERNAME = serverSettings.GIT_DEFAULT_USERNAME ?? "Our World in Data"; +var GIT_DEFAULT_EMAIL = serverSettings.GIT_DEFAULT_EMAIL ?? "info@ourworldindata.org"; +var BUGSNAG_API_KEY2 = serverSettings.BUGSNAG_API_KEY; +var BUGSNAG_NODE_API_KEY = serverSettings.BUGSNAG_NODE_API_KEY; +var BLOG_POSTS_PER_PAGE = parseIntOrUndefined2(serverSettings.BLOG_POSTS_PER_PAGE) ?? 21; +var BLOG_SLUG = serverSettings.BLOG_SLUG ?? "latest"; +var GRAPHER_DB_NAME = serverSettings.GRAPHER_DB_NAME ?? "owid"; +var GRAPHER_DB_USER = serverSettings.GRAPHER_DB_USER ?? "root"; +var GRAPHER_DB_PASS = serverSettings.GRAPHER_DB_PASS ?? ""; +var GRAPHER_DB_HOST = serverSettings.GRAPHER_DB_HOST ?? "localhost"; +var GRAPHER_DB_PORT = parseIntOrUndefined2(serverSettings.GRAPHER_DB_PORT) ?? 3306; +var GRAPHER_TEST_DB_NAME = serverSettings.GRAPHER_TEST_DB_NAME ?? "owid"; +var GRAPHER_TEST_DB_USER = serverSettings.GRAPHER_TEST_DB_USER ?? "root"; +var GRAPHER_TEST_DB_PASS = serverSettings.GRAPHER_TEST_DB_PASS ?? ""; +var GRAPHER_TEST_DB_HOST = serverSettings.GRAPHER_TEST_DB_HOST ?? "localhost"; +var GRAPHER_TEST_DB_PORT = parseIntOrUndefined2(serverSettings.GRAPHER_TEST_DB_PORT) ?? 3306; +var BAKED_SITE_DIR = serverSettings.BAKED_SITE_DIR ?? path2.resolve(BASE_DIR, "bakedSite"); +var SECRET_KEY = serverSettings.SECRET_KEY ?? "fejwiaof jewiafo jeioa fjieowajf isa fjidosajfgj"; +var SESSION_COOKIE_AGE = parseIntOrUndefined2(serverSettings.SESSION_COOKIE_AGE) ?? 1209600; +var ALGOLIA_SECRET_KEY = serverSettings.ALGOLIA_SECRET_KEY ?? ""; +var ALGOLIA_INDEXING = serverSettings.ALGOLIA_INDEXING === "true"; +var HTTPS_ONLY = serverSettings.HTTPS_ONLY !== "false"; +var GIT_DATASETS_DIR = serverSettings.GIT_DATASETS_DIR ?? `${BASE_DIR}/datasetsExport`; +var TMP_DIR = serverSettings.TMP_DIR ?? "/tmp"; +var UNCATEGORIZED_TAG_ID = parseIntOrUndefined2(serverSettings.UNCATEGORIZED_TAG_ID) ?? 375; +var BAKE_ON_CHANGE = serverSettings.BAKE_ON_CHANGE === "true"; +var DEPLOY_QUEUE_FILE_PATH = serverSettings.DEPLOY_QUEUE_FILE_PATH ?? `${BASE_DIR}/.queue`; +var DEPLOY_PENDING_FILE_PATH = serverSettings.DEPLOY_PENDING_FILE_PATH ?? `${BASE_DIR}/.pending`; +var CLOUDFLARE_AUD = serverSettings.CLOUDFLARE_AUD ?? ""; +var CATALOG_PATH = serverSettings.CATALOG_PATH ?? ""; +var GDOCS_PRIVATE_KEY = (serverSettings.GDOCS_PRIVATE_KEY ?? "").replaceAll('"', "").replaceAll("'", ""); +var GDOCS_CLIENT_ID = serverSettings.GDOCS_CLIENT_ID ?? ""; +var GDOCS_BACKPORTING_TARGET_FOLDER = serverSettings.GDOCS_BACKPORTING_TARGET_FOLDER ?? ""; +var GDOCS_IMAGES_BACKPORTING_TARGET_FOLDER = serverSettings.GDOCS_IMAGES_BACKPORTING_TARGET_FOLDER ?? ""; +var GDOCS_DONATE_FAQS_DOCUMENT_ID = serverSettings.GDOCS_DONATE_FAQS_DOCUMENT_ID ?? "194PNSFjgSlt9Zm5xYuDOF0l_GLKZbVxH2co3zCok_cE"; +var GDOCS_SHARED_DRIVE_ID = serverSettings.GDOCS_SHARED_DRIVE_ID ?? ""; +var GDOCS_DETAILS_ON_DEMAND_ID2 = serverSettings.GDOCS_DETAILS_ON_DEMAND_ID ?? ""; +var rcloneConfig = {}; +var rcloneConfigPath = path2.join(os.homedir(), ".config/rclone/rclone.conf"); +if (fs2.existsSync(rcloneConfigPath)) { + rcloneConfig = ini.parse(fs2.readFileSync(rcloneConfigPath, "utf-8")); +} +var IMAGE_HOSTING_R2_CDN_URL2 = serverSettings.IMAGE_HOSTING_R2_CDN_URL || ""; +var IMAGE_HOSTING_R2_BUCKET_PATH2 = serverSettings.IMAGE_HOSTING_R2_BUCKET_PATH || ""; +var IMAGE_HOSTING_R2_BUCKET_SUBFOLDER_PATH2 = IMAGE_HOSTING_R2_BUCKET_PATH2.slice( + IMAGE_HOSTING_R2_BUCKET_PATH2.indexOf("/") + 1 +); +var R2_ENDPOINT = serverSettings.R2_ENDPOINT || rcloneConfig["owid-r2"]?.endpoint || "https://078fcdfed9955087315dd86792e71a7e.r2.cloudflarestorage.com"; +var R2_ACCESS_KEY_ID = serverSettings.R2_ACCESS_KEY_ID || rcloneConfig["owid-r2"]?.access_key_id || ""; +var R2_SECRET_ACCESS_KEY = serverSettings.R2_SECRET_ACCESS_KEY || rcloneConfig["owid-r2"]?.secret_access_key || ""; +var R2_REGION = serverSettings.R2_REGION || rcloneConfig["owid-r2"]?.region || "auto"; +var GRAPHER_CONFIG_R2_BUCKET = serverSettings.GRAPHER_CONFIG_R2_BUCKET; +var GRAPHER_CONFIG_R2_BUCKET_PATH = serverSettings.GRAPHER_CONFIG_R2_BUCKET_PATH; +var BUILDKITE_API_ACCESS_TOKEN = serverSettings.BUILDKITE_API_ACCESS_TOKEN ?? ""; +var BUILDKITE_DEPLOY_CONTENT_PIPELINE_SLUG = serverSettings.BUILDKITE_DEPLOY_CONTENT_PIPELINE_SLUG || "owid-deploy-content-master"; +var BUILDKITE_BRANCH = serverSettings.BUILDKITE_BRANCH || "master"; +var BUILDKITE_DEPLOY_CONTENT_SLACK_CHANNEL = serverSettings.BUILDKITE_DEPLOY_CONTENT_SLACK_CHANNEL || "C06EWA0DK4H"; +var OPENAI_API_KEY = serverSettings.OPENAI_API_KEY ?? ""; +var SLACK_BOT_OAUTH_TOKEN = serverSettings.SLACK_BOT_OAUTH_TOKEN ?? ""; +var LEGACY_WORDPRESS_IMAGE_URL = serverSettings.LEGACY_WORDPRESS_IMAGE_URL ?? "https://assets.ourworldindata.org/uploads"; +var ENV_IS_STAGING = ADMIN_BASE_URL2.includes( + "http://staging-site" +); + +// site/SiteConstants.ts +import { faRss } from "file:///Users/sophia/code/owid/owid-grapher/node_modules/@fortawesome/free-solid-svg-icons/index.mjs"; +import { + faXTwitter, + faFacebookSquare, + faInstagram, + faThreads, + faLinkedin, + faBluesky +} from "file:///Users/sophia/code/owid/owid-grapher/node_modules/@fortawesome/free-brands-svg-icons/index.mjs"; +var polyfillFeatures = [ + "es2021", + // String.replaceAll, Promise.any, ... + "es2022", + // Array.at, String.at, ... + "es2023", + // Array.findLast, Array.toReversed, Array.toSorted, Array.with, ... + "IntersectionObserver", + "IntersectionObserverEntry" +]; +var POLYFILL_VERSION = "4.8.0"; +var POLYFILL_URL = `https://cdnjs.cloudflare.com/polyfill/v3/polyfill.min.js?version=${POLYFILL_VERSION}&features=${polyfillFeatures.join( + "," +)}`; +var DATA_INSIGHTS_ATOM_FEED_NAME = "atom-data-insights.xml"; +var DATA_INSIGHT_ATOM_FEED_PROPS = { + title: "Atom feed for Daily Data Insights", + href: `https://ourworldindata.org/${DATA_INSIGHTS_ATOM_FEED_NAME}` +}; +var RSS_FEEDS = [ + { + title: "Research & Writing RSS Feed", + url: "/atom.xml", + icon: faRss + }, + { + title: "Daily Data Insights RSS Feed", + url: `/${DATA_INSIGHTS_ATOM_FEED_NAME}`, + icon: faRss + } +]; + +// site/viteUtils.tsx +import { sortBy } from "file:///Users/sophia/code/owid/owid-grapher/packages/@ourworldindata/utils/dist/index.js"; +import urljoin from "file:///Users/sophia/code/owid/owid-grapher/node_modules/url-join/lib/url-join.js"; +var VITE_DEV_URL = process.env.VITE_DEV_URL ?? "http://localhost:8090"; +var VITE_ASSET_SITE_ENTRY = "site/owid.entry.ts"; +var VITE_ASSET_ADMIN_ENTRY = "adminSiteClient/admin.entry.ts"; +var VITE_ENTRYPOINT_INFO = { + ["site" /* Site */]: { + entryPointFile: VITE_ASSET_SITE_ENTRY, + outDir: "assets", + outName: "owid" + }, + ["admin" /* Admin */]: { + entryPointFile: VITE_ASSET_ADMIN_ENTRY, + outDir: "assets-admin", + outName: "admin" + } +}; + +// vite.config-common.mts +import { defineConfig } from "file:///Users/sophia/code/owid/owid-grapher/node_modules/vite/dist/node/index.js"; +import pluginReact from "file:///Users/sophia/code/owid/owid-grapher/node_modules/@vitejs/plugin-react/dist/index.mjs"; +import pluginChecker from "file:///Users/sophia/code/owid/owid-grapher/node_modules/vite-plugin-checker/dist/esm/main.js"; +var defineViteConfigForEntrypoint = (entrypoint) => { + const entrypointInfo = VITE_ENTRYPOINT_INFO[entrypoint]; + return defineConfig({ + publicDir: false, + // don't copy public folder to dist + resolve: { + // prettier-ignore + alias: { + "@ourworldindata/grapher/src": "@ourworldindata/grapher/src", + // need this for imports of @ourworldindata/grapher/src/core/grapher.scss to work + // we alias to the packages source files in dev and prod: + // this means we get instant dev updates when we change one of them, + // and the prod build builds them all as esm modules, which helps with tree shaking + // Idea from https://github.com/LinusBorg/vue-lib-template/blob/3775e49b20a7c3349dd49321cad2ed7f9d575057/packages/playground/vite.config.ts + "@ourworldindata/components": "@ourworldindata/components/src/index.ts", + "@ourworldindata/core-table": "@ourworldindata/core-table/src/index.ts", + "@ourworldindata/explorer": "@ourworldindata/explorer/src/index.ts", + "@ourworldindata/grapher": "@ourworldindata/grapher/src/index.ts", + "@ourworldindata/types": "@ourworldindata/types/src/index.ts", + "@ourworldindata/utils": "@ourworldindata/utils/src/index.ts" + } + }, + css: { + devSourcemap: true + }, + define: { + // Replace all clientSettings with their respective values, i.e. assign e.g. BUGSNAG_API_KEY to process.env.BUGSNAG_API_KEY + // it's important to note that we only expose values that are present in the clientSettings file - not any other things that are stored in .env + ...Object.fromEntries( + Object.entries(clientSettings_exports).map(([key, value]) => [ + `process.env.${key}`, + JSON.stringify(value) + ]) + ) + }, + build: { + manifest: true, + // creates a manifest.json file, which we use to determine which files to load in prod + emptyOutDir: true, + outDir: `dist/${entrypointInfo.outDir}`, + sourcemap: true, + target: ["chrome80", "firefox78", "safari13.1"], + // see docs/browser-support.md + rollupOptions: { + input: { + [entrypointInfo.outName]: entrypointInfo.entryPointFile + }, + output: { + assetFileNames: `${entrypointInfo.outName}.css`, + entryFileNames: `${entrypointInfo.outName}.mjs` + } + } + }, + plugins: [ + pluginReact({ + babel: { + parserOpts: { + plugins: ["decorators-legacy"] + // needed so mobx decorators work correctly + } + } + }), + pluginChecker({ + typescript: { + buildMode: true, + tsconfigPath: "tsconfig.vite-checker.json" + } + }) + ], + server: { + port: 8090, + warmup: { clientFiles: [VITE_ASSET_SITE_ENTRY] } + }, + preview: { + port: 8090 + } + }); +}; + +// vite.config-site.mts +var vite_config_site_default = defineViteConfigForEntrypoint("site" /* Site */); +export { + vite_config_site_default as default +}; +//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsic2l0ZS92aXRlVXRpbHMudHN4IiwgInNldHRpbmdzL2ZpbmRCYXNlRGlyLnRzIiwgInNldHRpbmdzL3NlcnZlclNldHRpbmdzLnRzIiwgInNldHRpbmdzL2NsaWVudFNldHRpbmdzLnRzIiwgInNpdGUvU2l0ZUNvbnN0YW50cy50cyIsICJ2aXRlLmNvbmZpZy1jb21tb24ubXRzIiwgInZpdGUuY29uZmlnLXNpdGUubXRzIl0sCiAgInNvdXJ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ltcG9ydCBSZWZyZXNoUnVudGltZSBmcm9tICcke2Jhc2VVcmx9L0ByZWFjdC1yZWZyZXNoJ1xuICBSZWZyZXNoUnVudGltZS5pbmplY3RJbnRvR2xvYmFsSG9vayh3aW5kb3cpXG4gIHdpbmRvdy4kUmVmcmVzaFJlZyQgPSAoKSA9PiB7fVxuICB3aW5kb3cuJFJlZnJlc2hTaWckID0gKCkgPT4gKHR5cGUpID0+IHR5cGVcbiAgd2luZG93Ll9fdml0ZV9wbHVnaW5fcmVhY3RfcHJlYW1ibGVfaW5zdGFsbGVkX18gPSB0cnVlYCxcbiAgICAgICAgICAgICAgICB9fVxuICAgICAgICAgICAgLz4sXG4gICAgICAgICAgICA8c2NyaXB0XG4gICAgICAgICAgICAgICAga2V5PVwidml0ZS1wbHVnaW4tY2hlY2tlclwiXG4gICAgICAgICAgICAgICAgdHlwZT1cIm1vZHVsZVwiXG4gICAgICAgICAgICAgICAgc3JjPXtgJHtiYXNlVXJsfS9Adml0ZS1wbHVnaW4tY2hlY2tlci1ydW50aW1lLWVudHJ5YH1cbiAgICAgICAgICAgIC8+LFxuICAgICAgICAgICAgPHNjcmlwdFxuICAgICAgICAgICAgICAgIGtleT1cInZpdGUtY2xpZW50XCJcbiAgICAgICAgICAgICAgICB0eXBlPVwibW9kdWxlXCJcbiAgICAgICAgICAgICAgICBzcmM9e2Ake2Jhc2VVcmx9L0B2aXRlL2NsaWVudGB9XG4gICAgICAgICAgICAvPixcbiAgICAgICAgICAgIDxzY3JpcHRcbiAgICAgICAgICAgICAgICBrZXk9e2VudHJ5cG9pbnR9XG4gICAgICAgICAgICAgICAgdHlwZT1cIm1vZHVsZVwiXG4gICAgICAgICAgICAgICAgc3JjPXtgJHtiYXNlVXJsfS8ke1ZJVEVfRU5UUllQT0lOVF9JTkZPW2VudHJ5cG9pbnRdLmVudHJ5UG9pbnRGaWxlfWB9XG4gICAgICAgICAgICAvPixcbiAgICAgICAgXSxcbiAgICB9XG59XG5cbi8vIEdvZXM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ICAgICAgaWYgKGVudHJ5LmVuZHNXaXRoKFwiLmNzc1wiKSkge1xuICAgICAgICAgICAgYXNzZXRzID0gW1xuICAgICAgICAgICAgICAgIC4uLmFzc2V0cyxcbiAgICAgICAgICAgICAgICA8bGlua1xuICAgICAgICAgICAgICAgICAgICBrZXk9e2Ake2VudHJ5fS1wcmVsb2FkYH1cbiAgICAgICAgICAgICAgICAgICAgcmVsPVwicHJlbG9hZFwiXG4gICAgICAgICAgICAgICAgICAgIGhyZWY9e2Fzc2V0VXJsfVxuICAgICAgICAgICAgICAgICAgICBhcz1cInN0eWxlXCJcbiAgICAgICAgICAgICAgICAvPixcbiAgICAgICAgICAgICAgICA8bGluayBrZXk9e2VudHJ5fSByZWw9XCJzdHlsZXNoZWV0XCIgaHJlZj17YXNzZXRVcmx9IC8+LFxuICAgICAgICAgICAgXVxuICAgICAgICB9IGVsc2UgaWYgKGVudHJ5Lm1hdGNoKC9cXC5bY21dPyhqc3xqc3h8dHN8dHN4KSQvKSkge1xuICAgICAgICAgICAgLy8gZXhwbGljaXRseSByZWZlcmVuY2UgdGhlIGVudHJ5OyBwcmVsb2FkIGl0IGFuZCBpdHMgZGVwZW5kZW5jaWVzXG4gICAgICAgICAgICBpZiAobWFuaWZlc3RFbnRyeT8uaXNFbnRyeSkge1xuICAgICAgICAgICAgICAgIGFzc2V0cyA9IFtcbiAgICAgICAgICAgICAgICAgICAgLi4uYXNzZXRzLFxuICAgICAgICAgICAgICAgICAgICA8c2NyaXB0XG4gICAgICAgICAgICAgICAgICAgICAgICBrZXk9e2VudHJ5fVxuICAgICAgICAgICAgICAgICAgICAgICAgdHlwZT1cIm1vZHVsZVwiXG4gICAgICAgICAgICAgICAgICAgICAgICBzcmM9e2Fzc2V0VXJsfVxuICAgICAgICAgICAgICAgICAgICAgICAgZGF0YS1hdHRhY2gtb3dpZC1lcnJvci1oYW5kbGVyXG4gICAgICAgICAgICAgICAgICAgIC8+LFxuICAgICAgICAgICAgICAgIF1cbiAgICAg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AgICAgICBvdXREaXI6IGBkaXN0LyR7ZW50cnlwb2ludEluZm8ub3V0RGlyfWAsXG4gICAgICAgICAgICBzb3VyY2VtYXA6IHRydWUsXG4gICAgICAgICAgICB0YXJnZXQ6IFtcImNocm9tZTgwXCIsIFwiZmlyZWZveDc4XCIsIFwic2FmYXJpMTMuMVwiXSwgLy8gc2VlIGRvY3MvYnJvd3Nlci1zdXBwb3J0Lm1kXG4gICAgICAgICAgICByb2xsdXBPcHRpb25zOiB7XG4gICAgICAgICAgICAgICAgaW5wdXQ6IHtcbiAgICAgICAgICAgICAgICAgICAgW2VudHJ5cG9pbnRJbmZvLm91dE5hbWVdOiBlbnRyeXBvaW50SW5mby5lbnRyeVBvaW50RmlsZSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIG91dHB1dDoge1xuICAgICAgICAgICAgICAgICAgICBhc3NldEZpbGVOYW1lczogYCR7ZW50cnlwb2ludEluZm8ub3V0TmFtZX0uY3NzYCxcbiAgICAgICAgICAgICAgICAgICAgZW50cnlGaWxlTmFtZXM6IGAke2VudHJ5cG9pbnRJbmZvLm91dE5hbWV9Lm1qc2AsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0sXG4gICAgICAgIHBsdWdpbnM6IFtcbiAgICAgICAgICAgIHBsdWdpblJlYWN0KHtcbiAgICAgICAgICAgICAgICBiYWJlbDoge1xuICAgICAgICAgICAgICAgICAgICBwYXJzZXJPcHRzOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICBwbHVnaW5zOiBbXCJkZWNvcmF0b3JzLWxlZ2FjeVwiXSwgLy8gbmVlZGVkIHNvIG1vYnggZGVjb3JhdG9ycyB3b3JrIGNvcnJlY3RseVxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9KSxcbiAgICAgICAgICAgIHBsdWdpbkNoZWNrZXIoe1xuICAgICAgICAgICAgICAgIHR5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F9kaXJuYW1lIiwgImRvdGVudiIsICJCQUtFRF9CQVNFX1VSTCIsICJBRE1JTl9CQVNFX1VSTCIsICJCQUtFRF9HUkFQSEVSX1VSTCIsICJCVUdTTkFHX0FQSV9LRVkiLCAicGFyc2VJbnRPclVuZGVmaW5lZCIsICJwYXRoIiwgIkdET0NTX0RFVEFJTFNfT05fREVNQU5EX0lEIiwgInBhdGgiLCAiZnMiLCAiSU1BR0VfSE9TVElOR19SMl9DRE5fVVJMIiwgIklNQUdFX0hPU1RJTkdfUjJfQlVDS0VUX1BBVEgiLCAiSU1BR0VfSE9TVElOR19SMl9CVUNLRVRfU1VCRk9MREVSX1BBVEgiLCAiQURNSU5fQkFTRV9VUkwiXQp9Cg== From 29d5cc9e67f2ab8a45fdb821a708da3649523403 Mon Sep 17 00:00:00 2001 From: sophiamersmann Date: Fri, 29 Nov 2024 14:28:53 +0100 Subject: [PATCH 40/52] =?UTF-8?q?=F0=9F=90=9B=20(slope)=20only=20drop=20en?= =?UTF-8?q?tities=20if=20start=20and=20end=20time=20are=20different?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../grapher/src/slopeCharts/SlopeChart.tsx | 2 +- ....timestamp-1732886743306-ebf767a3e601c.mjs | 351 ++++++++++++++++++ 2 files changed, 352 insertions(+), 1 deletion(-) create mode 100644 vite.config-site.mts.timestamp-1732886743306-ebf767a3e601c.mjs diff --git a/packages/@ourworldindata/grapher/src/slopeCharts/SlopeChart.tsx b/packages/@ourworldindata/grapher/src/slopeCharts/SlopeChart.tsx index 128a8b398dc..22b0148f18f 100644 --- a/packages/@ourworldindata/grapher/src/slopeCharts/SlopeChart.tsx +++ b/packages/@ourworldindata/grapher/src/slopeCharts/SlopeChart.tsx @@ -122,7 +122,7 @@ export class SlopeChart // if time selection is disabled, then filter all entities that // don't have data for the current time period - if (!this.manager.hasTimeline) { + if (!this.manager.hasTimeline && this.startTime !== this.endTime) { table = table .filterByTargetTimes([this.startTime, this.endTime]) .dropEntitiesThatHaveSomeMissingOrErrorValueInAllColumns( diff --git a/vite.config-site.mts.timestamp-1732886743306-ebf767a3e601c.mjs b/vite.config-site.mts.timestamp-1732886743306-ebf767a3e601c.mjs new file mode 100644 index 00000000000..9ef808f81c3 --- /dev/null +++ b/vite.config-site.mts.timestamp-1732886743306-ebf767a3e601c.mjs @@ -0,0 +1,351 @@ +var __defProp = Object.defineProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; + +// site/viteUtils.tsx +import React from "file:///Users/sophia/code/owid/owid-grapher/node_modules/react/index.js"; + +// settings/findBaseDir.ts +import path from "path"; +import fs from "fs"; +function findProjectBaseDir(from) { + if (!fs.existsSync) return void 0; + let dir = path.dirname(from); + while (dir.length) { + if (fs.existsSync(path.resolve(dir, "package.json"))) return dir; + const parentDir = path.resolve(dir, ".."); + if (parentDir === dir) break; + else dir = parentDir; + } + return void 0; +} + +// site/viteUtils.tsx +import fs3 from "file:///Users/sophia/code/owid/owid-grapher/node_modules/fs-extra/lib/index.js"; + +// settings/serverSettings.ts +import path2 from "path"; +import dotenv2 from "file:///Users/sophia/code/owid/owid-grapher/node_modules/dotenv/lib/main.js"; +import fs2 from "fs"; +import ini from "file:///Users/sophia/code/owid/owid-grapher/node_modules/ini/lib/ini.js"; +import os from "os"; + +// settings/clientSettings.ts +var clientSettings_exports = {}; +__export(clientSettings_exports, { + ADMIN_BASE_URL: () => ADMIN_BASE_URL, + ADMIN_SERVER_HOST: () => ADMIN_SERVER_HOST, + ADMIN_SERVER_PORT: () => ADMIN_SERVER_PORT, + ALGOLIA_ID: () => ALGOLIA_ID, + ALGOLIA_INDEX_PREFIX: () => ALGOLIA_INDEX_PREFIX, + ALGOLIA_SEARCH_KEY: () => ALGOLIA_SEARCH_KEY, + BAKED_BASE_URL: () => BAKED_BASE_URL, + BAKED_GRAPHER_EXPORTS_BASE_URL: () => BAKED_GRAPHER_EXPORTS_BASE_URL, + BAKED_GRAPHER_URL: () => BAKED_GRAPHER_URL, + BAKED_SITE_EXPORTS_BASE_URL: () => BAKED_SITE_EXPORTS_BASE_URL, + BUGSNAG_API_KEY: () => BUGSNAG_API_KEY, + DATA_API_URL: () => DATA_API_URL, + DONATE_API_URL: () => DONATE_API_URL, + ENV: () => ENV, + ETL_API_URL: () => ETL_API_URL, + ETL_WIZARD_URL: () => ETL_WIZARD_URL, + EXPLORER_DYNAMIC_THUMBNAIL_URL: () => EXPLORER_DYNAMIC_THUMBNAIL_URL, + FEATURE_FLAGS: () => FEATURE_FLAGS, + FeatureFlagFeature: () => FeatureFlagFeature, + GDOCS_BASIC_ARTICLE_TEMPLATE_URL: () => GDOCS_BASIC_ARTICLE_TEMPLATE_URL, + GDOCS_CLIENT_EMAIL: () => GDOCS_CLIENT_EMAIL, + GDOCS_DETAILS_ON_DEMAND_ID: () => GDOCS_DETAILS_ON_DEMAND_ID, + GOOGLE_TAG_MANAGER_ID: () => GOOGLE_TAG_MANAGER_ID, + GRAPHER_DYNAMIC_CONFIG_URL: () => GRAPHER_DYNAMIC_CONFIG_URL, + GRAPHER_DYNAMIC_THUMBNAIL_URL: () => GRAPHER_DYNAMIC_THUMBNAIL_URL, + IMAGE_HOSTING_R2_BUCKET_PATH: () => IMAGE_HOSTING_R2_BUCKET_PATH, + IMAGE_HOSTING_R2_BUCKET_SUBFOLDER_PATH: () => IMAGE_HOSTING_R2_BUCKET_SUBFOLDER_PATH, + IMAGE_HOSTING_R2_CDN_URL: () => IMAGE_HOSTING_R2_CDN_URL, + MULTI_DIM_DYNAMIC_CONFIG_URL: () => MULTI_DIM_DYNAMIC_CONFIG_URL, + PUBLISHED_AT_FORMAT: () => PUBLISHED_AT_FORMAT, + RECAPTCHA_SITE_KEY: () => RECAPTCHA_SITE_KEY, + SENTRY_DSN: () => SENTRY_DSN, + TOPICS_CONTENT_GRAPH: () => TOPICS_CONTENT_GRAPH +}); +import dotenv from "file:///Users/sophia/code/owid/owid-grapher/node_modules/dotenv/lib/main.js"; +import { parseIntOrUndefined } from "file:///Users/sophia/code/owid/owid-grapher/packages/@ourworldindata/utils/dist/index.js"; +var __vite_injected_original_dirname2 = "/Users/sophia/code/owid/owid-grapher/settings"; +if (typeof __vite_injected_original_dirname2 !== "undefined") { + const baseDir2 = findProjectBaseDir(__vite_injected_original_dirname2); + if (baseDir2) dotenv.config({ path: `${baseDir2}/.env` }); +} +var ENV = process.env.ENV === "production" ? "production" : "development"; +var BUGSNAG_API_KEY = process.env.BUGSNAG_API_KEY; +var SENTRY_DSN = process.env.SENTRY_DSN; +var ADMIN_SERVER_PORT = parseIntOrUndefined(process.env.ADMIN_SERVER_PORT) ?? 3030; +var ADMIN_SERVER_HOST = process.env.ADMIN_SERVER_HOST ?? "localhost"; +var BAKED_BASE_URL = process.env.BAKED_BASE_URL ?? `http://${ADMIN_SERVER_HOST}:${ADMIN_SERVER_PORT}`; +var BAKED_GRAPHER_URL = process.env.BAKED_GRAPHER_URL ?? `${BAKED_BASE_URL}/grapher`; +var BAKED_GRAPHER_EXPORTS_BASE_URL = process.env.BAKED_GRAPHER_EXPORTS_BASE_URL ?? `${BAKED_GRAPHER_URL}/exports`; +var BAKED_SITE_EXPORTS_BASE_URL = process.env.BAKED_SITE_EXPORTS_BASE_URL ?? `${BAKED_BASE_URL}/exports`; +var GRAPHER_DYNAMIC_THUMBNAIL_URL = process.env.GRAPHER_DYNAMIC_THUMBNAIL_URL ?? `${BAKED_GRAPHER_URL}`; +var EXPLORER_DYNAMIC_THUMBNAIL_URL = process.env.EXPLORER_DYNAMIC_THUMBNAIL_URL ?? `${BAKED_BASE_URL}/explorers`; +var GRAPHER_DYNAMIC_CONFIG_URL = process.env.GRAPHER_DYNAMIC_CONFIG_URL ?? `${BAKED_GRAPHER_URL}`; +var MULTI_DIM_DYNAMIC_CONFIG_URL = process.env.MULTI_DIM_DYNAMIC_CONFIG_URL ?? `${BAKED_BASE_URL}/multi-dim`; +var ADMIN_BASE_URL = process.env.ADMIN_BASE_URL ?? `http://${ADMIN_SERVER_HOST}:${ADMIN_SERVER_PORT}`; +var DATA_API_URL = process.env.DATA_API_URL ?? "https://api.ourworldindata.org/v1/indicators/"; +var ALGOLIA_ID = process.env.ALGOLIA_ID ?? ""; +var ALGOLIA_SEARCH_KEY = process.env.ALGOLIA_SEARCH_KEY ?? ""; +var ALGOLIA_INDEX_PREFIX = process.env.ALGOLIA_INDEX_PREFIX ?? ""; +var DONATE_API_URL = process.env.DONATE_API_URL ?? "http://localhost:8788/donation/donate"; +var RECAPTCHA_SITE_KEY = process.env.RECAPTCHA_SITE_KEY ?? "6LcJl5YUAAAAAATQ6F4vl9dAWRZeKPBm15MAZj4Q"; +var GOOGLE_TAG_MANAGER_ID = process.env.GOOGLE_TAG_MANAGER_ID ?? ""; +var TOPICS_CONTENT_GRAPH = process.env.TOPICS_CONTENT_GRAPH === "true"; +var GDOCS_CLIENT_EMAIL = process.env.GDOCS_CLIENT_EMAIL ?? ""; +var GDOCS_BASIC_ARTICLE_TEMPLATE_URL = process.env.GDOCS_BASIC_ARTICLE_TEMPLATE_URL ?? ""; +var IMAGE_HOSTING_R2_CDN_URL = process.env.IMAGE_HOSTING_R2_CDN_URL || ""; +var IMAGE_HOSTING_R2_BUCKET_PATH = process.env.IMAGE_HOSTING_R2_BUCKET_PATH || ""; +var IMAGE_HOSTING_R2_BUCKET_SUBFOLDER_PATH = IMAGE_HOSTING_R2_BUCKET_PATH.slice( + IMAGE_HOSTING_R2_BUCKET_PATH.indexOf("/") + 1 +); +var ETL_WIZARD_URL = process.env.ETL_WIZARD_URL ?? `http://${ADMIN_SERVER_HOST}:8053/`; +var ETL_API_URL = process.env.ETL_API_URL ?? `http://${ADMIN_SERVER_HOST}:8081/api/v1`; +var GDOCS_DETAILS_ON_DEMAND_ID = process.env.GDOCS_DETAILS_ON_DEMAND_ID ?? ""; +var PUBLISHED_AT_FORMAT = "ddd, MMM D, YYYY HH:mm"; +var FeatureFlagFeature = /* @__PURE__ */ ((FeatureFlagFeature2) => { + FeatureFlagFeature2["MultiDimDataPage"] = "MultiDimDataPage"; + return FeatureFlagFeature2; +})(FeatureFlagFeature || {}); +var featureFlagsRaw = typeof process.env.FEATURE_FLAGS === "string" && process.env.FEATURE_FLAGS.trim()?.split(",") || []; +var FEATURE_FLAGS = new Set( + Object.keys(FeatureFlagFeature).filter( + (key) => featureFlagsRaw.includes(key) + ) +); + +// settings/serverSettings.ts +import { parseIntOrUndefined as parseIntOrUndefined2 } from "file:///Users/sophia/code/owid/owid-grapher/packages/@ourworldindata/utils/dist/index.js"; +var __vite_injected_original_dirname3 = "/Users/sophia/code/owid/owid-grapher/settings"; +var baseDir = findProjectBaseDir(__vite_injected_original_dirname3); +if (baseDir === void 0) throw new Error("could not locate base package.json"); +dotenv2.config({ path: `${baseDir}/.env` }); +var serverSettings = process.env ?? {}; +var BASE_DIR = baseDir; +var DATA_API_FOR_ADMIN_UI = serverSettings.DATA_API_FOR_ADMIN_UI; +var BAKED_BASE_URL2 = BAKED_BASE_URL; +var VITE_PREVIEW = serverSettings.VITE_PREVIEW === "true"; +var ADMIN_BASE_URL2 = ADMIN_BASE_URL; +var BAKED_GRAPHER_URL2 = serverSettings.BAKED_GRAPHER_URL ?? `${BAKED_BASE_URL2}/grapher`; +var OPTIMIZE_SVG_EXPORTS = serverSettings.OPTIMIZE_SVG_EXPORTS === "true"; +var GITHUB_USERNAME = serverSettings.GITHUB_USERNAME ?? "owid-test"; +var GIT_DEFAULT_USERNAME = serverSettings.GIT_DEFAULT_USERNAME ?? "Our World in Data"; +var GIT_DEFAULT_EMAIL = serverSettings.GIT_DEFAULT_EMAIL ?? "info@ourworldindata.org"; +var BUGSNAG_API_KEY2 = serverSettings.BUGSNAG_API_KEY; +var BUGSNAG_NODE_API_KEY = serverSettings.BUGSNAG_NODE_API_KEY; +var BLOG_POSTS_PER_PAGE = parseIntOrUndefined2(serverSettings.BLOG_POSTS_PER_PAGE) ?? 21; +var BLOG_SLUG = serverSettings.BLOG_SLUG ?? "latest"; +var GRAPHER_DB_NAME = serverSettings.GRAPHER_DB_NAME ?? "owid"; +var GRAPHER_DB_USER = serverSettings.GRAPHER_DB_USER ?? "root"; +var GRAPHER_DB_PASS = serverSettings.GRAPHER_DB_PASS ?? ""; +var GRAPHER_DB_HOST = serverSettings.GRAPHER_DB_HOST ?? "localhost"; +var GRAPHER_DB_PORT = parseIntOrUndefined2(serverSettings.GRAPHER_DB_PORT) ?? 3306; +var GRAPHER_TEST_DB_NAME = serverSettings.GRAPHER_TEST_DB_NAME ?? "owid"; +var GRAPHER_TEST_DB_USER = serverSettings.GRAPHER_TEST_DB_USER ?? "root"; +var GRAPHER_TEST_DB_PASS = serverSettings.GRAPHER_TEST_DB_PASS ?? ""; +var GRAPHER_TEST_DB_HOST = serverSettings.GRAPHER_TEST_DB_HOST ?? "localhost"; +var GRAPHER_TEST_DB_PORT = parseIntOrUndefined2(serverSettings.GRAPHER_TEST_DB_PORT) ?? 3306; +var BAKED_SITE_DIR = serverSettings.BAKED_SITE_DIR ?? path2.resolve(BASE_DIR, "bakedSite"); +var SECRET_KEY = serverSettings.SECRET_KEY ?? "fejwiaof jewiafo jeioa fjieowajf isa fjidosajfgj"; +var SESSION_COOKIE_AGE = parseIntOrUndefined2(serverSettings.SESSION_COOKIE_AGE) ?? 1209600; +var ALGOLIA_SECRET_KEY = serverSettings.ALGOLIA_SECRET_KEY ?? ""; +var ALGOLIA_INDEXING = serverSettings.ALGOLIA_INDEXING === "true"; +var HTTPS_ONLY = serverSettings.HTTPS_ONLY !== "false"; +var GIT_DATASETS_DIR = serverSettings.GIT_DATASETS_DIR ?? `${BASE_DIR}/datasetsExport`; +var TMP_DIR = serverSettings.TMP_DIR ?? "/tmp"; +var UNCATEGORIZED_TAG_ID = parseIntOrUndefined2(serverSettings.UNCATEGORIZED_TAG_ID) ?? 375; +var BAKE_ON_CHANGE = serverSettings.BAKE_ON_CHANGE === "true"; +var DEPLOY_QUEUE_FILE_PATH = serverSettings.DEPLOY_QUEUE_FILE_PATH ?? `${BASE_DIR}/.queue`; +var DEPLOY_PENDING_FILE_PATH = serverSettings.DEPLOY_PENDING_FILE_PATH ?? `${BASE_DIR}/.pending`; +var CLOUDFLARE_AUD = serverSettings.CLOUDFLARE_AUD ?? ""; +var CATALOG_PATH = serverSettings.CATALOG_PATH ?? ""; +var GDOCS_PRIVATE_KEY = (serverSettings.GDOCS_PRIVATE_KEY ?? "").replaceAll('"', "").replaceAll("'", ""); +var GDOCS_CLIENT_ID = serverSettings.GDOCS_CLIENT_ID ?? ""; +var GDOCS_BACKPORTING_TARGET_FOLDER = serverSettings.GDOCS_BACKPORTING_TARGET_FOLDER ?? ""; +var GDOCS_IMAGES_BACKPORTING_TARGET_FOLDER = serverSettings.GDOCS_IMAGES_BACKPORTING_TARGET_FOLDER ?? ""; +var GDOCS_DONATE_FAQS_DOCUMENT_ID = serverSettings.GDOCS_DONATE_FAQS_DOCUMENT_ID ?? "194PNSFjgSlt9Zm5xYuDOF0l_GLKZbVxH2co3zCok_cE"; +var GDOCS_SHARED_DRIVE_ID = serverSettings.GDOCS_SHARED_DRIVE_ID ?? ""; +var GDOCS_DETAILS_ON_DEMAND_ID2 = serverSettings.GDOCS_DETAILS_ON_DEMAND_ID ?? ""; +var rcloneConfig = {}; +var rcloneConfigPath = path2.join(os.homedir(), ".config/rclone/rclone.conf"); +if (fs2.existsSync(rcloneConfigPath)) { + rcloneConfig = ini.parse(fs2.readFileSync(rcloneConfigPath, "utf-8")); +} +var IMAGE_HOSTING_R2_CDN_URL2 = serverSettings.IMAGE_HOSTING_R2_CDN_URL || ""; +var IMAGE_HOSTING_R2_BUCKET_PATH2 = serverSettings.IMAGE_HOSTING_R2_BUCKET_PATH || ""; +var IMAGE_HOSTING_R2_BUCKET_SUBFOLDER_PATH2 = IMAGE_HOSTING_R2_BUCKET_PATH2.slice( + IMAGE_HOSTING_R2_BUCKET_PATH2.indexOf("/") + 1 +); +var R2_ENDPOINT = serverSettings.R2_ENDPOINT || rcloneConfig["owid-r2"]?.endpoint || "https://078fcdfed9955087315dd86792e71a7e.r2.cloudflarestorage.com"; +var R2_ACCESS_KEY_ID = serverSettings.R2_ACCESS_KEY_ID || rcloneConfig["owid-r2"]?.access_key_id || ""; +var R2_SECRET_ACCESS_KEY = serverSettings.R2_SECRET_ACCESS_KEY || rcloneConfig["owid-r2"]?.secret_access_key || ""; +var R2_REGION = serverSettings.R2_REGION || rcloneConfig["owid-r2"]?.region || "auto"; +var GRAPHER_CONFIG_R2_BUCKET = serverSettings.GRAPHER_CONFIG_R2_BUCKET; +var GRAPHER_CONFIG_R2_BUCKET_PATH = serverSettings.GRAPHER_CONFIG_R2_BUCKET_PATH; +var BUILDKITE_API_ACCESS_TOKEN = serverSettings.BUILDKITE_API_ACCESS_TOKEN ?? ""; +var BUILDKITE_DEPLOY_CONTENT_PIPELINE_SLUG = serverSettings.BUILDKITE_DEPLOY_CONTENT_PIPELINE_SLUG || "owid-deploy-content-master"; +var BUILDKITE_BRANCH = serverSettings.BUILDKITE_BRANCH || "master"; +var BUILDKITE_DEPLOY_CONTENT_SLACK_CHANNEL = serverSettings.BUILDKITE_DEPLOY_CONTENT_SLACK_CHANNEL || "C06EWA0DK4H"; +var OPENAI_API_KEY = serverSettings.OPENAI_API_KEY ?? ""; +var SLACK_BOT_OAUTH_TOKEN = serverSettings.SLACK_BOT_OAUTH_TOKEN ?? ""; +var LEGACY_WORDPRESS_IMAGE_URL = serverSettings.LEGACY_WORDPRESS_IMAGE_URL ?? "https://assets.ourworldindata.org/uploads"; +var ENV_IS_STAGING = ADMIN_BASE_URL2.includes( + "http://staging-site" +); + +// site/SiteConstants.ts +import { faRss } from "file:///Users/sophia/code/owid/owid-grapher/node_modules/@fortawesome/free-solid-svg-icons/index.mjs"; +import { + faXTwitter, + faFacebookSquare, + faInstagram, + faThreads, + faLinkedin, + faBluesky +} from "file:///Users/sophia/code/owid/owid-grapher/node_modules/@fortawesome/free-brands-svg-icons/index.mjs"; +var polyfillFeatures = [ + "es2021", + // String.replaceAll, Promise.any, ... + "es2022", + // Array.at, String.at, ... + "es2023", + // Array.findLast, Array.toReversed, Array.toSorted, Array.with, ... + "IntersectionObserver", + "IntersectionObserverEntry" +]; +var POLYFILL_VERSION = "4.8.0"; +var POLYFILL_URL = `https://cdnjs.cloudflare.com/polyfill/v3/polyfill.min.js?version=${POLYFILL_VERSION}&features=${polyfillFeatures.join( + "," +)}`; +var DATA_INSIGHTS_ATOM_FEED_NAME = "atom-data-insights.xml"; +var DATA_INSIGHT_ATOM_FEED_PROPS = { + title: "Atom feed for Daily Data Insights", + href: `https://ourworldindata.org/${DATA_INSIGHTS_ATOM_FEED_NAME}` +}; +var RSS_FEEDS = [ + { + title: "Research & Writing RSS Feed", + url: "/atom.xml", + icon: faRss + }, + { + title: "Daily Data Insights RSS Feed", + url: `/${DATA_INSIGHTS_ATOM_FEED_NAME}`, + icon: faRss + } +]; + +// site/viteUtils.tsx +import { sortBy } from "file:///Users/sophia/code/owid/owid-grapher/packages/@ourworldindata/utils/dist/index.js"; +import urljoin from "file:///Users/sophia/code/owid/owid-grapher/node_modules/url-join/lib/url-join.js"; +var VITE_DEV_URL = process.env.VITE_DEV_URL ?? "http://localhost:8090"; +var VITE_ASSET_SITE_ENTRY = "site/owid.entry.ts"; +var VITE_ASSET_ADMIN_ENTRY = "adminSiteClient/admin.entry.ts"; +var VITE_ENTRYPOINT_INFO = { + ["site" /* Site */]: { + entryPointFile: VITE_ASSET_SITE_ENTRY, + outDir: "assets", + outName: "owid" + }, + ["admin" /* Admin */]: { + entryPointFile: VITE_ASSET_ADMIN_ENTRY, + outDir: "assets-admin", + outName: "admin" + } +}; + +// vite.config-common.mts +import { defineConfig } from "file:///Users/sophia/code/owid/owid-grapher/node_modules/vite/dist/node/index.js"; +import pluginReact from "file:///Users/sophia/code/owid/owid-grapher/node_modules/@vitejs/plugin-react/dist/index.mjs"; +import pluginChecker from "file:///Users/sophia/code/owid/owid-grapher/node_modules/vite-plugin-checker/dist/esm/main.js"; +var defineViteConfigForEntrypoint = (entrypoint) => { + const entrypointInfo = VITE_ENTRYPOINT_INFO[entrypoint]; + return defineConfig({ + publicDir: false, + // don't copy public folder to dist + resolve: { + // prettier-ignore + alias: { + "@ourworldindata/grapher/src": "@ourworldindata/grapher/src", + // need this for imports of @ourworldindata/grapher/src/core/grapher.scss to work + // we alias to the packages source files in dev and prod: + // this means we get instant dev updates when we change one of them, + // and the prod build builds them all as esm modules, which helps with tree shaking + // Idea from https://github.com/LinusBorg/vue-lib-template/blob/3775e49b20a7c3349dd49321cad2ed7f9d575057/packages/playground/vite.config.ts + "@ourworldindata/components": "@ourworldindata/components/src/index.ts", + "@ourworldindata/core-table": "@ourworldindata/core-table/src/index.ts", + "@ourworldindata/explorer": "@ourworldindata/explorer/src/index.ts", + "@ourworldindata/grapher": "@ourworldindata/grapher/src/index.ts", + "@ourworldindata/types": "@ourworldindata/types/src/index.ts", + "@ourworldindata/utils": "@ourworldindata/utils/src/index.ts" + } + }, + css: { + devSourcemap: true + }, + define: { + // Replace all clientSettings with their respective values, i.e. assign e.g. BUGSNAG_API_KEY to process.env.BUGSNAG_API_KEY + // it's important to note that we only expose values that are present in the clientSettings file - not any other things that are stored in .env + ...Object.fromEntries( + Object.entries(clientSettings_exports).map(([key, value]) => [ + `process.env.${key}`, + JSON.stringify(value) + ]) + ) + }, + build: { + manifest: true, + // creates a manifest.json file, which we use to determine which files to load in prod + emptyOutDir: true, + outDir: `dist/${entrypointInfo.outDir}`, + sourcemap: true, + target: ["chrome80", "firefox78", "safari13.1"], + // see docs/browser-support.md + rollupOptions: { + input: { + [entrypointInfo.outName]: entrypointInfo.entryPointFile + }, + output: { + assetFileNames: `${entrypointInfo.outName}.css`, + entryFileNames: `${entrypointInfo.outName}.mjs` + } + } + }, + plugins: [ + pluginReact({ + babel: { + parserOpts: { + plugins: ["decorators-legacy"] + // needed so mobx decorators work correctly + } + } + }), + pluginChecker({ + typescript: { + buildMode: true, + tsconfigPath: "tsconfig.vite-checker.json" + } + }) + ], + server: { + port: 8090, + warmup: { clientFiles: [VITE_ASSET_SITE_ENTRY] } + }, + preview: { + port: 8090 + } + }); +}; + +// vite.config-site.mts +var vite_config_site_default = defineViteConfigForEntrypoint("site" /* Site */); +export { + vite_config_site_default as default +}; +//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsic2l0ZS92aXRlVXRpbHMudHN4IiwgInNldHRpbmdzL2ZpbmRCYXNlRGlyLnRzIiwgInNldHRpbmdzL3NlcnZlclNldHRpbmdzLnRzIiwgInNldHRpbmdzL2NsaWVudFNldHRpbmdzLnRzIiwgInNpdGUvU2l0ZUNvbnN0YW50cy50cyIsICJ2aXRlLmNvbmZpZy1jb21tb24ubXRzIiwgInZpdGUuY29uZmlnLXNpdGUubXRzIl0sCiAgInNvdXJjZXNDb250ZW50IjogWyJpbXBvcnQgUmVhY3QgZnJvbSBcInJlYWN0XCJcbmltcG9ydCBmaW5kQmFzZURpciBmcm9tIFwiLi4vc2V0dGluZ3MvZmluZEJhc2VEaXIuanNcIlxuaW1wb3J0IGZzIGZyb20gXCJmcy1leHRyYVwiXG5pbXBvcnQge1xuICAgIEVOVixcbiAgICBCQUtFRF9CQVNFX1VSTCxcbiAgICBWSVRFX1BSRVZJRVcsXG59IGZyb20gXCIuLi9zZXR0aW5ncy9zZXJ2ZXJTZXR0aW5ncy5qc1wiXG5pbXBvcnQgeyBQT0xZRklMTF9VUkwgfSBmcm9tIFwiLi9TaXRlQ29uc3RhbnRzLmpzXCJcbmltcG9ydCB0eXBlIHsgTWFuaWZlc3QsIE1hbmlmZXN0Q2h1bmsgfSBmcm9tIFwidml0ZVwiXG5pbXBvcnQgeyBzb3J0QnkgfSBmcm9tIFwiQG91cndvcmxkaW5kYXRhL3V0aWxzXCJcbmltcG9ydCB1cmxqb2luIGZyb20gXCJ1cmwtam9pblwiXG5cbmNvbnN0IFZJVEVfREVWX1VSTCA9IHByb2Nlc3Mu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QoKGUpID0+IGUuZmlsZSA9PT0gZW50cnkpID8/XG4gICAgICAgICAgICAobWFuaWZlc3RbZW50cnldIGFzIE1hbmlmZXN0Q2h1bmsgfCB1bmRlZmluZWQpXG4gICAgICAgIGxldCBhc3NldHMgPSBbXSBhcyBSZWFjdC5SZWFjdEVsZW1lbnRbXVxuXG4gICAgICAgIGlmICghbWFuaWZlc3RFbnRyeSAmJiAhZW50cnkuZW5kc1dpdGgoXCIuY3NzXCIpKVxuICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKGBDb3VsZCBub3QgZmluZCBtYW5pZmVzdCBlbnRyeSBmb3IgJHtlbnRyeX1gKVxuXG4gICAgICAgIGNvbnN0IGFzc2V0VXJsID0gdXJsam9pbihhc3NldEJhc2VVcmwsIG1hbmlmZXN0RW50cnk/LmZpbGUgPz8gZW50cnkpXG5cbiAgICAgICAgaWYgKGVudHJ5LmVuZHNXaXRoKFwiLmNzc1wiKSkge1xuICAgICAgICAgICAgYXNzZXRzID0gW1xuICAgICAgICAgICAgICAgIC4uLmFzc2V0cyxcbiAgICAgICAgICAgICAgICA8bGlua1xuICAgICAgICAgICAgICAgICAgICBrZXk9e2Ake2VudHJ5fS1wcmVsb2FkYH1cbiAgICAgICAgICAgICAgICAgICAgcmVsPVwicHJlbG9hZFwiXG4gICAgICAgICAgICAgICAgICAgIGhyZWY9e2Fzc2V0VXJsfVxuICAgICAgICAgICAgICAgICAgICBhcz1cInN0eWxlXCJcbiAgICAgICAgICAgICAgICAvPixcbiAgICAgICAgICAgICAgICA8bGluayBrZXk9e2VudHJ5fSByZWw9XCJzdHlsZXNoZWV0XCIgaHJlZj17YXNzZXRVcmx9IC8+LFxuICAgICAgICAgICAgXVxuICAgICAgICB9IGVsc2UgaWYgKGVudHJ5Lm1hdGNoKC9cXC5bY21dPyhqc3xqc3h8dHN8dHN4KSQvKSkge1xuICAgICAgICAgICAgLy8gZXhwbGljaXRseSByZWZlcmVuY2UgdGhlIGVudHJ5OyBwcmVsb2FkIGl0IGFuZCBpdHMgZGVwZW5kZW5jaWVzXG4gICAgICAgICAgICBpZiAobWFuaWZlc3RFbnRyeT8uaXNFbnRyeSkge1xuICAgICAgICAgICAgICAgIGFzc2V0cyA9IFtcbiAgICAgICAgICAgICAgICAgICAgLi4uYXNzZXRzLFxuICAgICAgICAgICAgICAgICAgICA8c2NyaXB0XG4gICAgICAgICAgICAgICAgICAgICAgICBrZXk9e2VudHJ5fVxuICAgICAgICAgICAgICAgICAgICAgICAgdHlwZT1cIm1vZHVsZVwiXG4gICAgICAgICAgICAgICAgICAgICAgICBzcmM9e2Fzc2V0VXJsfVxuICAgICAgICAgICAgICAgICAgICAgICAgZGF0YS1hdHRhY2gtb3dpZC1lcnJvci1oYW5kbGVyXG4gICAgICAgICAgICAgICAgICAgIC8+LFxuICAgICAgICAgICAgICAgIF1cbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgYXNzZXRzID0gW1xuICAgICAgICAgICAgICAgIC4uLmFzc2V0cyxcbiAgICAgICAgICAgICAgICA8bGlua1xuICAgICAgICAgICAgICAgICAgICBrZXk9e2Ake2VudHJ5fS1wcmVsb2FkYH1cbiAgICAgICAgICAgICAgICAgICAgcmVsPVwibW9kdWxlcHJlbG9hZFwiIC8vIHNlZSBodHRwczovL2RldmVsb3Blci5jaHJvbWUuY29tL2Jsb2cvbW9kdWxlcHJlbG9hZC9cbiAgICAgICAgICAgICAgICAgICAgaHJlZj17YXNzZXRVcmx9XG4gICAgICAgICAgICAgICAgLz4sXG4gICAgICAgICAgICBdXG4gICAgICAgIH1cblxuICAgICAgICAvLyB3ZSBuZWVkIHRvIHJlY3Vyc2UgaW50byBib3RoIHRoZSBtb2R1bGUgaW1wb3J0cyBhbmQgaW1wb3J0ZWQgY3NzIGZpbGVzLCBhbmQgYWRkIHRhZ3MgZm9yIHRoZW0gYXMgd2VsbFxuICAgICAgICAvLyBhbHNvLCB3ZSBuZWVkIHRvIHRha2UgY2FyZSBvZiB0aGUgb3JkZX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gICAgICBPYmplY3QuZW50cmllcyhjbGllbnRTZXR0aW5ncykubWFwKChba2V5LCB2YWx1ZV0pID0+IFtcbiAgICAgICAgICAgICAgICAgICAgYHByb2Nlc3MuZW52LiR7a2V5fWAsXG4gICAgICAgICAgICAgICAgICAgIEpTT04uc3RyaW5naWZ5KHZhbHVlKSxcbiAgICAgICAgICAgICAgICBdKVxuICAgICAgICAgICAgKSxcbiAgICAgICAgfSxcbiAgICAgICAgYnVpbGQ6IHtcbiAgICAgICAgICAgIG1hbmlmZXN0OiB0cnVlLCAvLyBjcmVhdGVzIGEgbWFuaWZlc3QuanNvbiBmaWxlLCB3aGljaCB3ZSB1c2UgdG8gZGV0ZXJtaW5lIHdoaWNoIGZpbGVzIHRvIGxvYWQgaW4gcHJvZFxuICAgICAgICAgICAgZW1wdHlPdXREaXI6IHRydWUsXG4gICAgICAgICAgICBvdXREaXI6IGBkaXN0LyR7ZW50cnlwb2ludEluZm8ub3V0RGlyfWAsXG4gICAgICAgICAgICBzb3VyY2VtYXA6IHRydWUsXG4gICAgICAgICAgICB0YXJnZXQ6IFtcImNocm9tZTgwXCIsIFwiZmlyZWZveDc4XCIsIFwic2FmYXJpMTMuMVwiXSwgLy8gc2VlIGRvY3MvYnJvd3Nlci1zdXBwb3J0Lm1kXG4gICAgICAgICAgICByb2xsdXBPcHRpb25zOiB7XG4gICAgICAgICAgICAgICAgaW5wdXQ6IHtcbiAgICAgICAgICAgICAgICAgICAgW2VudHJ5cG9pbnRJbmZvLm91dE5hbWVdOiBlbnRyeXBvaW50SW5mby5lbnRyeVBvaW50RmlsZSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIG91dHB1dDoge1xuICAgICAgICAgICAgICAgICAgICBhc3NldEZpbGVOYW1lczogYCR7ZW50cnlwb2ludEluZm8ub3V0TmFtZX0uY3NzYCxcbiAgICAgICAgICAgICAgICAgICAgZW50cnlGaWxlTmFtZXM6IGAke2VudHJ5cG9pbnRJbmZvLm91dE5hbWV9Lm1qc2AsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0sXG4gICAgICAgIHBsdWdpbnM6IFtcbiAgICAgICAgICAgIHBsdWdpblJlYWN0KHtcbiAgICAgICAgICAgICAgICBiYWJlbDoge1xuICAgICAgICAgICAgICAgICAgICBwYXJzZXJPcHRzOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICBwbHVnaW5zOiBbXCJkZWNvcmF0b3JzLWxlZ2FjeVwiXSwgLy8gbmVlZGVkIHNvIG1vYnggZGVjb3JhdG9ycyB3b3JrIGNvcnJlY3RseVxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9KSxcbiAgICAgICAgICAgIHBsdWdpbkNoZWNrZXIoe1xuICAgICAgICAgICAgICAgIHR5cGVzY3JpcHQ6IHtcbiAgICAgICAgICAgICAgICAgICAgYnVpbGRNb2RlOiB0cnVlLFxuICAgICAgICAgICAgICAgICAgICB0c2NvbmZpZ1BhdGg6IFwidHNjb25maWcudml0ZS1jaGVja2VyLmpzb25cIixcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSksXG4gICAgICAgIF0sXG4gICAgICAgIHNlcnZlcjoge1xuICAgICAgICAgICAgcG9ydDogODA5MCxcbiAgICAgICAgICAgIHdhcm11cDogeyBjbGllbnRGaWxlczogW1ZJVEVfQVNTRVRfU0lURV9FTlRSWV0gfSxcbiAgICAgICAgfSxcbiAgICAgICAgcHJldmlldzoge1xuICAgICAgICAgICAgcG9ydDogODA5MCxcbiAgICAgICAgfSxcbiAgICB9KVxufVxuIiwgImNvbnN0IF9fdml0ZV9pbmplY3RlZF9vcmlnaW5hbF9kaXJuYW1lID0gXCIvVXNlcnMvc29waGlhL2NvZGUvb3dpZC9vd2lkLWdyYXBoZXJcIjtjb25zdCBfX3ZpdGVfaW5qZWN0ZWRfb3JpZ2luYWxfZmlsZW5hbWUgPSBcIi9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scUJBQXFCLEVBQUU7QUFBQSxJQUNuRDtBQUFBLElBQ0EsU0FBUztBQUFBLE1BQ0wsTUFBTTtBQUFBLElBQ1Y7QUFBQSxFQUNKLENBQUM7QUFDTDs7O0FDakZBLElBQU8sMkJBQVEsK0NBQWlEOyIsCiAgIm5hbWVzIjogWyJmcyIsICJwYXRoIiwgImRvdGVudiIsICJmcyIsICJfX3ZpdGVfaW5qZWN0ZWRfb3JpZ2luYWxfZGlybmFtZSIsICJfX3ZpdGVfaW5qZWN0ZWRfb3JpZ2luYWxfZGlybmFtZSIsICJiYXNlRGlyIiwgIkZlYXR1cmVGbGFnRmVhdHVyZSIsICJwYXJzZUludE9yVW5kZWZpbmVkIiwgIl9fdml0ZV9pbmplY3RlZF9vcmlnaW5hbF9kaXJuYW1lIiwgIl9fdml0ZV9pbmplY3RlZF9vcmlnaW5hbF9kaXJuYW1lIiwgImRvdGVudiIsICJCQUtFRF9CQVNFX1VSTCIsICJBRE1JTl9CQVNFX1VSTCIsICJCQUtFRF9HUkFQSEVSX1VSTCIsICJCVUdTTkFHX0FQSV9LRVkiLCAicGFyc2VJbnRPclVuZGVmaW5lZCIsICJwYXRoIiwgIkdET0NTX0RFVEFJTFNfT05fREVNQU5EX0lEIiwgInBhdGgiLCAiZnMiLCAiSU1BR0VfSE9TVElOR19SMl9DRE5fVVJMIiwgIklNQUdFX0hPU1RJTkdfUjJfQlVDS0VUX1BBVEgiLCAiSU1BR0VfSE9TVElOR19SMl9CVUNLRVRfU1VCRk9MREVSX1BBVEgiLCAiQURNSU5fQkFTRV9VUkwiXQp9Cg== From e89593c4916949a2d9c25ce9386ce8b120424ec8 Mon Sep 17 00:00:00 2001 From: sophiamersmann Date: Fri, 29 Nov 2024 14:58:36 +0100 Subject: [PATCH 41/52] =?UTF-8?q?=F0=9F=90=9B=20hide=20slope=20chart=20tab?= =?UTF-8?q?=20if=20line=20chart=20really=20is=20a=20bar=20chart?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../grapher/src/core/Grapher.tsx | 22 ++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/packages/@ourworldindata/grapher/src/core/Grapher.tsx b/packages/@ourworldindata/grapher/src/core/Grapher.tsx index f74c6d44f60..d4832fb959b 100644 --- a/packages/@ourworldindata/grapher/src/core/Grapher.tsx +++ b/packages/@ourworldindata/grapher/src/core/Grapher.tsx @@ -1542,10 +1542,26 @@ export class Grapher // if the given combination is not valid, then ignore all but the first chart type if (!validChartTypes) return chartTypes.slice(0, 1) - // projected data is only supported for line charts + // make sure showing a slope chart tab next to a line chart tab is sensible const isLineChart = validChartTypes[0] === GRAPHER_CHART_TYPES.LineChart - if (isLineChart && this.hasProjectedData) { - return [GRAPHER_CHART_TYPES.LineChart] + if (isLineChart) { + // projected data is only supported for line charts + if (this.hasProjectedData) return [GRAPHER_CHART_TYPES.LineChart] + + // if the line chart really is a bar chart, don't show the slope chart tab + const minTime = minTimeBoundFromJSONOrNegativeInfinity( + this.legacyConfigAsAuthored.minTime + ) + const maxTime = maxTimeBoundFromJSONOrPositiveInfinity( + this.legacyConfigAsAuthored.maxTime + ) + const times = + this.tableAfterAuthorTimelineFilter.timeColumn.uniqValues + const [startTime, endTime] = [minTime, maxTime].map((time) => + findClosestTime(times, time) + ) + const isDiscreteBar = this.hideTimeline && startTime === endTime + if (isDiscreteBar) return [GRAPHER_CHART_TYPES.LineChart] } return validChartTypes From c4097e938b63f74bcebc31f829f936949e3d18cd Mon Sep 17 00:00:00 2001 From: sophiamersmann Date: Fri, 29 Nov 2024 15:14:11 +0100 Subject: [PATCH 42/52] =?UTF-8?q?=E2=9C=A8=20automatically=20adjust=20hand?= =?UTF-8?q?les=20when=20switching=20from=20line=20to=20slope?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../grapher/src/controls/ContentSwitchers.tsx | 3 +++ .../grapher/src/core/Grapher.tsx | 20 +++++++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/packages/@ourworldindata/grapher/src/controls/ContentSwitchers.tsx b/packages/@ourworldindata/grapher/src/controls/ContentSwitchers.tsx index 8d947e5bb62..848f4340514 100644 --- a/packages/@ourworldindata/grapher/src/controls/ContentSwitchers.tsx +++ b/packages/@ourworldindata/grapher/src/controls/ContentSwitchers.tsx @@ -18,6 +18,7 @@ export interface ContentSwitchersManager { activeTab?: GrapherTabName hasMultipleChartTypes?: boolean setTab: (tab: GrapherTabName) => void + onTabChange: (oldTab: GrapherTabName, newTab: GrapherTabName) => void isNarrow?: boolean isMedium?: boolean isLineChartThatTurnedIntoDiscreteBar?: boolean @@ -112,8 +113,10 @@ export class ContentSwitchers extends React.Component<{ } @action.bound setTab(tabIndex: number): void { + const oldTab = this.manager.activeTab const newTab = this.availableTabs[tabIndex] this.manager.setTab(newTab) + this.manager.onTabChange?.(oldTab!, newTab) } render(): React.ReactElement { diff --git a/packages/@ourworldindata/grapher/src/core/Grapher.tsx b/packages/@ourworldindata/grapher/src/core/Grapher.tsx index d4832fb959b..8d9bdb03627 100644 --- a/packages/@ourworldindata/grapher/src/core/Grapher.tsx +++ b/packages/@ourworldindata/grapher/src/core/Grapher.tsx @@ -1311,6 +1311,26 @@ export class Grapher } } + @action.bound onTabChange( + oldTab: GrapherTabName, + newTab: GrapherTabName + ): void { + // if switching from a line to a slope chart and the handles are + // on the same time, then automatically adjust the handles so that + // a time period is selected and the slope chart view is meaningful + if ( + oldTab === GRAPHER_TAB_NAMES.LineChart && + newTab === GRAPHER_TAB_NAMES.SlopeChart && + this.areHandlesOnSameTime + ) { + if (this.startHandleTimeBound !== -Infinity) { + this.startHandleTimeBound = -Infinity + } else { + this.endHandleTimeBound = Infinity + } + } + } + // todo: can we remove this? // I believe these states can only occur during editing. @action.bound private ensureValidConfigWhenEditing(): void { From fddfee97df2f1e5ec7055ba6aff360a478269886 Mon Sep 17 00:00:00 2001 From: sophiamersmann Date: Fri, 29 Nov 2024 15:17:12 +0100 Subject: [PATCH 43/52] =?UTF-8?q?=F0=9F=90=9B=20(slope)=20only=20add=20ent?= =?UTF-8?q?ity=20name=20if=20necessary?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/@ourworldindata/grapher/src/slopeCharts/SlopeChart.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/@ourworldindata/grapher/src/slopeCharts/SlopeChart.tsx b/packages/@ourworldindata/grapher/src/slopeCharts/SlopeChart.tsx index 22b0148f18f..fbbed46fd2c 100644 --- a/packages/@ourworldindata/grapher/src/slopeCharts/SlopeChart.tsx +++ b/packages/@ourworldindata/grapher/src/slopeCharts/SlopeChart.tsx @@ -266,7 +266,7 @@ export class SlopeChart const { startTime, endTime, seriesStrategy } = this const { canSelectMultipleEntities = false } = this.manager - const { availableEntityNames } = this.selectionArray + const { availableEntityNames } = this.transformedTable const columnName = column.nonEmptyDisplayName const seriesName = getSeriesName({ entityName, From 6b6ff3537ec433df5d9c0fc2a8348e5c2388a47b Mon Sep 17 00:00:00 2001 From: sophiamersmann Date: Fri, 29 Nov 2024 15:23:57 +0100 Subject: [PATCH 44/52] =?UTF-8?q?=F0=9F=8E=89=20enable=20timeline=20animat?= =?UTF-8?q?ion=20for=20slope=20charts?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/@ourworldindata/grapher/src/core/Grapher.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/@ourworldindata/grapher/src/core/Grapher.tsx b/packages/@ourworldindata/grapher/src/core/Grapher.tsx index 8d9bdb03627..612bc475991 100644 --- a/packages/@ourworldindata/grapher/src/core/Grapher.tsx +++ b/packages/@ourworldindata/grapher/src/core/Grapher.tsx @@ -3519,7 +3519,7 @@ export class Grapher } @computed get disablePlay(): boolean { - return this.isOnSlopeChartTab + return false } @computed get animationEndTime(): Time { From 135ade9bf9155c3b8c82cd8f46a552e4b986c075 Mon Sep 17 00:00:00 2001 From: sophiamersmann Date: Fri, 29 Nov 2024 15:58:30 +0100 Subject: [PATCH 45/52] =?UTF-8?q?=F0=9F=94=A8=20(slope)=20update=20comment?= =?UTF-8?q?s?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../@ourworldindata/grapher/src/core/Grapher.tsx | 4 +--- .../grapher/src/slopeCharts/SlopeChart.tsx | 13 ++++++++++++- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/packages/@ourworldindata/grapher/src/core/Grapher.tsx b/packages/@ourworldindata/grapher/src/core/Grapher.tsx index 612bc475991..30fca4227a7 100644 --- a/packages/@ourworldindata/grapher/src/core/Grapher.tsx +++ b/packages/@ourworldindata/grapher/src/core/Grapher.tsx @@ -794,8 +794,6 @@ export class Grapher // Some chart types (e.g. stacked area charts) choose not to show an entity // with incomplete data. Such chart types define a custom transform function // to ensure that the entity selector only offers entities that are actually plotted. - // We apply the `tranformTableForSelection` method of the main chart type, - // so that the entity selector doesn't update when switching between chart types. if (this.chartInstance.transformTableForSelection) { table = this.chartInstance.transformTableForSelection(table) } @@ -1317,7 +1315,7 @@ export class Grapher ): void { // if switching from a line to a slope chart and the handles are // on the same time, then automatically adjust the handles so that - // a time period is selected and the slope chart view is meaningful + // the slope chart view is meaningful if ( oldTab === GRAPHER_TAB_NAMES.LineChart && newTab === GRAPHER_TAB_NAMES.SlopeChart && diff --git a/packages/@ourworldindata/grapher/src/slopeCharts/SlopeChart.tsx b/packages/@ourworldindata/grapher/src/slopeCharts/SlopeChart.tsx index fbbed46fd2c..b81b4e60de2 100644 --- a/packages/@ourworldindata/grapher/src/slopeCharts/SlopeChart.tsx +++ b/packages/@ourworldindata/grapher/src/slopeCharts/SlopeChart.tsx @@ -385,7 +385,18 @@ export class SlopeChart } @computed private get showNoDataSection(): boolean { - return this.noDataSeries.length > 0 + // nothing to show if there are no series with missing data + if (this.noDataSeries.length === 0) return false + + // we usually don't show the no data section if columns are plotted + // (since columns don't appear in the entity selector there is no need + // to explain that a column is missing – it just adds noise). but if + // the missing data strategy is set to hide, then we do want to give + // feedback as to why a slope is currently not rendered + return ( + this.seriesStrategy === SeriesStrategy.entity || + this.missingDataStrategy === MissingDataStrategy.hide + ) } @computed private get yAxisConfig(): AxisConfig { From 3050254f817551235552632b8793e9ff3b9d9ca4 Mon Sep 17 00:00:00 2001 From: sophiamersmann Date: Fri, 29 Nov 2024 16:35:07 +0100 Subject: [PATCH 46/52] =?UTF-8?q?=F0=9F=94=A8=20remove=20accidental=20comm?= =?UTF-8?q?its?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ....timestamp-1732790803730-c1bc0b6a7ecde.mjs | 351 ------------------ ....timestamp-1732870709594-73b494fdbcb7f.mjs | 351 ------------------ ....timestamp-1732886743306-ebf767a3e601c.mjs | 351 ------------------ 3 files changed, 1053 deletions(-) delete mode 100644 vite.config-site.mts.timestamp-1732790803730-c1bc0b6a7ecde.mjs delete mode 100644 vite.config-site.mts.timestamp-1732870709594-73b494fdbcb7f.mjs delete mode 100644 vite.config-site.mts.timestamp-1732886743306-ebf767a3e601c.mjs diff --git a/vite.config-site.mts.timestamp-1732790803730-c1bc0b6a7ecde.mjs b/vite.config-site.mts.timestamp-1732790803730-c1bc0b6a7ecde.mjs deleted file mode 100644 index 9ef808f81c3..00000000000 --- a/vite.config-site.mts.timestamp-1732790803730-c1bc0b6a7ecde.mjs +++ /dev/null @@ -1,351 +0,0 @@ -var __defProp = Object.defineProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; - -// site/viteUtils.tsx -import React from "file:///Users/sophia/code/owid/owid-grapher/node_modules/react/index.js"; - -// settings/findBaseDir.ts -import path from "path"; -import fs from "fs"; -function findProjectBaseDir(from) { - if (!fs.existsSync) return void 0; - let dir = path.dirname(from); - while (dir.length) { - if (fs.existsSync(path.resolve(dir, "package.json"))) return dir; - const parentDir = path.resolve(dir, ".."); - if (parentDir === dir) break; - else dir = parentDir; - } - return void 0; -} - -// site/viteUtils.tsx -import fs3 from "file:///Users/sophia/code/owid/owid-grapher/node_modules/fs-extra/lib/index.js"; - -// settings/serverSettings.ts -import path2 from "path"; -import dotenv2 from "file:///Users/sophia/code/owid/owid-grapher/node_modules/dotenv/lib/main.js"; -import fs2 from "fs"; -import ini from "file:///Users/sophia/code/owid/owid-grapher/node_modules/ini/lib/ini.js"; -import os from "os"; - -// settings/clientSettings.ts -var clientSettings_exports = {}; -__export(clientSettings_exports, { - ADMIN_BASE_URL: () => ADMIN_BASE_URL, - ADMIN_SERVER_HOST: () => ADMIN_SERVER_HOST, - ADMIN_SERVER_PORT: () => ADMIN_SERVER_PORT, - ALGOLIA_ID: () => ALGOLIA_ID, - ALGOLIA_INDEX_PREFIX: () => ALGOLIA_INDEX_PREFIX, - ALGOLIA_SEARCH_KEY: () => ALGOLIA_SEARCH_KEY, - BAKED_BASE_URL: () => BAKED_BASE_URL, - BAKED_GRAPHER_EXPORTS_BASE_URL: () => BAKED_GRAPHER_EXPORTS_BASE_URL, - BAKED_GRAPHER_URL: () => BAKED_GRAPHER_URL, - BAKED_SITE_EXPORTS_BASE_URL: () => BAKED_SITE_EXPORTS_BASE_URL, - BUGSNAG_API_KEY: () => BUGSNAG_API_KEY, - DATA_API_URL: () => DATA_API_URL, - DONATE_API_URL: () => DONATE_API_URL, - ENV: () => ENV, - ETL_API_URL: () => ETL_API_URL, - ETL_WIZARD_URL: () => ETL_WIZARD_URL, - EXPLORER_DYNAMIC_THUMBNAIL_URL: () => EXPLORER_DYNAMIC_THUMBNAIL_URL, - FEATURE_FLAGS: () => FEATURE_FLAGS, - FeatureFlagFeature: () => FeatureFlagFeature, - GDOCS_BASIC_ARTICLE_TEMPLATE_URL: () => GDOCS_BASIC_ARTICLE_TEMPLATE_URL, - GDOCS_CLIENT_EMAIL: () => GDOCS_CLIENT_EMAIL, - GDOCS_DETAILS_ON_DEMAND_ID: () => GDOCS_DETAILS_ON_DEMAND_ID, - GOOGLE_TAG_MANAGER_ID: () => GOOGLE_TAG_MANAGER_ID, - GRAPHER_DYNAMIC_CONFIG_URL: () => GRAPHER_DYNAMIC_CONFIG_URL, - GRAPHER_DYNAMIC_THUMBNAIL_URL: () => GRAPHER_DYNAMIC_THUMBNAIL_URL, - IMAGE_HOSTING_R2_BUCKET_PATH: () => IMAGE_HOSTING_R2_BUCKET_PATH, - IMAGE_HOSTING_R2_BUCKET_SUBFOLDER_PATH: () => IMAGE_HOSTING_R2_BUCKET_SUBFOLDER_PATH, - IMAGE_HOSTING_R2_CDN_URL: () => IMAGE_HOSTING_R2_CDN_URL, - MULTI_DIM_DYNAMIC_CONFIG_URL: () => MULTI_DIM_DYNAMIC_CONFIG_URL, - PUBLISHED_AT_FORMAT: () => PUBLISHED_AT_FORMAT, - RECAPTCHA_SITE_KEY: () => RECAPTCHA_SITE_KEY, - SENTRY_DSN: () => SENTRY_DSN, - TOPICS_CONTENT_GRAPH: () => TOPICS_CONTENT_GRAPH -}); -import dotenv from "file:///Users/sophia/code/owid/owid-grapher/node_modules/dotenv/lib/main.js"; -import { parseIntOrUndefined } from "file:///Users/sophia/code/owid/owid-grapher/packages/@ourworldindata/utils/dist/index.js"; -var __vite_injected_original_dirname2 = "/Users/sophia/code/owid/owid-grapher/settings"; -if (typeof __vite_injected_original_dirname2 !== "undefined") { - const baseDir2 = findProjectBaseDir(__vite_injected_original_dirname2); - if (baseDir2) dotenv.config({ path: `${baseDir2}/.env` }); -} -var ENV = process.env.ENV === "production" ? "production" : "development"; -var BUGSNAG_API_KEY = process.env.BUGSNAG_API_KEY; -var SENTRY_DSN = process.env.SENTRY_DSN; -var ADMIN_SERVER_PORT = parseIntOrUndefined(process.env.ADMIN_SERVER_PORT) ?? 3030; -var ADMIN_SERVER_HOST = process.env.ADMIN_SERVER_HOST ?? "localhost"; -var BAKED_BASE_URL = process.env.BAKED_BASE_URL ?? `http://${ADMIN_SERVER_HOST}:${ADMIN_SERVER_PORT}`; -var BAKED_GRAPHER_URL = process.env.BAKED_GRAPHER_URL ?? `${BAKED_BASE_URL}/grapher`; -var BAKED_GRAPHER_EXPORTS_BASE_URL = process.env.BAKED_GRAPHER_EXPORTS_BASE_URL ?? `${BAKED_GRAPHER_URL}/exports`; -var BAKED_SITE_EXPORTS_BASE_URL = process.env.BAKED_SITE_EXPORTS_BASE_URL ?? `${BAKED_BASE_URL}/exports`; -var GRAPHER_DYNAMIC_THUMBNAIL_URL = process.env.GRAPHER_DYNAMIC_THUMBNAIL_URL ?? `${BAKED_GRAPHER_URL}`; -var EXPLORER_DYNAMIC_THUMBNAIL_URL = process.env.EXPLORER_DYNAMIC_THUMBNAIL_URL ?? `${BAKED_BASE_URL}/explorers`; -var GRAPHER_DYNAMIC_CONFIG_URL = process.env.GRAPHER_DYNAMIC_CONFIG_URL ?? `${BAKED_GRAPHER_URL}`; -var MULTI_DIM_DYNAMIC_CONFIG_URL = process.env.MULTI_DIM_DYNAMIC_CONFIG_URL ?? `${BAKED_BASE_URL}/multi-dim`; -var ADMIN_BASE_URL = process.env.ADMIN_BASE_URL ?? `http://${ADMIN_SERVER_HOST}:${ADMIN_SERVER_PORT}`; -var DATA_API_URL = process.env.DATA_API_URL ?? "https://api.ourworldindata.org/v1/indicators/"; -var ALGOLIA_ID = process.env.ALGOLIA_ID ?? ""; -var ALGOLIA_SEARCH_KEY = process.env.ALGOLIA_SEARCH_KEY ?? ""; -var ALGOLIA_INDEX_PREFIX = process.env.ALGOLIA_INDEX_PREFIX ?? ""; -var DONATE_API_URL = process.env.DONATE_API_URL ?? "http://localhost:8788/donation/donate"; -var RECAPTCHA_SITE_KEY = process.env.RECAPTCHA_SITE_KEY ?? "6LcJl5YUAAAAAATQ6F4vl9dAWRZeKPBm15MAZj4Q"; -var GOOGLE_TAG_MANAGER_ID = process.env.GOOGLE_TAG_MANAGER_ID ?? ""; -var TOPICS_CONTENT_GRAPH = process.env.TOPICS_CONTENT_GRAPH === "true"; -var GDOCS_CLIENT_EMAIL = process.env.GDOCS_CLIENT_EMAIL ?? ""; -var GDOCS_BASIC_ARTICLE_TEMPLATE_URL = process.env.GDOCS_BASIC_ARTICLE_TEMPLATE_URL ?? ""; -var IMAGE_HOSTING_R2_CDN_URL = process.env.IMAGE_HOSTING_R2_CDN_URL || ""; -var IMAGE_HOSTING_R2_BUCKET_PATH = process.env.IMAGE_HOSTING_R2_BUCKET_PATH || ""; -var IMAGE_HOSTING_R2_BUCKET_SUBFOLDER_PATH = IMAGE_HOSTING_R2_BUCKET_PATH.slice( - IMAGE_HOSTING_R2_BUCKET_PATH.indexOf("/") + 1 -); -var ETL_WIZARD_URL = process.env.ETL_WIZARD_URL ?? `http://${ADMIN_SERVER_HOST}:8053/`; -var ETL_API_URL = process.env.ETL_API_URL ?? `http://${ADMIN_SERVER_HOST}:8081/api/v1`; -var GDOCS_DETAILS_ON_DEMAND_ID = process.env.GDOCS_DETAILS_ON_DEMAND_ID ?? ""; -var PUBLISHED_AT_FORMAT = "ddd, MMM D, YYYY HH:mm"; -var FeatureFlagFeature = /* @__PURE__ */ ((FeatureFlagFeature2) => { - FeatureFlagFeature2["MultiDimDataPage"] = "MultiDimDataPage"; - return FeatureFlagFeature2; -})(FeatureFlagFeature || {}); -var featureFlagsRaw = typeof process.env.FEATURE_FLAGS === "string" && process.env.FEATURE_FLAGS.trim()?.split(",") || []; -var FEATURE_FLAGS = new Set( - Object.keys(FeatureFlagFeature).filter( - (key) => featureFlagsRaw.includes(key) - ) -); - -// settings/serverSettings.ts -import { parseIntOrUndefined as parseIntOrUndefined2 } from "file:///Users/sophia/code/owid/owid-grapher/packages/@ourworldindata/utils/dist/index.js"; -var __vite_injected_original_dirname3 = "/Users/sophia/code/owid/owid-grapher/settings"; -var baseDir = findProjectBaseDir(__vite_injected_original_dirname3); -if (baseDir === void 0) throw new Error("could not locate base package.json"); -dotenv2.config({ path: `${baseDir}/.env` }); -var serverSettings = process.env ?? {}; -var BASE_DIR = baseDir; -var DATA_API_FOR_ADMIN_UI = serverSettings.DATA_API_FOR_ADMIN_UI; -var BAKED_BASE_URL2 = BAKED_BASE_URL; -var VITE_PREVIEW = serverSettings.VITE_PREVIEW === "true"; -var ADMIN_BASE_URL2 = ADMIN_BASE_URL; -var BAKED_GRAPHER_URL2 = serverSettings.BAKED_GRAPHER_URL ?? `${BAKED_BASE_URL2}/grapher`; -var OPTIMIZE_SVG_EXPORTS = serverSettings.OPTIMIZE_SVG_EXPORTS === "true"; -var GITHUB_USERNAME = serverSettings.GITHUB_USERNAME ?? "owid-test"; -var GIT_DEFAULT_USERNAME = serverSettings.GIT_DEFAULT_USERNAME ?? "Our World in Data"; -var GIT_DEFAULT_EMAIL = serverSettings.GIT_DEFAULT_EMAIL ?? "info@ourworldindata.org"; -var BUGSNAG_API_KEY2 = serverSettings.BUGSNAG_API_KEY; -var BUGSNAG_NODE_API_KEY = serverSettings.BUGSNAG_NODE_API_KEY; -var BLOG_POSTS_PER_PAGE = parseIntOrUndefined2(serverSettings.BLOG_POSTS_PER_PAGE) ?? 21; -var BLOG_SLUG = serverSettings.BLOG_SLUG ?? "latest"; -var GRAPHER_DB_NAME = serverSettings.GRAPHER_DB_NAME ?? "owid"; -var GRAPHER_DB_USER = serverSettings.GRAPHER_DB_USER ?? "root"; -var GRAPHER_DB_PASS = serverSettings.GRAPHER_DB_PASS ?? ""; -var GRAPHER_DB_HOST = serverSettings.GRAPHER_DB_HOST ?? "localhost"; -var GRAPHER_DB_PORT = parseIntOrUndefined2(serverSettings.GRAPHER_DB_PORT) ?? 3306; -var GRAPHER_TEST_DB_NAME = serverSettings.GRAPHER_TEST_DB_NAME ?? "owid"; -var GRAPHER_TEST_DB_USER = serverSettings.GRAPHER_TEST_DB_USER ?? "root"; -var GRAPHER_TEST_DB_PASS = serverSettings.GRAPHER_TEST_DB_PASS ?? ""; -var GRAPHER_TEST_DB_HOST = serverSettings.GRAPHER_TEST_DB_HOST ?? "localhost"; -var GRAPHER_TEST_DB_PORT = parseIntOrUndefined2(serverSettings.GRAPHER_TEST_DB_PORT) ?? 3306; -var BAKED_SITE_DIR = serverSettings.BAKED_SITE_DIR ?? path2.resolve(BASE_DIR, "bakedSite"); -var SECRET_KEY = serverSettings.SECRET_KEY ?? "fejwiaof jewiafo jeioa fjieowajf isa fjidosajfgj"; -var SESSION_COOKIE_AGE = parseIntOrUndefined2(serverSettings.SESSION_COOKIE_AGE) ?? 1209600; -var ALGOLIA_SECRET_KEY = serverSettings.ALGOLIA_SECRET_KEY ?? ""; -var ALGOLIA_INDEXING = serverSettings.ALGOLIA_INDEXING === "true"; -var HTTPS_ONLY = serverSettings.HTTPS_ONLY !== "false"; -var GIT_DATASETS_DIR = serverSettings.GIT_DATASETS_DIR ?? `${BASE_DIR}/datasetsExport`; -var TMP_DIR = serverSettings.TMP_DIR ?? "/tmp"; -var UNCATEGORIZED_TAG_ID = parseIntOrUndefined2(serverSettings.UNCATEGORIZED_TAG_ID) ?? 375; -var BAKE_ON_CHANGE = serverSettings.BAKE_ON_CHANGE === "true"; -var DEPLOY_QUEUE_FILE_PATH = serverSettings.DEPLOY_QUEUE_FILE_PATH ?? `${BASE_DIR}/.queue`; -var DEPLOY_PENDING_FILE_PATH = serverSettings.DEPLOY_PENDING_FILE_PATH ?? `${BASE_DIR}/.pending`; -var CLOUDFLARE_AUD = serverSettings.CLOUDFLARE_AUD ?? ""; -var CATALOG_PATH = serverSettings.CATALOG_PATH ?? ""; -var GDOCS_PRIVATE_KEY = (serverSettings.GDOCS_PRIVATE_KEY ?? "").replaceAll('"', "").replaceAll("'", ""); -var GDOCS_CLIENT_ID = serverSettings.GDOCS_CLIENT_ID ?? ""; -var GDOCS_BACKPORTING_TARGET_FOLDER = serverSettings.GDOCS_BACKPORTING_TARGET_FOLDER ?? ""; -var GDOCS_IMAGES_BACKPORTING_TARGET_FOLDER = serverSettings.GDOCS_IMAGES_BACKPORTING_TARGET_FOLDER ?? ""; -var GDOCS_DONATE_FAQS_DOCUMENT_ID = serverSettings.GDOCS_DONATE_FAQS_DOCUMENT_ID ?? "194PNSFjgSlt9Zm5xYuDOF0l_GLKZbVxH2co3zCok_cE"; -var GDOCS_SHARED_DRIVE_ID = serverSettings.GDOCS_SHARED_DRIVE_ID ?? ""; -var GDOCS_DETAILS_ON_DEMAND_ID2 = serverSettings.GDOCS_DETAILS_ON_DEMAND_ID ?? ""; -var rcloneConfig = {}; -var rcloneConfigPath = path2.join(os.homedir(), ".config/rclone/rclone.conf"); -if (fs2.existsSync(rcloneConfigPath)) { - rcloneConfig = ini.parse(fs2.readFileSync(rcloneConfigPath, "utf-8")); -} -var IMAGE_HOSTING_R2_CDN_URL2 = serverSettings.IMAGE_HOSTING_R2_CDN_URL || ""; -var IMAGE_HOSTING_R2_BUCKET_PATH2 = serverSettings.IMAGE_HOSTING_R2_BUCKET_PATH || ""; -var IMAGE_HOSTING_R2_BUCKET_SUBFOLDER_PATH2 = IMAGE_HOSTING_R2_BUCKET_PATH2.slice( - IMAGE_HOSTING_R2_BUCKET_PATH2.indexOf("/") + 1 -); -var R2_ENDPOINT = serverSettings.R2_ENDPOINT || rcloneConfig["owid-r2"]?.endpoint || "https://078fcdfed9955087315dd86792e71a7e.r2.cloudflarestorage.com"; -var R2_ACCESS_KEY_ID = serverSettings.R2_ACCESS_KEY_ID || rcloneConfig["owid-r2"]?.access_key_id || ""; -var R2_SECRET_ACCESS_KEY = serverSettings.R2_SECRET_ACCESS_KEY || rcloneConfig["owid-r2"]?.secret_access_key || ""; -var R2_REGION = serverSettings.R2_REGION || rcloneConfig["owid-r2"]?.region || "auto"; -var GRAPHER_CONFIG_R2_BUCKET = serverSettings.GRAPHER_CONFIG_R2_BUCKET; -var GRAPHER_CONFIG_R2_BUCKET_PATH = serverSettings.GRAPHER_CONFIG_R2_BUCKET_PATH; -var BUILDKITE_API_ACCESS_TOKEN = serverSettings.BUILDKITE_API_ACCESS_TOKEN ?? ""; -var BUILDKITE_DEPLOY_CONTENT_PIPELINE_SLUG = serverSettings.BUILDKITE_DEPLOY_CONTENT_PIPELINE_SLUG || "owid-deploy-content-master"; -var BUILDKITE_BRANCH = serverSettings.BUILDKITE_BRANCH || "master"; -var BUILDKITE_DEPLOY_CONTENT_SLACK_CHANNEL = serverSettings.BUILDKITE_DEPLOY_CONTENT_SLACK_CHANNEL || "C06EWA0DK4H"; -var OPENAI_API_KEY = serverSettings.OPENAI_API_KEY ?? ""; -var SLACK_BOT_OAUTH_TOKEN = serverSettings.SLACK_BOT_OAUTH_TOKEN ?? ""; -var LEGACY_WORDPRESS_IMAGE_URL = serverSettings.LEGACY_WORDPRESS_IMAGE_URL ?? "https://assets.ourworldindata.org/uploads"; -var ENV_IS_STAGING = ADMIN_BASE_URL2.includes( - "http://staging-site" -); - -// site/SiteConstants.ts -import { faRss } from "file:///Users/sophia/code/owid/owid-grapher/node_modules/@fortawesome/free-solid-svg-icons/index.mjs"; -import { - faXTwitter, - faFacebookSquare, - faInstagram, - faThreads, - faLinkedin, - faBluesky -} from "file:///Users/sophia/code/owid/owid-grapher/node_modules/@fortawesome/free-brands-svg-icons/index.mjs"; -var polyfillFeatures = [ - "es2021", - // String.replaceAll, Promise.any, ... - "es2022", - // Array.at, String.at, ... - "es2023", - // Array.findLast, Array.toReversed, Array.toSorted, Array.with, ... - "IntersectionObserver", - "IntersectionObserverEntry" -]; -var POLYFILL_VERSION = "4.8.0"; -var POLYFILL_URL = `https://cdnjs.cloudflare.com/polyfill/v3/polyfill.min.js?version=${POLYFILL_VERSION}&features=${polyfillFeatures.join( - "," -)}`; -var DATA_INSIGHTS_ATOM_FEED_NAME = "atom-data-insights.xml"; -var DATA_INSIGHT_ATOM_FEED_PROPS = { - title: "Atom feed for Daily Data Insights", - href: `https://ourworldindata.org/${DATA_INSIGHTS_ATOM_FEED_NAME}` -}; -var RSS_FEEDS = [ - { - title: "Research & Writing RSS Feed", - url: "/atom.xml", - icon: faRss - }, - { - title: "Daily Data Insights RSS Feed", - url: `/${DATA_INSIGHTS_ATOM_FEED_NAME}`, - icon: faRss - } -]; - -// site/viteUtils.tsx -import { sortBy } from "file:///Users/sophia/code/owid/owid-grapher/packages/@ourworldindata/utils/dist/index.js"; -import urljoin from "file:///Users/sophia/code/owid/owid-grapher/node_modules/url-join/lib/url-join.js"; -var VITE_DEV_URL = process.env.VITE_DEV_URL ?? "http://localhost:8090"; -var VITE_ASSET_SITE_ENTRY = "site/owid.entry.ts"; -var VITE_ASSET_ADMIN_ENTRY = "adminSiteClient/admin.entry.ts"; -var VITE_ENTRYPOINT_INFO = { - ["site" /* Site */]: { - entryPointFile: VITE_ASSET_SITE_ENTRY, - outDir: "assets", - outName: "owid" - }, - ["admin" /* Admin */]: { - entryPointFile: VITE_ASSET_ADMIN_ENTRY, - outDir: "assets-admin", - outName: "admin" - } -}; - -// vite.config-common.mts -import { defineConfig } from "file:///Users/sophia/code/owid/owid-grapher/node_modules/vite/dist/node/index.js"; -import pluginReact from "file:///Users/sophia/code/owid/owid-grapher/node_modules/@vitejs/plugin-react/dist/index.mjs"; -import pluginChecker from "file:///Users/sophia/code/owid/owid-grapher/node_modules/vite-plugin-checker/dist/esm/main.js"; -var defineViteConfigForEntrypoint = (entrypoint) => { - const entrypointInfo = VITE_ENTRYPOINT_INFO[entrypoint]; - return defineConfig({ - publicDir: false, - // don't copy public folder to dist - resolve: { - // prettier-ignore - alias: { - "@ourworldindata/grapher/src": "@ourworldindata/grapher/src", - // need this for imports of @ourworldindata/grapher/src/core/grapher.scss to work - // we alias to the packages source files in dev and prod: - // this means we get instant dev updates when we change one of them, - // and the prod build builds them all as esm modules, which helps with tree shaking - // Idea from https://github.com/LinusBorg/vue-lib-template/blob/3775e49b20a7c3349dd49321cad2ed7f9d575057/packages/playground/vite.config.ts - "@ourworldindata/components": "@ourworldindata/components/src/index.ts", - "@ourworldindata/core-table": "@ourworldindata/core-table/src/index.ts", - "@ourworldindata/explorer": "@ourworldindata/explorer/src/index.ts", - "@ourworldindata/grapher": "@ourworldindata/grapher/src/index.ts", - "@ourworldindata/types": "@ourworldindata/types/src/index.ts", - "@ourworldindata/utils": "@ourworldindata/utils/src/index.ts" - } - }, - css: { - devSourcemap: true - }, - define: { - // Replace all clientSettings with their respective values, i.e. assign e.g. BUGSNAG_API_KEY to process.env.BUGSNAG_API_KEY - // it's important to note that we only expose values that are present in the clientSettings file - not any other things that are stored in .env - ...Object.fromEntries( - Object.entries(clientSettings_exports).map(([key, value]) => [ - `process.env.${key}`, - JSON.stringify(value) - ]) - ) - }, - build: { - manifest: true, - // creates a manifest.json file, which we use to determine which files to load in prod - emptyOutDir: true, - outDir: `dist/${entrypointInfo.outDir}`, - sourcemap: true, - target: ["chrome80", "firefox78", "safari13.1"], - // see docs/browser-support.md - rollupOptions: { - input: { - [entrypointInfo.outName]: entrypointInfo.entryPointFile - }, - output: { - assetFileNames: `${entrypointInfo.outName}.css`, - entryFileNames: `${entrypointInfo.outName}.mjs` - } - } - }, - plugins: [ - pluginReact({ - babel: { - parserOpts: { - plugins: ["decorators-legacy"] - // needed so mobx decorators work correctly - } - } - }), - pluginChecker({ - typescript: { - buildMode: true, - tsconfigPath: "tsconfig.vite-checker.json" - } - }) - ], - server: { - port: 8090, - warmup: { clientFiles: [VITE_ASSET_SITE_ENTRY] } - }, - preview: { - port: 8090 - } - }); -}; - -// vite.config-site.mts -var vite_config_site_default = defineViteConfigForEntrypoint("site" /* Site */); -export { - vite_config_site_default as default -}; -//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsic2l0ZS92aXRlVXRpbHMudHN4IiwgInNldHRpbmdzL2ZpbmRCYXNlRGlyLnRzIiwgInNldHRpbmdzL3NlcnZlclNldHRpbmdzLnRzIiwgInNldHRpbmdzL2NsaWVudFNldHRpbmdzLnRzIiwgInNpdGUvU2l0ZUNvbnN0YW50cy50cyIsICJ2aXRlLmNvbmZpZy1jb21tb24ubXRzIiwgInZpdGUuY29uZmlnLXNpdGUubXRzIl0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F9faHRtbDogYGltcG9ydCBSZWZyZXNoUnVudGltZSBmcm9tICcke2Jhc2VVcmx9L0ByZWFjdC1yZWZyZXNoJ1xuICBSZWZyZXNoUnVudGltZS5pbmplY3RJbnRvR2xvYmFsSG9vayh3aW5kb3cpXG4gIHdpbmRvdy4kUmVmcmVzaFJlZyQgPSAoKSA9PiB7fVxuICB3aW5kb3cuJFJlZnJlc2hTaWckID0gKCkgPT4gKHR5cGUpID0+IHR5cGVcbiAgd2luZG93Ll9fdml0ZV9wbHVnaW5fcmVhY3RfcHJlYW1ibGVfaW5zdGFsbGVkX18gPSB0cnVlYCxcbiAgICAgICAgICAgICAgICB9fVxuICAgICAgICAgICAgLz4sXG4gICAgICAgICAgICA8c2NyaXB0XG4gICAgICAgICAgICAgICAga2V5PVwidml0ZS1wbHVnaW4tY2hlY2tlclwiXG4gICAgICAgICAgICAgICAgdHlwZT1cIm1vZHVsZVwiXG4gICAgICAgICAgICAgICAgc3JjPXtgJHtiYXNlVXJsfS9Adml0ZS1wbHVnaW4tY2hlY2tlci1ydW50aW1lLWVudHJ5YH1cbiAgICAgICAgICAgIC8+LFxuICAgICAgICAgICAgPHNjcmlwdFxuICAgICAgICAgICAgICAgIGtleT1cInZpdGUtY2xpZW50XCJcbiAgICAgICAgICAgICAgICB0eXBlPVwibW9kdWxlXCJcbiAgICAgICAgICAgICAgICBzcmM9e2Ake2Jhc2VVcmx9L0B2aXRlL2NsaWVudGB9XG4gICAgICAgICAgICAvPixcbiAgICAgICAgICAgIDxzY3JpcHRcbiAgICAgICAgICAgICAgICBrZXk9e2VudHJ5cG9pbnR9XG4gICAgICAgICAgICAgICAgdHlwZT1cIm1vZHVsZVwiXG4gICAgICAgICAgICAgICAgc3JjPXtgJHtiYXNlVXJsfS8ke1ZJVEVfRU5UUllQT0lOVF9JTkZPW2VudHJ5cG9pbnRdLmVudHJ5UG9pbnRGaWxlfWB9XG4gICAgICAgICAgICAvPixcbiAgICAgICAgXSxcbiAgICB9XG59XG5c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nkpXG5cbiAgICAgICAgaWYgKGVudHJ5LmVuZHNXaXRoKFwiLmNzc1wiKSkge1xuICAgICAgICAgICAgYXNzZXRzID0gW1xuICAgICAgICAgICAgICAgIC4uLmFzc2V0cyxcbiAgICAgICAgICAgICAgICA8bGlua1xuICAgICAgICAgICAgICAgICAgICBrZXk9e2Ake2VudHJ5fS1wcmVsb2FkYH1cbiAgICAgICAgICAgICAgICAgICAgcmVsPVwicHJlbG9hZFwiXG4gICAgICAgICAgICAgICAgICAgIGhyZWY9e2Fzc2V0VXJsfVxuICAgICAgICAgICAgICAgICAgICBhcz1cInN0eWxlXCJcbiAgICAgICAgICAgICAgICAvPixcbiAgICAgICAgICAgICAgICA8bGluayBrZXk9e2VudHJ5fSByZWw9XCJzdHlsZXNoZWV0XCIgaHJlZj17YXNzZXRVcmx9IC8+LFxuICAgICAgICAgICAgXVxuICAgICAgICB9IGVsc2UgaWYgKGVudHJ5Lm1hdGNoKC9cXC5bY21dPyhqc3xqc3h8dHN8dHN4KSQvKSkge1xuICAgICAgICAgICAgLy8gZXhwbGljaXRseSByZWZlcmVuY2UgdGhlIGVudHJ5OyBwcmVsb2FkIGl0IGFuZCBpdHMgZGVwZW5kZW5jaWVzXG4gICAgICAgICAgICBpZiAobWFuaWZlc3RFbnRyeT8uaXNFbnRyeSkge1xuICAgICAgICAgICAgICAgIGFzc2V0cyA9IFtcbiAgICAgICAgICAgICAgICAgICAgLi4uYXNzZXRzLFxuICAgICAgICAgICAgICAgICAgICA8c2NyaXB0XG4gICAgICAgICAgICAgICAgICAgICAgICBrZXk9e2VudHJ5fVxuICAgICAgICAgICAgICAgICAgICAgICAgdHlwZT1cIm1vZHVsZVwiXG4gICAgICAgICAgICAgICAgICAgICAgICBzcmM9e2Fzc2V0VXJsfVxuICAgICAgICAgICAgICAgICAgICAgICAgZGF0YS1hdHRhY2gtb3dpZC1lcnJvci1oYW5kbGVyXG4gICAgICAgICAgICAgICAgICAgIC8+LFxuICAgICAgICAgICAgICAg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WUsXG4gICAgICAgICAgICBvdXREaXI6IGBkaXN0LyR7ZW50cnlwb2ludEluZm8ub3V0RGlyfWAsXG4gICAgICAgICAgICBzb3VyY2VtYXA6IHRydWUsXG4gICAgICAgICAgICB0YXJnZXQ6IFtcImNocm9tZTgwXCIsIFwiZmlyZWZveDc4XCIsIFwic2FmYXJpMTMuMVwiXSwgLy8gc2VlIGRvY3MvYnJvd3Nlci1zdXBwb3J0Lm1kXG4gICAgICAgICAgICByb2xsdXBPcHRpb25zOiB7XG4gICAgICAgICAgICAgICAgaW5wdXQ6IHtcbiAgICAgICAgICAgICAgICAgICAgW2VudHJ5cG9pbnRJbmZvLm91dE5hbWVdOiBlbnRyeXBvaW50SW5mby5lbnRyeVBvaW50RmlsZSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIG91dHB1dDoge1xuICAgICAgICAgICAgICAgICAgICBhc3NldEZpbGVOYW1lczogYCR7ZW50cnlwb2ludEluZm8ub3V0TmFtZX0uY3NzYCxcbiAgICAgICAgICAgICAgICAgICAgZW50cnlGaWxlTmFtZXM6IGAke2VudHJ5cG9pbnRJbmZvLm91dE5hbWV9Lm1qc2AsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0sXG4gICAgICAgIHBsdWdpbnM6IFtcbiAgICAgICAgICAgIHBsdWdpblJlYWN0KHtcbiAgICAgICAgICAgICAgICBiYWJlbDoge1xuICAgICAgICAgICAgICAgICAgICBwYXJzZXJPcHRzOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICBwbHVnaW5zOiBbXCJkZWNvcmF0b3JzLWxlZ2FjeVwiXSwgLy8gbmVlZGVkIHNvIG1vYnggZGVjb3JhdG9ycyB3b3JrIGNvcnJlY3RseVxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9KSxcbiAgICAgICAgICAgIHBsdWdpbkNoZWNrZXIoe1xuICAgICAgICA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9vcmlnaW5hbF9kaXJuYW1lIiwgImRvdGVudiIsICJCQUtFRF9CQVNFX1VSTCIsICJBRE1JTl9CQVNFX1VSTCIsICJCQUtFRF9HUkFQSEVSX1VSTCIsICJCVUdTTkFHX0FQSV9LRVkiLCAicGFyc2VJbnRPclVuZGVmaW5lZCIsICJwYXRoIiwgIkdET0NTX0RFVEFJTFNfT05fREVNQU5EX0lEIiwgInBhdGgiLCAiZnMiLCAiSU1BR0VfSE9TVElOR19SMl9DRE5fVVJMIiwgIklNQUdFX0hPU1RJTkdfUjJfQlVDS0VUX1BBVEgiLCAiSU1BR0VfSE9TVElOR19SMl9CVUNLRVRfU1VCRk9MREVSX1BBVEgiLCAiQURNSU5fQkFTRV9VUkwiXQp9Cg== diff --git a/vite.config-site.mts.timestamp-1732870709594-73b494fdbcb7f.mjs b/vite.config-site.mts.timestamp-1732870709594-73b494fdbcb7f.mjs deleted file mode 100644 index 9ef808f81c3..00000000000 --- a/vite.config-site.mts.timestamp-1732870709594-73b494fdbcb7f.mjs +++ /dev/null @@ -1,351 +0,0 @@ -var __defProp = Object.defineProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; - -// site/viteUtils.tsx -import React from "file:///Users/sophia/code/owid/owid-grapher/node_modules/react/index.js"; - -// settings/findBaseDir.ts -import path from "path"; -import fs from "fs"; -function findProjectBaseDir(from) { - if (!fs.existsSync) return void 0; - let dir = path.dirname(from); - while (dir.length) { - if (fs.existsSync(path.resolve(dir, "package.json"))) return dir; - const parentDir = path.resolve(dir, ".."); - if (parentDir === dir) break; - else dir = parentDir; - } - return void 0; -} - -// site/viteUtils.tsx -import fs3 from "file:///Users/sophia/code/owid/owid-grapher/node_modules/fs-extra/lib/index.js"; - -// settings/serverSettings.ts -import path2 from "path"; -import dotenv2 from "file:///Users/sophia/code/owid/owid-grapher/node_modules/dotenv/lib/main.js"; -import fs2 from "fs"; -import ini from "file:///Users/sophia/code/owid/owid-grapher/node_modules/ini/lib/ini.js"; -import os from "os"; - -// settings/clientSettings.ts -var clientSettings_exports = {}; -__export(clientSettings_exports, { - ADMIN_BASE_URL: () => ADMIN_BASE_URL, - ADMIN_SERVER_HOST: () => ADMIN_SERVER_HOST, - ADMIN_SERVER_PORT: () => ADMIN_SERVER_PORT, - ALGOLIA_ID: () => ALGOLIA_ID, - ALGOLIA_INDEX_PREFIX: () => ALGOLIA_INDEX_PREFIX, - ALGOLIA_SEARCH_KEY: () => ALGOLIA_SEARCH_KEY, - BAKED_BASE_URL: () => BAKED_BASE_URL, - BAKED_GRAPHER_EXPORTS_BASE_URL: () => BAKED_GRAPHER_EXPORTS_BASE_URL, - BAKED_GRAPHER_URL: () => BAKED_GRAPHER_URL, - BAKED_SITE_EXPORTS_BASE_URL: () => BAKED_SITE_EXPORTS_BASE_URL, - BUGSNAG_API_KEY: () => BUGSNAG_API_KEY, - DATA_API_URL: () => DATA_API_URL, - DONATE_API_URL: () => DONATE_API_URL, - ENV: () => ENV, - ETL_API_URL: () => ETL_API_URL, - ETL_WIZARD_URL: () => ETL_WIZARD_URL, - EXPLORER_DYNAMIC_THUMBNAIL_URL: () => EXPLORER_DYNAMIC_THUMBNAIL_URL, - FEATURE_FLAGS: () => FEATURE_FLAGS, - FeatureFlagFeature: () => FeatureFlagFeature, - GDOCS_BASIC_ARTICLE_TEMPLATE_URL: () => GDOCS_BASIC_ARTICLE_TEMPLATE_URL, - GDOCS_CLIENT_EMAIL: () => GDOCS_CLIENT_EMAIL, - GDOCS_DETAILS_ON_DEMAND_ID: () => GDOCS_DETAILS_ON_DEMAND_ID, - GOOGLE_TAG_MANAGER_ID: () => GOOGLE_TAG_MANAGER_ID, - GRAPHER_DYNAMIC_CONFIG_URL: () => GRAPHER_DYNAMIC_CONFIG_URL, - GRAPHER_DYNAMIC_THUMBNAIL_URL: () => GRAPHER_DYNAMIC_THUMBNAIL_URL, - IMAGE_HOSTING_R2_BUCKET_PATH: () => IMAGE_HOSTING_R2_BUCKET_PATH, - IMAGE_HOSTING_R2_BUCKET_SUBFOLDER_PATH: () => IMAGE_HOSTING_R2_BUCKET_SUBFOLDER_PATH, - IMAGE_HOSTING_R2_CDN_URL: () => IMAGE_HOSTING_R2_CDN_URL, - MULTI_DIM_DYNAMIC_CONFIG_URL: () => MULTI_DIM_DYNAMIC_CONFIG_URL, - PUBLISHED_AT_FORMAT: () => PUBLISHED_AT_FORMAT, - RECAPTCHA_SITE_KEY: () => RECAPTCHA_SITE_KEY, - SENTRY_DSN: () => SENTRY_DSN, - TOPICS_CONTENT_GRAPH: () => TOPICS_CONTENT_GRAPH -}); -import dotenv from "file:///Users/sophia/code/owid/owid-grapher/node_modules/dotenv/lib/main.js"; -import { parseIntOrUndefined } from "file:///Users/sophia/code/owid/owid-grapher/packages/@ourworldindata/utils/dist/index.js"; -var __vite_injected_original_dirname2 = "/Users/sophia/code/owid/owid-grapher/settings"; -if (typeof __vite_injected_original_dirname2 !== "undefined") { - const baseDir2 = findProjectBaseDir(__vite_injected_original_dirname2); - if (baseDir2) dotenv.config({ path: `${baseDir2}/.env` }); -} -var ENV = process.env.ENV === "production" ? "production" : "development"; -var BUGSNAG_API_KEY = process.env.BUGSNAG_API_KEY; -var SENTRY_DSN = process.env.SENTRY_DSN; -var ADMIN_SERVER_PORT = parseIntOrUndefined(process.env.ADMIN_SERVER_PORT) ?? 3030; -var ADMIN_SERVER_HOST = process.env.ADMIN_SERVER_HOST ?? "localhost"; -var BAKED_BASE_URL = process.env.BAKED_BASE_URL ?? `http://${ADMIN_SERVER_HOST}:${ADMIN_SERVER_PORT}`; -var BAKED_GRAPHER_URL = process.env.BAKED_GRAPHER_URL ?? `${BAKED_BASE_URL}/grapher`; -var BAKED_GRAPHER_EXPORTS_BASE_URL = process.env.BAKED_GRAPHER_EXPORTS_BASE_URL ?? `${BAKED_GRAPHER_URL}/exports`; -var BAKED_SITE_EXPORTS_BASE_URL = process.env.BAKED_SITE_EXPORTS_BASE_URL ?? `${BAKED_BASE_URL}/exports`; -var GRAPHER_DYNAMIC_THUMBNAIL_URL = process.env.GRAPHER_DYNAMIC_THUMBNAIL_URL ?? `${BAKED_GRAPHER_URL}`; -var EXPLORER_DYNAMIC_THUMBNAIL_URL = process.env.EXPLORER_DYNAMIC_THUMBNAIL_URL ?? `${BAKED_BASE_URL}/explorers`; -var GRAPHER_DYNAMIC_CONFIG_URL = process.env.GRAPHER_DYNAMIC_CONFIG_URL ?? `${BAKED_GRAPHER_URL}`; -var MULTI_DIM_DYNAMIC_CONFIG_URL = process.env.MULTI_DIM_DYNAMIC_CONFIG_URL ?? `${BAKED_BASE_URL}/multi-dim`; -var ADMIN_BASE_URL = process.env.ADMIN_BASE_URL ?? `http://${ADMIN_SERVER_HOST}:${ADMIN_SERVER_PORT}`; -var DATA_API_URL = process.env.DATA_API_URL ?? "https://api.ourworldindata.org/v1/indicators/"; -var ALGOLIA_ID = process.env.ALGOLIA_ID ?? ""; -var ALGOLIA_SEARCH_KEY = process.env.ALGOLIA_SEARCH_KEY ?? ""; -var ALGOLIA_INDEX_PREFIX = process.env.ALGOLIA_INDEX_PREFIX ?? ""; -var DONATE_API_URL = process.env.DONATE_API_URL ?? "http://localhost:8788/donation/donate"; -var RECAPTCHA_SITE_KEY = process.env.RECAPTCHA_SITE_KEY ?? "6LcJl5YUAAAAAATQ6F4vl9dAWRZeKPBm15MAZj4Q"; -var GOOGLE_TAG_MANAGER_ID = process.env.GOOGLE_TAG_MANAGER_ID ?? ""; -var TOPICS_CONTENT_GRAPH = process.env.TOPICS_CONTENT_GRAPH === "true"; -var GDOCS_CLIENT_EMAIL = process.env.GDOCS_CLIENT_EMAIL ?? ""; -var GDOCS_BASIC_ARTICLE_TEMPLATE_URL = process.env.GDOCS_BASIC_ARTICLE_TEMPLATE_URL ?? ""; -var IMAGE_HOSTING_R2_CDN_URL = process.env.IMAGE_HOSTING_R2_CDN_URL || ""; -var IMAGE_HOSTING_R2_BUCKET_PATH = process.env.IMAGE_HOSTING_R2_BUCKET_PATH || ""; -var IMAGE_HOSTING_R2_BUCKET_SUBFOLDER_PATH = IMAGE_HOSTING_R2_BUCKET_PATH.slice( - IMAGE_HOSTING_R2_BUCKET_PATH.indexOf("/") + 1 -); -var ETL_WIZARD_URL = process.env.ETL_WIZARD_URL ?? `http://${ADMIN_SERVER_HOST}:8053/`; -var ETL_API_URL = process.env.ETL_API_URL ?? `http://${ADMIN_SERVER_HOST}:8081/api/v1`; -var GDOCS_DETAILS_ON_DEMAND_ID = process.env.GDOCS_DETAILS_ON_DEMAND_ID ?? ""; -var PUBLISHED_AT_FORMAT = "ddd, MMM D, YYYY HH:mm"; -var FeatureFlagFeature = /* @__PURE__ */ ((FeatureFlagFeature2) => { - FeatureFlagFeature2["MultiDimDataPage"] = "MultiDimDataPage"; - return FeatureFlagFeature2; -})(FeatureFlagFeature || {}); -var featureFlagsRaw = typeof process.env.FEATURE_FLAGS === "string" && process.env.FEATURE_FLAGS.trim()?.split(",") || []; -var FEATURE_FLAGS = new Set( - Object.keys(FeatureFlagFeature).filter( - (key) => featureFlagsRaw.includes(key) - ) -); - -// settings/serverSettings.ts -import { parseIntOrUndefined as parseIntOrUndefined2 } from "file:///Users/sophia/code/owid/owid-grapher/packages/@ourworldindata/utils/dist/index.js"; -var __vite_injected_original_dirname3 = "/Users/sophia/code/owid/owid-grapher/settings"; -var baseDir = findProjectBaseDir(__vite_injected_original_dirname3); -if (baseDir === void 0) throw new Error("could not locate base package.json"); -dotenv2.config({ path: `${baseDir}/.env` }); -var serverSettings = process.env ?? {}; -var BASE_DIR = baseDir; -var DATA_API_FOR_ADMIN_UI = serverSettings.DATA_API_FOR_ADMIN_UI; -var BAKED_BASE_URL2 = BAKED_BASE_URL; -var VITE_PREVIEW = serverSettings.VITE_PREVIEW === "true"; -var ADMIN_BASE_URL2 = ADMIN_BASE_URL; -var BAKED_GRAPHER_URL2 = serverSettings.BAKED_GRAPHER_URL ?? `${BAKED_BASE_URL2}/grapher`; -var OPTIMIZE_SVG_EXPORTS = serverSettings.OPTIMIZE_SVG_EXPORTS === "true"; -var GITHUB_USERNAME = serverSettings.GITHUB_USERNAME ?? "owid-test"; -var GIT_DEFAULT_USERNAME = serverSettings.GIT_DEFAULT_USERNAME ?? "Our World in Data"; -var GIT_DEFAULT_EMAIL = serverSettings.GIT_DEFAULT_EMAIL ?? "info@ourworldindata.org"; -var BUGSNAG_API_KEY2 = serverSettings.BUGSNAG_API_KEY; -var BUGSNAG_NODE_API_KEY = serverSettings.BUGSNAG_NODE_API_KEY; -var BLOG_POSTS_PER_PAGE = parseIntOrUndefined2(serverSettings.BLOG_POSTS_PER_PAGE) ?? 21; -var BLOG_SLUG = serverSettings.BLOG_SLUG ?? "latest"; -var GRAPHER_DB_NAME = serverSettings.GRAPHER_DB_NAME ?? "owid"; -var GRAPHER_DB_USER = serverSettings.GRAPHER_DB_USER ?? "root"; -var GRAPHER_DB_PASS = serverSettings.GRAPHER_DB_PASS ?? ""; -var GRAPHER_DB_HOST = serverSettings.GRAPHER_DB_HOST ?? "localhost"; -var GRAPHER_DB_PORT = parseIntOrUndefined2(serverSettings.GRAPHER_DB_PORT) ?? 3306; -var GRAPHER_TEST_DB_NAME = serverSettings.GRAPHER_TEST_DB_NAME ?? "owid"; -var GRAPHER_TEST_DB_USER = serverSettings.GRAPHER_TEST_DB_USER ?? "root"; -var GRAPHER_TEST_DB_PASS = serverSettings.GRAPHER_TEST_DB_PASS ?? ""; -var GRAPHER_TEST_DB_HOST = serverSettings.GRAPHER_TEST_DB_HOST ?? "localhost"; -var GRAPHER_TEST_DB_PORT = parseIntOrUndefined2(serverSettings.GRAPHER_TEST_DB_PORT) ?? 3306; -var BAKED_SITE_DIR = serverSettings.BAKED_SITE_DIR ?? path2.resolve(BASE_DIR, "bakedSite"); -var SECRET_KEY = serverSettings.SECRET_KEY ?? "fejwiaof jewiafo jeioa fjieowajf isa fjidosajfgj"; -var SESSION_COOKIE_AGE = parseIntOrUndefined2(serverSettings.SESSION_COOKIE_AGE) ?? 1209600; -var ALGOLIA_SECRET_KEY = serverSettings.ALGOLIA_SECRET_KEY ?? ""; -var ALGOLIA_INDEXING = serverSettings.ALGOLIA_INDEXING === "true"; -var HTTPS_ONLY = serverSettings.HTTPS_ONLY !== "false"; -var GIT_DATASETS_DIR = serverSettings.GIT_DATASETS_DIR ?? `${BASE_DIR}/datasetsExport`; -var TMP_DIR = serverSettings.TMP_DIR ?? "/tmp"; -var UNCATEGORIZED_TAG_ID = parseIntOrUndefined2(serverSettings.UNCATEGORIZED_TAG_ID) ?? 375; -var BAKE_ON_CHANGE = serverSettings.BAKE_ON_CHANGE === "true"; -var DEPLOY_QUEUE_FILE_PATH = serverSettings.DEPLOY_QUEUE_FILE_PATH ?? `${BASE_DIR}/.queue`; -var DEPLOY_PENDING_FILE_PATH = serverSettings.DEPLOY_PENDING_FILE_PATH ?? `${BASE_DIR}/.pending`; -var CLOUDFLARE_AUD = serverSettings.CLOUDFLARE_AUD ?? ""; -var CATALOG_PATH = serverSettings.CATALOG_PATH ?? ""; -var GDOCS_PRIVATE_KEY = (serverSettings.GDOCS_PRIVATE_KEY ?? "").replaceAll('"', "").replaceAll("'", ""); -var GDOCS_CLIENT_ID = serverSettings.GDOCS_CLIENT_ID ?? ""; -var GDOCS_BACKPORTING_TARGET_FOLDER = serverSettings.GDOCS_BACKPORTING_TARGET_FOLDER ?? ""; -var GDOCS_IMAGES_BACKPORTING_TARGET_FOLDER = serverSettings.GDOCS_IMAGES_BACKPORTING_TARGET_FOLDER ?? ""; -var GDOCS_DONATE_FAQS_DOCUMENT_ID = serverSettings.GDOCS_DONATE_FAQS_DOCUMENT_ID ?? "194PNSFjgSlt9Zm5xYuDOF0l_GLKZbVxH2co3zCok_cE"; -var GDOCS_SHARED_DRIVE_ID = serverSettings.GDOCS_SHARED_DRIVE_ID ?? ""; -var GDOCS_DETAILS_ON_DEMAND_ID2 = serverSettings.GDOCS_DETAILS_ON_DEMAND_ID ?? ""; -var rcloneConfig = {}; -var rcloneConfigPath = path2.join(os.homedir(), ".config/rclone/rclone.conf"); -if (fs2.existsSync(rcloneConfigPath)) { - rcloneConfig = ini.parse(fs2.readFileSync(rcloneConfigPath, "utf-8")); -} -var IMAGE_HOSTING_R2_CDN_URL2 = serverSettings.IMAGE_HOSTING_R2_CDN_URL || ""; -var IMAGE_HOSTING_R2_BUCKET_PATH2 = serverSettings.IMAGE_HOSTING_R2_BUCKET_PATH || ""; -var IMAGE_HOSTING_R2_BUCKET_SUBFOLDER_PATH2 = IMAGE_HOSTING_R2_BUCKET_PATH2.slice( - IMAGE_HOSTING_R2_BUCKET_PATH2.indexOf("/") + 1 -); -var R2_ENDPOINT = serverSettings.R2_ENDPOINT || rcloneConfig["owid-r2"]?.endpoint || "https://078fcdfed9955087315dd86792e71a7e.r2.cloudflarestorage.com"; -var R2_ACCESS_KEY_ID = serverSettings.R2_ACCESS_KEY_ID || rcloneConfig["owid-r2"]?.access_key_id || ""; -var R2_SECRET_ACCESS_KEY = serverSettings.R2_SECRET_ACCESS_KEY || rcloneConfig["owid-r2"]?.secret_access_key || ""; -var R2_REGION = serverSettings.R2_REGION || rcloneConfig["owid-r2"]?.region || "auto"; -var GRAPHER_CONFIG_R2_BUCKET = serverSettings.GRAPHER_CONFIG_R2_BUCKET; -var GRAPHER_CONFIG_R2_BUCKET_PATH = serverSettings.GRAPHER_CONFIG_R2_BUCKET_PATH; -var BUILDKITE_API_ACCESS_TOKEN = serverSettings.BUILDKITE_API_ACCESS_TOKEN ?? ""; -var BUILDKITE_DEPLOY_CONTENT_PIPELINE_SLUG = serverSettings.BUILDKITE_DEPLOY_CONTENT_PIPELINE_SLUG || "owid-deploy-content-master"; -var BUILDKITE_BRANCH = serverSettings.BUILDKITE_BRANCH || "master"; -var BUILDKITE_DEPLOY_CONTENT_SLACK_CHANNEL = serverSettings.BUILDKITE_DEPLOY_CONTENT_SLACK_CHANNEL || "C06EWA0DK4H"; -var OPENAI_API_KEY = serverSettings.OPENAI_API_KEY ?? ""; -var SLACK_BOT_OAUTH_TOKEN = serverSettings.SLACK_BOT_OAUTH_TOKEN ?? ""; -var LEGACY_WORDPRESS_IMAGE_URL = serverSettings.LEGACY_WORDPRESS_IMAGE_URL ?? "https://assets.ourworldindata.org/uploads"; -var ENV_IS_STAGING = ADMIN_BASE_URL2.includes( - "http://staging-site" -); - -// site/SiteConstants.ts -import { faRss } from "file:///Users/sophia/code/owid/owid-grapher/node_modules/@fortawesome/free-solid-svg-icons/index.mjs"; -import { - faXTwitter, - faFacebookSquare, - faInstagram, - faThreads, - faLinkedin, - faBluesky -} from "file:///Users/sophia/code/owid/owid-grapher/node_modules/@fortawesome/free-brands-svg-icons/index.mjs"; -var polyfillFeatures = [ - "es2021", - // String.replaceAll, Promise.any, ... - "es2022", - // Array.at, String.at, ... - "es2023", - // Array.findLast, Array.toReversed, Array.toSorted, Array.with, ... - "IntersectionObserver", - "IntersectionObserverEntry" -]; -var POLYFILL_VERSION = "4.8.0"; -var POLYFILL_URL = `https://cdnjs.cloudflare.com/polyfill/v3/polyfill.min.js?version=${POLYFILL_VERSION}&features=${polyfillFeatures.join( - "," -)}`; -var DATA_INSIGHTS_ATOM_FEED_NAME = "atom-data-insights.xml"; -var DATA_INSIGHT_ATOM_FEED_PROPS = { - title: "Atom feed for Daily Data Insights", - href: `https://ourworldindata.org/${DATA_INSIGHTS_ATOM_FEED_NAME}` -}; -var RSS_FEEDS = [ - { - title: "Research & Writing RSS Feed", - url: "/atom.xml", - icon: faRss - }, - { - title: "Daily Data Insights RSS Feed", - url: `/${DATA_INSIGHTS_ATOM_FEED_NAME}`, - icon: faRss - } -]; - -// site/viteUtils.tsx -import { sortBy } from "file:///Users/sophia/code/owid/owid-grapher/packages/@ourworldindata/utils/dist/index.js"; -import urljoin from "file:///Users/sophia/code/owid/owid-grapher/node_modules/url-join/lib/url-join.js"; -var VITE_DEV_URL = process.env.VITE_DEV_URL ?? "http://localhost:8090"; -var VITE_ASSET_SITE_ENTRY = "site/owid.entry.ts"; -var VITE_ASSET_ADMIN_ENTRY = "adminSiteClient/admin.entry.ts"; -var VITE_ENTRYPOINT_INFO = { - ["site" /* Site */]: { - entryPointFile: VITE_ASSET_SITE_ENTRY, - outDir: "assets", - outName: "owid" - }, - ["admin" /* Admin */]: { - entryPointFile: VITE_ASSET_ADMIN_ENTRY, - outDir: "assets-admin", - outName: "admin" - } -}; - -// vite.config-common.mts -import { defineConfig } from "file:///Users/sophia/code/owid/owid-grapher/node_modules/vite/dist/node/index.js"; -import pluginReact from "file:///Users/sophia/code/owid/owid-grapher/node_modules/@vitejs/plugin-react/dist/index.mjs"; -import pluginChecker from "file:///Users/sophia/code/owid/owid-grapher/node_modules/vite-plugin-checker/dist/esm/main.js"; -var defineViteConfigForEntrypoint = (entrypoint) => { - const entrypointInfo = VITE_ENTRYPOINT_INFO[entrypoint]; - return defineConfig({ - publicDir: false, - // don't copy public folder to dist - resolve: { - // prettier-ignore - alias: { - "@ourworldindata/grapher/src": "@ourworldindata/grapher/src", - // need this for imports of @ourworldindata/grapher/src/core/grapher.scss to work - // we alias to the packages source files in dev and prod: - // this means we get instant dev updates when we change one of them, - // and the prod build builds them all as esm modules, which helps with tree shaking - // Idea from https://github.com/LinusBorg/vue-lib-template/blob/3775e49b20a7c3349dd49321cad2ed7f9d575057/packages/playground/vite.config.ts - "@ourworldindata/components": "@ourworldindata/components/src/index.ts", - "@ourworldindata/core-table": "@ourworldindata/core-table/src/index.ts", - "@ourworldindata/explorer": "@ourworldindata/explorer/src/index.ts", - "@ourworldindata/grapher": "@ourworldindata/grapher/src/index.ts", - "@ourworldindata/types": "@ourworldindata/types/src/index.ts", - "@ourworldindata/utils": "@ourworldindata/utils/src/index.ts" - } - }, - css: { - devSourcemap: true - }, - define: { - // Replace all clientSettings with their respective values, i.e. assign e.g. BUGSNAG_API_KEY to process.env.BUGSNAG_API_KEY - // it's important to note that we only expose values that are present in the clientSettings file - not any other things that are stored in .env - ...Object.fromEntries( - Object.entries(clientSettings_exports).map(([key, value]) => [ - `process.env.${key}`, - JSON.stringify(value) - ]) - ) - }, - build: { - manifest: true, - // creates a manifest.json file, which we use to determine which files to load in prod - emptyOutDir: true, - outDir: `dist/${entrypointInfo.outDir}`, - sourcemap: true, - target: ["chrome80", "firefox78", "safari13.1"], - // see docs/browser-support.md - rollupOptions: { - input: { - [entrypointInfo.outName]: entrypointInfo.entryPointFile - }, - output: { - assetFileNames: `${entrypointInfo.outName}.css`, - entryFileNames: `${entrypointInfo.outName}.mjs` - } - } - }, - plugins: [ - pluginReact({ - babel: { - parserOpts: { - plugins: ["decorators-legacy"] - // needed so mobx decorators work correctly - } - } - }), - pluginChecker({ - typescript: { - buildMode: true, - tsconfigPath: "tsconfig.vite-checker.json" - } - }) - ], - server: { - port: 8090, - warmup: { clientFiles: [VITE_ASSET_SITE_ENTRY] } - }, - preview: { - port: 8090 - } - }); -}; - -// vite.config-site.mts -var vite_config_site_default = defineViteConfigForEntrypoint("site" /* Site */); -export { - vite_config_site_default as default -}; -//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsic2l0ZS92aXRlVXRpbHMudHN4IiwgInNldHRpbmdzL2ZpbmRCYXNlRGlyLnRzIiwgInNldHRpbmdzL3NlcnZlclNldHRpbmdzLnRzIiwgInNldHRpbmdzL2NsaWVudFNldHRpbmdzLnRzIiwgInNpdGUvU2l0ZUNvbnN0YW50cy50cyIsICJ2aXRlLmNvbmZpZy1jb21tb24ubXRzIiwgInZpdGUuY29uZmlnLXNpdGUubXRzIl0sCiAgInNvdXJjZXNDb250ZW50IjogWyJpbXBvcnQgUmVhY3QgZnJvbSBcInJlYWN0XCJcbmltcG9ydCBmaW5kQmFzZURpciBmcm9tIFwiLi4vc2V0dGluZ3MvZmluZEJhc2VEaXIuanNcIlxuaW1wb3J0IGZzIGZyb20gXCJmcy1leHRyYVwiXG5pbXBvcnQge1xuICAgIEVOVixcbiAgICBCQUtFRF9CQVNFX1VSTCxcbiAgICBWSVRFX1BSRVZJRVc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AgICAgICAgICAgICAgICAgIGhyZWY9e2Fzc2V0VXJsfVxuICAgICAgICAgICAgICAgICAgICBhcz1cInN0eWxlXCJcbiAgICAgICAgICAgICAgICAvPixcbiAgICAgICAgICAgICAgICA8bGluayBrZXk9e2VudHJ5fSByZWw9XCJzdHlsZXNoZWV0XCIgaHJlZj17YXNzZXRVcmx9IC8+LFxuICAgICAgICAgICAgXVxuICAgICAgICB9IGVsc2UgaWYgKGVudHJ5Lm1hdGNoKC9cXC5bY21dPyhqc3xqc3h8dHN8dHN4KSQvKSkge1xuICAgICAgICAgICAgLy8gZXhwbGljaXRseSByZWZlcmVuY2UgdGhlIGVudHJ5OyBwcmVsb2FkIGl0IGFuZCBpdHMgZGVwZW5kZW5jaWVzXG4gICAgICAgICAgICBpZiAobWFuaWZlc3RFbnRyeT8uaXNFbnRyeSkge1xuICAgICAgICAgICAgICAgIGFzc2V0cyA9IFtcbiAgICAgICAgICAgICAgICAgICAgLi4uYXNzZXRzLFxuICAgICAgICAgICAgICAgICAgICA8c2NyaXB0XG4gICAgICAgICAgICAgICAgICAgICAgICBrZXk9e2VudHJ5fVxuICAgICAgICAgICAgICAgICAgICAgICAgdHlwZT1cIm1vZHVsZVwiXG4gICAgICAgICAgICAgICAgICAgICAgICBzcmM9e2Fzc2V0VXJsfVxuICAgICAgICAgICAgICAgICAgICAgICAgZGF0YS1hdHRhY2gtb3dpZC1lcnJvci1oYW5kbGVyXG4gICAgICAgICAgICAgICAgICAgIC8+LFxuICAgICAgICAgICAgICAgIF1cbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgYXNzZXRzID0gW1xuICAgICAgICAgICAgICAgIC4uLmFzc2V0cyxcbiAgICAgICAgICAgICAgICA8bGlua1xuICAgICAgICAgICAgICAgICAgICBrZXk9e2Ake2VudHJ5fS1wcmVsb2FkYH1cbiAgICAgICAgICAgICAgICAgICAgcmVsPVwibW9kdWxlcHJlbG9hZFwiIC8vIHNlZSBodHRwczovL2RldmVsb3Blci5jaH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AgICAgICB0aXRsZTogXCJYXCIsXG4gICAgICAgIHVybDogXCJodHRwczovL3guY29tL291cndvcmxkaW5kYXRhXCIsXG4gICAgICAgIGljb246IGZhWFR3aXR0ZXIsXG4gICAgfSxcbiAgICB7XG4gICAgICAgIHRpdGxlOiBcIkluc3RhZ3JhbVwiLFxuICAgICAgICB1cmw6IFwiaHR0cHM6Ly93d3cuaW5zdGFncmFtLmNvbS9vdXJ3b3JsZGluZGF0YS9cIixcbiAgICAgICAgaWNvbjogZmFJbnN0YWdyYW0sXG4gICAgfSxcbiAgICB7XG4gICAgICAgIHRpdGxlOiBcIlRocmVhZHNcIixcbiAgICAgICAgdXJsOiBcImh0dHBzOi8vd3d3LnRocmVhZHMubmV0L0BvdXJ3b3JsZGluZGF0YVwiLFxuICAgICAgICBpY29uOiBmYVRocmVhZHMsXG4gICAgfSxcbiAgICB7XG4gICAgICAgIHRpdGxlOiBcIkZhY2Vib29rXCIsXG4gICAgICAgIHVybDogXCJodHRwczovL2ZhY2Vib29rLmNvbS9vdXJ3b3JsZGluZGF0YVwiLFxuICAgICAgICBpY29uOiBmYUZhY2Vib29rU3F1YXJlLFxuICAgIH0sXG4gICAge1xuICAgICAgICB0aXRsZTogXCJMaW5rZWRJblwiLFxuICAgICAgICB1cmw6IFwiaHR0cHM6Ly93d3cubGlua2VkaW4uY29tL2NvbXBhbnkvb3Vyd29ybGRpbmRhdGFcIixcbiAgICAgICAgaWNvbjogZmFMaW5rZWRpbixcbiAgICB9LFxuICAgIHtcbiAgICAgICAgdGl0bGU6IFwiQmx1ZXNreVwiLFxuICAgICAgICB1cmw6IFwiaHR0cHM6Ly9ic2t5LmFwcC9wcm9maWxlL291cndvcmxkaW5kYXRhLm9yZ1wiLFxuICAgICAgICBpY29uOiBmYUJsdWVza3ksXG4gICAgfSxcbl1cblxuZXhwb3J0IGNvbnN0IFJTU19GRUVEUyA9IFtcbiAgICB7XG4gICAgICAgIHRpdGxlOiBcIlJlc2VhcmNoICYgV3JpdG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Byb2xsdXBPcHRpb25zOiB7XG4gICAgICAgICAgICAgICAgaW5wdXQ6IHtcbiAgICAgICAgICAgICAgICAgICAgW2VudHJ5cG9pbnRJbmZvLm91dE5hbWVdOiBlbnRyeXBvaW50SW5mby5lbnRyeVBvaW50RmlsZSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIG91dHB1dDoge1xuICAgICAgICAgICAgICAgICAgICBhc3NldEZpbGVOYW1lczogYCR7ZW50cnlwb2ludEluZm8ub3V0TmFtZX0uY3NzYCxcbiAgICAgICAgICAgICAgICAgICAgZW50cnlGaWxlTmFtZXM6IGAke2VudHJ5cG9pbnRJbmZvLm91dE5hbWV9Lm1qc2AsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0sXG4gICAgICAgIHBsdWdpbnM6IFtcbiAgICAgICAgICAgIHBsdWdpblJlYWN0KHtcbiAgICAgICAgICAgICAgICBiYWJlbDoge1xuICAgICAgICAgICAgICAgICAgICBwYXJzZXJPcHRzOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICBwbHVnaW5zOiBbXCJkZWNvcmF0b3JzLWxlZ2FjeVwiXSwgLy8gbmVlZGVkIHNvIG1vYnggZGVjb3JhdG9ycyB3b3JrIGNvcnJlY3RseVxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9KSxcbiAgICAgICAgICAgIHBsdWdpbkNoZWNrZXIoe1xuICAgICAgICAgICAgICAgIHR5cGVzY3JpcHQ6IHtcbiAgICAgICAgICAgICAgICAgICAgYnVpbGRNb2RlOiB0cnVlLFxuICAgICAgICAgICAgICAgICAgICB0c2NvbmZpZ1BhdGg6IFwidHNjb25maWcudml0ZS1jaGVja2VyLmpzb25cIixcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSksXG4gICAgICAgIF0sXG4gICAgICAgIHNlcnZlcjoge1xuICAgICAgICAgICAgcG9yd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OR19SMl9DRE5fVVJMIiwgIklNQUdFX0hPU1RJTkdfUjJfQlVDS0VUX1BBVEgiLCAiSU1BR0VfSE9TVElOR19SMl9CVUNLRVRfU1VCRk9MREVSX1BBVEgiLCAiQURNSU5fQkFTRV9VUkwiXQp9Cg== diff --git a/vite.config-site.mts.timestamp-1732886743306-ebf767a3e601c.mjs b/vite.config-site.mts.timestamp-1732886743306-ebf767a3e601c.mjs deleted file mode 100644 index 9ef808f81c3..00000000000 --- a/vite.config-site.mts.timestamp-1732886743306-ebf767a3e601c.mjs +++ /dev/null @@ -1,351 +0,0 @@ -var __defProp = Object.defineProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; - -// site/viteUtils.tsx -import React from "file:///Users/sophia/code/owid/owid-grapher/node_modules/react/index.js"; - -// settings/findBaseDir.ts -import path from "path"; -import fs from "fs"; -function findProjectBaseDir(from) { - if (!fs.existsSync) return void 0; - let dir = path.dirname(from); - while (dir.length) { - if (fs.existsSync(path.resolve(dir, "package.json"))) return dir; - const parentDir = path.resolve(dir, ".."); - if (parentDir === dir) break; - else dir = parentDir; - } - return void 0; -} - -// site/viteUtils.tsx -import fs3 from "file:///Users/sophia/code/owid/owid-grapher/node_modules/fs-extra/lib/index.js"; - -// settings/serverSettings.ts -import path2 from "path"; -import dotenv2 from "file:///Users/sophia/code/owid/owid-grapher/node_modules/dotenv/lib/main.js"; -import fs2 from "fs"; -import ini from "file:///Users/sophia/code/owid/owid-grapher/node_modules/ini/lib/ini.js"; -import os from "os"; - -// settings/clientSettings.ts -var clientSettings_exports = {}; -__export(clientSettings_exports, { - ADMIN_BASE_URL: () => ADMIN_BASE_URL, - ADMIN_SERVER_HOST: () => ADMIN_SERVER_HOST, - ADMIN_SERVER_PORT: () => ADMIN_SERVER_PORT, - ALGOLIA_ID: () => ALGOLIA_ID, - ALGOLIA_INDEX_PREFIX: () => ALGOLIA_INDEX_PREFIX, - ALGOLIA_SEARCH_KEY: () => ALGOLIA_SEARCH_KEY, - BAKED_BASE_URL: () => BAKED_BASE_URL, - BAKED_GRAPHER_EXPORTS_BASE_URL: () => BAKED_GRAPHER_EXPORTS_BASE_URL, - BAKED_GRAPHER_URL: () => BAKED_GRAPHER_URL, - BAKED_SITE_EXPORTS_BASE_URL: () => BAKED_SITE_EXPORTS_BASE_URL, - BUGSNAG_API_KEY: () => BUGSNAG_API_KEY, - DATA_API_URL: () => DATA_API_URL, - DONATE_API_URL: () => DONATE_API_URL, - ENV: () => ENV, - ETL_API_URL: () => ETL_API_URL, - ETL_WIZARD_URL: () => ETL_WIZARD_URL, - EXPLORER_DYNAMIC_THUMBNAIL_URL: () => EXPLORER_DYNAMIC_THUMBNAIL_URL, - FEATURE_FLAGS: () => FEATURE_FLAGS, - FeatureFlagFeature: () => FeatureFlagFeature, - GDOCS_BASIC_ARTICLE_TEMPLATE_URL: () => GDOCS_BASIC_ARTICLE_TEMPLATE_URL, - GDOCS_CLIENT_EMAIL: () => GDOCS_CLIENT_EMAIL, - GDOCS_DETAILS_ON_DEMAND_ID: () => GDOCS_DETAILS_ON_DEMAND_ID, - GOOGLE_TAG_MANAGER_ID: () => GOOGLE_TAG_MANAGER_ID, - GRAPHER_DYNAMIC_CONFIG_URL: () => GRAPHER_DYNAMIC_CONFIG_URL, - GRAPHER_DYNAMIC_THUMBNAIL_URL: () => GRAPHER_DYNAMIC_THUMBNAIL_URL, - IMAGE_HOSTING_R2_BUCKET_PATH: () => IMAGE_HOSTING_R2_BUCKET_PATH, - IMAGE_HOSTING_R2_BUCKET_SUBFOLDER_PATH: () => IMAGE_HOSTING_R2_BUCKET_SUBFOLDER_PATH, - IMAGE_HOSTING_R2_CDN_URL: () => IMAGE_HOSTING_R2_CDN_URL, - MULTI_DIM_DYNAMIC_CONFIG_URL: () => MULTI_DIM_DYNAMIC_CONFIG_URL, - PUBLISHED_AT_FORMAT: () => PUBLISHED_AT_FORMAT, - RECAPTCHA_SITE_KEY: () => RECAPTCHA_SITE_KEY, - SENTRY_DSN: () => SENTRY_DSN, - TOPICS_CONTENT_GRAPH: () => TOPICS_CONTENT_GRAPH -}); -import dotenv from "file:///Users/sophia/code/owid/owid-grapher/node_modules/dotenv/lib/main.js"; -import { parseIntOrUndefined } from "file:///Users/sophia/code/owid/owid-grapher/packages/@ourworldindata/utils/dist/index.js"; -var __vite_injected_original_dirname2 = "/Users/sophia/code/owid/owid-grapher/settings"; -if (typeof __vite_injected_original_dirname2 !== "undefined") { - const baseDir2 = findProjectBaseDir(__vite_injected_original_dirname2); - if (baseDir2) dotenv.config({ path: `${baseDir2}/.env` }); -} -var ENV = process.env.ENV === "production" ? "production" : "development"; -var BUGSNAG_API_KEY = process.env.BUGSNAG_API_KEY; -var SENTRY_DSN = process.env.SENTRY_DSN; -var ADMIN_SERVER_PORT = parseIntOrUndefined(process.env.ADMIN_SERVER_PORT) ?? 3030; -var ADMIN_SERVER_HOST = process.env.ADMIN_SERVER_HOST ?? "localhost"; -var BAKED_BASE_URL = process.env.BAKED_BASE_URL ?? `http://${ADMIN_SERVER_HOST}:${ADMIN_SERVER_PORT}`; -var BAKED_GRAPHER_URL = process.env.BAKED_GRAPHER_URL ?? `${BAKED_BASE_URL}/grapher`; -var BAKED_GRAPHER_EXPORTS_BASE_URL = process.env.BAKED_GRAPHER_EXPORTS_BASE_URL ?? `${BAKED_GRAPHER_URL}/exports`; -var BAKED_SITE_EXPORTS_BASE_URL = process.env.BAKED_SITE_EXPORTS_BASE_URL ?? `${BAKED_BASE_URL}/exports`; -var GRAPHER_DYNAMIC_THUMBNAIL_URL = process.env.GRAPHER_DYNAMIC_THUMBNAIL_URL ?? `${BAKED_GRAPHER_URL}`; -var EXPLORER_DYNAMIC_THUMBNAIL_URL = process.env.EXPLORER_DYNAMIC_THUMBNAIL_URL ?? `${BAKED_BASE_URL}/explorers`; -var GRAPHER_DYNAMIC_CONFIG_URL = process.env.GRAPHER_DYNAMIC_CONFIG_URL ?? `${BAKED_GRAPHER_URL}`; -var MULTI_DIM_DYNAMIC_CONFIG_URL = process.env.MULTI_DIM_DYNAMIC_CONFIG_URL ?? `${BAKED_BASE_URL}/multi-dim`; -var ADMIN_BASE_URL = process.env.ADMIN_BASE_URL ?? `http://${ADMIN_SERVER_HOST}:${ADMIN_SERVER_PORT}`; -var DATA_API_URL = process.env.DATA_API_URL ?? "https://api.ourworldindata.org/v1/indicators/"; -var ALGOLIA_ID = process.env.ALGOLIA_ID ?? ""; -var ALGOLIA_SEARCH_KEY = process.env.ALGOLIA_SEARCH_KEY ?? ""; -var ALGOLIA_INDEX_PREFIX = process.env.ALGOLIA_INDEX_PREFIX ?? ""; -var DONATE_API_URL = process.env.DONATE_API_URL ?? "http://localhost:8788/donation/donate"; -var RECAPTCHA_SITE_KEY = process.env.RECAPTCHA_SITE_KEY ?? "6LcJl5YUAAAAAATQ6F4vl9dAWRZeKPBm15MAZj4Q"; -var GOOGLE_TAG_MANAGER_ID = process.env.GOOGLE_TAG_MANAGER_ID ?? ""; -var TOPICS_CONTENT_GRAPH = process.env.TOPICS_CONTENT_GRAPH === "true"; -var GDOCS_CLIENT_EMAIL = process.env.GDOCS_CLIENT_EMAIL ?? ""; -var GDOCS_BASIC_ARTICLE_TEMPLATE_URL = process.env.GDOCS_BASIC_ARTICLE_TEMPLATE_URL ?? ""; -var IMAGE_HOSTING_R2_CDN_URL = process.env.IMAGE_HOSTING_R2_CDN_URL || ""; -var IMAGE_HOSTING_R2_BUCKET_PATH = process.env.IMAGE_HOSTING_R2_BUCKET_PATH || ""; -var IMAGE_HOSTING_R2_BUCKET_SUBFOLDER_PATH = IMAGE_HOSTING_R2_BUCKET_PATH.slice( - IMAGE_HOSTING_R2_BUCKET_PATH.indexOf("/") + 1 -); -var ETL_WIZARD_URL = process.env.ETL_WIZARD_URL ?? `http://${ADMIN_SERVER_HOST}:8053/`; -var ETL_API_URL = process.env.ETL_API_URL ?? `http://${ADMIN_SERVER_HOST}:8081/api/v1`; -var GDOCS_DETAILS_ON_DEMAND_ID = process.env.GDOCS_DETAILS_ON_DEMAND_ID ?? ""; -var PUBLISHED_AT_FORMAT = "ddd, MMM D, YYYY HH:mm"; -var FeatureFlagFeature = /* @__PURE__ */ ((FeatureFlagFeature2) => { - FeatureFlagFeature2["MultiDimDataPage"] = "MultiDimDataPage"; - return FeatureFlagFeature2; -})(FeatureFlagFeature || {}); -var featureFlagsRaw = typeof process.env.FEATURE_FLAGS === "string" && process.env.FEATURE_FLAGS.trim()?.split(",") || []; -var FEATURE_FLAGS = new Set( - Object.keys(FeatureFlagFeature).filter( - (key) => featureFlagsRaw.includes(key) - ) -); - -// settings/serverSettings.ts -import { parseIntOrUndefined as parseIntOrUndefined2 } from "file:///Users/sophia/code/owid/owid-grapher/packages/@ourworldindata/utils/dist/index.js"; -var __vite_injected_original_dirname3 = "/Users/sophia/code/owid/owid-grapher/settings"; -var baseDir = findProjectBaseDir(__vite_injected_original_dirname3); -if (baseDir === void 0) throw new Error("could not locate base package.json"); -dotenv2.config({ path: `${baseDir}/.env` }); -var serverSettings = process.env ?? {}; -var BASE_DIR = baseDir; -var DATA_API_FOR_ADMIN_UI = serverSettings.DATA_API_FOR_ADMIN_UI; -var BAKED_BASE_URL2 = BAKED_BASE_URL; -var VITE_PREVIEW = serverSettings.VITE_PREVIEW === "true"; -var ADMIN_BASE_URL2 = ADMIN_BASE_URL; -var BAKED_GRAPHER_URL2 = serverSettings.BAKED_GRAPHER_URL ?? `${BAKED_BASE_URL2}/grapher`; -var OPTIMIZE_SVG_EXPORTS = serverSettings.OPTIMIZE_SVG_EXPORTS === "true"; -var GITHUB_USERNAME = serverSettings.GITHUB_USERNAME ?? "owid-test"; -var GIT_DEFAULT_USERNAME = serverSettings.GIT_DEFAULT_USERNAME ?? "Our World in Data"; -var GIT_DEFAULT_EMAIL = serverSettings.GIT_DEFAULT_EMAIL ?? "info@ourworldindata.org"; -var BUGSNAG_API_KEY2 = serverSettings.BUGSNAG_API_KEY; -var BUGSNAG_NODE_API_KEY = serverSettings.BUGSNAG_NODE_API_KEY; -var BLOG_POSTS_PER_PAGE = parseIntOrUndefined2(serverSettings.BLOG_POSTS_PER_PAGE) ?? 21; -var BLOG_SLUG = serverSettings.BLOG_SLUG ?? "latest"; -var GRAPHER_DB_NAME = serverSettings.GRAPHER_DB_NAME ?? "owid"; -var GRAPHER_DB_USER = serverSettings.GRAPHER_DB_USER ?? "root"; -var GRAPHER_DB_PASS = serverSettings.GRAPHER_DB_PASS ?? ""; -var GRAPHER_DB_HOST = serverSettings.GRAPHER_DB_HOST ?? "localhost"; -var GRAPHER_DB_PORT = parseIntOrUndefined2(serverSettings.GRAPHER_DB_PORT) ?? 3306; -var GRAPHER_TEST_DB_NAME = serverSettings.GRAPHER_TEST_DB_NAME ?? "owid"; -var GRAPHER_TEST_DB_USER = serverSettings.GRAPHER_TEST_DB_USER ?? "root"; -var GRAPHER_TEST_DB_PASS = serverSettings.GRAPHER_TEST_DB_PASS ?? ""; -var GRAPHER_TEST_DB_HOST = serverSettings.GRAPHER_TEST_DB_HOST ?? "localhost"; -var GRAPHER_TEST_DB_PORT = parseIntOrUndefined2(serverSettings.GRAPHER_TEST_DB_PORT) ?? 3306; -var BAKED_SITE_DIR = serverSettings.BAKED_SITE_DIR ?? path2.resolve(BASE_DIR, "bakedSite"); -var SECRET_KEY = serverSettings.SECRET_KEY ?? "fejwiaof jewiafo jeioa fjieowajf isa fjidosajfgj"; -var SESSION_COOKIE_AGE = parseIntOrUndefined2(serverSettings.SESSION_COOKIE_AGE) ?? 1209600; -var ALGOLIA_SECRET_KEY = serverSettings.ALGOLIA_SECRET_KEY ?? ""; -var ALGOLIA_INDEXING = serverSettings.ALGOLIA_INDEXING === "true"; -var HTTPS_ONLY = serverSettings.HTTPS_ONLY !== "false"; -var GIT_DATASETS_DIR = serverSettings.GIT_DATASETS_DIR ?? `${BASE_DIR}/datasetsExport`; -var TMP_DIR = serverSettings.TMP_DIR ?? "/tmp"; -var UNCATEGORIZED_TAG_ID = parseIntOrUndefined2(serverSettings.UNCATEGORIZED_TAG_ID) ?? 375; -var BAKE_ON_CHANGE = serverSettings.BAKE_ON_CHANGE === "true"; -var DEPLOY_QUEUE_FILE_PATH = serverSettings.DEPLOY_QUEUE_FILE_PATH ?? `${BASE_DIR}/.queue`; -var DEPLOY_PENDING_FILE_PATH = serverSettings.DEPLOY_PENDING_FILE_PATH ?? `${BASE_DIR}/.pending`; -var CLOUDFLARE_AUD = serverSettings.CLOUDFLARE_AUD ?? ""; -var CATALOG_PATH = serverSettings.CATALOG_PATH ?? ""; -var GDOCS_PRIVATE_KEY = (serverSettings.GDOCS_PRIVATE_KEY ?? "").replaceAll('"', "").replaceAll("'", ""); -var GDOCS_CLIENT_ID = serverSettings.GDOCS_CLIENT_ID ?? ""; -var GDOCS_BACKPORTING_TARGET_FOLDER = serverSettings.GDOCS_BACKPORTING_TARGET_FOLDER ?? ""; -var GDOCS_IMAGES_BACKPORTING_TARGET_FOLDER = serverSettings.GDOCS_IMAGES_BACKPORTING_TARGET_FOLDER ?? ""; -var GDOCS_DONATE_FAQS_DOCUMENT_ID = serverSettings.GDOCS_DONATE_FAQS_DOCUMENT_ID ?? "194PNSFjgSlt9Zm5xYuDOF0l_GLKZbVxH2co3zCok_cE"; -var GDOCS_SHARED_DRIVE_ID = serverSettings.GDOCS_SHARED_DRIVE_ID ?? ""; -var GDOCS_DETAILS_ON_DEMAND_ID2 = serverSettings.GDOCS_DETAILS_ON_DEMAND_ID ?? ""; -var rcloneConfig = {}; -var rcloneConfigPath = path2.join(os.homedir(), ".config/rclone/rclone.conf"); -if (fs2.existsSync(rcloneConfigPath)) { - rcloneConfig = ini.parse(fs2.readFileSync(rcloneConfigPath, "utf-8")); -} -var IMAGE_HOSTING_R2_CDN_URL2 = serverSettings.IMAGE_HOSTING_R2_CDN_URL || ""; -var IMAGE_HOSTING_R2_BUCKET_PATH2 = serverSettings.IMAGE_HOSTING_R2_BUCKET_PATH || ""; -var IMAGE_HOSTING_R2_BUCKET_SUBFOLDER_PATH2 = IMAGE_HOSTING_R2_BUCKET_PATH2.slice( - IMAGE_HOSTING_R2_BUCKET_PATH2.indexOf("/") + 1 -); -var R2_ENDPOINT = serverSettings.R2_ENDPOINT || rcloneConfig["owid-r2"]?.endpoint || "https://078fcdfed9955087315dd86792e71a7e.r2.cloudflarestorage.com"; -var R2_ACCESS_KEY_ID = serverSettings.R2_ACCESS_KEY_ID || rcloneConfig["owid-r2"]?.access_key_id || ""; -var R2_SECRET_ACCESS_KEY = serverSettings.R2_SECRET_ACCESS_KEY || rcloneConfig["owid-r2"]?.secret_access_key || ""; -var R2_REGION = serverSettings.R2_REGION || rcloneConfig["owid-r2"]?.region || "auto"; -var GRAPHER_CONFIG_R2_BUCKET = serverSettings.GRAPHER_CONFIG_R2_BUCKET; -var GRAPHER_CONFIG_R2_BUCKET_PATH = serverSettings.GRAPHER_CONFIG_R2_BUCKET_PATH; -var BUILDKITE_API_ACCESS_TOKEN = serverSettings.BUILDKITE_API_ACCESS_TOKEN ?? ""; -var BUILDKITE_DEPLOY_CONTENT_PIPELINE_SLUG = serverSettings.BUILDKITE_DEPLOY_CONTENT_PIPELINE_SLUG || "owid-deploy-content-master"; -var BUILDKITE_BRANCH = serverSettings.BUILDKITE_BRANCH || "master"; -var BUILDKITE_DEPLOY_CONTENT_SLACK_CHANNEL = serverSettings.BUILDKITE_DEPLOY_CONTENT_SLACK_CHANNEL || "C06EWA0DK4H"; -var OPENAI_API_KEY = serverSettings.OPENAI_API_KEY ?? ""; -var SLACK_BOT_OAUTH_TOKEN = serverSettings.SLACK_BOT_OAUTH_TOKEN ?? ""; -var LEGACY_WORDPRESS_IMAGE_URL = serverSettings.LEGACY_WORDPRESS_IMAGE_URL ?? "https://assets.ourworldindata.org/uploads"; -var ENV_IS_STAGING = ADMIN_BASE_URL2.includes( - "http://staging-site" -); - -// site/SiteConstants.ts -import { faRss } from "file:///Users/sophia/code/owid/owid-grapher/node_modules/@fortawesome/free-solid-svg-icons/index.mjs"; -import { - faXTwitter, - faFacebookSquare, - faInstagram, - faThreads, - faLinkedin, - faBluesky -} from "file:///Users/sophia/code/owid/owid-grapher/node_modules/@fortawesome/free-brands-svg-icons/index.mjs"; -var polyfillFeatures = [ - "es2021", - // String.replaceAll, Promise.any, ... - "es2022", - // Array.at, String.at, ... - "es2023", - // Array.findLast, Array.toReversed, Array.toSorted, Array.with, ... - "IntersectionObserver", - "IntersectionObserverEntry" -]; -var POLYFILL_VERSION = "4.8.0"; -var POLYFILL_URL = `https://cdnjs.cloudflare.com/polyfill/v3/polyfill.min.js?version=${POLYFILL_VERSION}&features=${polyfillFeatures.join( - "," -)}`; -var DATA_INSIGHTS_ATOM_FEED_NAME = "atom-data-insights.xml"; -var DATA_INSIGHT_ATOM_FEED_PROPS = { - title: "Atom feed for Daily Data Insights", - href: `https://ourworldindata.org/${DATA_INSIGHTS_ATOM_FEED_NAME}` -}; -var RSS_FEEDS = [ - { - title: "Research & Writing RSS Feed", - url: "/atom.xml", - icon: faRss - }, - { - title: "Daily Data Insights RSS Feed", - url: `/${DATA_INSIGHTS_ATOM_FEED_NAME}`, - icon: faRss - } -]; - -// site/viteUtils.tsx -import { sortBy } from "file:///Users/sophia/code/owid/owid-grapher/packages/@ourworldindata/utils/dist/index.js"; -import urljoin from "file:///Users/sophia/code/owid/owid-grapher/node_modules/url-join/lib/url-join.js"; -var VITE_DEV_URL = process.env.VITE_DEV_URL ?? "http://localhost:8090"; -var VITE_ASSET_SITE_ENTRY = "site/owid.entry.ts"; -var VITE_ASSET_ADMIN_ENTRY = "adminSiteClient/admin.entry.ts"; -var VITE_ENTRYPOINT_INFO = { - ["site" /* Site */]: { - entryPointFile: VITE_ASSET_SITE_ENTRY, - outDir: "assets", - outName: "owid" - }, - ["admin" /* Admin */]: { - entryPointFile: VITE_ASSET_ADMIN_ENTRY, - outDir: "assets-admin", - outName: "admin" - } -}; - -// vite.config-common.mts -import { defineConfig } from "file:///Users/sophia/code/owid/owid-grapher/node_modules/vite/dist/node/index.js"; -import pluginReact from "file:///Users/sophia/code/owid/owid-grapher/node_modules/@vitejs/plugin-react/dist/index.mjs"; -import pluginChecker from "file:///Users/sophia/code/owid/owid-grapher/node_modules/vite-plugin-checker/dist/esm/main.js"; -var defineViteConfigForEntrypoint = (entrypoint) => { - const entrypointInfo = VITE_ENTRYPOINT_INFO[entrypoint]; - return defineConfig({ - publicDir: false, - // don't copy public folder to dist - resolve: { - // prettier-ignore - alias: { - "@ourworldindata/grapher/src": "@ourworldindata/grapher/src", - // need this for imports of @ourworldindata/grapher/src/core/grapher.scss to work - // we alias to the packages source files in dev and prod: - // this means we get instant dev updates when we change one of them, - // and the prod build builds them all as esm modules, which helps with tree shaking - // Idea from https://github.com/LinusBorg/vue-lib-template/blob/3775e49b20a7c3349dd49321cad2ed7f9d575057/packages/playground/vite.config.ts - "@ourworldindata/components": "@ourworldindata/components/src/index.ts", - "@ourworldindata/core-table": "@ourworldindata/core-table/src/index.ts", - "@ourworldindata/explorer": "@ourworldindata/explorer/src/index.ts", - "@ourworldindata/grapher": "@ourworldindata/grapher/src/index.ts", - "@ourworldindata/types": "@ourworldindata/types/src/index.ts", - "@ourworldindata/utils": "@ourworldindata/utils/src/index.ts" - } - }, - css: { - devSourcemap: true - }, - define: { - // Replace all clientSettings with their respective values, i.e. assign e.g. BUGSNAG_API_KEY to process.env.BUGSNAG_API_KEY - // it's important to note that we only expose values that are present in the clientSettings file - not any other things that are stored in .env - ...Object.fromEntries( - Object.entries(clientSettings_exports).map(([key, value]) => [ - `process.env.${key}`, - JSON.stringify(value) - ]) - ) - }, - build: { - manifest: true, - // creates a manifest.json file, which we use to determine which files to load in prod - emptyOutDir: true, - outDir: `dist/${entrypointInfo.outDir}`, - sourcemap: true, - target: ["chrome80", "firefox78", "safari13.1"], - // see docs/browser-support.md - rollupOptions: { - input: { - [entrypointInfo.outName]: entrypointInfo.entryPointFile - }, - output: { - assetFileNames: `${entrypointInfo.outName}.css`, - entryFileNames: `${entrypointInfo.outName}.mjs` - } - } - }, - plugins: [ - pluginReact({ - babel: { - parserOpts: { - plugins: ["decorators-legacy"] - // needed so mobx decorators work correctly - } - } - }), - pluginChecker({ - typescript: { - buildMode: true, - tsconfigPath: "tsconfig.vite-checker.json" - } - }) - ], - server: { - port: 8090, - warmup: { clientFiles: [VITE_ASSET_SITE_ENTRY] } - }, - preview: { - port: 8090 - } - }); -}; - -// vite.config-site.mts -var vite_config_site_default = defineViteConfigForEntrypoint("site" /* Site */); -export { - vite_config_site_default as default -}; -//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsic2l0ZS92aXRlVXRpbHMudHN4IiwgInNldHRpbmdzL2ZpbmRCYXNlRGlyLnRzIiwgInNldHRpbmdzL3NlcnZlclNldHRpbmdzLnRzIiwgInNldHRpbmdzL2NsaWVudFNldHRpbmdzLnRzIiwgInNpdGUvU2l0ZUNvbnN0YW50cy50cyIsICJ2aXRlLmNvbmZpZy1jb21tb24ubXRzIiwgInZpdGUuY29uZmlnLXNpdGUubXRzIl0sCiAgInNvdXJjZXNDb250ZW50IjogWyJpbXBvcnQgUmVhY3QgZnJvbSBcInJlYWN0XCJcbmltcG9ydCBmaW5kQmFzZURpciBmcm9tIFwiLi4vc2V0dGluZ3MvZmluZEJhc2VEaXIuanNcIlxuaW1wb3J0IGZzIGZyb20gXCJmcy1leHRyYVwiXG5pbXBvcnQge1xuICAgIEVOVixcbiAgICBCQUtFRF9CQVNFX1VSTCxcbiAgICBWSVRFX1BSRVZJRVcsXG59IGZyb20gXCIuLi9zZXR0aW5ncy9zZXJ2ZXJTZXR0aW5ncy5qc1wiXG5pbXBvcnQgeyBQT0xZRklMTF9VUkwgfSBmcm9tIFwiLi9TaXRlQ29uc3RhbnRzLmpzXCJcbmltcG9ydCB0eXBlIHsgTWFuaWZlc3QsIE1hbmlmZXN0Q2h1bmsgfSBmcm9tIFwidml0ZVwiXG5pbXBvcnQgeyBzb3J0QnkgfSBmcm9tIFwiQG91cndvcmxka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GVtZW50W10gPT4ge1xuICAgICAgICBjb25zdCBtYW5pZmVzdEVudHJ5ID1cbiAgICAgICAgICAgIE9iamVjdC52YWx1ZXMobWFuaWZlc3QpLmZpbmQoKGUpID0+IGUuZmlsZSA9PT0gZW50cnkpID8/XG4gICAgICAgICAgICAobWFuaWZlc3RbZW50cnldIGFzIE1hbmlmZXN0Q2h1bmsgfCB1bmRlZmluZWQpXG4gICAgICAgIGxldCBhc3NldHMgPSBbXSBhcyBSZWFjdC5SZWFjdEVsZW1lbnRbXVxuXG4gICAgICAgIGlmICghbWFuaWZlc3RFbnRyeSAmJiAhZW50cnkuZW5kc1dpdGgoXCIuY3NzXCIpKVxuICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKGBDb3VsZCBub3QgZmluZCBtYW5pZmVzdCBlbnRyeSBmb3IgJHtlbnRyeX1gKVxuXG4gICAgICAgIGNvbnN0IGFzc2V0VXJsID0gdXJsam9pbihhc3NldEJhc2VVcmwsIG1hbmlmZXN0RW50cnk/LmZpbGUgPz8gZW50cnkpXG5cbiAgICAgICAgaWYgKGVudHJ5LmVuZHNXaXRoKFwiLmNzc1wiKSkge1xuICAgICAgICAgICAgYXNzZXRzID0gW1xuICAgICAgICAgICAgICAgIC4uLmFzc2V0cyxcbiAgICAgICAgICAgICAgICA8bGlua1xuICAgICAgICAgICAgICAgICAgICBrZXk9e2Ake2VudHJ5fS1wcmVsb2FkYH1cbiAgICAgICAgICAgICAgICAgICAgcmVsPVwicHJlbG9hZFwiXG4gICAgICAgICAgICAgICAgICAgIGhyZWY9e2Fzc2V0VXJsfVxuICAgICAgICAgICAgICAgICAgICBhcz1cInN0eWxlXCJcbiAgICAgICAgICAgICAgICAvPixcbiAgICAgICAgICAgICAgICA8bGluayBrZXk9e2VudHJ5fSByZWw9XCJzdHlsZXNoZWV0XCIgaHJlZj17YXNzZXRVcmx9IC8+LFxuICAgICAgICAgICAgXVxuICAgICAgICB9IGVsc2UgaWYgKGVudHJ5Lm1hdGNoKC9cXC5bY21dPyhqc3xqc3h8dHN8dHN4KSQvKSkge1xuICAgICAgICAgICAgLy8gZXhwbGljaXRseSByZWZlcmVuY2UgdGhlIGVudHJ5OyBwcmVsb2FkIGl0IGFuZCBpdHMgZGVwZW5kZW5jaWVzXG4gICAgICAgICAgICBpZiAobWFuaWZlc3RFbnRyeT8uaXNFbnRyeSkge1xuICAgICAgICAgICAgICAgIGFzc2V0cyA9IFtcbiAgICAgICAgICAgICAgICAgICAgLi4uYXNzZXRzLFxuICAgICAgICAgICAgICAgICAgICA8c2NyaXB0XG4gICAgICAgICAgICAgICAgICAgICAgICBrZXk9e2VudHJ5fVxuICAgICAgICAgICAgICAgICAgICAgICAgdHlwZT1cIm1vZHVsZVwiXG4gICAgICAgICAgICAgICAgICAgICAgICBzcmM9e2Fzc2V0VXJsfVxuICAgICAgICAgICAgICAgICAgICAgICAgZGF0YS1hdHRhY2gtb3dpZC1lcnJvci1oYW5kbGVyXG4gICAgICAgICAgICAgICAgICAgIC8+LFxuICAgICAgICAgICAgICAgIF1cbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgYXNzZXRzID0gW1xuICAgICAgICAgICAgICAgIC4uLmFzc2V0cyxcbiAgICAgICAgICAgICAgICA8bGlua1xuICAgICAgICAgICAgICAgICAgICBrZXk9e2Ake2VudHJ5fS1wcmVsb2FkYH1cbiAgICAgICAgICAgICAgICAgICAgcmVsPVwibW9kdWxlcHJlbG9hZFwiIC8vIHNlZSBodHRwczovL2RldmVsb3Blci5jaHJvbWUuY29tL2Jsb2cvbW9kdWxlcHJlbG9hZC9cbiAgICAgICAgICAgICAgICAgICAgaHJlZj17YXNzZXRVcmx9XG4gICAgICAgICAgICAgICAgLz4sXG4gICAgICAgICAgICBdXG4gICAgICAgIH1cblxuICAgICAgICAvLyB3ZSBuZWVkIHRvIHJlY3Vyc2UgaW50byBib3RoIHRoZSBtb2R1bGUgaW1wb3J0cyBhbmQgaW1wb3J0ZWQgY3NzIGZpbGVzLCBhbm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ICAgICAgaWNvbjogZmFJbnN0YWdyYW0sXG4gICAgfSxcbiAgICB7XG4gICAgICAgIHRpdGxlOiBcIlRocmVhZHNcIixcbiAgICAgICAgdXJsOiBcImh0dHBzOi8vd3d3LnRocmVhZHMubmV0L0BvdXJ3b3JsZGluZGF0YVwiLFxuICAgICAgICBpY29uOiBmYVRocmVhZHMsXG4gICAgfSxcbiAgICB7XG4gICAgICAgIHRpdGxlOiBcIkZhY2Vib29rXCIsXG4gICAgICAgIHVybDogXCJodHRwczovL2ZhY2Vib29rLmNvbS9vdXJ3b3JsZGluZGF0YVwiLFxuICAgICAgICBpY29uOiBmYUZhY2Vib29rU3F1YXJlLFxuICAgIH0sXG4gICAge1xuICAgICAgICB0aXRsZTogXCJMaW5rZWRJblwiLFxuICAgICAgICB1cmw6IFwiaHR0cHM6Ly93d3cubGlua2VkaW4uY29tL2NvbXBhbnkvb3Vyd29ybGRpbmRhdGFcIixcbiAgICAgICAgaWNvbjogZmFMaW5rZWRpbixcbiAgICB9LFxuICAgIHtcbiAgICAgICAgdGl0bGU6IFwiQmx1ZXNreVwiLFxuICAgICAgICB1cmw6IFwiaHR0cHM6Ly9ic2t5LmFwcC9wcm9maWxlL291cndvcmxkaW5kYXRhLm9yZ1wiLFxuICAgICAgICBpY29uOiBmYUJsdWVza3ksXG4gICAgfSxcbl1cblxuZXhwb3J0IGNvbnN0IFJTU19GRUVEUyA9IFtcbiAgICB7XG4gICAgICAgIHRpdGxlOiBcIlJlc2VhcmNoICYgV3JpdGluZyBSU1MgRmVlZFwiLFxuICAgICAgICB1cmw6IFwiL2F0b20ueG1sXCIsXG4gICAgICAgIGljb246IGZhUnNzLFxuICAgIH0sXG4gICAge1xuICAgICAgICB0aXRsZTogXCJEYWlseSBEYXRhIEluc2lnaHRzIFJTUyBGZWVkXCIsXG4gICAgICAgIHVybDogYC8ke0RBVEFfSU5TSUdIVFNfQVRPTV9GRUVEX05BTUV9YCxcbiAgICAgICAgaWNvbjogZmFSc3MsXG4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BvdGhlciB0aGluZ3MgdGhhdCBhcmUgc3RvcmVkIGluIC5lbnZcbiAgICAgICAgICAgIC4uLk9iamVjdC5mcm9tRW50cmllcyhcbiAgICAgICAgICAgICAgICBPYmplY3QuZW50cmllcyhjbGllbnRTZXR0aW5ncykubWFwKChba2V5LCB2YWx1ZV0pID0+IFtcbiAgICAgICAgICAgICAgICAgICAgYHByb2Nlc3MuZW52LiR7a2V5fWAsXG4gICAgICAgICAgICAgICAgICAgIEpTT04uc3RyaW5naWZ5KHZhbHVlKSxcbiAgICAgICAgICAgICAgICBdKVxuICAgICAgICAgICAgKSxcbiAgICAgICAgfSxcbiAgICAgICAgYnVpbGQ6IHtcbiAgICAgICAgICAgIG1hbmlmZXN0OiB0cnVlLCAvLyBjcmVhdGVzIGEgbWFuaWZlc3QuanNvbiBmaWxlLCB3aGljaCB3ZSB1c2UgdG8gZGV0ZXJtaW5lIHdoaWNoIGZpbGVzIHRvIGxvYWQgaW4gcHJvZFxuICAgICAgICAgICAgZW1wdHlPdXREaXI6IHRydWUsXG4gICAgICAgICAgICBvdXREaXI6IGBkaXN0LyR7ZW50cnlwb2ludEluZm8ub3V0RGlyfWAsXG4gICAgICAgICAgICBzb3VyY2VtYXA6IHRydWUsXG4gICAgICAgICAgICB0YXJnZXQ6IFtcImNocm9tZTgwXCIsIFwiZmlyZWZveDc4XCIsIFwic2FmYXJpMTMuMVwiXSwgLy8gc2VlIGRvY3MvYnJvd3Nlci1zdXBwb3J0Lm1kXG4gICAgICAgICAgICByb2xsdXBPcHRpb25zOiB7XG4gICAgICAgICAgICAgICAgaW5wdXQ6IHtcbiAgICAgICAgICAgICAgICAgICAgW2VudHJ5cG9pbnRJbmZvLm91dE5hbWVdOiBlbnRyeXBvaW50SW5mby5lbnRyeVBvaW50RmlsZSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIG91dHB1dDoge1xuICAgICAgICAgICAgICAgICAgICBhc3NldEZpbGVOYW1lczogYCR7ZW50cnlwb2ludEluZm8ub3V0TmFtZX0uY3NzYCxcbiAgICAgICAgICAgICAgICAgICAgZW50cnlGaWxlTmFtZXM6IGAke2VudHJ5cG9pbnRJbmZvLm91dE5hbWV9Lm1qc2AsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0sXG4gICAgICAgIHBsdWdpbnM6IFtcbiAgICAgICAgICAgIHBsdWdpblJlYWN0KHtcbiAgICAgICAgICAgICAgICBiYWJlbDoge1xuICAgICAgICAgICAgICAgICAgICBwYXJzZXJPcHRzOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICBwbHVnaW5zOiBbXCJkZWNvcmF0b3JzLWxlZ2FjeVwiXSwgLy8gbmVlZGVkIHNvIG1vYnggZGVjb3JhdG9ycyB3b3JrIGNvcnJlY3RseVxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9KSxcbiAgICAgICAgICAgIHBsdWdpbkNoZWNrZXIoe1xuICAgICAgICAgICAgICAgIHR5cGVzY3JpcHQ6IHtcbiAgICAgICAgICAgICAgICAgICAgYnVpbGRNb2RlOiB0cnVlLFxuICAgICAgICAgICAgICAgICAgICB0c2NvbmZpZ1BhdGg6IFwidHNjb25maWcudml0ZS1jaGVja2VyLmpzb25cIixcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSksXG4gICAgICAgIF0sXG4gICAgICAgIHNlcnZlcjoge1xuICAgICAgICAgICAgcG9ydDogODA5MCxcbiAgICAgICAgICAgIHdhcm11cDogeyBjbGllbnRGaWxlczogW1ZJVEVfQVNTRVRfU0lURV9FTlRSWV0gfSxcbiAgICAgICAgfSxcbiAgICAgICAgcHJldmlldzoge1xuICAgICAgICAgICAgcG9ydDogODA5MCxcbiAgICAgICAgfSxcbiAgICB9KVxufVxuIiwgImNvbnN0IF9fdml0ZV9pbmplY3RlZF9vcmlnaW5hbF9kaXJuYW1lID0gXCIvVXNlcnMvc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?q?=F0=9F=90=9B=20merge=20arrays=20correctly?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- db/migration/1732291572062-MigrateSlopeCharts.ts | 11 +++-------- packages/@ourworldindata/utils/src/index.ts | 1 + 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/db/migration/1732291572062-MigrateSlopeCharts.ts b/db/migration/1732291572062-MigrateSlopeCharts.ts index 92674e2e219..98cb50953ac 100644 --- a/db/migration/1732291572062-MigrateSlopeCharts.ts +++ b/db/migration/1732291572062-MigrateSlopeCharts.ts @@ -3,6 +3,7 @@ import { GrapherInterface, ScaleType, } from "@ourworldindata/types" +import { simpleMerge } from "@ourworldindata/utils" import { MigrationInterface, QueryRunner } from "typeorm" export class MigrateSlopeCharts1732291572062 implements MigrationInterface { @@ -28,14 +29,8 @@ export class MigrateSlopeCharts1732291572062 implements MigrationInterface { const patchConfig = JSON.parse(chart.patch) const fullConfig = JSON.parse(chart.full) - const newPatchConfig = { - ...patchConfig, - ...migrationConfig, - } - const newFullConfig = { - ...fullConfig, - ...migrationConfig, - } + const newPatchConfig = simpleMerge(patchConfig, migrationConfig) + const newFullConfig = simpleMerge(fullConfig, migrationConfig) await queryRunner.query( ` diff --git a/packages/@ourworldindata/utils/src/index.ts b/packages/@ourworldindata/utils/src/index.ts index 752ce632323..c648ca47e44 100644 --- a/packages/@ourworldindata/utils/src/index.ts +++ b/packages/@ourworldindata/utils/src/index.ts @@ -335,6 +335,7 @@ export { export { isAndroid, isIOS } from "./BrowserUtils.js" export { + simpleMerge, diffGrapherConfigs, mergeGrapherConfigs, simpleMerge, From 5d0cea420c05acc2ec93f2be7ebc771faee42d29 Mon Sep 17 00:00:00 2001 From: sophiamersmann Date: Mon, 2 Dec 2024 09:37:38 +0100 Subject: [PATCH 48/52] =?UTF-8?q?Revert=20"=F0=9F=90=9B=20hide=20slope=20c?= =?UTF-8?q?hart=20tab=20if=20line=20chart=20really=20is=20a=20bar=20chart"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../grapher/src/core/Grapher.tsx | 22 +++---------------- 1 file changed, 3 insertions(+), 19 deletions(-) diff --git a/packages/@ourworldindata/grapher/src/core/Grapher.tsx b/packages/@ourworldindata/grapher/src/core/Grapher.tsx index 30fca4227a7..673b56b3167 100644 --- a/packages/@ourworldindata/grapher/src/core/Grapher.tsx +++ b/packages/@ourworldindata/grapher/src/core/Grapher.tsx @@ -1560,26 +1560,10 @@ export class Grapher // if the given combination is not valid, then ignore all but the first chart type if (!validChartTypes) return chartTypes.slice(0, 1) - // make sure showing a slope chart tab next to a line chart tab is sensible + // projected data is only supported for line charts const isLineChart = validChartTypes[0] === GRAPHER_CHART_TYPES.LineChart - if (isLineChart) { - // projected data is only supported for line charts - if (this.hasProjectedData) return [GRAPHER_CHART_TYPES.LineChart] - - // if the line chart really is a bar chart, don't show the slope chart tab - const minTime = minTimeBoundFromJSONOrNegativeInfinity( - this.legacyConfigAsAuthored.minTime - ) - const maxTime = maxTimeBoundFromJSONOrPositiveInfinity( - this.legacyConfigAsAuthored.maxTime - ) - const times = - this.tableAfterAuthorTimelineFilter.timeColumn.uniqValues - const [startTime, endTime] = [minTime, maxTime].map((time) => - findClosestTime(times, time) - ) - const isDiscreteBar = this.hideTimeline && startTime === endTime - if (isDiscreteBar) return [GRAPHER_CHART_TYPES.LineChart] + if (isLineChart && this.hasProjectedData) { + return [GRAPHER_CHART_TYPES.LineChart] } return validChartTypes From e1169091253457d3cf7b3b4e30c7b80cb6a643a1 Mon Sep 17 00:00:00 2001 From: sophiamersmann Date: Mon, 2 Dec 2024 14:49:35 +0100 Subject: [PATCH 49/52] =?UTF-8?q?=E2=9C=A8=20(slope)=20incorporate=20pr=20?= =?UTF-8?q?feedback?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/controls/settings/AbsRelToggle.tsx | 4 +- .../grapher/src/lineCharts/LineChart.tsx | 2 +- .../src/scatterCharts/ScatterPlotChart.tsx | 4 +- .../src/slopeCharts/SlopeChart.test.ts | 4 +- .../grapher/src/slopeCharts/SlopeChart.tsx | 53 ++++++------------- .../src/slopeCharts/SlopeChartConstants.ts | 2 + 6 files changed, 25 insertions(+), 44 deletions(-) diff --git a/packages/@ourworldindata/grapher/src/controls/settings/AbsRelToggle.tsx b/packages/@ourworldindata/grapher/src/controls/settings/AbsRelToggle.tsx index b90e825960b..d24ce59e359 100644 --- a/packages/@ourworldindata/grapher/src/controls/settings/AbsRelToggle.tsx +++ b/packages/@ourworldindata/grapher/src/controls/settings/AbsRelToggle.tsx @@ -8,7 +8,7 @@ import { } from "@ourworldindata/types" import { LabeledSwitch } from "@ourworldindata/components" -const { LineChart, ScatterPlot } = GRAPHER_CHART_TYPES +const { LineChart, ScatterPlot, SlopeChart } = GRAPHER_CHART_TYPES export interface AbsRelToggleManager { stackMode?: StackMode @@ -38,7 +38,7 @@ export class AbsRelToggle extends React.Component<{ const { activeChartType } = this.manager return activeChartType === ScatterPlot ? "Show the percentage change per year over the the selected time range." - : activeChartType === LineChart + : activeChartType === LineChart || activeChartType === SlopeChart ? "Show proportional changes over time or actual values in their original units." : "Show values as their share of the total or as actual values in their original units." } diff --git a/packages/@ourworldindata/grapher/src/lineCharts/LineChart.tsx b/packages/@ourworldindata/grapher/src/lineCharts/LineChart.tsx index 87c2cb800c6..c1159cbc695 100644 --- a/packages/@ourworldindata/grapher/src/lineCharts/LineChart.tsx +++ b/packages/@ourworldindata/grapher/src/lineCharts/LineChart.tsx @@ -107,7 +107,7 @@ import { getAnnotationsMap, getColorKey, getSeriesName, -} from "./lineChartHelpers" +} from "./LineChartHelpers" const LINE_CHART_CLASS_NAME = "LineChart" diff --git a/packages/@ourworldindata/grapher/src/scatterCharts/ScatterPlotChart.tsx b/packages/@ourworldindata/grapher/src/scatterCharts/ScatterPlotChart.tsx index fc505bb6459..5906adeb482 100644 --- a/packages/@ourworldindata/grapher/src/scatterCharts/ScatterPlotChart.tsx +++ b/packages/@ourworldindata/grapher/src/scatterCharts/ScatterPlotChart.tsx @@ -935,7 +935,9 @@ export class ScatterPlotChart timeLabel = timeRange + (isRelativeMode ? " (avg. annual change)" : "") - const columns = [xColumn, yColumn, sizeColumn] + const columns = [xColumn, yColumn, sizeColumn].filter( + (column) => !column.isMissing + ) const allRoundedToSigFigs = columns.every( (column) => column.roundsToSignificantFigures ) diff --git a/packages/@ourworldindata/grapher/src/slopeCharts/SlopeChart.test.ts b/packages/@ourworldindata/grapher/src/slopeCharts/SlopeChart.test.ts index fdc342b3b43..bdfb7d1885c 100755 --- a/packages/@ourworldindata/grapher/src/slopeCharts/SlopeChart.test.ts +++ b/packages/@ourworldindata/grapher/src/slopeCharts/SlopeChart.test.ts @@ -71,7 +71,7 @@ it("can filter points with negative values when using a log scale", () => { } const chart = new SlopeChart({ manager }) // expect(chart.series.length).toEqual(2) - expect(chart.allValues.length).toEqual(4) + expect(chart.allYValues.length).toEqual(4) const logScaleManager = { ...manager, @@ -82,7 +82,7 @@ it("can filter points with negative values when using a log scale", () => { const logChart = new SlopeChart({ manager: logScaleManager }) expect(logChart.yAxis.domain[0]).toBeGreaterThan(0) // expect(logChart.series.length).toEqual(2) - expect(logChart.allValues.length).toEqual(2) + expect(logChart.allYValues.length).toEqual(2) }) describe("series naming in multi-column mode", () => { diff --git a/packages/@ourworldindata/grapher/src/slopeCharts/SlopeChart.tsx b/packages/@ourworldindata/grapher/src/slopeCharts/SlopeChart.tsx index b81b4e60de2..8e928278f04 100644 --- a/packages/@ourworldindata/grapher/src/slopeCharts/SlopeChart.tsx +++ b/packages/@ourworldindata/grapher/src/slopeCharts/SlopeChart.tsx @@ -71,7 +71,7 @@ import { getAnnotationsMap, getColorKey, getSeriesName, -} from "../lineCharts/lineChartHelpers" +} from "../lineCharts/LineChartHelpers" type SVGMouseOrTouchEvent = | React.MouseEvent @@ -295,6 +295,7 @@ export class SlopeChart ) return { + column, seriesName, entityName, color, @@ -403,7 +404,7 @@ export class SlopeChart return new AxisConfig(this.manager.yAxisConfig, this) } - @computed get allValues(): number[] { + @computed get allYValues(): number[] { return this.series.flatMap((series) => [ series.startValue, series.endValue, @@ -415,7 +416,7 @@ export class SlopeChart } @computed private get yDomainDefault(): [number, number] { - return domainExtent(this.allValues, this.yScaleType) + return domainExtent(this.allYValues, this.yScaleType) } @computed private get yDomain(): [number, number] { @@ -496,10 +497,8 @@ export class SlopeChart this.bounds.x + Math.max(0.25 * chartAreaWidth, this.yAxisWidth + 4) let endX = this.bounds.x + - Math.min( - chartAreaWidth - 0.25 * chartAreaWidth, - chartAreaWidth - lineLegendWidth - ) + chartAreaWidth - + Math.max(0.25 * chartAreaWidth, lineLegendWidth) const currentSlopeWidth = endX - startX if (currentSlopeWidth > maxSlopeWidth) { @@ -537,7 +536,7 @@ export class SlopeChart private playIntroAnimation() { // Nice little intro animation select(this.slopeAreaRef.current) - .select(".slopes") + .selectAll(".slope") .attr("stroke-dasharray", "100%") .attr("stroke-dashoffset", "100%") .transition() @@ -672,29 +671,13 @@ export class SlopeChart ? `% change since ${formatColumn.formatTime(startTime)}` : timeRange - const columns = this.yColumns - const allRoundedToSigFigs = columns.every( - (column) => column.roundsToSignificantFigures - ) - const anyRoundedToSigFigs = columns.some( - (column) => column.roundsToSignificantFigures - ) - const sigFigs = excludeUndefined( - columns.map((column) => - column.roundsToSignificantFigures - ? column.numSignificantFigures - : undefined - ) - ) - - const roundingNotice = anyRoundedToSigFigs + const roundingNotice = series.column.roundsToSignificantFigures ? { - icon: allRoundedToSigFigs - ? TooltipFooterIcon.none - : TooltipFooterIcon.significance, - text: makeTooltipRoundingNotice(sigFigs, { - plural: sigFigs.length > 1, - }), + icon: TooltipFooterIcon.none, + text: makeTooltipRoundingNotice( + [series.column.numSignificantFigures], + { plural: !isRelativeMode } + ), } : undefined const footer = excludeUndefined([roundingNotice]) @@ -803,13 +786,6 @@ export class SlopeChart return ( - {this.renderSlopes()} @@ -914,6 +890,7 @@ function Slope({ return ( onMouseOver?.(series)} onMouseLeave={() => onMouseLeave?.()} > diff --git a/packages/@ourworldindata/grapher/src/slopeCharts/SlopeChartConstants.ts b/packages/@ourworldindata/grapher/src/slopeCharts/SlopeChartConstants.ts index 544410718b7..85cd862866e 100644 --- a/packages/@ourworldindata/grapher/src/slopeCharts/SlopeChartConstants.ts +++ b/packages/@ourworldindata/grapher/src/slopeCharts/SlopeChartConstants.ts @@ -1,7 +1,9 @@ import { EntityName, PartialBy, PointVector } from "@ourworldindata/utils" import { ChartSeries } from "../chart/ChartInterface" +import { CoreColumn } from "@ourworldindata/core-table" export interface SlopeChartSeries extends ChartSeries { + column: CoreColumn entityName: EntityName startValue: number endValue: number From 647e34709648779b06ab3d7956b9ba5f710aff32 Mon Sep 17 00:00:00 2001 From: sophiamersmann Date: Mon, 2 Dec 2024 16:49:48 +0100 Subject: [PATCH 50/52] =?UTF-8?q?=F0=9F=94=A8=20rename=20line=20chart=20he?= =?UTF-8?q?lpers=20file?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/lineCharts/{lineChartHelpers.ts => LineChartHelpers.ts} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename packages/@ourworldindata/grapher/src/lineCharts/{lineChartHelpers.ts => LineChartHelpers.ts} (100%) diff --git a/packages/@ourworldindata/grapher/src/lineCharts/lineChartHelpers.ts b/packages/@ourworldindata/grapher/src/lineCharts/LineChartHelpers.ts similarity index 100% rename from packages/@ourworldindata/grapher/src/lineCharts/lineChartHelpers.ts rename to packages/@ourworldindata/grapher/src/lineCharts/LineChartHelpers.ts From 2b38230b264d107624ddf5ee2b9fa238abb1b812 Mon Sep 17 00:00:00 2001 From: Sophia Mersmann Date: Tue, 10 Dec 2024 18:13:04 +0100 Subject: [PATCH 51/52] =?UTF-8?q?=F0=9F=94=A8=20remove=20slope=20chart=20m?= =?UTF-8?q?igrations?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...407-RemoveColorDimensionFromSlopeCharts.ts | 32 - .../1732291572062-MigrateSlopeCharts.ts | 545 ------------------ 2 files changed, 577 deletions(-) delete mode 100644 db/migration/1732195571407-RemoveColorDimensionFromSlopeCharts.ts delete mode 100644 db/migration/1732291572062-MigrateSlopeCharts.ts diff --git a/db/migration/1732195571407-RemoveColorDimensionFromSlopeCharts.ts b/db/migration/1732195571407-RemoveColorDimensionFromSlopeCharts.ts deleted file mode 100644 index 1750d7e2576..00000000000 --- a/db/migration/1732195571407-RemoveColorDimensionFromSlopeCharts.ts +++ /dev/null @@ -1,32 +0,0 @@ -import { MigrationInterface, QueryRunner } from "typeorm" - -export class RemoveColorDimensionFromSlopeCharts1732195571407 - implements MigrationInterface -{ - public async up(queryRunner: QueryRunner): Promise { - // remove color dimension for all slope charts - // the y-dimension always comes first and the color dimension second, - // so it's safe to keep the first dimension only - await queryRunner.query(` - -- sql - UPDATE chart_configs - SET - patch = JSON_REPLACE(patch, '$.dimensions', JSON_ARRAY(patch -> '$.dimensions[0]')), - full = JSON_REPLACE(full, '$.dimensions', JSON_ARRAY(full -> '$.dimensions[0]')) - WHERE - chartType = 'SlopeChart' - `) - - // remove the color dimension for slope charts from the chart_dimensions table - await queryRunner.query(` - -- sql - DELETE cd FROM chart_dimensions cd - JOIN charts c ON c.id = cd.chartId - JOIN chart_configs cc ON c.configId = cc.id - WHERE cc.chartType = 'SlopeChart' AND cd.property = 'color' - `) - } - - // eslint-disable-next-line @typescript-eslint/no-empty-function - public async down(): Promise {} -} diff --git a/db/migration/1732291572062-MigrateSlopeCharts.ts b/db/migration/1732291572062-MigrateSlopeCharts.ts deleted file mode 100644 index 98cb50953ac..00000000000 --- a/db/migration/1732291572062-MigrateSlopeCharts.ts +++ /dev/null @@ -1,545 +0,0 @@ -import { - EntitySelectionMode, - GrapherInterface, - ScaleType, -} from "@ourworldindata/types" -import { simpleMerge } from "@ourworldindata/utils" -import { MigrationInterface, QueryRunner } from "typeorm" - -export class MigrateSlopeCharts1732291572062 implements MigrationInterface { - public async up(queryRunner: QueryRunner): Promise { - const slopeCharts = await queryRunner.query(` - -- sql - SELECT c.id, cc.id AS configId, cc.patch, cc.full - FROM charts c - JOIN chart_configs cc ON cc.id = c.configId - WHERE - cc.chartType = 'SlopeChart' - AND cc.full ->> '$.isPublished' = 'true' - `) - - const configUpdatesById = new Map( - configUpdates.map(({ id, config }) => [id, config]) - ) - - for (const chart of slopeCharts) { - const migrationConfig = configUpdatesById.get(chart.id) - if (!migrationConfig) continue - - const patchConfig = JSON.parse(chart.patch) - const fullConfig = JSON.parse(chart.full) - - const newPatchConfig = simpleMerge(patchConfig, migrationConfig) - const newFullConfig = simpleMerge(fullConfig, migrationConfig) - - await queryRunner.query( - ` - -- sql - UPDATE chart_configs - SET - patch = ?, - full = ? - WHERE id = ? - `, - [ - JSON.stringify(newPatchConfig), - JSON.stringify(newFullConfig), - chart.configId, - ] - ) - } - } - - // eslint-disable-next-line @typescript-eslint/no-empty-function - public async down(): Promise {} -} - -const configUpdates: { id: number; config: GrapherInterface }[] = [ - { - id: 414, - config: { - selectedEntityNames: [ - "Colombia", - "Guatemala", - "Indonesia", - "Iran", - "Jamaica", - "Pakistan", - "Trinidad and Tobago", - "Botswana", - "Bolivia", - "Japan", - "United States", - "Sweden", - "Germany", - "Netherlands", - "Belgium", - "France", - "Ireland", - "United Kingdom", - ], - hideRelativeToggle: true, - }, - }, - { - id: 415, - config: { - selectedEntityNames: [ - "Congenital heart anomalies", - "Neonatal preterm birth", - "Neonatal encephalopathy due to birth asphyxia and trauma", - "Congenital birth defects", - "Diarrheal diseases", - "Malaria", - ], - entityType: "cause", - entityTypePlural: "causes", - hideRelativeToggle: true, - hideLegend: false, - }, - }, - { - id: 679, - config: { - selectedEntityNames: [ - "Low-income countries", - "High-income countries", - "Lower-middle-income countries", - "Upper-middle-income countries", - ], - hideRelativeToggle: true, - yAxis: { - scaleType: ScaleType.linear, - }, - }, - }, - { - id: 874, - config: { - selectedEntityNames: [ - "North America (WB)", - "South Asia (WB)", - "Europe and Central Asia (WB)", - "Latin America and Caribbean (WB)", - ], - hideRelativeToggle: true, - }, - }, - { - id: 875, - config: { - selectedEntityNames: [ - "India", - "United States", - "Indonesia", - "Pakistan", - "Nigeria", - ], - hideRelativeToggle: true, - }, - }, - { - id: 1004, - config: { - selectedEntityNames: [ - "Europe (UN)", - "Asia (UN)", - "Africa (UN)", - "Oceania (UN)", - "Northern America (UN)", - "Latin America and the Caribbean (UN)", - ], - }, - }, - { id: 1459, config: {} }, - { - id: 1975, - config: { - selectedEntityNames: [ - "North America", - "South America", - "Europe", - "Asia", - "Oceania", - "Africa", - ], - }, - }, - { - id: 2832, - config: { - selectedEntityNames: [ - "Italy", - "France", - "Finland", - "Norway", - "Estonia", - "United Kingdom", - "Spain", - "Germany", - "Belgium", - ], - hideTimeline: true, - addCountryMode: EntitySelectionMode.Disabled, - }, - }, - { - id: 2833, - config: { - selectedEntityNames: [ - "Belgium", - "Poland", - "Italy", - "Germany", - "Norway", - "Spain", - "France", - "Finland", - "United Kingdom", - "Estonia", - ], - hideTimeline: true, - addCountryMode: EntitySelectionMode.Disabled, - }, - }, - { - id: 2834, - config: { - selectedEntityNames: [ - "Belgium", - "Italy", - "Spain", - "Norway", - "France", - "Poland", - "Estonia", - "United Kingdom", - "Finland", - "Germany", - ], - addCountryMode: EntitySelectionMode.Disabled, - }, - }, - { - id: 2835, - config: { - selectedEntityNames: [ - "Estonia", - "Norway", - "Poland", - "United Kingdom", - "France", - "Finland", - "Germany", - "Belgium", - "Italy", - "Spain", - ], - hideTimeline: true, - addCountryMode: EntitySelectionMode.Disabled, - }, - }, - { - id: 2975, - config: { - selectedEntityNames: [ - "Germany", - "Poland", - "United Kingdom", - "Finland", - "Estonia", - "Spain", - "Italy", - "Norway", - "France", - ], - hideTimeline: true, - addCountryMode: EntitySelectionMode.Disabled, - }, - }, - { - id: 2976, - config: { - selectedEntityNames: [ - "Poland", - "Italy", - "Spain", - "Estonia", - "France", - "Germany", - "Belgium", - "United Kingdom", - "Norway", - "Finland", - ], - hideTimeline: true, - addCountryMode: EntitySelectionMode.Disabled, - }, - }, - { - id: 2977, - config: { - selectedEntityNames: [ - "Poland", - "Norway", - "Estonia", - "Finland", - "Germany", - "Belgium", - "United Kingdom", - "Spain", - "Italy", - "France", - ], - hideTimeline: true, - addCountryMode: EntitySelectionMode.Disabled, - }, - }, - { - id: 2978, - config: { - selectedEntityNames: [ - "Poland", - "Norway", - "Belgium", - "Estonia", - "Italy", - "Finland", - "Germany", - "United Kingdom", - "Spain", - "France", - ], - hideTimeline: true, - addCountryMode: EntitySelectionMode.Disabled, - }, - }, - { - id: 2979, - config: { - selectedEntityNames: [ - "United Kingdom", - "Estonia", - "Belgium", - "Italy", - "France", - "Spain", - "Germany", - "Poland", - "Finland", - "Norway", - ], - hideTimeline: true, - addCountryMode: EntitySelectionMode.Disabled, - }, - }, - { - id: 3249, - config: { - selectedEntityNames: [ - "France", - "Italy", - "Japan", - "Portugal", - "Germany", - "Mexico", - "Norway", - "Sweden", - "Taiwan", - "Sri Lanka", - "United Kingdom", - "United States", - ], - }, - }, - { - id: 3359, - config: { - selectedEntityNames: [ - "Mali", - "South Africa", - "Nigeria", - "Niger", - "Chad", - "Ethiopia", - "Kenya", - "Uganda", - "Rwanda", - "Burundi", - "Tanzania", - "Mozambique", - "Madagascar", - "Zambia", - "Congo", - "Democratic Republic of Congo", - "Central African Republic", - "Cameroon", - "Togo", - "Benin", - "Sierra Leone", - "Cote d'Ivoire", - "Burkina Faso", - "Guinea-Bissau", - "Papua New Guinea", - "Senegal", - "Angola", - ], - }, - }, - { - id: 3364, - config: { - selectedEntityNames: [ - "India", - "Indonesia", - "United States", - "Pakistan", - ], - }, - }, - { - id: 3433, - config: {}, - }, - { - id: 3434, - config: {}, - }, - { - id: 3580, - config: { - entityTypePlural: "species", - }, - }, - { - id: 3620, - config: { - selectedEntityNames: [ - "Low income", - "High income", - "Middle income", - "Low & middle income", - "Lower middle income", - "Upper middle income", - ], - }, - }, - { - id: 3627, - config: { - selectedEntityNames: [ - "Low income", - "High income", - "Middle income", - "Low & middle income", - "Lower middle income", - "Upper middle income", - ], - }, - }, - { - id: 4408, - config: { - selectedEntityNames: [ - "East Asia (MPD)", - "Latin America (MPD)", - "Eastern Europe (MPD)", - "Western Europe (MPD)", - "Western offshoots (MPD)", - "Sub Saharan Africa (MPD)", - "South and South East Asia (MPD)", - "Middle East and North Africa (MPD)", - "World", - ], - }, - }, - { - id: 4764, - config: { - entityTypePlural: "species", - }, - }, - { - id: 6219, - config: { - hideRelativeToggle: true, - }, - }, - { - id: 6529, - config: { - selectedEntityNames: [ - "North America", - "Europe", - "Asia", - "South America", - "Oceania", - "Africa", - ], - }, - }, - { - id: 7150, - config: { - selectedEntityNames: [ - "Ethiopia", - "Myanmar", - "Niger", - "Chad", - "Colombia", - "Indonesia", - "Nigeria", - ], - }, - }, - { - id: 7206, - config: {}, - }, - { - id: 7220, - config: {}, - }, - { - id: 7221, - config: {}, - }, - { - id: 7226, - config: {}, - }, - { - id: 7344, - config: { - selectedEntityNames: [ - "United States", - "Romania", - "France", - "United Kingdom", - "Colombia", - "Mexico", - "Japan", - ], - }, - }, - { - id: 7448, - config: { - hideRelativeToggle: true, - }, - }, - { - id: 8157, - config: { - selectedEntityNames: [ - "South Asia (WB)", - "North America (WB)", - "Sub-Saharan Africa (WB)", - "East Asia and Pacific (WB)", - "Europe and Central Asia (WB)", - "Latin America and Caribbean (WB)", - "Middle East and North Africa (WB)", - ], - }, - }, -] From 3100127fa8fd504431e957286288e89ad2017d71 Mon Sep 17 00:00:00 2001 From: Sophia Mersmann Date: Tue, 10 Dec 2024 18:24:39 +0100 Subject: [PATCH 52/52] =?UTF-8?q?=F0=9F=94=A8=20fix=20rebase?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/@ourworldindata/utils/src/index.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/@ourworldindata/utils/src/index.ts b/packages/@ourworldindata/utils/src/index.ts index c648ca47e44..752ce632323 100644 --- a/packages/@ourworldindata/utils/src/index.ts +++ b/packages/@ourworldindata/utils/src/index.ts @@ -335,7 +335,6 @@ export { export { isAndroid, isIOS } from "./BrowserUtils.js" export { - simpleMerge, diffGrapherConfigs, mergeGrapherConfigs, simpleMerge,