Skip to content

Commit f811976

Browse files
Merge pull request #682 from plotly/colorpicker-css
fix colorpicker within fold within fold style
2 parents 6b1759f + dbf8532 commit f811976

File tree

2 files changed

+42
-32
lines changed

2 files changed

+42
-32
lines changed

src/default_panels/GraphTransformsPanel.js

Lines changed: 34 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -24,35 +24,39 @@ export class Aggregations extends Component {
2424
return null;
2525
}
2626

27-
return aggregations
28-
.filter(
29-
aggr =>
30-
aggr.target && aggr.target.match(/transforms\[\d*\]\./gi) === null
31-
)
32-
.map(({target}, i) => (
33-
<AggregationSection show key={i} aggregationIndex={i}>
34-
<Dropdown
35-
attr="func"
36-
label={target}
37-
options={[
38-
{label: _('Count'), value: 'count'},
39-
{label: _('Sum'), value: 'sum'},
40-
{label: _('Average'), value: 'avg'},
41-
{label: _('Median'), value: 'median'},
42-
{label: _('Mode'), value: 'mode'},
43-
{label: _('RMS'), value: 'rms'},
44-
{label: _('Standard Deviation'), value: 'stddev'},
45-
{label: _('Min'), value: 'min'},
46-
{label: _('Max'), value: 'max'},
47-
{label: _('First'), value: 'first'},
48-
{label: _('Last'), value: 'last'},
49-
{label: _('Change'), value: 'change'},
50-
{label: _('Range'), value: 'range'},
51-
]}
52-
clearable={false}
53-
/>
54-
</AggregationSection>
55-
));
27+
return (
28+
<PlotlySection name={_('Aggregations')} attr="aggregations">
29+
{aggregations
30+
.filter(
31+
aggr =>
32+
aggr.target && aggr.target.match(/transforms\[\d*\]\./gi) === null
33+
)
34+
.map(({target}, i) => (
35+
<AggregationSection show key={i} aggregationIndex={i}>
36+
<Dropdown
37+
attr="func"
38+
label={target}
39+
options={[
40+
{label: _('Count'), value: 'count'},
41+
{label: _('Sum'), value: 'sum'},
42+
{label: _('Average'), value: 'avg'},
43+
{label: _('Median'), value: 'median'},
44+
{label: _('Mode'), value: 'mode'},
45+
{label: _('RMS'), value: 'rms'},
46+
{label: _('Standard Deviation'), value: 'stddev'},
47+
{label: _('Min'), value: 'min'},
48+
{label: _('Max'), value: 'max'},
49+
{label: _('First'), value: 'first'},
50+
{label: _('Last'), value: 'last'},
51+
{label: _('Change'), value: 'change'},
52+
{label: _('Range'), value: 'range'},
53+
]}
54+
clearable={false}
55+
/>
56+
</AggregationSection>
57+
))}
58+
</PlotlySection>
59+
);
5660
}
5761
}
5862

@@ -88,9 +92,7 @@ const GraphTransformsPanel = (props, {localize: _}) => {
8892
]}
8993
/>
9094

91-
<PlotlySection name={_('Aggregations')} attr="aggregations">
92-
<Aggregations />
93-
</PlotlySection>
95+
<Aggregations />
9496
</TransformAccordion>
9597
</TraceAccordion>
9698
);

src/styles/components/widgets/_colorpicker.scss

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,3 +95,11 @@ $colorpicker-width: 185px;
9595
}
9696
}
9797
}
98+
99+
.fold .fold {
100+
.colorpicker__container {
101+
width: calc(
102+
$colorpicker-width - var(--spacing-half-unit) - var(--spacing-half-unit)
103+
);
104+
}
105+
}

0 commit comments

Comments
 (0)