Skip to content

Commit 5af29bc

Browse files
committed
update README and conditional logic for traces
1 parent 3d3281f commit 5af29bc

File tree

2 files changed

+8
-11
lines changed

2 files changed

+8
-11
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,7 @@ All Fields except `<Info />` accept an `attr` property to bind them to a key in
158158

159159
* `<TraceAccordion />`: `<Panel />` whose children are replicated into `<Folds />` connected to traces via `connectTraceToPlot()`.
160160
* `<LayoutPanel />`: `<Panel />` whose children are connected to the `layout` figure key
161+
* `<TraceRequiredPanel />`: `<LayoutPanel />` renders `<PanelEmpty />` if no trace data is set
161162
* `<AnnotationAccordion />`: `<Panel />` whose children are replicated into `<Folds />` connected to annotations via `connectAnnotationToLayout()`. For use in a `<LayoutPanel />`.
162163
* `<AxesFold />`: `<Fold />` whose children are bound to axis-specific keys. For use in a `<LayoutPanel />` in concert with `<AxesSelector />` (see below).
163164
* `<TraceMarkerSection />`: `<Section />` with trace-specific name handling. For use in containers bound to traces e.g. as children of `<TraceAccordion />`.

src/components/containers/TraceRequiredPanel.js

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22,18 +22,14 @@ class TraceRequiredPanel extends Component {
2222
/**
2323
* Check if there is any trace data
2424
*/
25-
if (fullData.filter(trace => trace.visible).length === 0) {
26-
if (hasTraces) {
27-
this.setState({
28-
hasTraces: false,
29-
});
30-
}
25+
if (fullData.filter(trace => trace.visible).length === 0 && hasTraces) {
26+
this.setState({
27+
hasTraces: false,
28+
});
3129
} else {
32-
if (!hasTraces) {
33-
this.setState({
34-
hasTraces: true,
35-
});
36-
}
30+
this.setState({
31+
hasTraces: true,
32+
});
3733
}
3834
}
3935
}

0 commit comments

Comments
 (0)