import { OrdinalCustomChart } from "semiotic" import { hitTargetRect, tokenLayer } from "semiotic/recipes" // The layout emits: // tokenLayer({ icon: "person", tokenSemantics: "observed-unit" }) // as datum-less glyph scene nodes for the visible signs // plus one hitTargetRect(...) per column for grouped hover/focus. const frameProps = { /* --- Data --- */ data: [{ bin: "-0.95", writeviz: -0.95, people: [{ type: "viz" }], count: 1, journalistCount: 0, vizCount: 1, label: "1 respondent at -0.95" }, { bin: "-0.90", writeviz: -0.9, people: [{ type: "viz" }, { type: "viz" }], count: 2, journalistCount: 0, vizCount: 2, label: "2 respondents at -0.90" }, ... ], /* --- Size --- */ margin: { top: 60, bottom: 70, left: 10, right: 80 }, width: 700, height: 370, /* --- Layout --- */ layout: function isotypeGlyphLayout(ctx) { // Emits one transparent hit target per column plus // tokenLayer({ tokenSemantics: "observed-unit", icon: "person" }) // as datum-less glyph scene nodes. return { nodes: [...columnHitTargets, ...personGlyphs], overlays } }, /* --- Process --- */ rExtent: [0,9], oExtent: ["-0.95","-0.90", ... ], valueAccessor: "count", categoryAccessor: "bin", /* --- Customize --- */ title: "Survey respondents by daily writing-vs-visualization balance", showAxes: false, /* --- Interact --- */ enableHover: true } export default () => { return <OrdinalCustomChart {...frameProps} /> }