This message was deleted.
# help
s
This message was deleted.
m
The axis you want to sort isn't
x
, but
fx
. Try
fx: { domain: order }
. That's "facet x"
I'm not 100% if that will work quite right. If it doesn't can you share the notebook you're working in?
t
the link is in my description
m
oh, apologies
t
it's fine, always appreciate anyone's response
m
ok, yes. setting the domain of
fx
works for me: https://observablehq.com/d/dd878dcd8ebbc322
t
do you know when I should use
fx
, I think the variable name confuses me
I felt like I always have to ask someone for help and feel a little bit guilty on that, it was way too frequent
m
fx
is the channel name for the horizontal facet direction. You'd use that if you want to affect the facets of the chart, and you'd use
x
when you want to affect the horizontal channel within one chart
in that chart the
x
channel is the age groups, and it is repeated several times, once for each facet. The
fx
channel is the State abbreviation (TX, CA, etc), and it only happens once
does that help?
t
@Michael Cooper so for a single (not grouped) regular bar chart, there is only one facet?
m
I'd think about it as not being faceted, but I think only having one facet is correct too
t
and channel in this case is a list of items that was used for each facet. I was trying to understand the relationship in and out I guess
cuz inside each facet is a full graph technically
m
a channel is the way that Plot talks about how you can visually encode data https://observablehq.com/plot/features/marks#marks-have-channels
m
Maybe here the terminology is a bit confusing: In general faceting means adding one or more dimensions based on which you "replicate" your main Plot for each category. This notebook is called Grouped bar chart, in Plot you generally use group, like Plot.group(..) for aggregating data based on a categorical attribute
m
You're right, that notebook has nothing to do
Plot.group
, which is a bit confusing
t
the
Plot.group
is used for grouping the rawdata before they are used for rendering right?
not the group we are talking about here
m
yeah. it would be more correct to say that the notebook is demonstrating a faceted bar chart, not a grouped one
t
this is actually one of the official example
grouped is pretty common term used for this kind of illustration in terms of user facing, but I'm not sure about the correct mathematical term though
m
I'm one of the official employees 😉. I can pass this along to our docs team
👀 1
😂 1
f
I also suspect that grouped was chosen for familiarity, as mentioned by @tan tan. The best docs aren't worth much if you can't find them 😁
m
I would recommend reading the new Plot docs. We launched them a few weeks ago, and in my opinion they are an excellent way to learn the library: https://observablehq.com/plot/
1
including lots of examples
t
It really depends on the reader's background,
group
can be confusing for developer like me cuz there are some common terms used inside the code (mathematically) and outside of the code (daily life) that hold completely different meanings. But maybe it makes sense for general data science people. 😂 idk, just a user feedback I guess
not just group, I think I will also encounter other terms here and there