include sample band on sampleset story

This commit is contained in:
Conor Barnes 2022-08-30 09:14:25 -03:00
parent a1db813b8b
commit 07b7b26d60
4 changed files with 11 additions and 3 deletions

View File

@ -110,6 +110,8 @@ export const DistributionChart: React.FC<DistributionChartProps> = (props) => {
}) })
: shapes.value; : shapes.value;
console.log({ data });
return ( return (
<div style={{ width: widthProp }}> <div style={{ width: widthProp }}>
{logX && shapes.value.some(hasMassBelowZero) ? ( {logX && shapes.value.some(hasMassBelowZero) ? (

View File

@ -51,7 +51,9 @@ export interface SquiggleChartProps {
minX?: number; minX?: number;
/** Specify the upper bound of the x scale */ /** Specify the upper bound of the x scale */
maxX?: number; maxX?: number;
// /** Whether the x-axis should be dates or numbers */ // /** Whether to include the sample band below the chart */
sample?: boolean;
/** Whether the x-axis should be dates or numbers */
xAxis?: "number" | "dateTime"; xAxis?: "number" | "dateTime";
/** Whether to show vega actions to the user, so they can copy the chart spec */ /** Whether to show vega actions to the user, so they can copy the chart spec */
distributionChartActions?: boolean; distributionChartActions?: boolean;
@ -81,6 +83,7 @@ export const SquiggleChart: React.FC<SquiggleChartProps> = React.memo(
maxX, maxX,
color, color,
title, title,
sample = false,
xAxis = "number", xAxis = "number",
distributionChartActions, distributionChartActions,
enableLocalSettings = false, enableLocalSettings = false,
@ -93,7 +96,7 @@ export const SquiggleChart: React.FC<SquiggleChartProps> = React.memo(
onChange, onChange,
executionId, executionId,
}); });
console.log({ result });
const distributionPlotSettings = { const distributionPlotSettings = {
showSummary, showSummary,
logX, logX,
@ -104,6 +107,7 @@ export const SquiggleChart: React.FC<SquiggleChartProps> = React.memo(
color, color,
title, title,
xAxis, xAxis,
sample,
actions: distributionChartActions, actions: distributionChartActions,
}; };

View File

@ -218,6 +218,7 @@ export function buildVegaSpec(
}, },
}, },
}, },
], ],
}, },
{ {

View File

@ -59,6 +59,7 @@ could be continuous, discrete or mixed.
args={{ args={{
code: "SampleSet.fromDist(normal(5,2))", code: "SampleSet.fromDist(normal(5,2))",
width, width,
sample: true,
}} }}
> >
{Template.bind({})} {Template.bind({})}
@ -85,7 +86,7 @@ could be continuous, discrete or mixed.
<Story <Story
name="Date Distribution" name="Date Distribution"
args={{ args={{
code: "mx(10^12, 10^12 + 10^11, 10^12 + 2 * 10^11)", code: "mx(1661819770311, 1661829770311, 1661839770311)",
width, width,
xAxis: "dateTime", xAxis: "dateTime",
width, width,