remove dead comments and simplify sample inclusion

This commit is contained in:
Conor Barnes 2022-09-07 11:01:18 -03:00
parent 0c614a3fcf
commit 5b0d7a898f

View File

@ -63,7 +63,6 @@ export const DistributionChart: React.FC<DistributionChartProps> = (props) => {
name: x.name,
// color: x.color, // not supported yet
...pointSet.asShape(),
// samples: [] as number[],
}))
)
);
@ -78,16 +77,9 @@ export const DistributionChart: React.FC<DistributionChartProps> = (props) => {
// if this is a sample set, include the samples
const samples: number[] = [];
const sampleSets = plot?.distributions.filter(
(dist) => dist.distribution.tag === SqDistributionTag.SampleSet
);
if (sampleSets.length) {
for (const { distribution } of sampleSets) {
if (distribution.tag === SqDistributionTag.SampleSet) {
// this conditional must be duplicated to please typescript, more elegant solution probably exists
samples.push(...distribution.value());
// shapes.value[0].samples.push(...distribution.value());
}
for (const { distribution } of plot?.distributions) {
if (distribution.tag === SqDistributionTag.SampleSet) {
samples.push(...distribution.value());
}
}