Skip to content

Commit b700818

Browse files
committed
fixes
1 parent 177f260 commit b700818

File tree

10 files changed

+107
-36
lines changed

10 files changed

+107
-36
lines changed

dev/percy/histogram.json

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
{
2+
"data": [
3+
{
4+
"type": "histogram",
5+
"mode": "markers",
6+
"uid": "dcb598",
7+
"x": [
8+
1,
9+
2,
10+
3,
11+
4,
12+
5,
13+
6
14+
],
15+
"xsrc": "ints",
16+
"autobinx": true,
17+
"xbins": {
18+
"start": -0.5,
19+
"end": 7.5,
20+
"size": 2
21+
},
22+
"y": [
23+
2,
24+
1,
25+
3,
26+
5,
27+
4,
28+
6
29+
],
30+
"ysrc": "jagged ints",
31+
"error_x": {
32+
"visible": true,
33+
"symmetric": true
34+
},
35+
"error_y": {
36+
"visible": true,
37+
"symmetric": false
38+
},
39+
"orientation": "v",
40+
"autobiny": true,
41+
"ybins": {
42+
"start": -0.5,
43+
"end": 7.5,
44+
"size": 2
45+
}
46+
}
47+
],
48+
"layout": {
49+
"plot_bgcolor": "rgb(255, 0, 0)",
50+
"xaxis": {
51+
"range": [
52+
0,
53+
2.3157894736842106
54+
],
55+
"autorange": true,
56+
"type": "linear"
57+
},
58+
"yaxis": {
59+
"range": [
60+
-0.5,
61+
7.552631578947369
62+
],
63+
"autorange": true,
64+
"type": "linear"
65+
},
66+
"autosize": true
67+
},
68+
"frames": []
69+
}

dev/percy/histogram2d.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"ysrc": "ints",
1919
"autobinx": false,
2020
"xbins": {
21-
"start": -0.5,
21+
"start": 0.5,
2222
"end": 9.5,
2323
"size": 5,
2424
"_dataSpan": 5
@@ -27,15 +27,15 @@
2727
"ybins": {
2828
"start": -0.5,
2929
"end": 9.5,
30-
"size": 5,
30+
"size": 10,
3131
"_dataSpan": 5
3232
},
33+
"zmin": 2,
34+
"zmax": 4,
35+
"zauto": true,
3336
"cumulative": {
3437
"enabled": true
35-
},
36-
"zmin": 0,
37-
"zmax": 4,
38-
"zauto": false
38+
}
3939
}
4040
],
4141
"layout": {

dev/percy/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import panelTest from './panelTest.json';
2+
import histogram from './histogram.json';
23
import histogram2d from './histogram2d.json';
34

4-
export {panelTest, histogram2d};
5+
export {panelTest, histogram, histogram2d};

dev/percy/panelTest.json

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@
126126
}
127127
],
128128
"xaxis": {
129-
"type": "linear",
129+
"type": "date",
130130
"range": [
131131
0.6919103739269605,
132132
6.3080896260730395
@@ -147,6 +147,19 @@
147147
6.3080896260730395
148148
]
149149
},
150+
"rangeselector": {
151+
"visible": true,
152+
"buttons": [
153+
{
154+
"label": "b1",
155+
"step": "year"
156+
},
157+
{
158+
"label": "b2",
159+
"step": "month"
160+
}
161+
]
162+
},
150163
"showspikes": true
151164
},
152165
"yaxis": {

src/__percy__/panels.percy.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import './percy.css';
1515
* To specify which panels to test with the mock, add entry to panelsToTest, else all panels will be tested
1616
*/
1717
const panelsToTest = {
18+
histogram: ['GraphCreatePanel'],
1819
histogram2d: ['GraphCreatePanel', 'StyleTracesPanel'],
1920
};
2021

src/components/fields/derived.js

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -183,29 +183,20 @@ export const BinningDropdown = connectToContainer(UnconnectedDropdown, {
183183
export const HistogramInfoVertical = connectToContainer(Info, {
184184
modifyPlotProps: (props, context, plotProps) => {
185185
plotProps.isVisible =
186-
context.container.type === 'histogram' &&
187-
context.container.orientation === 'v';
186+
context.fullContainer.type === 'histogram' &&
187+
context.fullContainer.orientation === 'v';
188188
return plotProps;
189189
},
190190
});
191191
export const HistogramInfoHorizontal = connectToContainer(Info, {
192192
modifyPlotProps: (props, context, plotProps) => {
193193
plotProps.isVisible =
194-
context.container.type === 'histogram' &&
195-
context.container.orientation === 'h';
194+
context.fullContainer.type === 'histogram' &&
195+
context.fullContainer.orientation === 'h';
196196
return plotProps;
197197
},
198198
});
199199

200-
export const ColorscaleNumeric = connectToContainer(UnconnectedNumeric, {
201-
modifyPlotProps: (props, context, plotProps) => {
202-
const {fullContainer} = plotProps;
203-
if (plotProps.isVisible && fullContainer && fullContainer.zauto) {
204-
plotProps.isVisible = false;
205-
}
206-
},
207-
});
208-
209200
export const AxesRange = connectToContainer(UnconnectedAxisRangeValue, {
210201
modifyPlotProps: (props, context, plotProps) => {
211202
const {fullContainer} = plotProps;

src/default_panels/GraphCreatePanel.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,12 @@ const GraphCreatePanel = (props, {localize: _}) => {
6666
/>
6767
<HistogramInfoVertical>
6868
{_(
69-
'Note: in vertical orientation X values are used for bins and Y values for weights.'
69+
'Note: in vertical orientation, X values are used for bins and Y values for weights.'
7070
)}
7171
</HistogramInfoVertical>
7272
<HistogramInfoHorizontal>
7373
{_(
74-
'Note: in horizontal orientation Y Values are used for bins and X values for weights.'
74+
'Note: in horizontal orientation, Y Values are used for bins and X values for weights.'
7575
)}
7676
</HistogramInfoHorizontal>
7777
<DataSelector label={_('I (Optional)')} attr="i" />

src/default_panels/StyleTracesPanel.js

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,7 @@ import {
2525
FontSelector,
2626
TextPosition,
2727
} from '../components';
28-
import {
29-
BinningNumeric,
30-
ColorscaleNumeric,
31-
BinningDropdown,
32-
} from '../components/fields/derived';
28+
import {BinningNumeric, BinningDropdown} from '../components/fields/derived';
3329

3430
const StyleTracesPanel = (props, {localize: _}) => (
3531
<TraceAccordion canGroup>
@@ -289,8 +285,8 @@ const StyleTracesPanel = (props, {localize: _}) => (
289285
{label: _('Custom'), value: false},
290286
]}
291287
/>
292-
<ColorscaleNumeric label={_('Min')} attr="zmin" />
293-
<ColorscaleNumeric label={_('Max')} attr="zmax" />
288+
<Numeric label={_('Min')} attr="zmin" />
289+
<Numeric label={_('Max')} attr="zmax" />
294290
<Radio
295291
label={_('Color Bar')}
296292
attr="showscale"

src/styles/components/containers/_fold.scss

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,10 @@
160160
}
161161
}
162162

163-
.fold + .fold {
164-
margin-top: var(--spacing-half-unit);
163+
.fold {
164+
margin-bottom: var(--spacing-half-unit);
165+
}
166+
167+
.fold .fold:last-child {
168+
margin-bottom: 0;
165169
}

src/styles/main.scss

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,6 @@
3333
}
3434
}
3535

36-
.editor_controls__wrapper > .panel > .panel__content > .fold:last-child {
37-
margin-bottom: var(--spacing-half-unit);
38-
}
39-
4036
.plotly_editor {
4137
display: flex;
4238
/*

0 commit comments

Comments
 (0)