Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hotfix(grapher): remove missing data strategy for (stacked) discrete bar charts #2837

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 3 additions & 7 deletions adminSiteClient/EditorFeatures.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -108,13 +108,9 @@ export class EditorFeatures {
return true
}

// for line charts and discrete bar charts, specifying a missing
// data strategy only makes sense if there are multiple entities
if (
this.grapher.isLineChart ||
this.grapher.isDiscreteBar ||
this.grapher.isStackedDiscreteBar
) {
// for line charts, specifying a missing data strategy only makes sense
// if there are multiple entities
if (this.grapher.isLineChart) {
return (
this.grapher.canChangeEntity ||
this.grapher.canSelectMultipleEntities
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import {
BASE_FONT_SIZE,
SeriesStrategy,
FacetStrategy,
MissingDataStrategy,
} from "../core/GrapherConstants"
import {
HorizontalAxisComponent,
Expand Down Expand Up @@ -126,15 +125,6 @@ export class DiscreteBarChart
.interpolateColumnWithTolerance(this.colorColumnSlug)
}

// 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
}

Expand All @@ -153,10 +143,6 @@ export class DiscreteBarChart
return this.props.manager
}

@computed private get missingDataStrategy(): MissingDataStrategy {
return this.manager.missingDataStrategy || MissingDataStrategy.auto
}

@computed private get targetTime(): Time | undefined {
return this.manager.endTime
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import { observer } from "mobx-react"
import {
BASE_FONT_SIZE,
FacetStrategy,
MissingDataStrategy,
SeriesName,
} from "../core/GrapherConstants"
import {
Expand Down Expand Up @@ -130,15 +129,6 @@ export class StackedDiscreteBarChart
)
}

// 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
}

Expand Down Expand Up @@ -168,10 +158,6 @@ export class StackedDiscreteBarChart
return (this.props.bounds ?? DEFAULT_BOUNDS).padRight(10).padBottom(2)
}

@computed private get missingDataStrategy(): MissingDataStrategy {
return this.manager.missingDataStrategy || MissingDataStrategy.auto
}

@computed private get baseFontSize(): number {
return this.manager.baseFontSize ?? BASE_FONT_SIZE
}
Expand Down