From 2c5547dd309dcdb61149e4c6771a842f23784a93 Mon Sep 17 00:00:00 2001 From: Dan Marshall Date: Fri, 27 Sep 2019 11:36:29 -0700 Subject: [PATCH] handlers for barchartH --- packages/sanddance-explorer/src/columns.ts | 4 ++++ packages/sanddance-explorer/src/explorer.tsx | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/sanddance-explorer/src/columns.ts b/packages/sanddance-explorer/src/columns.ts index 6195b843..d8d94fb5 100644 --- a/packages/sanddance-explorer/src/columns.ts +++ b/packages/sanddance-explorer/src/columns.ts @@ -26,8 +26,12 @@ export function ensureColumnsPopulated(chart: SandDance.types.Chart, insightColu }; switch (chart) { case 'barchart': + case 'barchartV': ensureColumn('x'); break; + case 'barchartH': + ensureColumn('y'); + break; case 'density': case 'scatterplot': case 'stacks': diff --git a/packages/sanddance-explorer/src/explorer.tsx b/packages/sanddance-explorer/src/explorer.tsx index b17e7240..dc38b2f1 100644 --- a/packages/sanddance-explorer/src/explorer.tsx +++ b/packages/sanddance-explorer/src/explorer.tsx @@ -405,8 +405,10 @@ export class Explorer extends React.Component { newState.columns = { ...columns }; //special case mappings when switching chart type - if (this.state.chart === 'scatterplot' && chart === 'barchart') { + if (this.state.chart === 'scatterplot' && (chart === 'barchart' || chart === 'barchartV')) { newState.columns = { ...columns, sort: columns.y }; + } else if (this.state.chart === 'scatterplot' && chart === 'barchartH') { + newState.columns = { ...columns, sort: columns.x }; } else if (chart === 'treemap') { newState.view = '2d'; if (!columns.size) {