Skip to content

Commit d2fbb9f

Browse files
committed
don't show trace selector actions if they don't exist
1 parent 12eba3a commit d2fbb9f

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

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/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)