Skip to content

Commit

Permalink
Add defaults to x/y column selections in scatter
Browse files Browse the repository at this point in the history
  • Loading branch information
ebb-tide committed Jun 5, 2019
1 parent 0088b35 commit 7cc1c66
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions ui/src/shared/components/ScatterContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import GraphLoadingDots from 'src/shared/components/GraphLoadingDots'

// Utils
import {useVisDomainSettings} from 'src/shared/utils/useVisDomainSettings'
import {getFormatter} from 'src/shared/utils/vis'
import {getFormatter, chooseXColumn, chooseYColumn} from 'src/shared/utils/vis'

// Constants
import {VIS_THEME} from 'src/shared/constants'
Expand Down Expand Up @@ -40,13 +40,16 @@ const ScatterContainer: FunctionComponent<Props> = ({
colors,
xDomain: storedXDomain,
yDomain: storedYDomain,
xColumn,
yColumn,
xColumn: storedXColumn,
yColumn: storedYColumn,
},
}) => {
const fillColumns = storedFill || []
const symbolColumns = storedSymbol || []

const xColumn = storedXColumn || chooseXColumn(table)
const yColumn = storedYColumn || chooseYColumn(table)

const columnKeys = table.columnKeys

const [xDomain, onSetXDomain, onResetXDomain] = useVisDomainSettings(
Expand Down

0 comments on commit 7cc1c66

Please sign in to comment.