Here is my notebook: https://observablehq.com/@frscott/nba-statistics
I currently have Points, Rebounds, and Assists displayed horizontally in small scatter plots by team name. I would like to display them vertically by team name [.row()] and horizontally concatenate the three separate graphs [.hconcat()]. For some reason when I do it this way there is an error.
Error: Invalid specification {}. Make sure the specification includes at least one of the following properties: “mark”, “layer”, “facet”, “hconcat”, “vconcat”, “concat”, or “repeat”.
{
const points = vl.markCircle()
.data(NBA_data)
.encode(
vl.x().fieldO('season').title('Seasons'),
vl.y().fieldQ('pts').title('Points'),
vl.color().fieldN('team_abbreviation').legend(null),
vl.row('team_abbreviation'),
vl.tooltip('player_name')
)
.resolve({axis: {x: 'independent'}})
.width(250)
.height(100)
.render();
const assists = vl.markCircle()
.data(NBA_data)
.encode(
vl.x().fieldO('season').title('Seasons'),
vl.y().fieldQ('ast').title('Assists'),
vl.color().fieldN('team_abbreviation').legend(null),
vl.row('team_abbreviation'),
vl.tooltip('player_name')
)
.resolve({axis: {x: 'independent'}})
.width(250)
.height(100)
.render();
const rebounds = vl.markCircle()
.data(NBA_data)
.encode(
vl.x().fieldO('season').title('Seasons'),
vl.y().fieldQ('reb').title('Rebounds'),
vl.color().fieldN('team_abbreviation').legend(null),
vl.row('team_abbreviation'),
vl.tooltip('player_name')
)
.resolve({axis: {x: 'independent'}})
.width(250)
.height(100)
.render();
return vl.hconcat(points, assists, rebounds).render();
}