Merge pull request #142 from QURIresearch/vega-remove-actions

Removes the action bubble from vega charts
This commit is contained in:
Ozzie Gooen 2022-03-30 20:11:13 -04:00 committed by GitHub
commit 9079d5aa82
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -13,11 +13,11 @@ import * as chartSpecification from "./spec-distributions.json";
import * as percentilesSpec from "./spec-percentiles.json"; import * as percentilesSpec from "./spec-percentiles.json";
let SquiggleVegaChart = createClassFromSpec({ let SquiggleVegaChart = createClassFromSpec({
spec: chartSpecification as Spec, spec: chartSpecification as Spec
}); });
let SquigglePercentilesChart = createClassFromSpec({ let SquigglePercentilesChart = createClassFromSpec({
spec: percentilesSpec as Spec, spec: percentilesSpec as Spec
}); });
export interface SquiggleChartProps { export interface SquiggleChartProps {
@ -74,7 +74,7 @@ export const SquiggleChart: React.FC<SquiggleChartProps> = (props) => {
y: y, y: y,
})); }));
return <SquiggleVegaChart data={{ con: values }} />; return <SquiggleVegaChart data={{ con: values }} actions={false}/>;
} else if (shape.tag === "Discrete") { } else if (shape.tag === "Discrete") {
let xyShape = shape.value.xyShape; let xyShape = shape.value.xyShape;
let totalY = xyShape.ys.reduce((a, b) => a + b); let totalY = xyShape.ys.reduce((a, b) => a + b);
@ -89,7 +89,7 @@ export const SquiggleChart: React.FC<SquiggleChartProps> = (props) => {
y: y, y: y,
})); }));
return <SquiggleVegaChart data={{ dis: values }} />; return <SquiggleVegaChart data={{ dis: values }} actions={false}/>;
} else if (shape.tag === "Mixed") { } else if (shape.tag === "Mixed") {
let discreteShape = shape.value.discrete.xyShape; let discreteShape = shape.value.discrete.xyShape;
let totalDiscrete = discreteShape.ys.reduce((a, b) => a + b); let totalDiscrete = discreteShape.ys.reduce((a, b) => a + b);
@ -156,6 +156,7 @@ export const SquiggleChart: React.FC<SquiggleChartProps> = (props) => {
return ( return (
<SquiggleVegaChart <SquiggleVegaChart
data={{ con: continuousValues, dis: discreteValues }} data={{ con: continuousValues, dis: discreteValues }}
actions={false}
/> />
); );
} }
@ -195,7 +196,10 @@ export const SquiggleChart: React.FC<SquiggleChartProps> = (props) => {
return null; return null;
} }
}); });
return <SquigglePercentilesChart data={{ facet: data.filter(x => x !== null) }} />; return <SquigglePercentilesChart
data={{ facet: data.filter(x => x !== null) }}
actions={false}
/>;
} }
}); });
return <>{chartResults}</>; return <>{chartResults}</>;