pr comment tweaks

This commit is contained in:
Conor Barnes 2022-08-29 21:11:48 -03:00
parent 87c6ff1c3d
commit a1db813b8b
4 changed files with 4 additions and 8 deletions

View File

@ -30,7 +30,7 @@ export type DistributionChartProps = {
plot: Plot; plot: Plot;
width?: number; width?: number;
height: number; height: number;
sample: boolean; sample?: boolean;
xAxis?: "number" | "dateTime"; xAxis?: "number" | "dateTime";
} & DistributionPlottingSettings; } & DistributionPlottingSettings;
@ -57,7 +57,6 @@ export const DistributionChart: React.FC<DistributionChartProps> = (props) => {
actions = false, actions = false,
xAxis = "number", xAxis = "number",
} = props; } = props;
console.log({ plot });
const [sized] = useSize((size) => { const [sized] = useSize((size) => {
const shapes = flattenResult( const shapes = flattenResult(
plot.distributions.map((x) => plot.distributions.map((x) =>
@ -93,9 +92,7 @@ export const DistributionChart: React.FC<DistributionChartProps> = (props) => {
const domain = const domain =
xAxis === "dateTime" xAxis === "dateTime"
? predomain.map((p) => { ? predomain.map((p) => ({ dateTime: p.x, y: p.y }))
return { dateTime: p.x, y: p.y };
})
: predomain; : predomain;
const data = const data =

View File

@ -51,7 +51,7 @@ 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 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;

View File

@ -14,10 +14,8 @@ export type DistributionChartSpecOptions = {
title?: string; title?: string;
/** The formatting of the ticks */ /** The formatting of the ticks */
format?: string; format?: string;
/** Whether or not to show the band of sample data at the bottom */ /** Whether or not to show the band of sample data at the bottom */
sample?: boolean; sample?: boolean;
/** Whether the x-axis should be dates or numbers */ /** Whether the x-axis should be dates or numbers */
xAxis?: "number" | "dateTime"; xAxis?: "number" | "dateTime";
}; };

View File

@ -88,6 +88,7 @@ could be continuous, discrete or mixed.
code: "mx(10^12, 10^12 + 10^11, 10^12 + 2 * 10^11)", code: "mx(10^12, 10^12 + 10^11, 10^12 + 2 * 10^11)",
width, width,
xAxis: "dateTime", xAxis: "dateTime",
width,
}} }}
> >
{Template.bind({})} {Template.bind({})}