viewof familyJob = embed({
data: {values: data},
hconcat: [
{
selection: {
price: {type: "single", on: "mouseover"}
},
mark :{type: "rect"},
autosize:"fit",
width: 200,
height: 200,
transform: [
{filter: {field: "table", lte: range[1]}},
{filter: {field: "table", gte: range[0]}}
],
encoding: {
y : {field: "color", type: "nominal", title: "color"},
x : {field: "clarity", type: "ordinal", title: "clarity"},
color: {
condition: {selection: "price", field: "price", aggregate: "mean",
type: "quantitative"
},
value: "lightgray"
}
},
config: {
axis: {grid: true, tickBand: "extent"}
}
},
{
mark: {type:"bar", tooltip: {"content": "data"}},
autosize:"fit",
width: 200,
height: 200,
selection: {
area: {type: "interval"}
},
transform: [{filter: {field: "table", lte: range[1]}}, {filter: {field: "table", gte: range[0]}}],
encoding: {
x:{field:"clarity", type:"nominal", title: "clarity"},
y:{field: "price", type: "quantitative", title: "Number of price", aggregate:"mean"},
color: {
condition: {selection: "area", title: "color", field: "color", type: "nominal"},
value: "lightgray"
}
}
}
]
})