-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
135 lines (113 loc) · 3.94 KB
/
index.html
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
<!DOCTYPE html>
<html lang="ja">
<head>
<script type="text/javascript" src="https://admin.karte.io/libs/easy-dc-dash/v0.3/bundle.browser.js"></script>
<link rel="stylesheet" type="text/css" href="https://admin.karte.io/libs/easy-dc-dash/v0.3/bundle.css" />
</head>
<style>
body {
background-color: transparent;
}
.flex-col {
display: flex;
flex-direction: column;
}
.flex-row {
display: flex;
flex-direction: row;
}
.krt-dc-container {
display: flex;
justify-content: center;
align-items: flex-start;
flex-wrap: wrap;
padding-top: 50px;
}
.krt-dc-container .block {
width: 100%;
padding-left: 5%;
padding-right: 5%;
margin: 20px 0;
text-align: center;
}
.krt-dc-container h2.block {
margin-top: 2rem;
}
</style>
<body>
<easy-dc-dataset
csv="./data.csv"
date-fields="day"
int-fields="pv"
float-fields="total_time"
date-format="%Y-%m-%dT%H:%M:%S.000Z"
></easy-dc-dataset>
<div class="krt-dc-container">
<h1>Plaid Engineer Blogの記事評価</h1>
<h2 class="block">time range (2017-11-21 ~ 2017-12-05)</h2>
<date-volume-chart
id="volume-chart"
dimension='d.day'
reduce='d.pv'
></date-volume-chart>
<h2 class="block">曜日別</h2>
<week-row title="PV" dimension="d.day" reduce="d.pv"></week-row>
<week-row title="VT" dimension="d.day" reduce="d.total_time"></week-row>
<h2 class="block">PVとVT(注視時間)</h2>
<div class="flex-col">
<div class="flex-row">
<list-row dimension="d.path" reduce="d.pv" :cap="6" title="ページごと総UniqPV" link-formatter="linkFormatter"></list-row>
<list-row dimension="d.path" reduce="d.total_time" :cap="6" title="ページごと総VT" link-formatter="linkFormatter"></list-row>
</div>
<div class="flex-row">
<multidim-pie
title="PVの割合"
layout="square-and-legend"
link-formatter="linkFormatter"
dimension="d.path"
reduce="d.pv"
:show-label=false
></multidim-pie>
<multidim-pie
title="VTの割合"
layout="square-and-legend"
link-formatter="linkFormatter"
dimension="d.path"
reduce="d.total_time"
:show-label="false"
></multidim-pie>
</div>
</div>
<h2 class="block">PVあたりのVT</h2>
<stack-and-rate layout="overlay-legend" dimension="d.day" reduce="[[d.pv, d.total_time - d.pv], {count: d.pv, value: d.total_time}]" scale="time.day" labels="UniqPV,VT,平均VT"></stack-and-rate>
<bubble
date-key='d.day'
dimension='ymd'
reduce="{PV: d.pv, VT: d.total_time, 'PV/VT': {count: d.pv, value: d.total_time}}"
x-axis-label="PV"
y-axis-label="VT"
radius-label="PV/VT"
radius-format='%'
:max-bubble-relative-size=0.1
></bubble>
<h2 class="block">テーブル</h2>
<data-table dimension="d.path" columns="path,pv,total_time" labels="Path,UU,ViewingTime(min)" :representations="['pageLink','number', 'min']"></data-table>
</div>
<script type="text/javascript">
EasyDC.Store.registerRepresentation('pageLink', function(v, d, k) {
return `<a target="_blank" href="http://tech.plaid.co.jp${v}">http://tech.plaid.co.jp${v}</a>`
})
EasyDC.Store.registerRepresentation('min', function(v, d, k) {
return Math.round(Number(v / 60))
})
EasyDC.Store.registerRepresentation('number', function(v, d, k) {
return (Math.round(Number(v * 100)) / 100).toLocaleString()
})
EasyDC.Store.registerLinkFormatter('linkFormatter', (v) => {
if (v.toLowerCase() === 'others') return null
return 'http://tech.plaid.co.jp' + v
})
EasyDC.run()
</script>
</body>
</html>