-
Notifications
You must be signed in to change notification settings - Fork 2
/
vega-ecommerce-scatterplot-matrix.json
52 lines (52 loc) · 1.5 KB
/
vega-ecommerce-scatterplot-matrix.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
{
"$schema": "https://vega.github.io/schema/vega-lite/v2.json",
"description": "Scatterplot matrix showing customer ecommerce data",
"repeat": {
"row": [
"_source.products.taxful_price.avg",
"_source.products.taxful_price.sum",
"_source.products.quantity.avg",
"_source.products.quantity.sum",
"_source.products.quantity.cardinality"
],
"column": [
"_source.products.quantity.cardinality",
"_source.products.quantity.sum",
"_source.products.quantity.avg",
"_source.products.taxful_price.sum",
"_source.products.taxful_price.avg"
]
},
"spec": {
"width": 140,
"height": 140,
"data": {
"url": {
"index": "customer_outliers",
"body": {
"size": 10000,
"query": {
"match_all": {}
}
}
},
"format": {"property": "hits.hits"}
},
"mark": {"type": "point"},
"encoding": {
"x": { "field": { "repeat": "column"}, "type": "quantitative", "scale": { "zero": false} },
"y": { "field": { "repeat": "row"}, "type": "quantitative", "scale": { "zero": false} },
"color": {
"field": "_source.ml.outlier_score",
"type": "quantitative",
"scale": { "range": ["#aaa", "#aaa", "#aaa", "red"]}
},
"size": {
"field": "_source.ml.outlier_score",
"type": "quantitative",
"scale": { "range": [2, 16] }
},
"tooltip": {"field": "_source.customer", "type": "nominal"}
}
}
}