Files
dano2025/preanalysis/correlation_matrix_shopping.html
2025-12-16 01:51:05 +03:00

42 lines
6.0 KiB
HTML

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<style>
#vis.vega-embed {
width: 100%;
display: flex;
}
#vis.vega-embed details,
#vis.vega-embed details summary {
position: relative;
}
</style>
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/vega@6"></script>
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/vega-lite@6.1.0"></script>
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/vega-embed@7"></script>
</head>
<body>
<div id="vis"></div>
<script>
(function(vegaEmbed) {
var spec = {"usermeta": {"embedOptions": {"theme": "dark"}}, "config": {"view": {"continuousWidth": 300, "continuousHeight": 300, "strokeWidth": 0}, "background": "#00000000", "title": {"anchor": "middle", "font": "Segoe UI Variable", "fontSize": 20, "fontWeight": 600}}, "layer": [{"mark": {"type": "rect", "cornerRadius": 6}, "encoding": {"color": {"field": "correlation", "legend": {"gradientLength": 300, "gradientThickness": 20, "labelFont": "Segoe UI Variable", "labelFontSize": 12, "labelFontWeight": 400, "orient": "right", "title": "\u041a\u043e\u0440\u0440\u0435\u043b\u044f\u0446\u0438\u044f", "titleFont": "Segoe UI Variable", "titleFontSize": 14, "titleFontWeight": 600}, "scale": {"domain": [-1, 0, 1], "range": ["#1B3B72", "#FFFFFF", "#198F51"]}, "type": "quantitative"}, "tooltip": [{"field": "variable1", "title": "\u041f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f 1", "type": "nominal"}, {"field": "variable2", "title": "\u041f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f 2", "type": "nominal"}, {"field": "correlation", "format": ".3f", "title": "\u041a\u043e\u0440\u0440\u0435\u043b\u044f\u0446\u0438\u044f", "type": "quantitative"}], "x": {"axis": {"labelAngle": -45, "labelFont": "Segoe UI Variable", "labelFontSize": 14, "labelFontWeight": 400}, "field": "variable2", "title": null, "type": "nominal"}, "y": {"axis": {"labelFont": "Segoe UI Variable", "labelFontSize": 14, "labelFontWeight": 400}, "field": "variable1", "title": null, "type": "nominal"}}}, {"mark": {"type": "text", "font": "Segoe UI Variable", "fontSize": 12, "fontWeight": 500}, "encoding": {"color": {"condition": {"test": "(datum.correlation > 0.6)", "value": "white"}, "value": "#757575"}, "text": {"field": "correlation", "format": ".2f", "type": "quantitative"}, "x": {"axis": {"labelAngle": -45, "labelFont": "Segoe UI Variable", "labelFontSize": 14, "labelFontWeight": 400}, "field": "variable2", "title": null, "type": "nominal"}, "y": {"axis": {"labelFont": "Segoe UI Variable", "labelFontSize": 14, "labelFontWeight": 400}, "field": "variable1", "title": null, "type": "nominal"}}}], "data": {"name": "data-6991dc45fac5ad496fd827bd6724a7ff"}, "height": 600, "padding": 60, "title": "\u041a\u043e\u0440\u0440\u0435\u043b\u044f\u0446\u0438\u043e\u043d\u043d\u0430\u044f \u043c\u0430\u0442\u0440\u0438\u0446\u0430: shopping", "width": 600, "$schema": "https://vega.github.io/schema/vega-lite/v6.1.0.json", "datasets": {"data-6991dc45fac5ad496fd827bd6724a7ff": [{"variable1": "active_imp_shopping", "variable2": "active_imp_shopping", "correlation": 1.0}, {"variable1": "passive_imp_shopping", "variable2": "active_imp_shopping", "correlation": 0.227}, {"variable1": "active_click_shopping", "variable2": "active_imp_shopping", "correlation": 0.873}, {"variable1": "passive_click_shopping", "variable2": "active_imp_shopping", "correlation": 0.117}, {"variable1": "orders_amt_shopping", "variable2": "active_imp_shopping", "correlation": 0.187}, {"variable1": "active_imp_shopping", "variable2": "passive_imp_shopping", "correlation": 0.227}, {"variable1": "passive_imp_shopping", "variable2": "passive_imp_shopping", "correlation": 1.0}, {"variable1": "active_click_shopping", "variable2": "passive_imp_shopping", "correlation": 0.209}, {"variable1": "passive_click_shopping", "variable2": "passive_imp_shopping", "correlation": 0.259}, {"variable1": "orders_amt_shopping", "variable2": "passive_imp_shopping", "correlation": 0.148}, {"variable1": "active_imp_shopping", "variable2": "active_click_shopping", "correlation": 0.873}, {"variable1": "passive_imp_shopping", "variable2": "active_click_shopping", "correlation": 0.209}, {"variable1": "active_click_shopping", "variable2": "active_click_shopping", "correlation": 1.0}, {"variable1": "passive_click_shopping", "variable2": "active_click_shopping", "correlation": 0.08}, {"variable1": "orders_amt_shopping", "variable2": "active_click_shopping", "correlation": 0.184}, {"variable1": "active_imp_shopping", "variable2": "passive_click_shopping", "correlation": 0.117}, {"variable1": "passive_imp_shopping", "variable2": "passive_click_shopping", "correlation": 0.259}, {"variable1": "active_click_shopping", "variable2": "passive_click_shopping", "correlation": 0.08}, {"variable1": "passive_click_shopping", "variable2": "passive_click_shopping", "correlation": 1.0}, {"variable1": "orders_amt_shopping", "variable2": "passive_click_shopping", "correlation": 0.116}, {"variable1": "active_imp_shopping", "variable2": "orders_amt_shopping", "correlation": 0.187}, {"variable1": "passive_imp_shopping", "variable2": "orders_amt_shopping", "correlation": 0.148}, {"variable1": "active_click_shopping", "variable2": "orders_amt_shopping", "correlation": 0.184}, {"variable1": "passive_click_shopping", "variable2": "orders_amt_shopping", "correlation": 0.116}, {"variable1": "orders_amt_shopping", "variable2": "orders_amt_shopping", "correlation": 1.0}]}};
var embedOpt = {"mode": "vega-lite"};
function showError(el, error){
el.innerHTML = ('<div style="color:red;">'
+ '<p>JavaScript Error: ' + error.message + '</p>'
+ "<p>This usually means there's a typo in your chart specification. "
+ "See the javascript console for the full traceback.</p>"
+ '</div>');
throw error;
}
const el = document.getElementById('vis');
vegaEmbed("#vis", spec, embedOpt)
.catch(error => showError(el, error));
})(vegaEmbed);
</script>
</body>
</html>