Skip to content

Commit b66f59c

Browse files
committed
Color option layout updates - set left color to 1/4 of modal width, with min width at 330px
1 parent 3d27c0f commit b66f59c

2 files changed

Lines changed: 34 additions & 35 deletions

File tree

packages/components/src/internal/components/chart/ChartColorInputs.tsx

Lines changed: 31 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ export const ChartColorInputs: FC<ChartColorInputsProps> = memo(({ chartConfig,
128128
const colorPaletteScale = chartConfig.geomOptions.colorPaletteScale;
129129
const showColorPaletteScale = useMemo(() => showColorOption(chartConfig, 'colorPaletteScale'), [chartConfig]);
130130
const showSeriesLineStyle = isLinePlot && chartConfig.measures?.series !== undefined;
131+
const showAnyColorOptions = showBoxFillColor || showLineColor || showPointFillColor;
131132

132133
const setGeomOptions = useCallback(
133134
options => {
@@ -177,37 +178,35 @@ export const ChartColorInputs: FC<ChartColorInputsProps> = memo(({ chartConfig,
177178

178179
return (
179180
<>
180-
{showBoxFillColor && (
181+
{showAnyColorOptions && (
181182
<div className="form-group row">
182-
<div className="col-xs-12">
183-
<label>Fill Color</label>
184-
<ColorPickerInput
185-
allowRemove={isBoxPlot}
186-
name="boxFillColor"
187-
onChange={onBoxFillColorChange}
188-
value={boxFillColor}
189-
/>
190-
</div>
191-
</div>
192-
)}
193-
{showLineColor && (
194-
<div className="form-group row">
195-
<div className="col-xs-12">
196-
<label>Line Color</label>
197-
<ColorPickerInput name="lineColor" onChange={onLineColorChange} value={lineColor} />
198-
</div>
199-
</div>
200-
)}
201-
{showPointFillColor && (
202-
<div className="form-group row">
203-
<div className="col-xs-12">
204-
<label>{isLinePlot ? '' : 'Point '}Color</label>
205-
<ColorPickerInput
206-
name="pointFillColor"
207-
onChange={onPointFillColorChange}
208-
value={pointFillColor}
209-
/>
210-
</div>
183+
{showBoxFillColor && (
184+
<div className="col-xs-4">
185+
<label>Fill Color</label>
186+
<ColorPickerInput
187+
allowRemove={isBoxPlot}
188+
name="boxFillColor"
189+
onChange={onBoxFillColorChange}
190+
value={boxFillColor}
191+
/>
192+
</div>
193+
)}
194+
{showLineColor && (
195+
<div className="col-xs-4">
196+
<label>Line Color</label>
197+
<ColorPickerInput name="lineColor" onChange={onLineColorChange} value={lineColor} />
198+
</div>
199+
)}
200+
{showPointFillColor && (
201+
<div className="col-xs-4">
202+
<label>{isLinePlot ? '' : 'Point '}Color</label>
203+
<ColorPickerInput
204+
name="pointFillColor"
205+
onChange={onPointFillColorChange}
206+
value={pointFillColor}
207+
/>
208+
</div>
209+
)}
211210
</div>
212211
)}
213212
{showColorPaletteScale && (
@@ -363,7 +362,7 @@ export const SeriesLineStyleInput: FC<SeriesLineStyleInputProps> = memo(({ chart
363362
</div>
364363
{selectedSeries && (
365364
<div className="row">
366-
<div className="col-xs-6">
365+
<div className="col-xs-4">
367366
<div>Color</div>
368367
<ColorPickerInput
369368
allowRemove
@@ -372,7 +371,7 @@ export const SeriesLineStyleInput: FC<SeriesLineStyleInputProps> = memo(({ chart
372371
value={seriesOptionMap[selectedSeries]?.color}
373372
/>
374373
</div>
375-
<div className="col-xs-6">
374+
<div className="col-xs-8">
376375
<div>Shape</div>
377376
<SelectInput
378377
clearable={false}

packages/components/src/theme/charts.scss

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -206,14 +206,14 @@
206206

207207
.lk-modal .chart-builder-modal .modal-body {
208208
display: flex;
209-
flex: 1;
210209
gap: 8px;
211210
padding: 0;
212211
overflow: hidden;
213212
}
214213

215214
.chart-settings {
216-
width: 300px;
215+
flex: 1;
216+
min-width: 330px;
217217
border-right: solid 1px $gray-border-light;
218218
padding: 15px;
219219
overflow-y: auto;
@@ -225,7 +225,7 @@
225225
}
226226

227227
.chart-builder-modal__chart-preview {
228-
flex: 1;
228+
flex: 3;
229229
overflow: auto;
230230
padding-top: 15px;
231231
display: flex;

0 commit comments

Comments
 (0)