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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Basic Layout</title>
<link rel="stylesheet" href="https://libs.cartocdn.com/airship-style/v2.4.1/airship.css">
<script type="module" src="https://libs.cartocdn.com/airship-components/v2.4.1/airship/airship.esm.js"></script>
<script nomodule="" src="https://libs.cartocdn.com/airship-components/v2.4.1/airship/airship.js"></script>
<!-- Include Mapbox GL JS -->
<script src="https://libs.cartocdn.com/mapbox-gl/v0.48.0-carto1/mapbox-gl.js"></script>
<!-- Include Mapbox GL CSS -->
<link href="https://libs.cartocdn.com/mapbox-gl/v0.48.0-carto1/mapbox-gl.css" rel="stylesheet" />
<style>
.map-area-text {
position: absolute;
z-index: 10;
top: 24px;
left: 8px;
padding: 8px;
background-color: #FFF;
}
.panel-text {
margin-right: 8px;
padding: 8px;
background-color: #FFF;
}
</style>
</head>
<body class="as-app-body as-app">
<header class="as-toolbar">
<div class="as-toolbar__item as-title">TOOLBAR</div>
</header>
<nav class="as-tabs"></nav>
<div class="as-content">
<aside class="as-sidebar as-sidebar--left">
<div class="as-container">
<div class="as-box as-title">
LEFT SIDEBAR
</div>
</div>
</aside>
<main class="as-main">
<div class="as-map-area">
<div class="map-area-text as-title">MAP</div>
<div id="map"></div>
<div class="as-map-panels">
<div class="as-panel as-panel--top as-panel--right">
<div class="as-title panel-text">MAP PANELS -> </div>
<div class="as-panel__element as-p--32 as-bg--warning"></div>
<div class="as-panel__element as-p--32 as-bg--success"></div>
</div>
</div>
</div>
<footer class="as-map-footer as-bg--complementary" style="height: 100px;">
<div class="as-box as-title as-color--type-04">
MAP FOOTER
</div>
</footer>
</main>
<aside class="as-sidebar as-sidebar--right">
<div class="as-container">
<div class="as-box as-title">
RIGHT SIDEBAR
</div>
</div>
</aside>
</div>
<!-- Basic CARTO-VL MAP -->
<script>
const map = new mapboxgl.Map({
container: 'map',
style: 'https://basemaps.cartocdn.com/gl/voyager-gl-style/style.json',
center: [0, 30],
zoom: 2,
scrollZoom: false,
dragRotate: false,
touchZoomRotate: false
});
</script>
</body>
</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
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
<!DOCTYPE html>
<html dir="ltr" lang="en">
<head>
<base href="/">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=5.0">
<title>Airship</title>
<link rel="stylesheet" href="https://libs.cartocdn.com/airship-style/v2.4.1/airship.css">
<script type="module" src="https://libs.cartocdn.com/airship-components/v2.4.1/airship/airship.esm.js"></script>
<script nomodule="" src="https://libs.cartocdn.com/airship-components/v2.4.1/airship/airship.js"></script>
<!-- CARTO.js -->
<!-- Include Leaflet -->
<script src="https://unpkg.com/leaflet@1.3.1/dist/leaflet.js"></script>
<link href="https://unpkg.com/leaflet@1.3.1/dist/leaflet.css" rel="stylesheet">
<!-- Include CARTO.js -->
<script src="https://libs.cartocdn.com/carto.js/v4.1.2/carto.min.js"></script>
<link href="https://carto.com/developers/carto-js/examples/maps/public/style.css" rel="stylesheet">
<!-- / CARTO.js -->
</head>
<body class="as-app-body as-app">
<as-responsive-content>
<aside class="as-sidebar as-sidebar--left" data-name="Stores">
<div class="as-container">
<section class="as-box">
<h1 class="as-title">Store 1</h1>
<div class="as-badge">Test</div>
<p class="as-body">
Inventore possimus nam quam necessitatibus omnis, est sequi rem quibusdam molestiae, at saepe odit voluptatem quae debitis consequatur iste ducimus quaerat dolorum.
</p>
<button class="as-btn as-btn--secondary as-btn--s">Visit</button>
</section>
<section class="as-box">
<h1 class="as-title">Store 2</h1>
<div class="as-badge">Test</div>
<p class="as-body">
Inventore possimus nam quam necessitatibus omnis, est sequi rem quibusdam molestiae, at saepe odit voluptatem quae debitis consequatur iste ducimus quaerat dolorum.
</p>
<button class="as-btn as-btn--secondary as-btn--s">Visit</button>
</section>
<section class="as-box">
<h1 class="as-title">Store 3</h1>
<div class="as-badge">Test</div>
<p class="as-body">
Inventore possimus nam quam necessitatibus omnis, est sequi rem quibusdam molestiae, at saepe odit voluptatem quae debitis consequatur iste ducimus quaerat dolorum.
</p>
<button class="as-btn as-btn--secondary as-btn--s">Visit</button>
</section>
</div>
</aside>
<main class="as-main">
<div class="as-map-area">
<div id="map"></div>
<div class="as-map-panels" data-name="Legends">
<div class="as-panel as-panel--top as-panel--right">
<div class="as-panel__element">
<section class="as-box">
<p class="as-subheader">LEGEND 1</p>
<p class="as-body">
There are no special containers for legends. Just add an 'as-box' element to an 'as-panel__element'
</p>
</section>
<section class="as-box">
<p class="as-subheader">LEGEND 2</p>
<p class="as-body">
There are no special containers for legends. Just add an 'as-box' element to an 'as-panel__element'
</p>
</section>
</div>
</div>
</div>
</div>
</main>
<aside class="as-sidebar as-sidebar--right" data-name="Containers">
<div class="as-container as-container--border">
<section class="as-box">
<h1 class="as-title">Fixed container</h1>
<p class="as-body">Use this container when you need to present fixed content. This content will occupy as much vertical
space as needed.</p>
</section>
</div>
<div class="as-container as-container--scrollable">
<section class="as-box">
<h1 class="as-title">Scrollable container</h1>
<p class="as-body">
When you need to present lots of content that don't fit in the available space, use a scrollable container. It'll take the
space left by the fixed containers.
</p>
</section>
<section class="as-box">
<h1 class="as-title">A box</h1>
<p class="as-body">
This content is here to fill up more space than available so you can scroll.
</p>
</section>
<section class="as-box">
<h1 class="as-title">A box</h1>
<p class="as-body">
This content is here to fill up more space than available so you can scroll.
</p>
</section>
<section class="as-box">
<h1 class="as-title">A box</h1>
<p class="as-body">
This content is here to fill up more space than available so you can scroll.
</p>
</section>
<section class="as-box">
<h1 class="as-title">A box</h1>
<p class="as-body">
This content is here to fill up more space than available so you can scroll.
</p>
</section>
</div>
</aside>
</as-responsive-content>
<script type="text/javascript">
const responsiveContent = document.querySelector('as-responsive-content');
responsiveContent.addEventListener('ready', () => {
const map = L.map('map', {
zoomControl: false
}).setView([30, 0], 3);
map.scrollWheelZoom.disable();
L.tileLayer('https://{s}.basemaps.cartocdn.com/rastertiles/voyager_nolabels/{z}/{x}/{y}.png', {
maxZoom: 18
}).addTo(map);
const client = new carto.Client({
apiKey: 'default_public',
username: 'cartojs-test'
});
const source = new carto.source.Dataset('ne_10m_populated_places_simple');
const style = new carto.style.CartoCSS(`
#layer {
marker-width: 7;
marker-fill: #EE4D5A;
marker-line-color: #FFFFFF;
}
`);
const layer = new carto.layer.Layer(source, style);
client.addLayer(layer);
client.getLeafletLayer().addTo(map);
});
</script>
</body>
</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
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
<!DOCTYPE html>
<html dir="ltr" lang="en">
<head>
<base href="/">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=5.0">
<title>Airship</title>
<link rel="stylesheet" href="https://libs.cartocdn.com/airship-style/v2.4.1/airship.css">
<script type="module" src="https://libs.cartocdn.com/airship-components/v2.4.1/airship/airship.esm.js"></script>
<script nomodule="" src="https://libs.cartocdn.com/airship-components/v2.4.1/airship/airship.js"></script>
<!-- CARTO.js -->
<!-- Include Leaflet -->
<script src="https://unpkg.com/leaflet@1.3.1/dist/leaflet.js"></script>
<link href="https://unpkg.com/leaflet@1.3.1/dist/leaflet.css" rel="stylesheet">
<!-- Include CARTO.js -->
<script src="https://libs.cartocdn.com/carto.js/v4.1.2/carto.min.js"></script>
<link href="https://carto.com/developers/carto-js/examples/maps/public/style.css" rel="stylesheet">
<!-- / CARTO.js -->
</head>
<body class="as-app-body as-app">
<as-responsive-content>
<aside class="as-sidebar as-sidebar--left" data-name="Stores" data-tab-order="2">
<div class="as-container">
<section class="as-box">
<h1 class="as-title">Store 1</h1>
<div class="as-badge">Test</div>
<p class="as-body">
Inventore possimus nam quam necessitatibus omnis, est sequi rem quibusdam molestiae, at saepe odit voluptatem quae debitis consequatur iste ducimus quaerat dolorum.
</p>
<button class="as-btn as-btn--secondary as-btn--s">Visit</button>
</section>
<section class="as-box">
<h1 class="as-title">Store 2</h1>
<div class="as-badge">Test</div>
<p class="as-body">
Inventore possimus nam quam necessitatibus omnis, est sequi rem quibusdam molestiae, at saepe odit voluptatem quae debitis consequatur iste ducimus quaerat dolorum.
</p>
<button class="as-btn as-btn--secondary as-btn--s">Visit</button>
</section>
<section class="as-box">
<h1 class="as-title">Store 3</h1>
<div class="as-badge">Test</div>
<p class="as-body">
Inventore possimus nam quam necessitatibus omnis, est sequi rem quibusdam molestiae, at saepe odit voluptatem quae debitis consequatur iste ducimus quaerat dolorum.
</p>
<button class="as-btn as-btn--secondary as-btn--s">Visit</button>
</section>
</div>
</aside>
<main class="as-main" data-tab-order="0">
<div class="as-map-area">
<div id="map"></div>
<div class="as-map-panels" data-name="Legends" data-tab-order="1">
<div class="as-panel as-panel--top as-panel--right">
<div class="as-panel__element">
<section class="as-box">
<p class="as-subheader">LEGEND 1</p>
<p class="as-body">
There are no special containers for legends. Just add an 'as-box' element to an 'as-panel__element'
</p>
</section>
<section class="as-box">
<p class="as-subheader">LEGEND 2</p>
<p class="as-body">
There are no special containers for legends. Just add an 'as-box' element to an 'as-panel__element'
</p>
</section>
</div>
</div>
</div>
</div>
</main>
<aside class="as-sidebar as-sidebar--right" data-name="Containers" data-tab-order="3">
<div class="as-container as-container--border">
<section class="as-box">
<h1 class="as-title">Fixed container</h1>
<p class="as-body">Use this container when you need to present fixed content. This content will occupy as much vertical
space as needed.</p>
</section>
</div>
<div class="as-container as-container--scrollable">
<section class="as-box">
<h1 class="as-title">Scrollable container</h1>
<p class="as-body">
When you need to present lots of content that don't fit in the available space, use a scrollable container. It'll take the
space left by the fixed containers.
</p>
</section>
<section class="as-box">
<h1 class="as-title">A box</h1>
<p class="as-body">
This content is here to fill up more space than available so you can scroll.
</p>
</section>
<section class="as-box">
<h1 class="as-title">A box</h1>
<p class="as-body">
This content is here to fill up more space than available so you can scroll.
</p>
</section>
<section class="as-box">
<h1 class="as-title">A box</h1>
<p class="as-body">
This content is here to fill up more space than available so you can scroll.
</p>
</section>
<section class="as-box">
<h1 class="as-title">A box</h1>
<p class="as-body">
This content is here to fill up more space than available so you can scroll.
</p>
</section>
</div>
</aside>
</as-responsive-content>
<script type="text/javascript">
const responsiveContent = document.querySelector('as-responsive-content');
responsiveContent.addEventListener('ready', () => {
const map = L.map('map', {
zoomControl: false
}).setView([30, 0], 3);
map.scrollWheelZoom.disable();
L.tileLayer('https://{s}.basemaps.cartocdn.com/rastertiles/voyager_nolabels/{z}/{x}/{y}.png', {
maxZoom: 18
}).addTo(map);
const client = new carto.Client({
apiKey: 'default_public',
username: 'cartojs-test'
});
const source = new carto.source.Dataset('ne_10m_populated_places_simple');
const style = new carto.style.CartoCSS(`
#layer {
marker-width: 7;
marker-fill: #EE4D5A;
marker-line-color: #FFFFFF;
}
`);
const layer = new carto.layer.Layer(source, style);
client.addLayer(layer);
client.getLeafletLayer().addTo(map);
});
</script>
</body>
</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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Basic Layout</title>
<link rel="stylesheet" href="https://libs.cartocdn.com/airship-style/v2.4.1/airship.css">
<script type="module" src="https://libs.cartocdn.com/airship-components/v2.4.1/airship/airship.esm.js"></script>
<script nomodule="" src="https://libs.cartocdn.com/airship-components/v2.4.1/airship/airship.js"></script>
<!-- Include Mapbox GL JS -->
<script src="https://libs.cartocdn.com/mapbox-gl/v0.48.0-carto1/mapbox-gl.js"></script>
<!-- Include Mapbox GL CSS -->
<link href="https://libs.cartocdn.com/mapbox-gl/v0.48.0-carto1/mapbox-gl.css" rel="stylesheet" />
</head>
<body class="as-app-body as-app">
<header class="as-toolbar"></header>
<div class="as-content">
<main class="as-main">
<div class="as-map-area">
<div id="map"></div>
</div>
</main>
</div>
<!-- Basic CARTO-VL MAP -->
<script>
const map = new mapboxgl.Map({
container: 'map',
style: 'https://basemaps.cartocdn.com/gl/voyager-gl-style/style.json',
center: [0, 30],
zoom: 2,
scrollZoom: false,
dragRotate: false,
touchZoomRotate: false
});
</script>
</body>
</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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Basic Layout</title>
<link rel="stylesheet" href="https://libs.cartocdn.com/airship-style/v2.4.1/airship.css">
<script type="module" src="https://libs.cartocdn.com/airship-components/v2.4.1/airship/airship.esm.js"></script>
<script nomodule="" src="https://libs.cartocdn.com/airship-components/v2.4.1/airship/airship.js"></script>
<!-- Include Mapbox GL JS -->
<script src="https://libs.cartocdn.com/mapbox-gl/v0.48.0-carto1/mapbox-gl.js"></script>
<!-- Include Mapbox GL CSS -->
<link href="https://libs.cartocdn.com/mapbox-gl/v0.48.0-carto1/mapbox-gl.css" rel="stylesheet" />
</head>
<body class="as-app-body">
<div class="as-app as-app--nav-left">
<header class="as-toolbar"></header>
<div class="as-content">
<main class="as-main">
<div class="as-map-area">
<div id="map"></div>
</div>
</main>
</div>
</div>
<!-- Basic CARTO-VL MAP -->
<script>
const map = new mapboxgl.Map({
container: 'map',
style: 'https://basemaps.cartocdn.com/gl/voyager-gl-style/style.json',
center: [0, 30],
zoom: 2,
scrollZoom: false,
dragRotate: false,
touchZoomRotate: false
});
</script>
</body>
</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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Basic Layout</title>
<link rel="stylesheet" href="https://libs.cartocdn.com/airship-style/v2.4.1/airship.css">
<script type="module" src="https://libs.cartocdn.com/airship-components/v2.4.1/airship/airship.esm.js"></script>
<script nomodule="" src="https://libs.cartocdn.com/airship-components/v2.4.1/airship/airship.js"></script>
<!-- Include Mapbox GL JS -->
<script src="https://libs.cartocdn.com/mapbox-gl/v0.48.0-carto1/mapbox-gl.js"></script>
<!-- Include Mapbox GL CSS -->
<link href="https://libs.cartocdn.com/mapbox-gl/v0.48.0-carto1/mapbox-gl.css" rel="stylesheet" />
</head>
<body class="as-app-body">
<div class="as-app as-app--nav-right">
<header class="as-toolbar"></header>
<div class="as-content">
<main class="as-main">
<div class="as-map-area">
<div id="map"></div>
</div>
</main>
</div>
</div>
<!-- Basic CARTO-VL MAP -->
<script>
const map = new mapboxgl.Map({
container: 'map',
style: 'https://basemaps.cartocdn.com/gl/voyager-gl-style/style.json',
center: [0, 30],
zoom: 2,
scrollZoom: false,
dragRotate: false,
touchZoomRotate: false
});
</script>
</body>
</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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Sidebar</title>
<link rel="stylesheet" href="https://libs.cartocdn.com/airship-style/v2.4.1/airship.css">
<script type="module" src="https://libs.cartocdn.com/airship-components/v2.4.1/airship/airship.esm.js"></script>
<script nomodule="" src="https://libs.cartocdn.com/airship-components/v2.4.1/airship/airship.js"></script>
<!-- CARTO.js -->
<!-- Include Leaflet -->
<script src="https://unpkg.com/leaflet@1.3.1/dist/leaflet.js"></script>
<link href="https://unpkg.com/leaflet@1.3.1/dist/leaflet.css" rel="stylesheet">
<!-- Include CARTO.js -->
<script src="https://libs.cartocdn.com/carto.js/v4.1/carto.min.js"></script>
<link href="https://carto.com/developers/carto-js/examples/maps/public/style.css" rel="stylesheet">
<!-- / CARTO.js -->
</head>
<body class="as-app-body as-app">
<nav role="tablist" class="as-toolbar-tabs as-tabs">
<button onclick="showMap(event)" role="tab" class="as-tabs__item as-tabs__item--active">MAP</button>
<button onclick="showLeft(event)" role="tab" class="as-tabs__item">LEFT</button>
<button onclick="showRight(event)" role="tab" class="as-tabs__item">RIGHT</button>
</nav>
<div class="as-content">
<aside class="as-sidebar as-sidebar--left as-bg--success"></aside>
<main class="as-main">
<div class="as-map-area">
<div id="map"></div>
</div>
</main>
<aside class="as-sidebar as-sidebar--right as-bg--warning"></aside>
</div>
<script defer src="../common/map.js"></script>
<script defer src="../common/tabs.js"></script>
</body>
</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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Sidebar</title>
<link rel="stylesheet" href="https://libs.cartocdn.com/airship-style/v2.4.1/airship.css">
<script type="module" src="https://libs.cartocdn.com/airship-components/v2.4.1/airship/airship.esm.js"></script>
<script nomodule="" src="https://libs.cartocdn.com/airship-components/v2.4.1/airship/airship.js"></script>
<!-- CARTO.js -->
<!-- Include Leaflet -->
<script src="https://unpkg.com/leaflet@1.3.1/dist/leaflet.js"></script>
<link href="https://unpkg.com/leaflet@1.3.1/dist/leaflet.css" rel="stylesheet">
<!-- Include CARTO.js -->
<script src="https://libs.cartocdn.com/carto.js/v4.1/carto.min.js"></script>
<link href="https://carto.com/developers/carto-js/examples/maps/public/style.css" rel="stylesheet">
<!-- / CARTO.js -->
</head>
<body class="as-app-body as-app">
<nav role="tablist" class="as-toolbar-tabs as-tabs">
<button onclick="showMap(event)" role="tab" class="as-tabs__item as-tabs__item--active">MAP</button>
<button onclick="showLeft(event)" role="tab" class="as-tabs__item">LEFT</button>
<button onclick="showRight(event)" role="tab" class="as-tabs__item">RIGHT</button>
</nav>
<div class="as-content">
<aside class="as-sidebar as-sidebar--left as-bg--success"></aside>
<main class="as-main">
<div class="as-map-area">
<div id="map"></div>
</div>
</main>
</div>
<script defer src="../common/map.js"></script>
<script defer src="../common/tabs.js"></script>
</body>
</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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Sidebar</title>
<link rel="stylesheet" href="https://libs.cartocdn.com/airship-style/v2.4.1/airship.css">
<script type="module" src="https://libs.cartocdn.com/airship-components/v2.4.1/airship/airship.esm.js"></script>
<script nomodule="" src="https://libs.cartocdn.com/airship-components/v2.4.1/airship/airship.js"></script>
<!-- CARTO.js -->
<!-- Include Leaflet -->
<script src="https://unpkg.com/leaflet@1.3.1/dist/leaflet.js"></script>
<link href="https://unpkg.com/leaflet@1.3.1/dist/leaflet.css" rel="stylesheet">
<!-- Include CARTO.js -->
<script src="https://libs.cartocdn.com/carto.js/v4.1/carto.min.js"></script>
<link href="https://carto.com/developers/carto-js/examples/maps/public/style.css" rel="stylesheet">
<!-- / CARTO.js -->
</head>
<body class="as-app-body as-app">
<nav role="tablist" class="as-toolbar-tabs as-tabs">
<button onclick="showMap(event)" role="tab" class="as-tabs__item as-tabs__item--active">MAP</button>
<button onclick="showLeft(event)" role="tab" class="as-tabs__item">LEFT</button>
<button onclick="showRight(event)" role="tab" class="as-tabs__item">RIGHT</button>
</nav>
<div class="as-content">
<main class="as-main">
<div class="as-map-area">
<div id="map"></div>
</div>
</main>
<aside class="as-sidebar as-sidebar--right as-bg--warning"></aside>
</div>
<script defer src="../common/map.js"></script>
<script defer src="../common/tabs.js"></script>
</body>
</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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Sidebar</title>
<link rel="stylesheet" href="https://libs.cartocdn.com/airship-style/v2.4.1/airship.css">
<script type="module" src="https://libs.cartocdn.com/airship-components/v2.4.1/airship/airship.esm.js"></script>
<script nomodule="" src="https://libs.cartocdn.com/airship-components/v2.4.1/airship/airship.js"></script>
<!-- CARTO.js -->
<!-- Include Leaflet -->
<script src="https://unpkg.com/leaflet@1.3.1/dist/leaflet.js"></script>
<link href="https://unpkg.com/leaflet@1.3.1/dist/leaflet.css" rel="stylesheet">
<!-- Include CARTO.js -->
<script src="https://libs.cartocdn.com/carto.js/v4.1/carto.min.js"></script>
<link href="https://carto.com/developers/carto-js/examples/maps/public/style.css" rel="stylesheet">
<!-- / CARTO.js -->
</head>
<body class="as-app-body as-app">
<nav role="tablist" class="as-toolbar-tabs as-tabs">
<button onclick="showMap(event)" role="tab" class="as-tabs__item as-tabs__item--active">MAP</button>
<button onclick="showLeft(event)" role="tab" class="as-tabs__item">LEFT</button>
<button onclick="showRight(event)" role="tab" class="as-tabs__item">RIGHT</button>
</nav>
<div class="as-content">
<aside class="as-sidebar as-sidebar--left as-sidebar--l as-bg--success"></aside>
<main class="as-main">
<div class="as-map-area">
<div id="map"></div>
</div>
</main>
</div>
<script defer src="../common/map.js"></script>
<script defer src="../common/tabs.js"></script>
</body>
</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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Sidebar</title>
<link rel="stylesheet" href="https://libs.cartocdn.com/airship-style/v2.4.1/airship.css">
<script type="module" src="https://libs.cartocdn.com/airship-components/v2.4.1/airship/airship.esm.js"></script>
<script nomodule="" src="https://libs.cartocdn.com/airship-components/v2.4.1/airship/airship.js"></script>
<!-- CARTO.js -->
<!-- Include Leaflet -->
<script src="https://unpkg.com/leaflet@1.3.1/dist/leaflet.js"></script>
<link href="https://unpkg.com/leaflet@1.3.1/dist/leaflet.css" rel="stylesheet">
<!-- Include CARTO.js -->
<script src="https://libs.cartocdn.com/carto.js/v4.1/carto.min.js"></script>
<link href="https://carto.com/developers/carto-js/examples/maps/public/style.css" rel="stylesheet">
<!-- / CARTO.js -->
</head>
<body class="as-app-body as-app">
<nav role="tablist" class="as-toolbar-tabs as-tabs">
<button onclick="showMap(event)" role="tab" class="as-tabs__item as-tabs__item--active">MAP</button>
<button onclick="showLeft(event)" role="tab" class="as-tabs__item">LEFT</button>
<button onclick="showRight(event)" role="tab" class="as-tabs__item">RIGHT</button>
</nav>
<div class="as-content">
<main class="as-main">
<div class="as-map-area">
<div id="map"></div>
</div>
</main>
<aside class="as-sidebar as-sidebar--right as-sidebar--xl as-bg--warning"></aside>
</div>
<script defer src="../common/map.js"></script>
<script defer src="../common/tabs.js"></script>
</body>
</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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Footer</title>
<link rel="stylesheet" href="https://libs.cartocdn.com/airship-style/v2.4.1/airship.css">
<script type="module" src="https://libs.cartocdn.com/airship-components/v2.4.1/airship/airship.esm.js"></script>
<script nomodule="" src="https://libs.cartocdn.com/airship-components/v2.4.1/airship/airship.js"></script>
<!-- CARTO.js -->
<!-- Include Leaflet -->
<script src="https://unpkg.com/leaflet@1.3.1/dist/leaflet.js"></script>
<link href="https://unpkg.com/leaflet@1.3.1/dist/leaflet.css" rel="stylesheet">
<!-- Include CARTO.js -->
<script src="https://libs.cartocdn.com/carto.js/v4.1/carto.min.js"></script>
<link href="https://carto.com/developers/carto-js/examples/maps/public/style.css" rel="stylesheet">
<!-- / CARTO.js -->
</head>
<body class="as-app-body as-app">
<nav role="tablist" class="as-toolbar-tabs as-tabs">
<button onclick="showMap(event)" role="tab" class="as-tabs__item as-tabs__item--active">MAP</button>
<button onclick="showBottom(event)" role="tab" class="as-tabs__item">FOOTER</button>
</nav>
<div class="as-content">
<main class="as-main">
<div class="as-map-area">
<div id="map"></div>
</div>
<footer class="as-map-footer as-bg--badge-yellow" style="min-height:100px;"></footer>
</main>
</div>
<script defer src="../common/map.js"></script>
<script defer src="../common/tabs.js"></script>
</body>
</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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Basic Layout</title>
<link rel="stylesheet" href="https://libs.cartocdn.com/airship-style/v2.4.1/airship.css">
<script type="module" src="https://libs.cartocdn.com/airship-components/v2.4.1/airship/airship.esm.js"></script>
<script nomodule="" src="https://libs.cartocdn.com/airship-components/v2.4.1/airship/airship.js"></script>
<!-- Include Mapbox GL JS -->
<script src="https://libs.cartocdn.com/mapbox-gl/v0.48.0-carto1/mapbox-gl.js"></script>
<!-- Include Mapbox GL CSS -->
<link href="https://libs.cartocdn.com/mapbox-gl/v0.48.0-carto1/mapbox-gl.css" rel="stylesheet" />
</head>
<body class="as-app-body as-app">
<div class="as-content">
<main class="as-main">
<div class="as-map-area">
<div id="map"></div>
<div class="as-map-panels">
<div class="as-panel as-panel--top as-panel--left">
<div class="as-panel__element as-p--32 as-bg--warning"></div>
<div class="as-panel__element as-p--32 as-bg--success"></div>
</div>
<div class="as-panel as-panel--top as-panel--right">
<div class="as-panel__element as-p--32 as-bg--warning"></div>
<div class="as-panel__element as-p--32 as-bg--success"></div>
</div>
</div>
</div>
</main>
</div>
<!-- Basic CARTO-VL MAP -->
<script>
const map = new mapboxgl.Map({
container: 'map',
style: 'https://basemaps.cartocdn.com/gl/voyager-gl-style/style.json',
center: [0, 30],
zoom: 2,
scrollZoom: false,
dragRotate: false,
touchZoomRotate: false
});
</script>
</body>
</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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Basic Layout</title>
<link rel="stylesheet" href="https://libs.cartocdn.com/airship-style/v2.4.1/airship.css">
<script type="module" src="https://libs.cartocdn.com/airship-components/v2.4.1/airship/airship.esm.js"></script>
<script nomodule="" src="https://libs.cartocdn.com/airship-components/v2.4.1/airship/airship.js"></script>
<!-- Include Mapbox GL JS -->
<script src="https://libs.cartocdn.com/mapbox-gl/v0.48.0-carto1/mapbox-gl.js"></script>
<!-- Include Mapbox GL CSS -->
<link href="https://libs.cartocdn.com/mapbox-gl/v0.48.0-carto1/mapbox-gl.css" rel="stylesheet" />
</head>
<body class="as-app-body as-app">
<div class="as-content">
<main class="as-main">
<div class="as-map-area">
<div id="map"></div>
<div class="as-map-panels">
<div class="as-panel as-panel--top as-panel--right">
<div class="as-panel__element as-p--32 as-bg--warning">
<p class="as-body as-box">Panel</p>
</div>
<div class="as-panel__element as-p--32 as-bg--success">
<p class="as-body as-box as-box--xlarge">Panel</p>
</div>
</div>
</div>
</div>
<footer class="as-map-footer as-bg--badge-yellow">
<section class="as-box as-box--medium as-box--border">
<h1 class="as-title">A box with border</h1>
<p class="as-body">Use this container when you need to present content and a right border line.</p>
</section>
<section class="as-box as-box--small as-box--scroll" style="min-width: 120px;">
<h1 class="as-title">A scrollable box</h1>
<p class="as-body">`as-box--scroll` when you need to present lots of content that don't fit
in the available space, use a scrollable box.</p>
</section>
<section class="as-box as-box--small">
<h1 class="as-title">A small box</h1>
<p class="as-body">
This content is here to fill up more space.
</p>
</section>
<section class="as-box as-box--medium">
<h1 class="as-title">A medium box</h1>
<p class="as-body">
This content is here to fill up more space.
</p>
</section>
<section class="as-box as-box--large">
<h1 class="as-title">A large box</h1>
<p class="as-body">
This content is here to fill up more space.
</p>
</section>
<section class="as-box as-box--xlarge">
<h1 class="as-title">A xlarge box</h1>
<p class="as-body">
This content is here to fill up more space.
</p>
</section>
</footer>
</main>
<aside class="as-sidebar as-sidebar--right as-bg--warning">
<div class="as-container as-container--border">
<section class="as-box">
<h1 class="as-title">Fixed container</h1>
<p class="as-body">Use this container when you need to present fixed content. This content will occupy as
much vertical space as needed.</p>
</section>
</div>
<div class="as-container as-container--scrollable">
<section class="as-box">
<h1 class="as-title">Scrollable container</h1>
<p class="as-body">
When you need to present lots of content that don't fit in the available space, use a scrollable container.
It'll take the space left by the fixed containers.
</p>
</section>
<section class="as-box">
<h1 class="as-title">A box</h1>
<p class="as-body">
This content is here to fill up more space than available so you can scroll.
</p>
</section>
<section class="as-box">
<h1 class="as-title">A box</h1>
<p class="as-body">
This content is here to fill up more space than available so you can scroll.
</p>
</section>
<section class="as-box">
<h1 class="as-title">A box</h1>
<p class="as-body">
This content is here to fill up more space than available so you can scroll.
</p>
</section>
<section class="as-box as-box--xlarge">
<h1 class="as-title">A box</h1>
<p class="as-body">
This content is here to fill up more space than available so you can scroll.
</p>
</section>
</div>
</aside>
</div>
<!-- Basic CARTO-VL MAP -->
<script>
const map = new mapboxgl.Map({
container: 'map',
style: 'https://basemaps.cartocdn.com/gl/voyager-gl-style/style.json',
center: [0, 30],
zoom: 2,
scrollZoom: false,
dragRotate: false,
touchZoomRotate: false
});
</script>
</body>
</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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Sidebar</title>
<link rel="stylesheet" href="https://libs.cartocdn.com/airship-style/v2.4.1/airship.css">
<script type="module" src="https://libs.cartocdn.com/airship-components/v2.4.1/airship/airship.esm.js"></script>
<script nomodule="" src="https://libs.cartocdn.com/airship-components/v2.4.1/airship/airship.js"></script>
<!-- CARTO.js -->
<!-- Include Leaflet -->
<script src="https://unpkg.com/leaflet@1.3.1/dist/leaflet.js"></script>
<link href="https://unpkg.com/leaflet@1.3.1/dist/leaflet.css" rel="stylesheet">
<!-- Include CARTO.js -->
<script src="https://libs.cartocdn.com/carto.js/v4.1/carto.min.js"></script>
<!-- / CARTO.js -->
</head>
<body class="as-app-body as-app">
<div role="tablist" class="as-toolbar-tabs as-tabs">
<button onclick="showMap(event)" role="tab" class="as-tabs__item as-tabs__item--active">MAP</button>
<button onclick="showRightPanel(event)" role="tab" class="as-tabs__item">RIGHT</button>
<button onclick="showBottomPanel(event)" role="tab" class="as-tabs__item">BOTTOM</button>
</div>
<div class="as-content">
<main class="as-main">
<div class="as-map-area">
<div id="map"></div>
</div>
<div class="as-map-footer">
<section class="as-box as-bg--primary">
<h1 class="as-title">Primary</h1>
<p class="as-body">Adding 'as-bg--primary' will set the background to the primary color</p>
</section>
</div>
</main>
<aside class="as-sidebar as-sidebar--right">
<div class="as-container as-container--border as-bg--secondary" style="color: #FFF;">
<section class="as-box">
<h1 class="as-title">Secondary</h1>
<p class="as-body">Adding 'as-bg--secondary' will set the background to the secondary color</p>
</section>
</div>
<div class="as-container as-container--scrollable as-bg--complementary">
<section class="as-box">
<h1 class="as-title">Complementary</h1>
<p class="as-body">Adding 'as-bg--complementary' will set the background to the complementary color</p>
</section>
</div>
</aside>
</div>
<script src="../layouts/common/map.js"></script>
<script src="../layouts/common/tabs.js"></script>
</body>
</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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Bottom bar</title>
<link rel="stylesheet" href="https://libs.cartocdn.com/airship-style/v2.4.1/airship.css">
<!-- CARTO.js -->
<!-- Include Leaflet -->
<script src="https://unpkg.com/leaflet@1.3.1/dist/leaflet.js"></script>
<link href="https://unpkg.com/leaflet@1.3.1/dist/leaflet.css" rel="stylesheet">
<!-- Include CARTO.js -->
<script src="https://libs.cartocdn.com/carto.js/v4.1/carto.min.js"></script>
<!-- / CARTO.js -->
</head>
<body class="as-app-body as-app">
<div role="tablist" class="as-toolbar-tabs as-tabs">
<button onclick="showMap(event)" role="tab" class="as-tabs__item as-tabs__item--active">MAP</button>
<button onclick="showBottomPanel(event)" role="tab" class="as-tabs__item">BOTTOM</button>
</div>
<div class="as-content">
<main class="as-main">
<div class="as-map-area">
<div id="map"></div>
</div>
<div class="as-map-footer as-bg--badge-yellow as-color--type-01">
<section class="as-box as-box--medium as-box--border">
<h1 class="as-title">A box with border</h1>
<p class="as-body">Use this class when you need to present content and a border line to the right.</p>
</section>
<section class="as-box as-box--small as-box--scroll" style="min-width: 200px;">
<h1 class="as-title">A scrollable box</h1>
<p class="as-body">`as-box--scroll` when you need to present lots of content that don't fit
in the available space, use a scrollable box.</p>
</section>
<section class="as-box as-box--small">
<h1 class="as-title">A small box</h1>
<p class="as-body">
This content is here to fill up more space.
</p>
</section>
<section class="as-box as-box--medium">
<h1 class="as-title">A medium box</h1>
<p class="as-body">
This content is here to fill up more space.
</p>
</section>
<section class="as-box as-box--large">
<h1 class="as-title">A large box</h1>
<p class="as-body">
This content is here to fill up more space.
</p>
</section>
<section class="as-box as-box--xlarge">
<h1 class="as-title">A xlarge box</h1>
<p class="as-body">
This content is here to fill up more space.
</p>
</section>
</div>
</main>
</div>
<script src="../layouts/common/map.js"></script>
<script src="../layouts/common/tabs.js"></script>
</body>
</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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Bottom bar</title>
<link rel="stylesheet" href="https://libs.cartocdn.com/airship-style/v2.4.1/airship.css">
<!-- CARTO.js -->
<!-- Include Leaflet -->
<script src="https://unpkg.com/leaflet@1.3.1/dist/leaflet.js"></script>
<link href="https://unpkg.com/leaflet@1.3.1/dist/leaflet.css" rel="stylesheet">
<!-- Include CARTO.js -->
<script src="https://libs.cartocdn.com/carto.js/v4.1/carto.min.js"></script>
<link href="https://carto.com/developers/carto-js/examples/maps/public/style.css" rel="stylesheet">
<!-- / CARTO.js -->
</head>
<body class="as-app-body as-app">
<div role="tablist" class="as-toolbar-tabs as-tabs">
<button onclick="showMap(event)" role="tab" class="as-tabs__item as-tabs__item--active">MAP</button>
<button onclick="showLegendsPanel(event); setActiveTab(event.target);" role="tab" class="as-tabs__item">LEGENDS</button>
</div>
<div class="as-content">
<main class="as-main">
<div class="as-map-area">
<div id="map"></div>
<div class="as-map-panels">
<div class="as-panel as-panel--top as-panel--left">
<div class="as-panel__element">
<section class="as-box">
<p class="as-title">LEGENDS</p>
<p class="as-body">
There are no special containers for legends. Just add an 'as-box' element to an 'as-panel__element'
</p>
</section>
<section class="as-box">
<p class="as-title">LEGEND 2</p>
<p class="as-body">
In responsive view, all panels will stack up in its own page.
</p>
</section>
</div>
</div>
<div class="as-panel as-panel--top as-panel--right as-panel--vertical">
<div class="as-panel__element">
<section class="as-box">
<p class="as-title">LEGEND 3</p>
<p class="as-body">
Legen... wait for it... dary!
</p>
</section>
</div>
</div>
</div>
</div>
</main>
</div>
<script src="../layouts/common/map.js"></script>
<script src="../layouts/common/tabs.js"></script>
</body>
</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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Sidebar</title>
<link rel="stylesheet" href="https://libs.cartocdn.com/airship-style/v2.4.1/airship.css">
<!-- CARTO.js -->
<!-- Include Leaflet -->
<script src="https://unpkg.com/leaflet@1.3.1/dist/leaflet.js"></script>
<link href="https://unpkg.com/leaflet@1.3.1/dist/leaflet.css" rel="stylesheet">
<!-- Include CARTO.js -->
<script src="https://libs.cartocdn.com/carto.js/v4.1/carto.min.js"></script>
<link href="https://carto.com/developers/carto-js/examples/maps/public/style.css" rel="stylesheet">
<!-- / CARTO.js -->
</head>
<body class="as-app-body as-app">
<div role="tablist" class="as-toolbar-tabs as-tabs">
<button onclick="showMap(event)" role="tab" class="as-tabs__item as-tabs__item--active">MAP</button>
<button onclick="showRightPanel(event)" role="tab" class="as-tabs__item">RIGHT</button>
</div>
<div class="as-content">
<main class="as-main">
<div class="as-map-area">
<div id="map"></div>
</div>
</main>
<aside class="as-sidebar as-sidebar--right as-bg--warning as-color--type-04">
<div class="as-container as-container--border">
<section class="as-box">
<h1 class="as-title">Fixed container</h1>
<p class="as-body">Use this container when you need to present fixed content. This content will occupy as much vertical space as needed.</p>
</section>
</div>
<div class="as-container as-container--scrollable">
<section class="as-box">
<h1 class="as-title">Scrollable container</h1>
<p class="as-body">
When you need to present lots of content that don't fit in the available space, use a scrollable container. It'll take the space left by the fixed containers.
</p>
</section>
<section class="as-box">
<h1 class="as-title">A box</h1>
<p class="as-body">
This content is here to fill up more space than available so you can scroll.
</p>
</section>
<section class="as-box">
<h1 class="as-title">A box</h1>
<p class="as-body">
This content is here to fill up more space than available so you can scroll.
</p>
</section>
<section class="as-box">
<h1 class="as-title">A box</h1>
<p class="as-body">
This content is here to fill up more space than available so you can scroll.
</p>
</section>
<section class="as-box">
<h1 class="as-title">A box</h1>
<p class="as-body">
This content is here to fill up more space than available so you can scroll.
</p>
</section>
</div>
</aside>
</div>
<script src="../layouts/common/map.js"></script>
<script src="../layouts/common/tabs.js"></script>
</body>
</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
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Default Theme</title>
<link href="https://fonts.googleapis.com/css?family=Montserrat" rel="stylesheet">
<link rel="stylesheet" href="https://libs.cartocdn.com/airship-style/v2.4.1/airship.css">
<link rel="stylesheet" href="https://libs.cartocdn.com/airship-icons/v2.4.1/icons.css">
<script type="module" src="https://libs.cartocdn.com/airship-components/v2.4.1/airship/airship.esm.js"></script>
<script nomodule="" src="https://libs.cartocdn.com/airship-components/v2.4.1/airship/airship.js"></script>
</head>
<style>
as-infowindow {
position: absolute;
top: 30px;
left: 30px;
}
.as-map-area {
background: #B5E0F9;
}
</style>
<body class="as-app-body as-app">
<as-toolbar>
<div class="as-toolbar__item">
<img src="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzJweCIgaGVpZ2h0PSIzMnB4IiB2aWV3Qm94PSI3NjIgLTU4IDMyIDMyIiB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiPgogIDxnIHN0cm9rZT0ibm9uZSIgc3Ryb2tlLXdpZHRoPSIxIiBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDc2Mi4wMDAwMDAsIC01OC4wMDAwMDApIj4KICAgIDxjaXJjbGUgY2xhc3M9IkhhbG8iIGZpbGw9IiNGRkZGRkYiIG9wYWNpdHk9IjAuMiIgY3g9IjE2IiBjeT0iMTYiIHI9IjE2Ij48L2NpcmNsZT4KICAgIDxjaXJjbGUgY2xhc3M9InBvaW50IiBmaWxsPSIjRkZGRkZGIiBjeD0iMTYiIGN5PSIxNiIgcj0iNS41Ij48L2NpcmNsZT4KICA8L2c+Cjwvc3ZnPgo="
alt="Logo" />
</div>
<p class="as-toolbar__item">Paragraph</p>
<a href="./default.html" class="as-toolbar__item">Default Theme</a>
<a href="./light.html" class="as-toolbar__item">Light Theme</a>
<a href="./dark.html" class="as-toolbar__item">Dark Theme</a>
<i class="as-toolbar__item as-icon as-icon-points"></i>
</as-toolbar>
<as-responsive-content>
<aside class="as-sidebar as-sidebar--left as-sidebar--left--l">
<div class="as-container">
<as-tabs>
<div class="as-p--12" role="tabpanel" data-title="Styles">
<section>
<h2 class="as-subheader">Badges</h2>
<span class="as-badge as-bg--badge-blue">Blue</span>
<span class="as-badge as-bg--badge-gray">Gray</span>
<span class="as-badge as-bg--badge-green">Green</span>
<span class="as-badge as-bg--badge-pink">Pink</span>
<span class="as-badge as-bg--badge-yellow">Yellow</span>
</section>
<br />
<section>
<h2 class="as-subheader">Breadcrumbs</h2>
<ul class="as-breadcrumb">
<li class="as-breadcrumb__item">
<a href="#">Home</a>
</li>
<li class="as-breadcrumb__item">
<a href="#">Users</a>
</li>
<li class="as-breadcrumb__item">
New user
</li>
</ul>
</section>
<br />
<section>
<h2 class="as-subheader">Buttons</h2>
<button class="as-btn as-m--4"> I'm a regular button</button>
<button class="as-btn as-btn--primary as-m--4"> I'm a primary button</button>
<button class="as-btn as-btn--secondary as-m--4"> I'm a secondary button</button>
<button class="as-btn as-btn--complementary as-m--4"> I'm a complementary button</button>
<button disabled class="as-btn as-m--4"> I'm a disabled base button</button>
<button disabled class="as-btn as-btn--primary as-m--4"> I'm a disabled primary button</button>
<button disabled class="as-btn as-btn--secondary as-m--4"> I'm a disabled secondary button</button>
<a class="as-btn as-m--4"> I'm a regular a</a>
<a class="as-btn as-btn--primary as-m--4"> I'm a primary a</a>
<a class="as-btn as-btn--secondary as-m--4"> I'm a secondary a</a>
</section>
<br />
<section>
<button class="as-btn as-btn--primary as-m--4">
<i class="as-icon as-icon-plus"></i>
<p>Icon button</p>
</button>
<button class="as-btn as-btn--secondary as-m--4">
<p>Icon button</p>
<i aria-hidden class="as-icon as-icon-twitter"></i>
</button>
<div class="as-button-group as-m--4" role="group">
<button aria-label="twitter" class="as-btn as-btn--secondary">
<i aria-hidden class="as-icon as-icon-twitter"></i>
</button>
<button aria-label="facebook" class="as-btn as-btn--secondary">
<i aria-hidden class="as-icon as-icon-facebook"></i>
</button>
<button aria-label="home" class="as-btn as-btn--secondary">
<i aria-hidden class="as-icon as-icon-home"></i>
</button>
</div>
</section>
<br />
<section>
<ul class="as-list--simple">
<li class="as-radio">
<input class="as-radio__input" type="radio" name="contact" id="first" value="first" checked />
<label class="as-caption" for="first">First</label>
</li>
<li class="as-radio">
<input class="as-radio__input" type="radio" name="contact" id="second" value="second" />
<label class="as-caption" for="second">Second</label>
</li>
<li class="as-radio">
<input class="as-radio__input" type="radio" name="contact" id="third" value="third" disabled />
<label class="as-caption" for="third">Third</label>
</li>
<li class="as-radio">
<input class="as-radio__input" type="radio" name="contact2" id="fourth" value="fourth" checked disabled />
<label class="as-caption" for="fourth">Fourth</label>
</li>
</ul>
</section>
<section>
<div class="as-checkbox">
<input class="as-checkbox-input" type="checkbox" id="checkbox-0" name="checkbox-0" value="checkbox-0">
<span class="as-checkbox-decoration">
<svg class="as-checkbox-media">
<polyline class="as-checkbox-check" points="1.65093994 3.80255127 4.48919678 6.97192383 10.3794556 0.717346191"></polyline>
</svg>
</span>
<label class="as-caption" for="checkbox-0"> Checkbox</label>
</div>
<div class="as-checkbox">
<input class="as-checkbox-input as-checkbox-input--error" type="checkbox" id="checkbox3" name="checkbox3" value="checkbox3">
<span class="as-checkbox-decoration">
<svg class="as-checkbox-media">
<polyline class="as-checkbox-check" points="1.65093994 3.80255127 4.48919678 6.97192383 10.3794556 0.717346191"></polyline>
</svg>
</span>
<label class="as-caption" for="checkbox3"> Checkbox Error</label>
</div>
<div class="as-checkbox">
<input disabled class="as-checkbox-input" type="checkbox" id="checkbox2" name="checkbox2" value="checkbox2">
<span class="as-checkbox-decoration">
<svg class="as-checkbox-media">
<polyline class="as-checkbox-check" points="1.65093994 3.80255127 4.48919678 6.97192383 10.3794556 0.717346191"></polyline>
</svg>
</span>
<label class="as-caption" for="checkbox2"> Checkbox Disabled</label>
</div>
<div class="as-checkbox">
<input disabled checked class="as-checkbox-input" type="checkbox" id="checkbox2" name="checkbox2" value="checkbox2">
<span class="as-checkbox-decoration">
<svg class="as-checkbox-media">
<polyline class="as-checkbox-check" points="1.65093994 3.80255127 4.48919678 6.97192383 10.3794556 0.717346191"></polyline>
</svg>
</span>
<label class="as-caption" for="checkbox2"> Checkbox Disabled</label>
</div>
<div class="as-checkbox">
<input disabled class="as-checkbox-input as-checkbox-input--error" type="checkbox" id="checkbox3" name="checkbox3" value="checkbox3">
<span class="as-checkbox-decoration">
<svg class="as-checkbox-media">
<polyline class="as-checkbox-check" points="1.65093994 3.80255127 4.48919678 6.97192383 10.3794556 0.717346191"></polyline>
</svg>
</span>
<label class="as-caption" for="checkbox3"> Checkbox Error Disabled</label>
</div>
<div class="as-checkbox">
<input disabled checked class="as-checkbox-input as-checkbox-input--error" type="checkbox" id="checkbox3" name="checkbox3" value="checkbox3">
<span class="as-checkbox-decoration">
<svg class="as-checkbox-media">
<polyline class="as-checkbox-check" points="1.65093994 3.80255127 4.48919678 6.97192383 10.3794556 0.717346191"></polyline>
</svg>
</span>
<label class="as-caption" for="checkbox3"> Checkbox Error Disabled Checked</label>
</div>
</section>
<br />
<section>
<p>
<span class="as-caption">Default</span>
<input class="as-input" type="text">
</p>
<p>
<span class="as-caption">With placeholder</span>
<input class="as-input" type="text" placeholder="Hello there">
</p>
<p>
<span class="as-caption">With value</span>
<input class="as-input" type="text" value="Hello there">
</p>
<p>
<span class="as-caption">Default</span>
<input class="as-input" type="text" disabled>
</p>
<p>
<span class="as-caption">With placeholder</span>
<input class="as-input" type="text" placeholder="Hello there" disabled>
</p>
<p>
<span class="as-caption">With value</span>
<input class="as-input" type="text" value="Hello there" disabled>
</p>
<p>
<span class="as-caption">Default</span>
<input class="as-input" type="text" readonly>
</p>
<p>
<span class="as-caption">With placeholder</span>
<input class="as-input" type="text" placeholder="Hello there" readonly>
</p>
<p>
<span class="as-caption">With value</span>
<input class="as-input" type="text" value="Hello there" readonly>
</p>
<p>
<span class="as-caption">Default</span>
<input class="as-input" type="text" required>
</p>
<p>
<span class="as-caption">With placeholder</span>
<input class="as-input" type="text" placeholder="Hello there" required>
</p>
<p>
<span class="as-caption">With value</span>
<input class="as-input" type="email" value="Hello there">
</p>
<p>
<span class="as-caption">Textarea</span>
<textarea class="as-textarea" rows="4" required></textarea>
</p>
</section>
<section>
<span class="as-loading">
<svg viewBox="0 0 50 50">
<circle cx="25" cy="25" r="20" fill="none" />
</svg>
</span>
</section>
</div>
<div class="as-p--12" role="tabpanel" data-title="Table">
<as-responsive-content>
<table class="as-table as-table--stripped">
<thead>
<tr>
<th>Food</th>
<th>Calories</th>
</tr>
</thead>
<tbody>
<tr>
<td>Cookies</td>
<td>345</td>
</tr>
<tr>
<td>Chocolate</td>
<td>600</td>
</tr>
<tr>
<td>Carrot cake</td>
<td>250</td>
</tr>
</tbody>
</table>
</as-responsive-content>
</div>
<div class="as-p--12" role="tabpanel" data-title="Switch">
<h2 class="as-title">Switch</h2>
<as-switch label="Test me"></as-switch>
</div>
<div class="as-p--12" role="tabpanel" data-title="Tooltips">
<h2 class="as-title">Tooltips</h2>
<ul class="as-list--simple">
<li class="as-m--16"><span role="tooltip" class="as-tooltip as-tooltip--left as-bg--color-blue">Tooltip left</span></li>
<li class="as-m--16"><span role="tooltip" class="as-tooltip as-tooltip--right">Tooltip right</span></li>
<li class="as-m--16"><span role="tooltip" class="as-tooltip as-tooltip--top">Tooltip top</span></li>
<li class="as-m--16"><span role="tooltip" class="as-tooltip as-tooltip--bottom">Tooltip bottom</span></li>
<li class="as-m--16"><span role="tooltip" class="as-tooltip as-tooltip--top as-tooltip--error">Error</span></li>
<li class="as-m--16"><span role="tooltip" class="as-tooltip as-tooltip--top as-tooltip--warning">Warning</span></li>
<li class="as-m--16"><span role="tooltip" class="as-tooltip as-tooltip--top as-tooltip--success">Success</span></li>
<li class="as-m--16"><span role="tooltip" class="as-tooltip as-tooltip--top as-tooltip--primary">Primary</span></li>
<li class="as-m--16"><span role="tooltip" class="as-tooltip as-tooltip--top as-tooltip--secondary">Secondary</span></li>
<li class="as-m--16"><span role="tooltip" class="as-tooltip as-tooltip--top as-tooltip--complementary">Complementary</span></li>
</ul>
</div>
<div class="as-p--12" role="tabpanel" data-title="Modal">
<h2 class="as-title">Modal</h2>
<button class="as-btn as-btn--primary as-m--4" id="js-button-modal">
Open modal
</button>
</div>
<div class="as-p--12" role="tabpanel" data-title="Range slider">
<h2 class="as-title">Range slider</h2>
<as-range-slider></as-range-slider>
</div>
<div class="as-p--12" role="tabpanel" data-title="Dropdown">
<h2 class="as-title">Dropdown</h2>
<as-dropdown default-text="Dropdown" can-clear="true"></as-dropdown>
<br />
<h2 class="as-title">Menu dropdown</h2>
<div style="width: 240px;" class="as-menu-dropdown">
<button aria-haspopup="listbox" class="as-menu-dropdown--input"> I'm a dropdown </button>
<ul tabindex="-1" class="as-menu-dropdown--options">
<li>
<button>All</button>
</li>
<li>
<button>spent</button>
</li>
<li>
<button>Loaded</button>
</li>
<li>
<button>Waiting</button>
</li>
</ul>
</div>
</div>
<div class="as-p--12" role="tabpanel" data-title="Banner">
<div class="as-banner">
<div class="as-banner__icon">
<i class="as-icon as-icon-info"></i>
</div>
<div class="as-banner__content">This is the default banner without any support colors</div>
</div>
<div class="as-banner as-banner--success">
<div class="as-banner__icon">
<i class="as-icon as-icon-tick-circle-fill"></i>
</div>
<div class="as-banner__content">Your profile settings have been updated successfully</div>
</div>
<div class="as-banner as-banner--warning">
<div class="as-banner__icon">
<i class="as-icon as-icon-alert-fill"></i>
</div>
<div class="as-banner__content">It seems like you're over platforms limits, please contact us or upgrade your account plan</div>
</div>
<div class="as-banner as-banner--error">
<div class="as-banner__icon">
<i class="as-icon as-icon-alert-fill"></i>
</div>
<div class="as-banner__content">An error has ocurred. Could not retreive customer information</div>
</div>
</div>
</as-tabs>
</div>
</aside>
<main class="as-main">
<div class="as-map-area">
<div id="map"></div>
<div class="as-map-panels">
<div class="as-panel as-panel--top as-panel--right">
<div class="as-panel__element">
<div class="as-box">
<p class="as-body">This is a panel example</p>
</div>
</div>
</div>
</div>
<as-infowindow src="http://on-desktop.com/wps/Animals___Cats_Black_Cat_Panther_043844_.jpg">
<h2 class="as-title">Cat</h2>
<p>
<span class="as-badge">mammal</span>
<span class="as-badge as-bg--badge-pink">carnivorous</span>
</p>
<p class="as-body">
The domestic cat is a small, typically furry, carnivorous mammal. They are often called house cats when
kept as indoor pets or simply cats when there is no need to distinguish them from other felids and felines.
</p>
</as-infowindow>
</div>
<footer class="as-map-footer as-p--12">
<div class="as-box">
<as-stacked-bar-widget id="widget-0" show-legend="true" heading="Star Wars Revenue" description="Description"></as-stacked-bar-widget>
</div>
<div class="as-box">
<as-histogram-widget heading="Title" description="Description" show-header show-clear-button></as-histogram-widget>
</div>
</footer>
</main>
<aside class="as-sidebar as-sidebar--right as-sidebar--l">
<div class="as-container">
<as-category-widget class="as-p--16" heading="Business Volume" description="Description"></as-category-widget>
</div>
</aside>
</as-responsive-content>
<div id="js-modal" class="as-modal--hidden">
<div class="as-modal__content">
<a style="position: absolute; right: 12px; top: 12px;" id="js-button-modal-close" class="as-btn">Close</a>
<h2 class="as-title">This is a modal</h2>
<p class="as-body">
Lorem ipsum dolor sit amet consectetur adipisicing elit. Totam suscipit sequi provident maxime illum possimus debitis, at
natus voluptatem praesentium itaque sunt commodi odio incidunt fugiat, cupiditate ipsum officiis eligendi?
</p>
<hr>
<h2 class="as-subheader">I have padding</h2>
<p class="as-body">
Lorem ipsum dolor sit, amet consectetur adipisicing elit. Atque voluptas vitae praesentium itaque corporis, soluta iure optio
labore minus modi ab quibusdam accusamus delectus dolores rem impedit cupiditate tenetur illum?
</p>
</div>
</div>
<script>
function feedRangeSlider () {
var rangeSliderWidget = document.querySelector('as-range-slider');
rangeSliderWidget.minValue = 10;
rangeSliderWidget.maxValue = 20;
rangeSliderWidget.value = 12;
rangeSliderWidget.step = 2;
}
function feedDropdown () {
const dropdown = document.querySelector('as-dropdown');
dropdown.options = [
{
text: 'All',
value: 'all'
},
{
text: 'Open',
value: 'open'
},
{
text: 'Unfulfilled',
value: 'unfulfilled'
},
{
text: 'Unpaid',
value: 'unpaid'
}
];
}
function feedHistogram () {
const widget0 = document.querySelector('as-stacked-bar-widget');
widget0.data = [{
category: 'Star Wars Ep. IV: A New Hope',
values: {
dvd: 27229125,
blue: 3555058,
}
},
{
category: 'Star Wars Ep. V: The Empire Strikes Back',
values: {
dvd: 24928640,
blue: 2738207,
},
},
{
category: 'Star Wars Ep. VI: Return of the Jedi',
values: {
dvd: 23786454,
blue: 1908593,
}
}
];
widget0.metadata = {
dvd: {
label: 'Domestic DVD Sales',
color: '#17b0ff'
},
blue: {
label: 'Domestic Blu-ray Sales',
color: '#17ff66'
}
}
var histogramWidget = document.querySelector('as-histogram-widget');
histogramWidget.data = [{
start: 0,
end: 10,
value: 5
},
{
start: 10,
end: 20,
value: 10
},
{
start: 20,
end: 30,
value: 15
},
{
start: 30,
end: 40,
value: 20
},
{
start: 40,
end: 50,
value: 30
},
];
}
function feedCategories () {
const categoryWidget = document.querySelector('as-category-widget');
categoryWidget.showHeader = true;
categoryWidget.showClearButton = true;
categoryWidget.useTotalPercentage = false;
categoryWidget.visibleCategories = Infinity;
categoryWidget.categories = [{
name: 'Bars & Restaurants',
value: 1000
},
{
name: 'Fashion',
value: 900
},
{
name: 'Grocery',
value: 800
},
{
name: 'Health',
value: 400
},
{
name: 'Shopping mall',
value: 250
},
{
name: 'Transportation',
value: 1000
},
{
name: 'Leisure',
value: 760
}
];
}
function setModal() {
const jsButtonModal = document.getElementById('js-button-modal');
const jsButtonModalClose = document.getElementById('js-button-modal-close');
const jsModal = document.getElementById('js-modal');
jsButtonModal.addEventListener('click', function() {
jsModal.classList.remove('as-modal--hidden');
jsModal.classList.add('as-modal');
});
jsButtonModalClose.addEventListener('click', function() {
jsModal.classList.remove('as-modal');
jsModal.classList.add('as-modal--hidden');
});
}
function onLoad () {
feedRangeSlider();
feedDropdown();
feedHistogram();
feedCategories();
setModal();
};
const responsiveContent = document.querySelector('as-responsive-content');
responsiveContent.addEventListener('ready', onLoad);
</script>
</body>
</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
<!DOCTYPE html>
<html dir="ltr" lang="en">
<head>
<base href="/">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=5.0">
<title>Airship</title>
<link rel="stylesheet" href="https://libs.cartocdn.com/airship-style/v2.4.1/airship.css">
<script type="module" src="https://libs.cartocdn.com/airship-components/v2.4.1/airship/airship.esm.js"></script>
<script nomodule="" src="https://libs.cartocdn.com/airship-components/v2.4.1/airship/airship.js"></script>
</head>
<body>
<as-category-widget
class="as-p--16"
heading="Business Volume"
description="Description"></as-category-widget>
<script>
var categoryWidget = document.querySelector('as-category-widget');
categoryWidget.showClearButton = true;
categoryWidget.categories = [
{ name: 'Bars & Restaurants', value: 1000 },
{ name: 'Fashion', value: 900 },
{ name: 'Grocery', value: 800 },
{ name: 'Health', value: 400 },
{ name: 'Shopping mall', value: 250 },
{ name: 'Transportation', value: 1000 },
{ name: 'Leisure', value: 760 }
];
</script>
</body>
</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
<!DOCTYPE html>
<html dir="ltr" lang="en">
<head>
<base href="/">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=5.0">
<title>Airship</title>
<link rel="stylesheet" href="https://libs.cartocdn.com/airship-style/v2.4.1/airship.css">
<script type="module" src="https://libs.cartocdn.com/airship-components/v2.4.1/airship/airship.esm.js"></script>
<script nomodule="" src="https://libs.cartocdn.com/airship-components/v2.4.1/airship/airship.js"></script>
</head>
<body>
<as-category-widget
class="as-p--16"
heading="Business Volume"
description="Description"
visible-categories="5"
disable-interactivity></as-category-widget>
<script>
var categoryWidget = document.querySelector('as-category-widget');
categoryWidget.categories = [
{ name: 'Bars & Restaurants', value: 1000 },
{ name: 'Fashion', value: 900 },
{ name: 'Grocery', value: 800 },
{ name: 'Health', value: 400 },
{ name: 'Shopping mall', value: 250 },
{ name: 'Transportation', value: 1000 },
{ name: 'Leisure', value: 760 }
];
</script>
</body>
</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
<!DOCTYPE html>
<html dir="ltr" lang="en">
<head>
<base href="/">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=5.0">
<title>Airship</title>
<link rel="stylesheet" href="https://libs.cartocdn.com/airship-style/v2.4.1/airship.css">
<script type="module" src="https://libs.cartocdn.com/airship-components/v2.4.1/airship/airship.esm.js"></script>
<script nomodule="" src="https://libs.cartocdn.com/airship-components/v2.4.1/airship/airship.js"></script>
</head>
<body>
<as-category-widget
class="as-p--16"
heading="Business Volume"
description="Description"
default-bar-color="#47DB99"></as-category-widget>
<script>
const categoryWidget = document.querySelector('as-category-widget');
categoryWidget.showClearButton = false;
categoryWidget.useTotalPercentage = true;
categoryWidget.visibleCategories = 2;
categoryWidget.categories = [
{ name: 'Bars & Restaurants', value: 1000, color: '#FABADA' },
{ name: 'Fashion', value: 900 },
{ name: 'Grocery', value: 800 },
{ name: 'Health', value: 400 },
{ name: 'Shopping mall', value: 250 },
{ name: 'Transportation', value: 1000 },
{ name: 'Leisure', value: 760 }
];
</script>
</body>
</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
<!DOCTYPE html>
<html dir="ltr" lang="en">
<head>
<base href="/">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=5.0">
<title>Airship</title>
<link rel="stylesheet" href="https://libs.cartocdn.com/airship-style/v2.4.1/airship.css">
<script type="module" src="https://libs.cartocdn.com/airship-components/v2.4.1/airship/airship.esm.js"></script>
<script nomodule="" src="https://libs.cartocdn.com/airship-components/v2.4.1/airship/airship.js"></script>
</head>
<body>
<as-category-widget
class="as-p--16"
heading="Business Volume"
description="Description"
default-bar-color="#47DB99"></as-category-widget>
<script>
const categoryWidget = document.querySelector('as-category-widget');
categoryWidget.showClearButton = true;
categoryWidget.showHeader = false;
categoryWidget.visibleCategories = 5;
categoryWidget.categories = [
{ name: 'Bars & Restaurants', value: 1000, color: '#FABADA' },
{ name: 'Fashion', value: 900 },
{ name: 'Grocery', value: 800 },
{ name: 'Health', value: 400 },
{ name: 'Shopping mall', value: 250 },
{ name: 'Transportation', value: 1000 },
{ name: 'Leisure', value: 760 }
];
</script>
</body>
</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
<!DOCTYPE html>
<html dir="ltr" lang="en">
<head>
<base href="/">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=5.0">
<title>Airship</title>
<link rel="stylesheet" href="../../../packages/styles/dist/core/core.css">
<script type="module" src="https://libs.cartocdn.com/airship-components/v2.4.1/airship/airship.esm.js"></script>
<script nomodule="" src="https://libs.cartocdn.com/airship-components/v2.4.1/airship/airship.js"></script>
</head>
<body>
<as-dropdown default-text="Dropdown" can-clear="true"></as-dropdown>
<script>
const dropdown = document.querySelector('as-dropdown');
dropdown.options = [
{ text: 'All', value: 'all' },
{ text: 'Open', value: 'open' },
{ text: 'Unfulfilled', value: 'unfulfilled' },
{ text: 'Unpaid', value: 'unpaid' }
];
</script>
</body>
</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
<!DOCTYPE html>
<html dir="ltr" lang="en">
<head>
<base href="/">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=5.0">
<title>Airship</title>
<link rel="stylesheet" href="https://libs.cartocdn.com/airship-style/v2.4.1/airship.css">
<script type="module" src="https://libs.cartocdn.com/airship-components/v2.4.1/airship/airship.esm.js"></script>
<script nomodule="" src="https://libs.cartocdn.com/airship-components/v2.4.1/airship/airship.js"></script>
</head>
<body>
<div style="width: 250px;">
<as-histogram-widget
heading="Title"
description="Description"
show-header
show-clear-button>
</as-histogram-widget>
</div>
<script>
var histogramWidget = document.querySelector('as-histogram-widget');
histogramWidget.data = [
{ start: 0, end: 10, value: 5 },
{ start: 10, end: 20, value: 10 },
{ start: 20, end: 30, value: 15 },
{ start: 30, end: 40, value: 20 },
{ start: 40, end: 50, value: 30 },
];
</script>
</body>
</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
<!DOCTYPE html>
<html dir="ltr" lang="en">
<head>
<base href="/">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=5.0">
<title>Airship</title>
<link rel="stylesheet" href="https://libs.cartocdn.com/airship-style/v2.4.1/airship.css">
<script type="module" src="https://libs.cartocdn.com/airship-components/v2.4.1/airship/airship.esm.js"></script>
<script nomodule="" src="https://libs.cartocdn.com/airship-components/v2.4.1/airship/airship.js"></script>
</head>
<body>
<div style="width: 250px;">
<as-histogram-widget
show-header="false"
show-clear-button>
</as-histogram-widget>
</div>
<p id="selection">Nothing selected</p>
<script>
var histogramWidget = document.querySelector('as-histogram-widget');
histogramWidget.data = [
{ start: 0, end: 10, value: 5 },
{ start: 10, end: 20, value: 10 },
{ start: 20, end: 30, value: 15 },
{ start: 30, end: 40, value: 20 },
{ start: 40, end: 50, value: 30 },
];
histogramWidget.tooltipFormatter = function (data) {
return histogramWidget.defaultFormatter(data).then((formatted) => {
formatted[1] = `${formatted[1]} kg`;
return formatted;
});
};
var selectionEl = document.querySelector('#selection');
histogramWidget.addEventListener('selectionChanged', function (e) {
console.log('selectionChanged');
if (e.detail === null) {
selectionEl.innerText = 'Nothing selected';
} else {
selectionEl.innerText = 'Selected from ' + e.detail.selection[0] + ' to ' + e.detail.selection[1];
}
});
</script>
</body>
</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
<!DOCTYPE html>
<html dir="ltr" lang="en">
<head>
<base href="/">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=5.0">
<title>Airship</title>
<link rel="stylesheet" href="https://libs.cartocdn.com/airship-style/v2.4.1/airship.css">
<script type="module" src="https://libs.cartocdn.com/airship-components/v2.4.1/airship/airship.esm.js"></script>
<script nomodule="" src="https://libs.cartocdn.com/airship-components/v2.4.1/airship/airship.js"></script>
</head>
<body>
<div style="width: 250px;">
<as-histogram-widget
heading="Title"
description="Description"
show-header
show-clear-button
disable-interactivity>
</as-histogram-widget>
</div>
<script>
var histogramWidget = document.querySelector('as-histogram-widget');
histogramWidget.data = [
{ start: 0, end: 10, value: 5 },
{ start: 10, end: 20, value: 10 },
{ start: 20, end: 30, value: 15 },
{ start: 30, end: 40, value: 20 },
{ start: 40, end: 50, value: 30 },
];
</script>
</body>
</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
<!DOCTYPE html>
<html dir="ltr" lang="en">
<head>
<base href="/">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=5.0">
<title>Airship</title>
<link rel="stylesheet" href="https://libs.cartocdn.com/airship-style/v2.4.1/airship.css">
<script type="module" src="https://libs.cartocdn.com/airship-components/v2.4.1/airship/airship.esm.js"></script>
<script nomodule="" src="https://libs.cartocdn.com/airship-components/v2.4.1/airship/airship.js"></script>
</head>
<body>
<div style="width: 250px;">
<as-histogram-widget
heading="Title"
show-header
show-clear-button>
</as-histogram-widget>
</div>
<script>
var histogramWidget = document.querySelector('as-histogram-widget');
var data = [
{ start: 0, end: 10, value: 5 },
{ start: 10, end: 20, value: 10 },
{ start: 20, end: 30, value: 15 },
{ start: 30, end: 40, value: 20 },
{ start: 40, end: 50, value: 30 },
];
histogramWidget.data = data;
histogramWidget.backgroundData = data.map(function (value) {
return ({
start: value.start,
end: value.end,
value: value.value * 1.33
});
});
</script>
</body>
</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
<!DOCTYPE html>
<html dir="ltr" lang="en">
<head>
<base href="/">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=5.0">
<title>Airship</title>
<link rel="stylesheet" href="https://libs.cartocdn.com/airship-style/v2.4.1/airship.css">
<script type="module" src="https://libs.cartocdn.com/airship-components/v2.4.1/airship/airship.esm.js"></script>
<script nomodule="" src="https://libs.cartocdn.com/airship-components/v2.4.1/airship/airship.js"></script>
</head>
<body>
<div style="width: 250px;">
<as-histogram-widget
heading="Title"
show-header
show-clear-button>
</as-histogram-widget>
</div>
<script>
var histogramWidget = document.querySelector('as-histogram-widget');
var data = [
{ category: 'Category A', value: 5 },
{ category: 'Category B', value: 10 },
{ category: 'Category C', value: 15 },
{ category: 'Category D', value: 20 },
{ category: 'Category E', value: 30 },
];
histogramWidget.data = data;
histogramWidget.backgroundData = data.map(function (value) {
return ({
category: value.category,
value: value.value * 1.33
});
});
</script>
</body>
</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
<!DOCTYPE html>
<html dir="ltr" lang="en">
<head>
<base href="/">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=5.0">
<title>Airship</title>
<link rel="stylesheet" href="https://libs.cartocdn.com/airship-style/v2.4.1/airship.css">
<script type="module" src="https://libs.cartocdn.com/airship-components/v2.4.1/airship/airship.esm.js"></script>
<script nomodule="" src="https://libs.cartocdn.com/airship-components/v2.4.1/airship/airship.js"></script>
</head>
<body>
<div style="width: 250px;">
<as-histogram-widget
show-header="false"
show-clear-button>
</as-histogram-widget>
</div>
<p id="selection">Nothing selected</p>
<script>
var histogramWidget = document.querySelector('as-histogram-widget');
histogramWidget.data = [
{ start: 0, end: 10, value: 5 },
{ start: 10, end: 20, value: 10 },
{ start: 20, end: 30, value: 15 },
{ start: 30, end: 40, value: 20 },
{ start: 40, end: 50, value: 30 },
];
histogramWidget.tooltipFormatter = function (data) {
return Promise.all(
[histogramWidget.xFormatter(data.start), histogramWidget.xFormatter(data.end), histogramWidget.defaultFormatter(data)]
).then((value) => {
return [
`From ${value[0]} to ${value[1]}`,
value[1] + ' kg'
]
});
}
</script>
</body>
</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
<!DOCTYPE html>
<html dir="ltr" lang="en">
<head>
<base href="/">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=5.0">
<title>Airship</title>
<link rel="stylesheet" href="https://libs.cartocdn.com/airship-style/v2.4.1/airship.css">
<script type="module" src="https://libs.cartocdn.com/airship-components/v2.4.1/airship/airship.esm.js"></script>
<script nomodule="" src="https://libs.cartocdn.com/airship-components/v2.4.1/airship/airship.js"></script>
</head>
<body>
<div>
<button class="as-btn as-btn--primary js-data">Click to toggle data</button>
<p class="as-body">Note how on the first histogram, the bar height remains consistent and on the second histogram the bar height is adapted to the new data.</p>
<p class="as-caption">This feature is useful to have more context when filtering or showing a subset of data.</p>
</div>
<div style="width: 500px; margin-top: 16px; display: flex;">
<as-histogram-widget
id="withRange"
heading="With custom range"
show-header
disable-interactivity>
</as-histogram-widget>
<as-histogram-widget
id="withoutRange"
heading="Without custom range"
color="#FABADA"
show-header
disable-interactivity>
</as-histogram-widget>
</div>
<script>
var histogramWidgetWithRange = document.querySelector('#withRange');
var histogramWidgetWithoutRange = document.querySelector('#withoutRange');
var newData = false;
var data = [
{ start: 0, end: 10, value: 0 },
{ start: 10, end: 20, value: 10 },
{ start: 20, end: 30, value: 15 },
{ start: 30, end: 40, value: 20 },
{ start: 40, end: 50, value: 30 },
];
var secondData = [
{ start: 0, end: 10, value: 0 },
{ start: 10, end: 20, value: 10 },
{ start: 20, end: 30, value: 15 },
{ start: 30, end: 40, value: 0 },
{ start: 40, end: 50, value: 0 },
];
histogramWidgetWithRange.range = [0, 30];
histogramWidgetWithRange.data = data;
histogramWidgetWithoutRange.data = data;
document.querySelector('.js-data').addEventListener('click', function () {
histogramWidgetWithRange.data = newData ? data : secondData;
histogramWidgetWithoutRange.data = newData ? data : secondData;
newData = !newData;
});
</script>
</body>
</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
<!DOCTYPE html>
<html dir="ltr" lang="en">
<head>
<base href="/">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=5.0">
<title>Airship</title>
<link rel="stylesheet" href="https://libs.cartocdn.com/airship-style/v2.4.1/airship.css">
<script type="module" src="https://libs.cartocdn.com/airship-components/v2.4.1/airship/airship.esm.js"></script>
<script nomodule="" src="https://libs.cartocdn.com/airship-components/v2.4.1/airship/airship.js"></script>
<style>
as-histogram-widget {
flex: 1;
min-width: 200px;
}
</style>
</head>
<body>
<h2 class="as-title">Y-Axis options</p>
<div style="display: flex; flex-wrap: wrap;">
<as-histogram-widget
id="y1"
heading="With custom tick values"
description="Show 20 and 25"
show-header
disable-interactivity>
</as-histogram-widget>
<as-histogram-widget
id="y2"
heading="With custom tick count"
description="Show 1 tick"
show-header
disable-interactivity>
</as-histogram-widget>
<as-histogram-widget
id="y3"
heading="With custom tick formatter"
description="Show ¡${value}!"
show-header
disable-interactivity>
</as-histogram-widget>
</div>
<h2 class="as-title">X-Axis options</p>
<div style="display: flex; flex-wrap: wrap;">
<as-histogram-widget
id="x1"
heading="With custom tick values"
description="Show 20"
show-header
disable-interactivity>
</as-histogram-widget>
<as-histogram-widget
id="x2"
heading="With custom tick count"
description="Show 1 tick (besides 0)"
show-header
disable-interactivity>
</as-histogram-widget>
<as-histogram-widget
id="x3"
heading="With custom tick formatter"
description="Show ~${value}"
show-header
disable-interactivity>
</as-histogram-widget>
</div>
<script>
var histY1 = document.querySelector('#y1');
var histY2 = document.querySelector('#y2');
var histY3 = document.querySelector('#y3');
var histX1 = document.querySelector('#x1');
var histX2 = document.querySelector('#x2');
var histX3 = document.querySelector('#x3');
var all = [histY1, histY2, histY3, histX1, histX2, histX3];
var data = [
{ start: 0, end: 10, value: 30, color: '#74d7ec' },
{ start: 10, end: 20, value: 30, color: '#ffafc7' },
{ start: 20, end: 30, value: 0 },
{ start: 30, end: 40, value: 30, color: '#ffafc7' },
{ start: 40, end: 50, value: 30, color: '#74d7ec' },
];
all.forEach((widget) => widget.data = data);
histY1.yAxisOptions = {
values: [20, 25],
};
histY2.yAxisOptions = {
ticks: 1
};
histY3.yAxisOptions = {
padding: 8,
format: (value) => `¡${value}!`
};
histX1.xAxisOptions = {
values: [20],
};
histX2.xAxisOptions = {
ticks: 1
};
histX3.xAxisOptions = {
format: (value) => `~${value}`
};
</script>
</body>
</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
<!DOCTYPE html>
<html dir="ltr" lang="en">
<head>
<base href="/">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=5.0">
<title>Airship</title>
<link rel="stylesheet" href="https://libs.cartocdn.com/airship-style/v2.4.1/airship.css">
<script type="module" src="https://libs.cartocdn.com/airship-components/v2.4.1/airship/airship.esm.js"></script>
<script nomodule="" src="https://libs.cartocdn.com/airship-components/v2.4.1/airship/airship.js"></script>
</head>
<body>
<as-range-slider></as-range-slider>
<script>
const rangeSliderWidget = document.querySelector('as-range-slider');
rangeSliderWidget.minValue = 10;
rangeSliderWidget.maxValue = 20;
rangeSliderWidget.value = 12;
rangeSliderWidget.step = 2;
</script>
</body>
</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
<!DOCTYPE html>
<html dir="ltr" lang="en">
<head>
<base href="/">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=5.0">
<title>Airship</title>
<link rel="stylesheet" href="https://libs.cartocdn.com/airship-style/v2.4.1/airship.css">
<script type="module" src="https://libs.cartocdn.com/airship-components/v2.4.1/airship/airship.esm.js"></script>
<script nomodule="" src="https://libs.cartocdn.com/airship-components/v2.4.1/airship/airship.js"></script>
</head>
<body>
<as-range-slider value="5" disabled="true"></as-range-slider>
<br/>
<button>Toggle disabled</button>
<script>
document.querySelector('button').addEventListener('click', () => {
const rangeSliderWidget = document.querySelector('as-range-slider');
rangeSliderWidget.disabled = !rangeSliderWidget.disabled;
})
</script>
</body>
</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
<!DOCTYPE html>
<html dir="ltr" lang="en">
<head>
<base href="/">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=5.0">
<title>Airship</title>
<link rel="stylesheet" href="https://libs.cartocdn.com/airship-style/v2.4.1/airship.css">
<script type="module" src="https://libs.cartocdn.com/airship-components/v2.4.1/airship/airship.esm.js"></script>
<script nomodule="" src="https://libs.cartocdn.com/airship-components/v2.4.1/airship/airship.js"></script>
</head>
<body>
<as-range-slider min-value="25" max-value="75"></as-range-slider>
<script>
const rangeSliderWidget = document.querySelector('as-range-slider');
rangeSliderWidget.range = [30, 70];
rangeSliderWidget.step = 5;
rangeSliderWidget.isDraggable = true;
rangeSliderWidget.formatValue = (value) => (`${value}€`);
rangeSliderWidget.addEventListener('change', (event) => console.log('Changed:', event.detail));
rangeSliderWidget.addEventListener('changeStart', (event) => console.log('Change Start:', event.detail));
rangeSliderWidget.addEventListener('changeEnd', (event) => console.log('Change End:', event.detail));
</script>
</body>
</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
<!DOCTYPE html>
<html dir="ltr" lang="en">
<head>
<base href="/">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=5.0">
<title>Airship</title>
<link rel="stylesheet" href="https://libs.cartocdn.com/airship-style/v2.4.1/airship.css">
<script type="module" src="https://libs.cartocdn.com/airship-components/v2.4.1/airship/airship.esm.js"></script>
<script nomodule="" src="https://libs.cartocdn.com/airship-components/v2.4.1/airship/airship.js"></script>
<style>
body {
height: 100vh;
margin: 0;
padding: 0;
background: #F2F2F2;
}
as-animation-controls-widget {
width: 100%;
height: 100%;
background: white;
}
</style>
</head>
<body>
<as-animation-controls-widget animated heading="Animation control">
</as-animation-controls-widget>
<script>
var animationControlsWidget = document.querySelector('as-animation-controls-widget');
// Use the widget here
</script>
</body>
</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
<!DOCTYPE html>
<html dir="ltr" lang="en">
<head>
<base href="/">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=5.0">
<title>Airship</title>
<link rel="stylesheet" href="https://libs.cartocdn.com/airship-style/v2.4.1/airship.css">
<script type="module" src="https://libs.cartocdn.com/airship-components/v2.4.1/airship/airship.esm.js"></script>
<script nomodule="" src="https://libs.cartocdn.com/airship-components/v2.4.1/airship/airship.js"></script>
<style>
body {
height: 100vh;
margin: 0;
padding: 0;
background: #F2F2F2;
}
as-animation-controls-widget {
width: 100%;
height: 100%;
background: white;
}
</style>
</head>
<body>
<as-animation-controls-widget
animated
heading="Animated Example"
>
</as-animation-controls-widget>
<script>
var timeData = [{
start: Date.parse('1987-06-18'),
end: Date.parse('1987-06-19'),
value: 1
},
{
start: Date.parse('1987-06-19'),
end: Date.parse('1987-06-20'),
value: 2
},
{
start: Date.parse('1987-06-20'),
end: Date.parse('1987-06-21'),
value: 4
},
{
start: Date.parse('1987-06-21'),
end: Date.parse('1987-06-22'),
value: 8
},
{
start: Date.parse('1987-06-22'),
end: Date.parse('1987-06-23'),
value: 16
}];
var progress = 0;
var animationControlsWidget = document.querySelector('as-animation-controls-widget');
animationControlsWidget.data = timeData;
// Simulate an animation progress
setInterval(() => {
if (!animationControlsWidget.playing) {
return;
}
progress = Math.min(progress + 20, 100);
animationControlsWidget.progress = progress;
if (progress >= 100) {
progress = 0;
}
}, 500);
animationControlsWidget.addEventListener('seek', (evt) => {
progress = evt.detail;
animationControlsWidget.progress = progress;
});
animationControlsWidget.addEventListener('pause', (evt) => {
console.log('Paused!', evt);
});
animationControlsWidget.addEventListener('play', (evt) => {
console.log('Playing!', evt);
});
</script>
</body>
</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
<!DOCTYPE html>
<html dir="ltr" lang="en">
<head>
<base href="/">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=5.0">
<title>Airship</title>
<link rel="stylesheet" href="https://libs.cartocdn.com/airship-style/v2.4.1/airship.css">
<script type="module" src="https://libs.cartocdn.com/airship-components/v2.4.1/airship/airship.esm.js"></script>
<script nomodule="" src="https://libs.cartocdn.com/airship-components/v2.4.1/airship/airship.js"></script>
<style>
body {
height: 100vh;
margin: 0;
padding: 0;
background: #F2F2F2;
}
as-time-series-widget {
width: 100%;
height: 100%;
background: white;
}
</style>
</head>
<body>
<as-time-series-widget
x-label="Time"
y-label="Overall world coolness"
responsive
show-clear-button
heading="World coolness evolution"
>
</as-time-series-widget>
<script>
var timeData = [{
start: Date.parse('1987-06-18'),
end: Date.parse('1987-06-19'),
value: 1
},
{
start: Date.parse('1987-06-19'),
end: Date.parse('1987-06-20'),
value: 2
},
{
start: Date.parse('1987-06-20'),
end: Date.parse('1987-06-21'),
value: 4
},
{
start: Date.parse('1987-06-21'),
end: Date.parse('1987-06-22'),
value: 8
},
{
start: Date.parse('1987-06-22'),
end: Date.parse('1987-06-23'),
value: 16
},
{
start: Date.parse('1987-06-23'),
end: Date.parse('1987-06-24'),
value: 32
}];
var timeSeriesWidget = document.querySelector('as-time-series-widget');
timeSeriesWidget.data = timeData;
</script>
</body>
</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
<!DOCTYPE html>
<html dir="ltr" lang="en">
<head>
<base href="/">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=5.0">
<title>Airship</title>
<link rel="stylesheet" href="https://libs.cartocdn.com/airship-style/v2.4.1/airship.css">
<script type="module" src="https://libs.cartocdn.com/airship-components/v2.4.1/airship/airship.esm.js"></script>
<script nomodule="" src="https://libs.cartocdn.com/airship-components/v2.4.1/airship/airship.js"></script>
<style>
body {
height: 100vh;
margin: 0;
padding: 0;
background: #F2F2F2;
}
as-time-series-widget {
width: 100%;
height: 100%;
background: white;
}
</style>
</head>
<body>
<as-time-series-widget
x-label="Time"
y-label="Overall world coolness"
responsive
show-clear-button
heading="World coolness evolution"
>
</as-time-series-widget>
<script>
var timeData = [{
start: new Date(Date.parse('1987-06-18')),
end: new Date(Date.parse('1987-06-19')),
value: 1
},
{
start: new Date(Date.parse('1987-06-19')),
end: new Date(Date.parse('1987-06-20')),
value: 2
},
{
start: new Date(Date.parse('1987-06-20')),
end: new Date(Date.parse('1987-06-21')),
value: 4
},
{
start: new Date(Date.parse('1987-06-21')),
end: new Date(Date.parse('1987-06-22')),
value: 8
},
{
start: new Date(Date.parse('1987-06-22')),
end: new Date(Date.parse('1987-06-23')),
value: 16
},
{
start: new Date(Date.parse('1987-06-23')),
end: new Date(Date.parse('1987-06-24')),
value: 32
}];
var timeSeriesWidget = document.querySelector('as-time-series-widget');
timeSeriesWidget.data = timeData;
</script>
</body>
</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
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
<!DOCTYPE html>
<html dir="ltr" lang="en">
<head>
<base href="/">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=5.0">
<title>Airship</title>
<link rel="stylesheet" href="https://libs.cartocdn.com/airship-style/v2.4.1/airship.css">
<script type="module" src="https://libs.cartocdn.com/airship-components/v2.4.1/airship/airship.esm.js"></script>
<script nomodule="" src="https://libs.cartocdn.com/airship-components/v2.4.1/airship/airship.js"></script>
<style>
body {
height: 100vh;
margin: 0;
padding: 0;
background: #F2F2F2;
}
.content {
display: flex;
flex-direction: column;
height: 100vh;
}
as-time-series-widget {
flex: 1;
width: 100%;
height: 100%;
background: white;
}
.controls {
padding: 8px;
}
</style>
</head>
<body>
<div class="content">
<div class="controls">
<p class="as-body">
<a href="https://github.com/d3/d3-time-format#locale_format">Format documentation</a>
</p>
<div class="as-button-group js-format" role="group">
<button data-fmt="%x - %X" aria-label="twitter" class="as-btn as-btn--secondary">
Full date (%x - %X)
</button>
<button data-fmt="%x" aria-label="facebook" class="as-btn as-btn--secondary">
Date (%x)
</button>
<button data-fmt="%X" aria-label="home" class="as-btn as-btn--secondary">
Time (%X)
</button>
<button data-fmt="%Q" aria-label="home" class="as-btn as-btn--secondary">
Milliseconds (%Q)
</button>
<button data-fmt="%c" aria-label="home" class="as-btn as-btn--secondary">
Locale date (%c)
</button>
<button data-fmt="Around %B of %Y" aria-label="home" class="as-btn as-btn--secondary">
Arbitrary string + format (`Around %B of %Y`)
</button>
</div>
<p class="as-body">
Changing the language for locale specific formatting
</p>
<div class="as-button-group js-locale" role="group">
<button data-locale="https://unpkg.com/d3-time-format@2/locale/es-ES.json" aria-label="twitter" class="as-btn as-btn--secondary">
Spanish 🇪🇸
</button>
<button data-locale="https://unpkg.com/d3-time-format@2/locale/de-DE.json" aria-label="twitter" class="as-btn as-btn--secondary">
German 🇩🇪
</button>
<button data-locale="https://unpkg.com/d3-time-format@2/locale/fr-FR.json" aria-label="twitter" class="as-btn as-btn--secondary">
French 🇫🇷
</button>
<button data-locale="https://unpkg.com/d3-time-format@2/locale/pt-BR.json" aria-label="twitter" class="as-btn as-btn--secondary">
Brazilian Portuguese 🇧🇷
</button>
<button data-locale="https://unpkg.com/d3-time-format@2/locale/de-CH.json" aria-label="twitter" class="as-btn as-btn--secondary">
Swiss German 🇨🇭
</button>
<button data-locale="https://unpkg.com/d3-time-format@2/locale/fr-CA.json" aria-label="twitter" class="as-btn as-btn--secondary">
Canadian French 🇫🇷
</button>
<button data-locale="https://unpkg.com/d3-time-format@2/locale/ru-RU.json" aria-label="twitter" class="as-btn as-btn--secondary">
Russia 🇷🇺
</button>
</div>
</div>
<!--
time-format accepts these formats specifiers: https://github.com/d3/d3-time-format#locale_format
-->
<as-time-series-widget
x-label="Time"
y-label="Overall world coolness"
responsive
show-clear-button
heading="World coolness evolution"
time-format="%x"
>
</as-time-series-widget>
</div>
<script>
var timeData = [{
start: Date.parse('1987-06-18'),
end: Date.parse('1987-06-19'),
value: 1
},
{
start: Date.parse('1987-06-19'),
end: Date.parse('1987-06-20'),
value: 2
},
{
start: Date.parse('1987-06-20'),
end: Date.parse('1987-06-21'),
value: 4
},
{
start: Date.parse('1987-06-21'),
end: Date.parse('1987-06-22'),
value: 8
},
{
start: Date.parse('1987-06-22'),
end: Date.parse('1987-06-23'),
value: 16
},
{
start: Date.parse('1987-06-23'),
end: Date.parse('1987-06-24'),
value: 32
}];
var timeSeriesWidget = document.querySelector('as-time-series-widget');
timeSeriesWidget.data = timeData;
var formatInput = document.querySelector('.js-format');
formatInput.addEventListener('click', (evt) => {
var format = evt.target.dataset.fmt;
if (!format) {
return;
}
timeSeriesWidget.timeFormat = format;
});
document.querySelector('.js-locale').addEventListener('click', (evt) => {
var locale = evt.target.dataset.locale;
if (!locale) {
return;
}
fetch(locale)
.then(response => response.json())
.then((json) => {
timeSeriesWidget.timeFormatLocale = json;
});
});
</script>
</body>
</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
<!DOCTYPE html>
<html dir="ltr" lang="en">
<head>
<base href="/">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=5.0">
<title>Airship</title>
<link rel="stylesheet" href="https://libs.cartocdn.com/airship-style/v2.4.1/airship.css">
<script type="module" src="https://libs.cartocdn.com/airship-components/v2.4.1/airship/airship.esm.js"></script>
<script nomodule="" src="https://libs.cartocdn.com/airship-components/v2.4.1/airship/airship.js"></script>
<style>
body {
height: 100vh;
margin: 0;
padding: 0;
background: #F2F2F2;
}
as-time-series-widget {
width: 100%;
height: 100%;
background: white;
}
</style>
</head>
<body>
<as-time-series-widget
animated
x-label="Time"
y-label="Overall world coolness"
responsive
show-clear-button
heading="World coolness evolution"
time-format="%x"
>
</as-time-series-widget>
<script>
var timeData = [{
start: Date.parse('1987-06-18'),
end: Date.parse('1987-06-19'),
value: 1
},
{
start: Date.parse('1987-06-19'),
end: Date.parse('1987-06-20'),
value: 2
},
{
start: Date.parse('1987-06-20'),
end: Date.parse('1987-06-21'),
value: 4
},
{
start: Date.parse('1987-06-21'),
end: Date.parse('1987-06-22'),
value: 8
},
{
start: Date.parse('1987-06-22'),
end: Date.parse('1987-06-23'),
value: 16
}];
var paused = false;
var progress = 0;
var timeSeriesWidget = document.querySelector('as-time-series-widget');
timeSeriesWidget.data = timeData;
timeSeriesWidget.playing = !paused;
// Simulate an animation progress
setInterval(() => {
if (paused) {
return;
}
progress = Math.min(progress + 20, 100);
timeSeriesWidget.progress = progress;
timeSeriesWidget.playing = !paused;
if (progress >= 100) {
progress = 0;
}
}, 1000);
timeSeriesWidget.addEventListener('seek', (evt) => {
progress = evt.detail;
timeSeriesWidget.progress = progress;
});
timeSeriesWidget.addEventListener('pause', () => {
paused = true;
timeSeriesWidget.playing = !paused;
});
timeSeriesWidget.addEventListener('play', () => {
paused = false;
timeSeriesWidget.playing = !paused;
});
timeSeriesWidget.tooltipFormatter = (data) => {
return Promise.all(
[
timeSeriesWidget.xFormatter(data.start),
timeSeriesWidget.xFormatter(data.end),
timeSeriesWidget.defaultFormatter(data)
]
).then((resolved) => {
return [
`From ${resolved[0]} to ${resolved[1]}`,
resolved[2][1]
];
});
};
</script>
</body>
</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
<!DOCTYPE html>
<html dir="ltr" lang="en">
<head>
<base href="/">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=5.0">
<title>Airship</title>
<link rel="stylesheet" href="https://libs.cartocdn.com/airship-style/v2.4.1/airship.css">
<script type="module" src="https://libs.cartocdn.com/airship-components/v2.4.1/airship/airship.esm.js"></script>
<script nomodule="" src="https://libs.cartocdn.com/airship-components/v2.4.1/airship/airship.js"></script>
<style>
body {
background-color: white;
}
</style>
</head>
<body>
<as-legend
heading="Title"
description="Description">
<as-legend-category slot="legends" orientation="horizontal"></as-legend-category>
<span slot="footer">Footer</span>
</as-legend>
<script>
var legend = document.querySelector('as-legend-category');
legend.data = [
{ type: 'point', width: 16, color: '#D4006E', label: 'Layer 1' },
{ type: 'point', width: 8, color: '#541D82', label: 'Layer 2' },
{ type: 'point', width: 16, color: '#0054A5', label: 'Layer 3' },
];
</script>
</body>
</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
<!DOCTYPE html>
<html dir="ltr" lang="en">
<head>
<base href="/">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=5.0">
<title>Airship</title>
<link rel="stylesheet" href="https://libs.cartocdn.com/airship-style/v2.4.1/airship.css">
<script type="module" src="https://libs.cartocdn.com/airship-components/v2.4.1/airship/airship.esm.js"></script>
<script nomodule="" src="https://libs.cartocdn.com/airship-components/v2.4.1/airship/airship.js"></script>
<style>
body {
background-color: white;
}
</style>
</head>
<body>
<as-legend-color-bins-polygon id="horizontal" orientation="horizontal"></as-legend-color-bins-polygon>
<as-legend-color-bins-polygon id="vertical" ></as-legend-color-bins-polygon>
<script>
const vertical = document.querySelector('#vertical');
const horizontal = document.querySelector('#horizontal');
const data = [
{ color: '#74d7ec', label: '-100' },
{ color: '#ffafc7', label: '-50' },
{ color: 'white', label: '0' },
{ color: '#ffafc7', label: '50' },
{ color: '#74d7ec', label: '100' },
];
vertical.data = horizontal.data = data;
</script>
</body>
</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
<!DOCTYPE html>
<html dir="ltr" lang="en">
<head>
<base href="/">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=5.0">
<title>Airship</title>
<link rel="stylesheet" href="https://libs.cartocdn.com/airship-style/v2.4.1/airship.css">
<script type="module" src="https://libs.cartocdn.com/airship-components/v2.4.1/airship/airship.esm.js"></script>
<script nomodule="" src="https://libs.cartocdn.com/airship-components/v2.4.1/airship/airship.js"></script>
<style>
body {
background-color: white;
}
</style>
</head>
<body>
<as-legend-category orientation="horizontal"></as-legend-category>
<script>
var legend = document.querySelector('as-legend-category');
legend.data = [
{ type: 'point', width: 16, color: '#D4006E', label: 'Point layer' },
{ type: 'line', strokeStyle: 'dashed', color: '#541D82', label: 'Line layer' },
{ type: 'polygon', color: '#0054A5', label: 'Polygon layer', strokeColor: 'rgba(0, 54, 165, 0.3)' },
];
</script>
</body>
</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
<!DOCTYPE html>
<html dir="ltr" lang="en">
<head>
<base href="/">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=5.0">
<title>Airship</title>
<link rel="stylesheet" href="https://libs.cartocdn.com/airship-style/v2.4.1/airship.css">
<script type="module" src="https://libs.cartocdn.com/airship-components/v2.4.1/airship/airship.esm.js"></script>
<script nomodule="" src="https://libs.cartocdn.com/airship-components/v2.4.1/airship/airship.js"></script>
<style>
body {
background-color: white;
}
</style>
</head>
<body>
<as-legend-color-bins-polygon id="legend" orientation="horizontal"></as-legend-color-bins-polygon>
<script>
const legend = document.querySelector('#legend');
legend.data = [
{ color: '#E70000', label: '0' },
{ color: '#FF8C00', label: '10' },
{ color: '#FFEF00', label: '20' },
{ color: '#00811F', label: '30' },
{ color: '#0044FF', label: '40' },
{ color: '#760089', label: '40' },
];
</script>
</body>
</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
<!DOCTYPE html>
<html dir="ltr" lang="en">
<head>
<base href="/">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=5.0">
<title>Airship</title>
<link rel="stylesheet" href="https://libs.cartocdn.com/airship-style/v2.4.1/airship.css">
<script type="module" src="https://libs.cartocdn.com/airship-components/v2.4.1/airship/airship.esm.js"></script>
<script nomodule="" src="https://libs.cartocdn.com/airship-components/v2.4.1/airship/airship.js"></script>
<style>
body {
background-color: white;
}
</style>
</head>
<body>
<as-legend-color-continuous-polygon id="legend" orientation="horizontal"></as-legend-color-continuous-polygon>
<script>
const legend = document.querySelector('#legend');
legend.data = [
{ "color": "#B0F2BCFF", "label": 10 },
{ "color": "#77E2A8FF", "label": 20 },
{ "color": "#4CC8A3FF", "label": 30 },
{ "color": "#31A6A2FF", "label": 40 },
{ "color": "#257D98FF", "label": 50 }
]
</script>
</body>
</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
<!DOCTYPE html>
<html dir="ltr" lang="en">
<head>
<base href="/">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=5.0">
<title>Airship</title>
<link rel="stylesheet" href="https://libs.cartocdn.com/airship-style/v2.4.1/airship.css">
<script type="module" src="https://libs.cartocdn.com/airship-components/v2.4.1/airship/airship.esm.js"></script>
<script nomodule="" src="https://libs.cartocdn.com/airship-components/v2.4.1/airship/airship.js"></script>
<style>
body {
background-color: white;
}
</style>
</head>
<body>
<as-legend-size-bins-line id="legend" orientation="horizontal"></as-legend-size-bins-line>
<script>
const legend = document.querySelector('#legend');
legend.data = [
{ color: '#FFC667', width: 28, label: '280' },
{ color: '#FFC667', width: 24, label: '240' },
{ color: '#FFC667', width: 16, label: '160' }
]
</script>
</body>
</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
<!DOCTYPE html>
<html dir="ltr" lang="en">
<head>
<base href="/">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=5.0">
<title>Airship</title>
<link rel="stylesheet" href="https://libs.cartocdn.com/airship-style/v2.4.1/airship.css">
<script type="module" src="https://libs.cartocdn.com/airship-components/v2.4.1/airship/airship.esm.js"></script>
<script nomodule="" src="https://libs.cartocdn.com/airship-components/v2.4.1/airship/airship.js"></script>
<style>
body {
background-color: white;
}
</style>
</head>
<body>
<as-legend-size-bins-point id="legend" orientation="horizontal"></as-legend-size-bins-point>
<script>
const legend = document.querySelector('#legend');
legend.data = [
{ marker: 'https://libs.cartocdn.com/carto-vl/assets/symbols/house.svg', color: '#000000', width: 28, label: 'House' },
{ marker: 'https://libs.cartocdn.com/carto-vl/assets/symbols/marker.svg', color: '#000000', width: 24, label: 'POI' },
{ marker: 'https://libs.cartocdn.com/carto-vl/assets/symbols/cross.svg', color: '#000000', width: 16, label: 'Unknown' }
]
</script>
</body>
</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
<!DOCTYPE html>
<html dir="ltr" lang="en">
<head>
<base href="/">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=5.0">
<title>Airship</title>
<link rel="stylesheet" href="https://libs.cartocdn.com/airship-style/v2.4.1/airship.css">
<script type="module" src="https://libs.cartocdn.com/airship-components/v2.4.1/airship/airship.esm.js"></script>
<script nomodule="" src="https://libs.cartocdn.com/airship-components/v2.4.1/airship/airship.js"></script>
<style>
body {
background-color: white;
}
</style>
</head>
<body>
<as-legend-size-category-line id="legend" orientation="vertical"></as-legend-size-category-line>
<script>
const legend = document.querySelector('#legend');
legend.data = [
{ color: '#FFC667', width: 10, label: '280' },
{ color: '#FFC667', width: 12, label: '240' },
{ color: '#FFC667', width: 15, label: '160' }
]
</script>
</body>
</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
<!DOCTYPE html>
<html dir="ltr" lang="en">
<head>
<base href="/">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=5.0">
<title>Airship</title>
<link rel="stylesheet" href="https://libs.cartocdn.com/airship-style/v2.4.1/airship.css">
<script type="module" src="https://libs.cartocdn.com/airship-components/v2.4.1/airship/airship.esm.js"></script>
<script nomodule="" src="https://libs.cartocdn.com/airship-components/v2.4.1/airship/airship.js"></script>
<style>
body {
background-color: white;
}
</style>
</head>
<body>
<as-legend-size-continuous-line id="legend" orientation="horizontal"></as-legend-size-continuous-line>
<script>
const legend = document.querySelector('#legend');
legend.data = [
{ color: '#FFC667', width: 28, label: '280' },
{ color: '#FFC667', width: 24, label: '240' },
{ color: '#FFC667', width: 16, label: '160' }
]
</script>
</body>
</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
<!DOCTYPE html>
<html dir="ltr" lang="en">
<head>
<base href="/">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=5.0">
<title>Airship</title>
<link rel="stylesheet" href="https://libs.cartocdn.com/airship-style/v2.4.1/airship.css">
<script type="module" src="https://libs.cartocdn.com/airship-components/v2.4.1/airship/airship.esm.js"></script>
<script nomodule="" src="https://libs.cartocdn.com/airship-components/v2.4.1/airship/airship.js"></script>
<style>
body {
background-color: white;
}
</style>
</head>
<body>
<as-legend-size-continuous-point id="legend" orientation="horizontal"></as-legend-size-continuous-point>
<script>
const legend = document.querySelector('#legend');
legend.data = [
{ color: '#FFC667', strokeColor: '#0000001', width: 64, label: '64' },
{ color: '#FFC667', strokeColor: '#0000001', width: 96, label: '96' },
{ color: '#FFC667', strokeColor: '#0000001', width: 128, label: '128' }
]
</script>
</body>
</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
<!DOCTYPE html>
<html dir="ltr" lang="en">
<head>
<base href="/">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=5.0">
<title>Airship</title>
<link rel="stylesheet" href="https://libs.cartocdn.com/airship-style/v2.4.1/airship.css">
<script type="module" src="https://libs.cartocdn.com/airship-components/v2.4.1/airship/airship.esm.js"></script>
<script nomodule="" src="https://libs.cartocdn.com/airship-components/v2.4.1/airship/airship.js"></script>
<style>
body {
background-color: white;
}
</style>
</head>
<body>
<as-legend-size-continuous-point id="legend" orientation="horizontal" scale="4"></as-legend-size-continuous-point>
<script>
const legend = document.querySelector('#legend');
legend.data = [
{ color: '#FFC667', strokeColor: '#0000001', width: 16, label: '64' },
{ color: '#FFC667', strokeColor: '#0000001', width: 24, label: '96' },
{ color: '#FFC667', strokeColor: '#0000001', width: 32, label: '128' }
]
</script>
</body>
</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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Airship bridge</title>
<script src="https://cdn.jsdelivr.net/npm/lodash@4.17.11/lodash.min.js"></script>
<script src="https://libs.cartocdn.com/carto-vl/v1.4/carto-vl.min.js"></script>
<link href="https://api.tiles.mapbox.com/mapbox-gl-js/v0.52.0/mapbox-gl.css" rel="stylesheet" />
<script src="https://api.tiles.mapbox.com/mapbox-gl-js/v0.52.0/mapbox-gl.js"></script>
<link rel="stylesheet" href="https://libs.cartocdn.com/airship-style/v2.4.1/airship.css">
<script type="module" src="https://libs.cartocdn.com/airship-components/v2.4.1/airship/airship.esm.js"></script>
<script nomodule="" src="https://libs.cartocdn.com/airship-components/v2.4.1/airship/airship.js"></script>
<script src="https://libs.cartocdn.com/airship-bridge/v2.4.1/asbridge.js"></script>
<style>
.as-map-footer {
max-width: 812px;
}
</style>
</head>
<body class="as-app-body">
<div class="as-app">
<div class="as-content">
<main class="as-main">
<div class="as-map-area">
<div id="map"></div>
</div>
<div class="as-map-footer">
<div class="as-box">
<as-histogram-widget
show-clear-button
id="typeHist"
>
</as-histogram-widget>
</div>
<div class="as-box">
<as-category-widget
show-clear-button
id="typeCat"
>
</as-category-widget>
</div>
</div>
</main>
</div>
</div>
<script>
const map = new mapboxgl.Map({
container: 'map',
style: carto.basemaps.darkmatter,
center: [-4.77, 37.88],
zoom: 3
});
carto.setDefaultAuth({
username: 'roman-carto',
apiKey: 'default_public'
});
const s = carto.expressions;
const source = new carto.source.Dataset('ne_10m_airports');
const viz = new carto.Viz(`
strokeWidth: 0
color: ramp($location, vivid)
`);
const vizLayer = new carto.Layer('layer', source, viz);
const airportLayer = new AsBridge.VLBridge({
carto: carto,
map: map,
layer: vizLayer,
source: source
});
airportLayer.histogram('#typeHist', 'location', {
readOnly: false
});
airportLayer.category('#typeCat', 'location', {
readOnly: false
});
airportLayer.build();
vizLayer.addTo(map, 'watername_ocean');
</script>
</body>
</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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Airship bridge</title>
<script src="https://cdn.jsdelivr.net/npm/lodash@4.17.11/lodash.min.js"></script>
<script src="https://libs.cartocdn.com/carto-vl/v1.4/carto-vl.min.js"></script>
<link href="https://api.tiles.mapbox.com/mapbox-gl-js/v0.52.0/mapbox-gl.css" rel="stylesheet" />
<script src="https://api.tiles.mapbox.com/mapbox-gl-js/v0.52.0/mapbox-gl.js"></script>
<link rel="stylesheet" href="https://libs.cartocdn.com/airship-style/v2.4.1/airship.css">
<script type="module" src="https://libs.cartocdn.com/airship-components/v2.4.1/airship/airship.esm.js"></script>
<script nomodule="" src="https://libs.cartocdn.com/airship-components/v2.4.1/airship/airship.js"></script>
<script src="https://libs.cartocdn.com/airship-bridge/v2.4.1/asbridge.js"></script>
<style>
.as-map-footer {
max-width: 812px;
}
</style>
</head>
<body class="as-app-body">
<div class="as-app">
<div class="as-content">
<main class="as-main">
<div class="as-map-area">
<div id="map"></div>
</div>
<div class="as-map-footer">
<div class="as-box">
<as-histogram-widget
show-clear-button
id="typeHist"
heading="Location"
>
</as-histogram-widget>
</div>
<div class="as-box">
<as-histogram-widget
show-clear-button
id="scaleHist"
heading="Scalerank"
>
</as-histogram-widget>
</div>
</div>
</main>
</div>
</div>
<script>
const map = new mapboxgl.Map({
container: 'map',
style: carto.basemaps.darkmatter,
center: [-4.77, 37.88],
zoom: 3
});
carto.setDefaultAuth({
username: 'roman-carto',
apiKey: 'default_public'
});
const s = carto.expressions;
const source = new carto.source.Dataset('ne_10m_airports');
const viz = new carto.Viz(`
strokeWidth: 0
color: ramp($location, vivid)
`);
const vizLayer = new carto.Layer('layer', source, viz);
const airportLayer = new AsBridge.VLBridge({
carto: carto,
map: map,
layer: vizLayer,
source: source
});
airportLayer.histogram('#typeHist', 'location', {
readOnly: false
});
airportLayer.histogram('#scaleHist', 'scalerank', {
bucketRanges: [[2, 3], [3, 4], [4, 5], [5, 6], [6, 7], [7, 8], [8, 9]],
readOnly: false,
totals: true
});
airportLayer.build();
vizLayer.addTo(map, 'watername_ocean');
</script>
</body>
</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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Airship bridge</title>
<script src="https://cdn.jsdelivr.net/npm/lodash@4.17.11/lodash.min.js"></script>
<script src="https://libs.cartocdn.com/carto-vl/v1.4/carto-vl.min.js"></script>
<link href="https://api.tiles.mapbox.com/mapbox-gl-js/v0.52.0/mapbox-gl.css" rel="stylesheet" />
<script src="https://api.tiles.mapbox.com/mapbox-gl-js/v0.52.0/mapbox-gl.js"></script>
<link rel="stylesheet" href="https://libs.cartocdn.com/airship-style/v2.4.1/airship.css">
<script type="module" src="https://libs.cartocdn.com/airship-components/v2.4.1/airship/airship.esm.js"></script>
<script nomodule="" src="https://libs.cartocdn.com/airship-components/v2.4.1/airship/airship.js"></script>
<script src="https://libs.cartocdn.com/airship-bridge/v2.4.1/asbridge.js"></script>
<style>
.as-map-footer {
max-width: 812px;
}
</style>
</head>
<body class="as-app-body">
<div class="as-app">
<div class="as-content">
<main class="as-main">
<div class="as-map-area">
<div id="map"></div>
</div>
<div class="as-map-footer">
<div class="as-box">
<as-time-series-widget
animated
heading='Animation'
description='Try seeking, pausing or selecting a range'
time-format='%Q'
>
</as-time-series-widget>
</div>
</div>
</main>
</div>
</div>
<script>
const map = new mapboxgl.Map({
container: 'map',
style: carto.basemaps.darkmatter,
center: [-4.77, 37.88],
zoom: 12
});
carto.setDefaultAuth({
username: 'roman-carto',
apiKey: 'default_public'
});
const source = new carto.source.SQL(`select * from cordoba_catastro_simple where year > 1900 and year < 2018`);
const viz = new carto.Viz(`
filter: animation(linear($year, 1900, 2017), 30, fade(0.1, ${Number.MAX_SAFE_INTEGER}))
strokeWidth: 0
`);
const vizLayer = new carto.Layer('layer', source, viz);
const timeWidget = document.querySelector('as-time-series-widget');
vizLayer.addTo(map, 'watername_ocean');
const bridge = new AsBridge.VLBridge({
carto: carto,
map: map,
layer: vizLayer,
source: source
});
bridge.timeSeries('as-time-series-widget', 'year', {
buckets: 30,
readOnly: false
});
bridge.build();
</script>
</body>
</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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Airship bridge</title>
<script src="https://cdn.jsdelivr.net/npm/lodash@4.17.11/lodash.min.js"></script>
<script src="https://libs.cartocdn.com/carto-vl/v1.4/carto-vl.min.js"></script>
<link href="https://api.tiles.mapbox.com/mapbox-gl-js/v0.52.0/mapbox-gl.css" rel="stylesheet" />
<script src="https://api.tiles.mapbox.com/mapbox-gl-js/v0.52.0/mapbox-gl.js"></script>
<link rel="stylesheet" href="https://libs.cartocdn.com/airship-style/v2.4.1/airship.css">
<script type="module" src="https://libs.cartocdn.com/airship-components/v2.4.1/airship/airship.esm.js"></script>
<script nomodule="" src="https://libs.cartocdn.com/airship-components/v2.4.1/airship/airship.js"></script>
<script src="https://libs.cartocdn.com/airship-bridge/v2.4.1/asbridge.js"></script>
<style>
.as-map-footer {
max-width: 812px;
}
</style>
</head>
<body class="as-app-body">
<div class="as-app">
<div class="as-content">
<main class="as-main">
<div class="as-map-area">
<div id="map"></div>
</div>
<div class="as-map-footer">
<div class="as-box">
<as-time-series-widget
animated
heading='Animation'
description='Try seeking, pausing or selecting a range'
>
</as-time-series-widget>
</div>
<div class="as-box">
<as-histogram-widget>
</as-histogram-widget>
</div>
</div>
</main>
</div>
</div>
<script>
const map = new mapboxgl.Map({
container: 'map',
style: carto.basemaps.darkmatter,
center: [-122.327739, 47.615199],
zoom: 10
});
carto.setDefaultAuth({
username: 'cartovl',
apiKey: 'default_public'
});
const source = new carto.source.Dataset('seattle_collisions');
const viz = new carto.Viz(`
@duration: 30
filter: animation($incdate, @duration, fade(0.5, 0.5))
strokeWidth: 0
`);
const vizLayer = new carto.Layer('layer', source, viz);
const timeWidget = document.querySelector('as-time-series-widget');
vizLayer.addTo(map, 'watername_ocean');
const bridge = new AsBridge.VLBridge({
carto: carto,
map: map,
layer: vizLayer,
source: source
});
bridge.timeSeries('as-time-series-widget', 'incdate', {
buckets: 30,
readOnly: false
});
bridge.histogram('as-histogram-widget', 'personcount', {
buckets: 30,
totals: true,
readOnly: false
});
bridge.build();
</script>
</body>
</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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<title>Airship bridge</title>
<script src="https://cdn.jsdelivr.net/npm/lodash@4.17.11/lodash.min.js"></script>
<script src="https://libs.cartocdn.com/carto-vl/v1.4/carto-vl.min.js"></script>
<link
href="https://api.tiles.mapbox.com/mapbox-gl-js/v0.52.0/mapbox-gl.css"
rel="stylesheet"
/>
<script src="https://api.tiles.mapbox.com/mapbox-gl-js/v0.52.0/mapbox-gl.js"></script>
<link rel="stylesheet" href="https://libs.cartocdn.com/airship-style/v2.4.1/airship.css" />
<script
type="module"
src="https://libs.cartocdn.com/airship-components/v2.4.1/airship/airship.esm.js"
></script>
<script
nomodule=""
src="https://libs.cartocdn.com/airship-components/v2.4.1/airship/airship.js"
></script>
<script src="https://libs.cartocdn.com/airship-bridge/v2.4.1/asbridge.js"></script>
<style>
.as-map-footer {
max-width: 812px;
}
</style>
</head>
<body class="as-app-body">
<div class="as-app">
<div class="as-content">
<main class="as-main">
<div class="as-map-area">
<div id="map"></div>
</div>
<div class="as-map-footer">
<div class="as-box">
<as-animation-controls-widget
animated
heading="Animation"
description="Try seeking and pausing"
>
</as-animation-controls-widget>
</div>
</div>
</main>
</div>
</div>
<script>
const map = new mapboxgl.Map({
container: "map",
style: carto.basemaps.darkmatter,
center: [-4.77, 37.88],
zoom: 12,
});
carto.setDefaultAuth({
username: "roman-carto",
apiKey: "default_public",
});
const source = new carto.source.SQL(
`select * from cordoba_catastro_simple where year > 1900 and year < 2018`
);
const viz = new carto.Viz(`
@duration: 30
filter: animation(linear($year, 1900, 2017), @duration, fade(0.1, ${Number.MAX_SAFE_INTEGER}))
strokeWidth: 0
`);
const vizLayer = new carto.Layer("layer", source, viz);
vizLayer.addTo(map, "watername_ocean");
const bridge = new AsBridge.VLBridge({
carto: carto,
map: map,
layer: vizLayer,
source: source,
});
bridge.animationControls("as-animation-controls-widget", "year");
bridge.build();
</script>
</body>
</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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<title>Airship bridge</title>
<script src="https://cdn.jsdelivr.net/npm/lodash@4.17.11/lodash.min.js"></script>
<script src="https://libs.cartocdn.com/carto-vl/v1.4/carto-vl.min.js"></script>
<link
href="https://api.tiles.mapbox.com/mapbox-gl-js/v0.52.0/mapbox-gl.css"
rel="stylesheet"
/>
<script src="https://api.tiles.mapbox.com/mapbox-gl-js/v0.52.0/mapbox-gl.js"></script>
<link rel="stylesheet" href="https://libs.cartocdn.com/airship-style/v2.4.1/airship.css" />
<script
type="module"
src="https://libs.cartocdn.com/airship-components/v2.4.1/airship/airship.esm.js"
></script>
<script
nomodule=""
src="https://libs.cartocdn.com/airship-components/v2.4.1/airship/airship.js"
></script>
<script src="https://libs.cartocdn.com/airship-bridge/v2.4.1/asbridge.js"></script>
<style>
.as-map-footer {
max-width: 812px;
}
</style>
</head>
<body class="as-app-body">
<div class="as-app">
<div class="as-content">
<main class="as-main">
<div class="as-map-area">
<div id="map"></div>
</div>
<div class="as-map-footer">
<div class="as-box">
<as-animation-controls-widget
animated
heading="Animation"
description="Try seeking and pausing"
>
</as-animation-controls-widget>
</div>
</div>
</main>
</div>
</div>
<script>
const map = new mapboxgl.Map({
container: "map",
style: carto.basemaps.darkmatter,
center: [-4.77, 37.88],
zoom: 12,
});
carto.setDefaultAuth({
username: "roman-carto",
apiKey: "default_public",
});
const source = new carto.source.SQL(
`select * from cordoba_catastro_simple where year > 1900 and year < 2018`
);
const viz = new carto.Viz(`
@duration: 30
strokeWidth: 0
`);
const vizLayer = new carto.Layer("layer", source, viz);
const animationControlsWidget = document.querySelector(
"as-animation-controls-widget"
);
vizLayer.addTo(map, "watername_ocean");
const bridge = new AsBridge.VLBridge({
carto: carto,
map: map,
layer: vizLayer,
source: source,
});
bridge.animationControls(animationControlsWidget, "year");
bridge.build();
</script>
</body>
</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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<title>Airship bridge</title>
<script src="https://cdn.jsdelivr.net/npm/lodash@4.17.11/lodash.min.js"></script>
<script src="https://libs.cartocdn.com/carto-vl/v1.4/carto-vl.min.js"></script>
<link
href="https://api.tiles.mapbox.com/mapbox-gl-js/v0.52.0/mapbox-gl.css"
rel="stylesheet"
/>
<script src="https://api.tiles.mapbox.com/mapbox-gl-js/v0.52.0/mapbox-gl.js"></script>
<link rel="stylesheet" href="https://libs.cartocdn.com/airship-style/v2.4.1/airship.css" />
<script
type="module"
src="https://libs.cartocdn.com/airship-components/v2.4.1/airship/airship.esm.js"
></script>
<script
nomodule=""
src="https://libs.cartocdn.com/airship-components/v2.4.1/airship/airship.js"
></script>
<script src="https://libs.cartocdn.com/airship-bridge/v2.4.1/asbridge.js"></script>
<style>
.as-map-footer {
max-width: 812px;
}
</style>
</head>
<body class="as-app-body">
<div class="as-app">
<div class="as-content">
<main class="as-main">
<div class="as-map-area">
<div id="map"></div>
</div>
<div class="as-map-footer">
<div class="as-box">
<as-animation-controls-widget
animated
heading="Animation"
description="Try seeking and pausing"
>
</as-animation-controls-widget>
</div>
</div>
</main>
</div>
</div>
<script>
const map = new mapboxgl.Map({
container: "map",
style: carto.basemaps.darkmatter,
center: [-122.30571212980425, 47.6181],
zoom: 10,
});
carto.setDefaultAuth({
username: "cartovl",
apiKey: "default_public",
});
const source = new carto.source.Dataset("seattle_collisions");
const viz = new carto.Viz(`
color: ramp($addrtype, Bold)
@myVariable: animation(linear($incdate), 20,fade(1, 1)) * ramp(linear($personcount, 2, 5), [5, 20])
strokeWidth: 0
`);
const vizLayer = new carto.Layer("layer", source, viz);
vizLayer.addTo(map, "watername_ocean");
const bridge = new AsBridge.VLBridge({
carto: carto,
map: map,
layer: vizLayer,
source: source,
});
bridge.animationControls("as-animation-controls-widget", "incdate", {
variableName: "myVariable",
propertyName: "width",
});
bridge.build();
</script>
</body>
</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
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<title>Airship bridge</title>
<script src="https://cdn.jsdelivr.net/npm/lodash@4.17.11/lodash.min.js"></script>
<script src="https://libs.cartocdn.com/carto-vl/v1.4/carto-vl.min.js"></script>
<link
href="https://api.tiles.mapbox.com/mapbox-gl-js/v0.52.0/mapbox-gl.css"
rel="stylesheet"
/>
<script src="https://api.tiles.mapbox.com/mapbox-gl-js/v0.52.0/mapbox-gl.js"></script>
<link rel="stylesheet" href="https://libs.cartocdn.com/airship-style/v2.4.1/airship.css" />
<script
type="module"
src="https://libs.cartocdn.com/airship-components/v2.4.1/airship/airship.esm.js"
></script>
<script
nomodule=""
src="https://libs.cartocdn.com/airship-components/v2.4.1/airship/airship.js"
></script>
<script src="https://libs.cartocdn.com/airship-bridge/v2.4.1/asbridge.js"></script>
<style>
.as-map-footer {
max-width: 812px;
}
</style>
</head>
<body class="as-app-body">
<div class="as-app">
<div class="as-content">
<main class="as-main">
<div class="as-map-area">
<div id="map"></div>
</div>
<div class="as-map-footer">
<div class="as-box">
<as-animation-controls-widget
animated
heading="Animation"
description="Try seeking and pausing"
>
</as-animation-controls-widget>
</div>
</div>
</main>
</div>
</div>
<script>
const map = new mapboxgl.Map({
container: "map",
style: carto.basemaps.darkmatter,
center: [-74.0032059, 40.7482066],
zoom: 12,
});
carto.setDefaultAuth({
apiKey: "default_public",
username: "cartovl",
});
const s = carto.expressions;
const source = new carto.source.Dataset("taxi_50k");
const viz = new carto.Viz(`
@hour: clusterTime($tpep_pickup_datetime, 'hour', 'America/New_York')
width: 10
strokeWidth: 0
color: opacity(rgb(255,255,0),0.5)
filter: animation(@hour, 130, fade(0.0,0.0))
@list: viewportFeatures(@hour)
@maxhour: globalMax(@hour)
@minhour: globalMin(@hour)
`);
const layer = new carto.Layer("layer", source, viz);
layer.addTo(map);
const timeWidget = document.querySelector("as-animation-controls-widget");
const bridge = new AsBridge.VLBridge({
carto: carto,
map: map,
layer: layer,
source: source,
});
bridge.animationControls("as-animation-controls-widget", "hour");
bridge.build();
</script>
</body>
</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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<title>Airship bridge</title>
<script src="https://cdn.jsdelivr.net/npm/lodash@4.17.11/lodash.min.js"></script>
<script src="https://libs.cartocdn.com/carto-vl/v1.4/carto-vl.min.js"></script>
<link
href="https://api.tiles.mapbox.com/mapbox-gl-js/v0.52.0/mapbox-gl.css"
rel="stylesheet"
/>
<script src="https://api.tiles.mapbox.com/mapbox-gl-js/v0.52.0/mapbox-gl.js"></script>
<link rel="stylesheet" href="https://libs.cartocdn.com/airship-style/v2.4.1/airship.css" />
<script
type="module"
src="https://libs.cartocdn.com/airship-components/v2.4.1/airship/airship.esm.js"
></script>
<script
nomodule=""
src="https://libs.cartocdn.com/airship-components/v2.4.1/airship/airship.js"
></script>
<script src="https://libs.cartocdn.com/airship-bridge/v2.4.1/asbridge.js"></script>
<style>
.as-map-footer {
max-width: 812px;
}
</style>
</head>
<body class="as-app-body">
<div class="as-app">
<div class="as-content">
<main class="as-main">
<div class="as-map-area">
<div id="map"></div>
</div>
<div class="as-map-footer">
<div class="as-box">
<as-animation-controls-widget
animated
heading="Animation"
description="Try seeking and pausing"
>
</as-animation-controls-widget>
</div>
<div class="as-box">
<as-category-widget show-clear-button> </as-category-widget>
</div>
</div>
</main>
</div>
</div>
<script>
const map = new mapboxgl.Map({
container: "map",
style: carto.basemaps.darkmatter,
center: [-122.327739, 47.615199],
zoom: 10,
});
carto.setDefaultAuth({
username: "cartovl",
apiKey: "default_public",
});
const source = new carto.source.Dataset("seattle_collisions");
const viz = new carto.Viz(`
@duration: 30
strokeWidth: 0
color: ramp($addrtype, Bold)
filter: animation($incdate, 30, fade(1, 1))
`);
const layer = new carto.Layer("layer", source, viz);
const animationControlsWidget = document.querySelector(
"as-animation-controls-widget"
);
const categoryWidget = document.querySelector("as-category-widget");
layer.addTo(map, "watername_ocean");
const bridge = new AsBridge.VLBridge({
carto: carto,
map: map,
layer: layer,
source: source,
});
bridge.animationControls(animationControlsWidget, "year");
bridge.category(categoryWidget, "addrtype", {
readOnly: false,
});
bridge.build();
</script>
</body>
</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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Airship bridge ramp legends</title>
<script src="https://cdn.jsdelivr.net/npm/lodash@4.17.11/lodash.min.js"></script>
<script src="https://libs.cartocdn.com/carto-vl/v1.4/carto-vl.min.js"></script>
<link href="https://api.tiles.mapbox.com/mapbox-gl-js/v0.52.0/mapbox-gl.css" rel="stylesheet" />
<script src="https://api.tiles.mapbox.com/mapbox-gl-js/v0.52.0/mapbox-gl.js"></script>
<link rel="stylesheet" href="https://libs.cartocdn.com/airship-style/v2.4.1/airship.css">
<script type="module" src="https://libs.cartocdn.com/airship-components/v2.4.1/airship/airship.esm.js"></script>
<script nomodule="" src="https://libs.cartocdn.com/airship-components/v2.4.1/airship/airship.js"></script>
<script src="https://libs.cartocdn.com/airship-bridge/v2.4.1/asbridge.js"></script>
<style>
.as-panel {
flex-direction: column;
}
as-legend {
width: 100%;
}
</style>
</head>
<body class="as-app-body">
<div class="as-app">
<as-responsive-content>
<main class="as-main">
<div class="as-map-area">
<div id="map"></div>
<div class="as-map-panels">
<div class="as-panel as-panel--top as-panel--left" id="legends">
<as-legend
id="legendsLocation"
heading="Location"
description="Point size is defined by location">
<as-legend-size-bins-point
slot="legends"
id="airportLegend">
</as-legend-size-bins-point>
</as-legend>
<as-legend
id="legendsRivers"
heading="Rivers"
description="Color intensity is defined by river length">
<as-legend-color-continuous id="rivers" slot="legends">
</as-legend-color-continuous>
</as-legend>
<as-legend
id="legendsRivers"
heading="Rivers"
description="Same as above, using a gradient legend">
<as-legend-color-continuous-polygon id="riversGradient" slot="legends">
</as-legend-color-continuous-polygon>
</as-legend>
</div>
</div>
</div>
</main>
</as-responsive-content>
</div>
<script>
const responsive = document.querySelector('as-responsive-content');
responsive.componentOnReady().then(() => {
const map = new mapboxgl.Map({
container: 'map',
style: carto.basemaps.darkmatter,
center: [-4.77, 37.88],
zoom: 2
});
carto.setDefaultAuth({
username: 'roman-carto',
apiKey: 'default_public'
});
const s = carto.expressions;
const airportSource = new carto.source.Dataset('ne_10m_airports');
const airportViz = new carto.Viz(`
strokeWidth: 0
width: ramp($location, [8, 24])
`);
const airportLayer = new carto.Layer('airports', airportSource, airportViz);
airportLayer.addTo(map, 'watername_ocean');
const riversSource = new carto.source.Dataset('ne_50m_rivers_lake_centerlines');
const riversViz = new carto.Viz(`
color: ramp($lgth, SUNSET)
width: 3
`);
const riversLayer = new carto.Layer('rivers', riversSource, riversViz);
riversLayer.addTo(map, 'watername_ocean');
AsBridge.VL.Legends.rampLegend('#airportLegend',
airportLayer,
'width',
{
dynamic: true
}
);
AsBridge.VL.Legends.rampLegend('#rivers',
riversLayer,
'color',
{
dynamic: true
}
);
AsBridge.VL.Legends.rampLegend('#riversGradient',
riversLayer,
'color',
{
dynamic: true
}
);
});
</script>
</body>
</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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Airship bridge multi layer legend</title>
<script src="https://cdn.jsdelivr.net/npm/lodash@4.17.11/lodash.min.js"></script>
<script src="https://libs.cartocdn.com/carto-vl/v1.4/carto-vl.min.js"></script>
<link href="https://api.tiles.mapbox.com/mapbox-gl-js/v0.52.0/mapbox-gl.css" rel="stylesheet" />
<script src="https://api.tiles.mapbox.com/mapbox-gl-js/v0.52.0/mapbox-gl.js"></script>
<link rel="stylesheet" href="https://libs.cartocdn.com/airship-style/v2.4.1/airship.css">
<script type="module" src="https://libs.cartocdn.com/airship-components/v2.4.1/airship/airship.esm.js"></script>
<script nomodule="" src="https://libs.cartocdn.com/airship-components/v2.4.1/airship/airship.js"></script>
<script src="https://libs.cartocdn.com/airship-bridge/v2.4.1/asbridge.js"></script>
<style>
.as-panel {
flex-direction: column;
padding: 16px;
background: white;
}
.as-btn {
margin-top: 16px;
}
as-legend {
--as-legend--padding: 0;
width: 100%;
}
</style>
</head>
<body class="as-app-body">
<div class="as-app">
<as-responsive-content>
<main class="as-main">
<div class="as-map-area">
<div id="map"></div>
<div class="as-map-panels">
<div class="as-panel as-panel--top as-panel--left" id="legends">
<as-legend
id="legendsLocation"
heading="Layers">
<as-legend-category
slot="legends"
id="legend">
</as-legend-category>
</as-legend>
<button id="changeStyle" class="as-btn as-btn--primary">Change style</button>
</div>
</div>
</div>
</main>
</as-responsive-content>
</div>
<script>
const responsive = document.querySelector('as-responsive-content');
responsive.componentOnReady().then(() => {
const map = new mapboxgl.Map({
container: 'map',
style: carto.basemaps.darkmatter,
center: [-4.77, 37.88],
zoom: 2
});
carto.setDefaultAuth({
username: 'roman-carto',
apiKey: 'default_public'
});
const s = carto.expressions;
const bordersSource = new carto.source.Dataset('world_borders');
const bordersViz = new carto.Viz('strokeWidth: 0');
const bordersLayer = new carto.Layer('borders', bordersSource, bordersViz);
bordersLayer.addTo(map, 'watername_ocean');
const airportSource = new carto.source.Dataset('ne_10m_airports');
const airportViz = new carto.Viz('strokeWidth: 0');
const airportLayer = new carto.Layer('airports', airportSource, airportViz);
airportLayer.addTo(map, 'watername_ocean');
const riversSource = new carto.source.Dataset('ne_50m_rivers_lake_centerlines');
const riversViz = new carto.Viz();
const riversLayer = new carto.Layer('rivers', riversSource, riversViz);
riversLayer.addTo(map, 'watername_ocean');
AsBridge.VL.Legends.layersLegend('#legend',
[{ layer: airportLayer, props: { label: 'World Airports' }}, riversLayer, bordersLayer],
{
dynamic: true
}
);
// When this fires, the legend will update because we are using dynamic: true
document.querySelector('#changeStyle').addEventListener('click', () => {
bordersViz.color.blendTo('#483c69');
airportViz.width.blendTo(16);
riversViz.color.blendTo('#ffcc37')
});
});
</script>
</body>
</html>