import { StreamOrdinalFrame } from "semiotic" const colors = { "Almond lovers": "#ac58e5", "Berry buyers": "#E0488B", "Carrots-n-more": "#9fd0cb", "Delicious-n-new": "#e0d33a" } const frameProps = { /* --- Data --- */ data: [{ market: "Auburn, AL", segment: "Almond lovers", value: 3840, pct: 0.54 }, { market: "Auburn, AL", segment: "Berry buyers", value: 1920, pct: 0.27 }, ... ], chartType: "bar", /* --- Size --- */ size: [700,400], margin: { left: 45, top: 40, bottom: 80, right: 50 }, /* --- Layout --- */ barPadding: 8, dynamicColumnWidth: "value", stackBy: "segment", /* --- Process --- */ oAccessor: "market", rAccessor: "pct", /* --- Customize --- */ pieceStyle: (d12) => { return { fill: colors2[d12.segment], stroke: "white", strokeWidth: 1 }; }, showAxes: true, /* --- Annotate --- */ oLabel: true, rFormat: (d12) => Math.floor(d12 * 100) + "%" } export default () => { return <StreamOrdinalFrame {...frameProps} /> }