42 lines
5.9 KiB
HTML
42 lines
5.9 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-9caae2929b2f51d937bc7954921aa62a"}, "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: super", "width": 600, "$schema": "https://vega.github.io/schema/vega-lite/v6.1.0.json", "datasets": {"data-9caae2929b2f51d937bc7954921aa62a": [{"variable1": "active_imp_super", "variable2": "active_imp_super", "correlation": 1.0}, {"variable1": "passive_imp_super", "variable2": "active_imp_super", "correlation": 0.108}, {"variable1": "active_click_super", "variable2": "active_imp_super", "correlation": 0.815}, {"variable1": "passive_click_super", "variable2": "active_imp_super", "correlation": 0.036}, {"variable1": "orders_amt_super", "variable2": "active_imp_super", "correlation": 0.044}, {"variable1": "active_imp_super", "variable2": "passive_imp_super", "correlation": 0.108}, {"variable1": "passive_imp_super", "variable2": "passive_imp_super", "correlation": 1.0}, {"variable1": "active_click_super", "variable2": "passive_imp_super", "correlation": 0.139}, {"variable1": "passive_click_super", "variable2": "passive_imp_super", "correlation": 0.25}, {"variable1": "orders_amt_super", "variable2": "passive_imp_super", "correlation": 0.107}, {"variable1": "active_imp_super", "variable2": "active_click_super", "correlation": 0.815}, {"variable1": "passive_imp_super", "variable2": "active_click_super", "correlation": 0.139}, {"variable1": "active_click_super", "variable2": "active_click_super", "correlation": 1.0}, {"variable1": "passive_click_super", "variable2": "active_click_super", "correlation": 0.018}, {"variable1": "orders_amt_super", "variable2": "active_click_super", "correlation": 0.021}, {"variable1": "active_imp_super", "variable2": "passive_click_super", "correlation": 0.036}, {"variable1": "passive_imp_super", "variable2": "passive_click_super", "correlation": 0.25}, {"variable1": "active_click_super", "variable2": "passive_click_super", "correlation": 0.018}, {"variable1": "passive_click_super", "variable2": "passive_click_super", "correlation": 1.0}, {"variable1": "orders_amt_super", "variable2": "passive_click_super", "correlation": 0.119}, {"variable1": "active_imp_super", "variable2": "orders_amt_super", "correlation": 0.044}, {"variable1": "passive_imp_super", "variable2": "orders_amt_super", "correlation": 0.107}, {"variable1": "active_click_super", "variable2": "orders_amt_super", "correlation": 0.021}, {"variable1": "passive_click_super", "variable2": "orders_amt_super", "correlation": 0.119}, {"variable1": "orders_amt_super", "variable2": "orders_amt_super", "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> |