mirror of https://github.com/apache/superset.git
[welcome] removing calendar heatmap from welcome page (#1119)
This commit is contained in:
parent
edcc2a11c6
commit
9389f89889
|
@ -5,9 +5,7 @@ require('../stylesheets/welcome.css');
|
|||
require('bootstrap');
|
||||
require('datatables.net-bs');
|
||||
require('../node_modules/datatables-bootstrap3-plugin/media/css/datatables-bootstrap3.css');
|
||||
require('../node_modules/cal-heatmap/cal-heatmap.css');
|
||||
const d3 = require('d3');
|
||||
const CalHeatMap = require('cal-heatmap');
|
||||
function modelViewTable(selector, modelView, orderCol, order) {
|
||||
// Builds a dataTable from a flask appbuilder api endpoint
|
||||
let url = '/' + modelView.toLowerCase() + '/api/read';
|
||||
|
@ -51,32 +49,5 @@ function modelViewTable(selector, modelView, orderCol, order) {
|
|||
});
|
||||
}
|
||||
$(document).ready(function () {
|
||||
d3.json('/caravel/activity_per_day', function (json) {
|
||||
const ext = d3.extent(d3.values(json));
|
||||
const cal = new CalHeatMap();
|
||||
const range = 10;
|
||||
const legendBounds = [];
|
||||
const step = (ext[1] - ext[0]) / (range - 1);
|
||||
for (let i = 0; i < range; i++) {
|
||||
legendBounds.push(i * step + ext[0]);
|
||||
}
|
||||
cal.init({
|
||||
start: new Date().setFullYear(new Date().getFullYear() - 1),
|
||||
range: 13,
|
||||
data: json,
|
||||
legend: legendBounds,
|
||||
legendColors: [
|
||||
'#D6E685',
|
||||
'#1E6823',
|
||||
],
|
||||
domain: 'month',
|
||||
subDomain: 'day',
|
||||
itemName: 'action',
|
||||
tooltip: true,
|
||||
cellSize: 10,
|
||||
cellPadding: 2,
|
||||
domainGutter: 22,
|
||||
});
|
||||
});
|
||||
modelViewTable('#dash_table', 'DashboardModelViewAsync', 'changed_on', 'desc');
|
||||
});
|
||||
|
|
|
@ -12,34 +12,26 @@
|
|||
{% block body %}
|
||||
<div class="container welcome">
|
||||
{% include 'caravel/flash_wrapper.html' %}
|
||||
<div class="cal-heatmap-panel">
|
||||
<div id="cal-heatmap"></div>
|
||||
</div>
|
||||
<br/>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<div class="panel-title">
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<h2>{{ _("Dashboards") }}</h2>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="search-container pull-right">
|
||||
<i class="fa fa-search"></i>
|
||||
<span class="search"></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<div class="panel-title">
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<h2>{{ _("Dashboards") }}</h2>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="search-container pull-right">
|
||||
<i class="fa fa-search"></i>
|
||||
<span class="search"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<img class="loading" src="/static/assets/images/loading.gif"/>
|
||||
<table id="dash_table" class="table" width="100%"></table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<img class="loading" src="/static/assets/images/loading.gif"/>
|
||||
<table id="dash_table" class="table" width="100%"></table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
|
Loading…
Reference in New Issue