Skip to content

Commit

Permalink
enhance(admin): do not persist a single entity when multiple are pref…
Browse files Browse the repository at this point in the history
…erred
  • Loading branch information
sophiamersmann committed Oct 20, 2023
1 parent ad1a24b commit 50341f2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions adminSiteClient/EditorBasicTab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ class DimensionSlotView extends React.Component<{
const { availableEntityNames, availableEntityNameSet } = selection

if (grapher.isScatter || grapher.isSlopeChart || grapher.isMarimekko) {
// chart types that display all entities by default shouldn't specifically select any
// chart types that display all entities by default shouldn't select any by default
selection.clearSelection()
} else if (
grapher.yColumnsFromDimensions.length > 1 &&
Expand All @@ -105,7 +105,7 @@ class DimensionSlotView extends React.Component<{
} else {
// stacked charts or charts with a single y-dimension should select multiple entities by default.
// if possible, the currently selected entities are persisted, otherwise a random sample is selected
if (selection.numSelectedEntities === 0) {
if (selection.numSelectedEntities <= 1) {
selection.setSelectedEntities(
availableEntityNames.length > 10
? sampleSize(availableEntityNames, 4)
Expand Down

0 comments on commit 50341f2

Please sign in to comment.