Skip to content

Commit

Permalink
🔨 rename isConnected to plotMarkersOnlyInLineChart
Browse files Browse the repository at this point in the history
  • Loading branch information
sophiamersmann committed Jan 9, 2025
1 parent 3aee00f commit e7a9696
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 10 deletions.
13 changes: 8 additions & 5 deletions adminSiteClient/DimensionCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ export class DimensionCard<
this.onChange()
}

@action.bound onIsConnected(value: boolean) {
this.props.dimension.display.isConnected = value
@action.bound onPlotMarkersOnly(value: boolean) {
this.props.dimension.display.plotMarkersOnlyInLineChart = value
this.onChange()
}

Expand Down Expand Up @@ -259,9 +259,12 @@ export class DimensionCard<
)}
{grapher.isLineChart && (
<Toggle
label="Is connected"
value={column.display?.isConnected ?? true}
onValue={this.onIsConnected}
label="Plot markers only"
value={
column.display
?.plotMarkersOnlyInLineChart ?? false
}
onValue={this.onPlotMarkersOnly}
/>
)}
<hr className="ui divider" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1316,7 +1316,7 @@ export class LineChart
points,
seriesName,
isProjection: column.isProjection,
isConnected: column.display?.isConnected ?? true,
isConnected: !column.display?.plotMarkersOnlyInLineChart,
color: seriesColor,
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -266,11 +266,11 @@ properties:
description: |
Indicates if this time series is a forward projection (if yes then this is rendered
differently in e.g. line charts)
isConnected:
plotMarkersOnlyInLineChart:
type: boolean
default: false
description: |
Indicates if this time series should be connected with a line. Only relevant for line charts.
Indicates if data points should be connected with a line in a line chart
name:
type: string
description: The display string for this variable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export interface OwidVariableDisplayConfigInterface {
includeInTable?: boolean
tableDisplay?: OwidVariableDataTableConfigInterface
color?: string
isConnected?: boolean
plotMarkersOnlyInLineChart?: boolean
}

// todo: flatten onto the above
Expand Down
2 changes: 1 addition & 1 deletion packages/@ourworldindata/utils/src/OwidVariable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class OwidVariableDisplayConfigDefaults {
@observable includeInTable? = true
@observable tableDisplay?: OwidVariableDataTableConfigInterface
@observable color?: string = undefined
@observable isConnected?: boolean = undefined
@observable plotMarkersOnlyInLineChart?: boolean = undefined
}

export class OwidVariableDisplayConfig
Expand Down

0 comments on commit e7a9696

Please sign in to comment.