Skip to content

Commit 2444791

Browse files
committed
#1 added datepicker to timeline.
1 parent d909b9c commit 2444791

11 files changed

+296
-2162
lines changed

index.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ joola.init({}, function (err) {
2020
point.location = {lat: point.lat, lon: point.lon};
2121
point.tag = 'tag';
2222
point.type = 'sensor';
23-
point.metric = 1;
24-
point.humidity = 0.9;
23+
point.metric = Math.floor(Math.random() * 60) + 1;
24+
point.humidity = (Math.floor(Math.random() * 100) + 1) / 100;
2525
delete point.lat;
2626
delete point.lon;
2727

public/css/default.css

+96-14
Original file line numberDiff line numberDiff line change
@@ -515,31 +515,50 @@ select.mcontrols {
515515
background: #3074a4;
516516
}
517517

518-
.ui-control code {
518+
code#mousemove {
519519
position: absolute;
520520
top: 50px;
521521
left: 50%;
522522
margin-left: -110px;
523523
width: 220px;
524524
border-radius: 3px;
525-
z-index: 1001;
525+
526526
text-align: center;
527-
padding-top:5px;
527+
padding-top: 5px;
528528
}
529529

530-
.ui-control code:empty {
531-
display:none;
530+
code#mousemove:empty {
531+
display: none;
532532
}
533533

534534
#details {
535-
position: absolute;
535+
position: fixed;
536+
537+
height: 550px;
538+
bottom: -500px;
539+
width: 80%;
540+
left: 50%;
541+
margin-left: -40%;
542+
background-color: whitesmoke;
543+
padding: 10px;
544+
border-top-left-radius: 3px;
545+
border-top-right-radius: 3px;
546+
547+
font-size: 14px;
548+
549+
}
536550

537-
bottom: 60px;
538-
left: 10px;
539-
background-color: black;
551+
#details #table {
552+
553+
}
554+
555+
[jio-type="table"] .table-wrapper {
556+
height: 420px;
557+
}
558+
559+
#details.expanded {
560+
bottom: 0;
540561

541-
min-width: 450px;
542-
min-height: 200px;
543562
}
544563

545564
pre.ui-coordinates {
@@ -576,8 +595,8 @@ pre.ui-coordinates {
576595
position: absolute;
577596
top: 10px;
578597
left: 50%;
579-
width: 40%;
580-
margin-left: -20%;
598+
width: 50%;
599+
margin-left: -25%;
581600

582601
border: 0 solid white;
583602
border-radius: 3px;
@@ -626,6 +645,7 @@ svg.timeline {
626645
color: white;
627646
}
628647

648+
/*
629649
.timeline-wrapper .timeline-state {
630650
display: table-cell;
631651
padding-left: 5px;
@@ -640,7 +660,7 @@ svg.timeline {
640660
border-left: 1px solid #666;
641661
width: 95px;
642662
}
643-
663+
*/
644664
.timeline-wrapper .timeline-state .timeline-state-caption {
645665
position: relative;
646666
top: -4px;
@@ -651,3 +671,65 @@ svg.timeline {
651671
fill: black;
652672
fill-opacity: 0.825;
653673
}
674+
675+
.timeline-wrapper .timeline-state {
676+
display: table-cell;
677+
padding: 0;
678+
background-color: whitesmoke;
679+
text-transform: uppercase;
680+
font-size: 12px;
681+
font-weight: bold;
682+
border: 0;
683+
border-bottom-right-radius: 3px;
684+
border-top-right-radius: 3px;
685+
color: black;
686+
border-left: 1px solid #666;
687+
width: 125px;
688+
}
689+
690+
[jio-type="datepicker"] {
691+
float: none !important;
692+
}
693+
694+
[jio-type=datepicker] .jcontainer {
695+
border: 0 !important;
696+
position: relative !important;
697+
top: -2px !important;
698+
left: 5px !important;
699+
border-radius: 0 !important;
700+
}
701+
702+
[jio-type=datepicker] .datetable .dropdownmarker {
703+
position: inherit !important;
704+
margin-top: 3px !important;
705+
}
706+
707+
[jio-type=datepicker] .datebox.expanded .datetable .dropdownmarker {
708+
margin-top: -3px !important;
709+
}
710+
711+
[jio-type=datepicker] .picker {
712+
margin-left: -4px !important;
713+
margin-top: 0 !important;
714+
}
715+
716+
[jio-type=datepicker] .expanded {
717+
border-bottom-right-radius: 0 !important;
718+
}
719+
720+
[jio-type=datepicker] .picker .wrapper .control .optionscontainer {
721+
font-size: 14px !important;
722+
}
723+
724+
.compareoption {
725+
display: none !important;
726+
}
727+
728+
[jio-type=datepicker] .picker .wrapper .control .optionscontainer .daterange .dateoption {
729+
width: 7.5em !important;
730+
font-size: 14px !important;
731+
}
732+
733+
[jio-type=datepicker] .ui-datepicker-title {
734+
padding-top: 10px !important;
735+
}

public/index.html

+20-14
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<meta charset="utf-8">
77
<link rel="stylesheet" href="http://layout.jquery-dev.com/lib/css/layout-default-latest.css">
88
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css">
9-
<link rel="stylesheet" href="https://code.jquery.com/ui/1.11.4/themes/black-tie/jquery-ui.css">
9+
<!--<link rel="stylesheet" href="https://code.jquery.com/ui/1.11.4/themes/black-tie/jquery-ui.css">-->
1010
<link href="//cdnjs.cloudflare.com/ajax/libs/font-awesome/4.1.0/css/font-awesome.min.css" rel="stylesheet">
1111
<link rel="stylesheet" href="/css/default.css">
1212

@@ -41,25 +41,29 @@
4141
<script src="/js/leaflet.js"></script>
4242
<script src="https://cdnjs.cloudflare.com/ajax/libs/flot/0.8.3/jquery.flot.min.js"></script>
4343

44-
<script src="/js/vendor/crossfilter.js"></script>
45-
46-
<script src="http://localhost:8080/joola.js?APIToken=apitoken-demo"></script>
44+
<script src="http://localhost:8080/joola.js"></script>
4745
<script src="/js/state.js"></script>
48-
<script src="/js/wireframe.js"></script>
46+
<script src="/js/globals.js"></script>
4947
<script src="/js/geohash.js"></script>
5048
<script src="/js/joola.js"></script>
49+
<script src="/js/wireframe.js"></script>
5150
<script src="/js/timeline.js"></script>
52-
51+
<script src="/js/sequence.js"></script>
5352
</head>
5453
<body>
5554

5655
<div id="map-canvas"></div>
5756

58-
<div id="details" class="resizable draggable">
59-
<div class="header handle">Details Window</div>
57+
<div id="details" class="expanded">
58+
<div class="header handle ">
59+
<span class="showingresults">
60+
Loading data...
61+
</span>
62+
</div>
6063
<div class="content">
61-
<pre id='coordinates' class='ui-coordinates'></pre>
62-
<div class="clearfix"></div>
64+
<div id="table"></div>
65+
<!--<pre id='coordinates' class='ui-coordinates'></pre>
66+
<div class="clearfix"></div>-->
6367
</div>
6468
</div>
6569

@@ -74,9 +78,9 @@
7478
<a href='#' id='geocoder'>Geocoder</a>
7579
<a href='#' id='infocontrol'>Info Control</a>
7680
</nav>-->
77-
<div id='position' class='ui-control'>
78-
<code id='mousemove'></code><br/>
79-
</div>
81+
82+
<code id='mousemove'></code>
83+
8084

8185
<div class="timeline-wrapper">
8286
<div class="timeline-controls">
@@ -89,4 +93,6 @@
8993
<div class="timeline-state"><span class="timeline-state-caption">Last 90 sec.</span></div>
9094
</div>
9195
</body>
92-
</html>
96+
</html>
97+
98+

public/js/globals.js

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
var query = {
2+
timeframe: 'last_90_seconds',
3+
interval: 'second',
4+
dimensions: ['location.lat', 'location.lon', 'tag', 'type'],
5+
metrics: ['metric', {key: 'humidity', aggregation: 'avg', decimals: 2}],
6+
collection: 'geo',
7+
realtime: {
8+
enabled: true,
9+
interval: state.get('config.refresh.duration')
10+
}
11+
};
12+
var runningQueries=[];
13+
var map;
14+
var geojson = [];
15+
var heat;
16+
var EPSData = [];
17+
18+
var realtime = true;

0 commit comments

Comments
 (0)