Skip to content

Commit e8d90c6

Browse files
authored
Merge pull request #727 from plotly/examples-fixes
Examples fixes
2 parents 12eba3a + 347578e commit e8d90c6

File tree

4 files changed

+16
-6
lines changed

4 files changed

+16
-6
lines changed

src/components/fields/SubplotCreator.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,15 @@ class UnconnectedSingleSubplotCreator extends Component {
3535
}
3636

3737
updateSubplot(update) {
38-
const currentSubplotId = this.props.fullContainer[SUBPLOT_TO_ATTR[this.props.attr].data];
38+
const currentSubplotId = this.props.fullContainer[SUBPLOT_TO_ATTR[this.props.layoutAttr].data];
3939
let subplotToBeGarbageCollected = null;
4040

4141
// When we select another subplot, make sure no unused axes are left
4242
if (
4343
currentSubplotId !== update &&
4444
!this.context.fullData.some(
4545
trace =>
46-
trace[SUBPLOT_TO_ATTR[this.props.attr].data] === currentSubplotId &&
46+
trace[SUBPLOT_TO_ATTR[this.props.layoutAttr].data] === currentSubplotId &&
4747
trace.index !== this.props.fullContainer.index
4848
)
4949
) {

src/components/widgets/TraceTypeSelector.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ class TraceTypeSelector extends Component {
107107
label: _('Charts like this by Plotly users.'),
108108
onClick:
109109
chartHelp[value] &&
110+
chartHelp[value].feedQuery &&
110111
(e =>
111112
onClick(e, () =>
112113
window.open(
@@ -120,12 +121,16 @@ class TraceTypeSelector extends Component {
120121
label: _('View tutorials on this chart type.'),
121122
onClick:
122123
chartHelp[value] &&
124+
chartHelp[value].helpDoc &&
123125
(e => onClick(e, () => window.open(chartHelp[value].helpDoc, '_blank'))),
124126
icon: <ThumnailViewIcon />,
125127
},
126128
{
127129
label: _('See a basic example.'),
128-
onClick: chartHelp[value] && (e => onClick(e, chartHelp[value].examplePlot)),
130+
onClick:
131+
chartHelp[value] &&
132+
chartHelp[value].examplePlot &&
133+
(e => onClick(e, chartHelp[value].examplePlot)),
129134
icon: <GraphIcon />,
130135
},
131136
];

src/styles/components/sidebar/_main.scss

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,9 @@
112112

113113
&--single {
114114
margin-top: 15px;
115+
&:last-child {
116+
margin-bottom: 15px;
117+
}
115118
}
116119

117120
&::before {

src/styles/components/widgets/_trace-type-selector.scss

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
$item-size: 90px;
2+
$image-size: 60px;
3+
24
.trace-grid {
35
display: grid;
46
grid-template-columns: repeat(4, 1fr);
@@ -97,6 +99,7 @@ $item-size: 90px;
9799
justify-content: flex-start;
98100
align-items: flex-end;
99101
z-index: 99;
102+
height: $image-size;
100103

101104
&:hover {
102105
.trace-item__actions__item {
@@ -139,10 +142,9 @@ $item-size: 90px;
139142
&__image {
140143
position: relative;
141144
z-index: 2;
142-
$size: 60px;
143145
border: 1px solid var(--color-border-default);
144-
width: $size;
145-
height: $size;
146+
width: $image-size;
147+
height: $image-size;
146148
border-radius: var(--border-radius);
147149
background: var(--color-background-top);
148150
box-shadow: 0 2px 9px transparent;

0 commit comments

Comments
 (0)