最佳答案
是的,您可以通过组合窗口变换和折叠变换在 Vega-Lite 中创建平行坐标图。这是 Iris 数据集 ( vega editor link ) 的示例:
{
"data": {
"url": "data/iris.json"
},
"transform": [
{"window": [{"op": "count", "as": "index"}]},
{"fold": ["petalLength", "petalWidth", "sepalLength", "sepalWidth"]}
],
"mark": "line",
"encoding": {
"color": {"type": "nominal", "field": "species"},
"detail": {"type": "nominal", "field": "index"},
"opacity": {"value": 0.3},
"x": {"type": "nominal", "field": "key"},
"y": {"type": "quantitative", "field": "value"}
},
"width": 600,
"height": 300
}
注意我们使用 window transform构建索引,然后是 fold transform重组数据以进行绘图。
关于javascript - Vega-Lite 中的平行坐标?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54671453/