Skip to content

Commit

Permalink
Support empty data on PriorPosteriorDistribution initialization (#226)
Browse files Browse the repository at this point in the history
  • Loading branch information
anders-kiaer authored Aug 21, 2020
1 parent d43053c commit bf3d090
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ class PriorPosteriorDistribution extends Component {

PriorPosteriorDistribution.defaultProps = {
height: 700,
data: { iterations: [], labels: [], values: [] },
};

PriorPosteriorDistribution.propTypes = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,13 +129,15 @@ class D3PriorPosterior {
.attr("height", this.height)
.style("overflow", "visible");

this.createMainGroup();
this.createXAndColorScale();

this.renderPileChart();
this.renderHistogram();
this.initNumberBinsPicker();
this.initIterationPicker();
if (this.data.labels.length > 0) {
this.createMainGroup();
this.createXAndColorScale();

this.renderPileChart();
this.renderHistogram();
this.initNumberBinsPicker();
this.initIterationPicker();
}
}

createMainGroup() {
Expand Down

0 comments on commit bf3d090

Please sign in to comment.