-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathindex.qmd
More file actions
273 lines (215 loc) · 7.03 KB
/
index.qmd
File metadata and controls
273 lines (215 loc) · 7.03 KB
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
---
pagetitle: "ggsql"
page-layout: custom
section-divs: false
toc: false
lightbox: false
repo-actions: false
listing:
- id: example-carousel
contents: gallery/examples
type: grid
grid-columns: 6
image-height: 150px
fields: [image, title]
sort: "order"
max-items: 6
include-in-header:
text: |
<link href="https://fonts.googleapis.com/css2?family=Antic+Didone&display=swap" rel="stylesheet">
---
::: {.hero-banner}
# <span class="hcode">QUERY</span> <span class="hviz-wrapper">{.hviz aria-hidden="true"}<span class="sr-only">VISUALIZE</span></span> <span class="hund">UNDERSTAND</span>
::: {.hero-body}
ggsql brings the elegance of the [Grammar of Graphics](get_started/grammar.qmd) to SQL. Write familiar queries, add visualization clauses, and see your data transform into beautiful, composable charts — no context switching, no separate tools, just SQL with superpowers.
::: {.hero-buttons}
[Get started](get_started/installation.qmd){.btn .btn-primary .btn-lg}
[View examples](gallery/index.qmd){.btn .btn-outline-primary .btn-lg}
:::
:::
:::
::: {.content-block .dark-bg}
### Try it out
```{ggsql}
-- Regular query
SELECT * FROM ggsql:penguins
WHERE island = 'Biscoe'
-- Followed by visualization declaration
VISUALISE bill_len AS x, bill_dep AS y, body_mass AS fill
DRAW point
PLACE rule
SETTING slope => 0.4, y => -1
SCALE BINNED fill
LABEL
title => 'Relationship between bill dimensions in 3 species of penguins',
x => 'Bill length (mm)',
y => 'Bill depth (mm)'
```
:::
::: {.content-block .examples-carousel}
## Explore the examples
::: {#example-carousel}
:::
[See all examples →](gallery/index.qmd){.see-all-link}
:::
::: {.content-block .dark-bg .install-section}
### Install it today
::: {.install-columns}
::: {.install-col .install-col-left}
::: {#installer-recommended}
<noscript>Download from [GitHub Releases](https://github.com/posit-dev/ggsql/releases)</noscript>
:::
[Other platforms](get_started/installation.qmd){.other-platforms-link}
:::
::: {.install-divider}
[or]{.divider-text}
:::
::: {.install-col .install-col-right}
```bash
# Jupyter kernel
uv tool install ggsql-jupyter
ggsql-jupyter --install
# CLI
uv tool install ggsql
```
:::
:::
```{=html}
<script>
(function() {
const repoOwner = 'posit-dev';
const repoName = 'ggsql';
const includePreReleases = true;
function detectOS() {
const ua = navigator.userAgent.toLowerCase();
if (ua.includes('win')) return 'windows';
if (ua.includes('mac')) return 'macos';
if (ua.includes('linux')) return 'linux';
return 'unknown';
}
function getOSIcon(os) {
const icons = {
windows: 'bi-windows',
macos: 'bi-apple',
linux: 'bi-ubuntu'
};
return icons[os] ? `<i class="bi ${icons[os]}"></i>` : '';
}
const patterns = {
windows_exe: /^ggsql[_-]\d.*x64.*-setup\.exe$/i,
macos: /^ggsql[_-]\d.*(aarch64|arm64).*\.dmg$/i,
linux: /^ggsql[_-]\d.*amd64.*\.deb$/i
};
function findAsset(assets, pattern) {
return assets?.find(a => pattern?.test(a.name));
}
async function loadInstaller() {
const container = document.getElementById('installer-recommended');
if (!container) return;
const os = detectOS();
try {
const endpoint = includePreReleases
? `https://api.github.com/repos/${repoOwner}/${repoName}/releases`
: `https://api.github.com/repos/${repoOwner}/${repoName}/releases/latest`;
const response = await fetch(endpoint);
if (!response.ok) throw new Error('Failed to fetch release');
const data = await response.json();
const release = includePreReleases ? data[0] : data;
if (!release) throw new Error('No releases found');
const version = release.tag_name;
const assets = release.assets || [];
let asset;
if (os === 'windows') {
asset = findAsset(assets, patterns.windows_exe);
} else if (os === 'macos') {
asset = findAsset(assets, patterns.macos);
} else if (os === 'linux') {
asset = findAsset(assets, patterns.linux);
}
container.innerHTML = `
<a href="${asset?.browser_download_url || release.html_url}" class="btn btn-primary install-btn">
${getOSIcon(os)} Download ggsql ${version}
</a>
`;
} catch (e) {
container.innerHTML = `
<a href="https://github.com/${repoOwner}/${repoName}/releases" class="btn btn-primary install-btn">
View Downloads on GitHub
</a>
`;
}
}
if (document.readyState === 'loading') {
document.addEventListener('DOMContentLoaded', loadInstaller);
} else {
loadInstaller();
}
})();
</script>
```
:::
::: {.content-block}
## Features
::: {.features}
::: {.feature}
### Familiar syntax
Write standard SQL queries and seamlessly extend them with visualization clauses. Your existing SQL knowledge transfers directly.
```{.ggsql .code-example}
SELECT date, revenue, region
FROM sales
WHERE year = 2024
VISUALISE date AS x, revenue AS y
DRAW line
```
:::
::: {.feature}
### Grammar of graphics
Compose visualizations from independent layers, scales, and coordinates. Mix and match components for powerful custom visuals. The [grammar of graphics](get_started/grammar.qmd) provides you with a single mental model for every type of plot.
```{.ggsql .code-example}
VISUALISE date AS x FROM sales
DRAW bar
SCALE BINNED x
SETTING breaks => 'weeks'
FACET region
```
:::
::: {.feature}
### Built for humans _and_ AI
The structured syntax makes it easy for AI agents to write, and for you to read, adjust, and verify.
You also avoid needing agents to launch full programming languages like Python or R to create powerful visualizations, so you can rest assured that the agent doesn't accidentally alter your environment in unwanted ways.
:::
::: {.feature}
### Connect directly to your data
ggsql interfaces directly with your database. Want to create a histogram over 1 billion observations? No problem! All calculations are pushed to the database so you only extract what is needed for the visual.
:::
:::
:::
::: {.content-block .integrations}
## Available where your data is
::: {.tool-grid}
::: {.tool-item}
[{.tool-logo} Positron](get_started/installation.qmd#vs-code--positron-extension)
:::
::: {.tool-item}
[{.tool-logo} Quarto](get_started/installation.qmd#jupyter-kernel)
:::
::: {.tool-item}
[{.tool-logo} Jupyter](get_started/installation.qmd#jupyter-kernel)
:::
::: {.tool-item}
[{.tool-logo} VS Code](get_started/installation.qmd#vs-code--positron-extension)
:::
:::
:::
::: {.content-block}
::: {.cta-section}
## Ready to get started?
Install ggsql and start creating visualizations in minutes.
::: {.cta-buttons}
[Installation](get_started/installation.qmd){.btn .btn-primary .btn-lg}
[Documentation](syntax/index.qmd){.btn .btn-outline-primary .btn-lg}
[Examples](gallery/index.qmd){.btn .btn-outline-secondary .btn-lg}
:::
Or try our [online playground](wasm/) to experience the syntax _right now_.
:::
:::