procon = ({h = 124, range} = {}) => (data) =>
{
const links = R.map(addCategoryToTrack)(data.links());
const areVoteLinks = R.filter(linkIsVote)(links);
const butVoteLinks = R.reject(linkIsVote)(links);
const descendants = data.descendants();
const domain = uniques("category")(descendants);
const categories = R.filter(isCategory)(descendants);
const facets = R.filter(isFacet)(descendants);
const votes = R.filter(isVote)(descendants);
const butVotes = R.reject(isVote)(descendants);
const prompts = R.filter(isPrompt)(descendants);
const margin = 1;
return Plot.plot(
{
marks: [
tracks({curve, stroke: "grey"})(areVoteLinks),
tracks({curve, stroke: "category"})(butVoteLinks),
categoryBoxes()(categories),
facetBoxes()(facets),
promptBoxes()(facets),
voteBoxes({size: 27})(votes),
stations()(butVotes),
voteTexts()(votes),
facetTexts({side: +1, margin})(facets),
facetTexts({side: -1, margin})(facets),
promptTexts({side: -1})(prompts),
promptTexts({side: +1})(prompts),
categoryTexts({width: 30})(categories),
],
x: {
inset: µ(1),
label: null,
tickFormat: null, tickSize: null,
},
y: {
label: null,
domain: [+µ(h), -µ(h)],
tickFormat: null, tickSize: null,
},
style: { backgroundColor: "snow"},
width,
height: width * 9 / 16,
marginRight: 0,
marginLeft: 0,
marginBottom: 0,
marginTop: 0,
color: {type: "categorical", domain, range},
}
)
}