Skip to content

Commit

Permalink
(#855) Resolving and closing
Browse files Browse the repository at this point in the history
  • Loading branch information
adkinsrs committed Aug 12, 2024
1 parent 56a91bc commit f00bf79
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions www/js/dataset_curator.js
Original file line number Diff line number Diff line change
Expand Up @@ -1121,15 +1121,16 @@ const setupPlotlyOptions = async () => {
const difference = (arr1, arr2) => arr1.filter(x => !arr2.includes(x))
const continuousColumns = difference(allColumns, catColumns);

// class name, list of columns, add expression, default category

const xColumns = ["bar", "violin"].includes(plotType) ? catColumns : allColumns;
const xUseRaw = ["bar", "violin"].includes(plotType) ? false : true;
const yColumns = ["bar", "violin"].includes(plotType) ? continuousColumns : allColumns;
const colorColumns = ["bar", "line", "violin"].includes(plotType) ? catColumns : allColumns;
const colorUseRaw = ["bar", "line", "violin"].includes(plotType) ? false : true;

// Arguments - class name, list of columns, add expression, default category
updateSeriesOptions("js-plotly-x-axis", xColumns, xUseRaw);
updateSeriesOptions("js-plotly-y-axis", yColumns, true, "raw_value");
updateSeriesOptions("js-plotly-color", allColumns, true);
updateSeriesOptions("js-plotly-color", colorColumns, colorUseRaw);
updateSeriesOptions("js-plotly-label", allColumns, true);
updateSeriesOptions("js-plotly-facet-row", catColumns, false);
updateSeriesOptions("js-plotly-facet-col", catColumns, false);
Expand Down

0 comments on commit f00bf79

Please sign in to comment.