vegalite(
{
data: { values: data },
"mark": {
"type": "line", "fillOpacity": 0.5, "strokeOpacity": 0.8,"strokeWidth":1},
"width": 700,
"height": 40,
"transform": [
{"density": "carat", "groupby": ["color"], "extent": [0, 4]},
],
encoding: {
"x": {"field": "value", "type": "quantitative", "axis": {"grid": false, "title": "Carat of diamonds"}},
"y": {"field": "density", "type": "quantitative",
"scale": {"range": [40,-80]},
"axis": { "title": false, "domain": false, "labels": false, "ticks": false, "grid": false},
},
"row": { "field": "color", "type": "nominal", "title": "Colors",
"spacing": 0,
"header": {"labelAngle": 0, "labelOrient": "left", "labelAlign":"left", "labelPadding":0},
"axis": false,
"sort": { "field": "color", "op": "max", "order": "ascending"}
},
"fill": { "field": "color", "type": "nominal", "legend": null},
"stroke": { "field": "color"}
},
"bounds": "flush",
"padding": 0,
"config": {
"view": {
"stroke": "transparent"
}
}
}
)