"group" distinct value #2196
-
as far as I understand the current I just abuse the observable lib, and fake the gap and title to something I want it to look like: |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Having non-shared axes for faceted charts comes up occasionally. The normal answer here is to make multiple charts that each have their own distinct axes, and then control any axis that needs to be shared. Here's an example of that: https://observablehq.com/d/e047d12f66d50640 htl.html`${d3
.sort(
d3.groups(data, (d) => d.group),
(d) => d[0]
)
.map(([groupNum, groupData]) =>
Plot.plot({
marginLeft: 100,
x: { grid: true, domain: xDomain },
y: { label: `letter (group ${groupNum})` },
marks: [
Plot.barX(groupData, { y: "letter", x: "frequency", sort: { y: "-x" } })
]
})
)}` This is common enough that there is probably room for Plot to have some helper, but in the mean time this is what I'd do. |
Beta Was this translation helpful? Give feedback.
-
We call this “faceting with varying scales”. Please upvote #8 if you are interested in this feature. 🙏 |
Beta Was this translation helpful? Give feedback.
Having non-shared axes for faceted charts comes up occasionally. The normal answer here is to make multiple charts that each have their own distinct axes, and then control any axis that needs to be shared. Here's an example of that: https://observablehq.com/d/e047d12f66d50640
This is common enough that there is probably room for Plot…