Skip to content

Commit

Permalink
Move chart splitter id to const
Browse files Browse the repository at this point in the history
  • Loading branch information
DianaDerevyankina committed Jan 25, 2021
1 parent 48780a0 commit 4436b62
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/plugins/vis_type_xy/public/chart_splitter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ interface ChartSplitterProps {
sort?: GroupBySort;
}

const CHART_SPLITTER_ID = '__chart_splitter__';

export const ChartSplitter = ({
splitColumnAccessor,
splitRowAccessor,
Expand All @@ -23,7 +25,7 @@ export const ChartSplitter = ({
splitColumnAccessor || splitRowAccessor ? (
<>
<GroupBy
id="__chart_splitter__"
id={CHART_SPLITTER_ID}
by={(spec, datum) => {
const splitTypeAccessor = splitColumnAccessor || splitRowAccessor;
if (splitTypeAccessor) {
Expand All @@ -36,8 +38,8 @@ export const ChartSplitter = ({
sort={sort || 'dataIndex'}
/>
<SmallMultiples
splitVertically={splitRowAccessor ? '__chart_splitter__' : undefined}
splitHorizontally={splitColumnAccessor ? '__chart_splitter__' : undefined}
splitVertically={splitRowAccessor ? CHART_SPLITTER_ID : undefined}
splitHorizontally={splitColumnAccessor ? CHART_SPLITTER_ID : undefined}
/>
</>
) : null;

0 comments on commit 4436b62

Please sign in to comment.