|
| 1 | +<!DOCTYPE html> |
| 2 | +<html lang="en"> |
| 3 | + <head> |
| 4 | + <meta charset="utf-8" /> |
| 5 | + <title>Exploring Data With Only a Webserver</title> |
| 6 | + <link rel="stylesheet" href="/css/document.css" /> |
| 7 | + <link |
| 8 | + rel="shortcut icon" |
| 9 | + type="image/x-icon" |
| 10 | + href="/img/favicon.ico" |
| 11 | + /> |
| 12 | + <script |
| 13 | + async |
| 14 | + src="https://www.googletagmanager.com/gtag/js?id=G-0M10W7C20Y" |
| 15 | + ></script> |
| 16 | + <script> |
| 17 | + window.dataLayer = window.dataLayer || []; |
| 18 | + function gtag() { |
| 19 | + dataLayer.push(arguments); |
| 20 | + } |
| 21 | + gtag("js", new Date()); |
| 22 | + |
| 23 | + gtag("config", "G-0M10W7C20Y"); |
| 24 | + </script> |
| 25 | + <script src="/js/generated/malloy-render-0.0.397.js"></script> |
| 26 | + <style> |
| 27 | + .result-inner .malloy-render { |
| 28 | + width: 100%; |
| 29 | + } |
| 30 | + .result-inner .table-container { |
| 31 | + width: 100%; |
| 32 | + } |
| 33 | + </style> |
| 34 | + </head> |
| 35 | + <body> |
| 36 | + <div class="top"> |
| 37 | + <div class="header"> |
| 38 | + <div class="header-banner"> |
| 39 | + <a href="http://www.malloydata.dev" target="_blank"> |
| 40 | + <img |
| 41 | + class="logo" |
| 42 | + src="/img/logo.png" |
| 43 | + alt="malloy logo" |
| 44 | + /> |
| 45 | + </a> |
| 46 | + |
| 47 | + Malloy |
| 48 | + <a href="/blog"><span class="subtitle">Blog</span></a> |
| 49 | + </div> |
| 50 | + <div class="header-right"> |
| 51 | + <div class="header-links"> |
| 52 | + <a href="https://github.com/malloydata/malloy" target="_blank" |
| 53 | + ><img |
| 54 | + src="/img/github.svg" |
| 55 | + style="transform: scale(0.5)" |
| 56 | + /></a> |
| 57 | + <a href="/slack" target="_blank" |
| 58 | + ><img src="/img/slack.svg" |
| 59 | + /></a> |
| 60 | + </div> |
| 61 | + </div> |
| 62 | + </div> |
| 63 | + <div class="main"> |
| 64 | + <div class="content"> |
| 65 | + <div class="document-outer blog"> |
| 66 | + |
| 67 | + <div class="blog-header linear-navigation"> |
| 68 | + <div class="item"> |
| 69 | + <a href="/blog" |
| 70 | + ><img |
| 71 | + src="/img/previous.svg" |
| 72 | + alt="previous" |
| 73 | + />All Posts</a |
| 74 | + > |
| 75 | + </div> |
| 76 | + <div class="edit-link"> |
| 77 | + <a |
| 78 | + class="edit-link" |
| 79 | + target="_blank" |
| 80 | + href="https://github.dev/malloydata/malloydata.github.io/blob/main/src/blog/2022-11-24-webserver-data/index.malloynb#C1" |
| 81 | + >VSCode |
| 82 | + <img |
| 83 | + src="/img/open_notebook.svg" |
| 84 | + alt="document" |
| 85 | + /></a> |
| 86 | + </div> |
| 87 | + </div> |
| 88 | + <div class="document"><div class="title-row"> |
| 89 | + |
| 90 | + <h1> |
| 91 | + <a id="exploring-data-with-only-a-webserver" class="header-link anchor" href="#exploring-data-with-only-a-webserver"> |
| 92 | + Exploring Data With Only a Webserver |
| 93 | + </a> |
| 94 | + </h1> |
| 95 | + |
| 96 | + <a class="edit-link" target="_blank" href="https://github.dev/malloydata/malloydata.github.io/blob/main/src/blog/2022-11-24-webserver-data/index.malloynb#C1">VSCode <img src="/img/open_notebook.svg" alt="document"/></a> |
| 97 | + </div> |
| 98 | + <p>Malloy Composer lets you build a web based data exploration experience by adding just 3 files to your data model.</p> |
| 99 | +<p><em>November 24, 2022 by lloyd tabb</em> |
| 100 | +<br/><br/><br/></p> |
| 101 | + |
| 102 | + <h2> |
| 103 | + <a id="try-it-first-" class="header-link anchor" href="#try-it-first-"> |
| 104 | + <a href="https://lloydtabb.github.io/babynames/#/default">Try it First.</a> |
| 105 | + </a> |
| 106 | + </h2> |
| 107 | + <p>Believe it or not, the page <a href="https://lloydtabb.github.io/babynames/#/default?page=about">below runs</a> entirely in your web browser. The SQL database engine (DuckDB) is running in your browser. The Malloy compiler is running in your browser too. The <a href="https://github.com/lloydtabb/babynames">whole</a> application is built with <a href="https://github.com/lloydtabb/babynames/blob/main/names.malloy">200 lines of Malloy code</a>, a <a href="https://github.com/lloydtabb/babynames/blob/main/composer.json">config file</a>, a <a href="https://raw.githubusercontent.com/lloydtabb/babynames/main/names.md">markdown document</a> and a <a href="https://github.com/lloydtabb/babynames/blob/main/index.html">single html file</a>. Just look at the <a href="https://github.com/lloydtabb/babynames">repository on Github</a>.</p> |
| 108 | +<img src="baby-names.png"/><p><a href="https://lloydtabb.github.io/babynames/#/default">Try it!</a></p> |
| 109 | +<div class="title-row"> |
| 110 | + |
| 111 | + <h1> |
| 112 | + <a id="want-to-do-this-with-your-own-data-set-" class="header-link anchor" href="#want-to-do-this-with-your-own-data-set-"> |
| 113 | + Want to do this with your own data set? |
| 114 | + </a> |
| 115 | + </h1> |
| 116 | + |
| 117 | + <a class="edit-link" target="_blank" href="https://github.dev/malloydata/malloydata.github.io/blob/main/src/blog/2022-11-24-webserver-data/index.malloynb#C1">VSCode <img src="/img/open_notebook.svg" alt="document"/></a> |
| 118 | + </div> |
| 119 | + <p>It’s easy, just follow the three steps below.</p> |
| 120 | + |
| 121 | + <h2> |
| 122 | + <a id="step-1-build-a-malloy-data-model" class="header-link anchor" href="#step-1-build-a-malloy-data-model"> |
| 123 | + Step 1: Build a Malloy Data Model |
| 124 | + </a> |
| 125 | + </h2> |
| 126 | + <p>Install VSCode and add the <a href="https://marketplace.visualstudio.com/items?itemName=malloydata.malloy-vscode">Malloy Extension</a>. Build and test your data model.</p> |
| 127 | + |
| 128 | + <h2> |
| 129 | + <a id="step-2-add-the-index-html-composer-json-and-names-md" class="header-link anchor" href="#step-2-add-the-index-html-composer-json-and-names-md"> |
| 130 | + Step 2: Add the index.html, composer.json and names.md |
| 131 | + </a> |
| 132 | + </h2> |
| 133 | + <p>The file <code>index.html</code> shouldn’t need any modification. Edit the <code>composer.json</code> to point at your malloy file and the tables that it uses. Rename and edit the names file to have queries that are interesting to you.</p> |
| 134 | + |
| 135 | + <h2> |
| 136 | + <a id="step-3-serve-from-any-webserver" class="header-link anchor" href="#step-3-serve-from-any-webserver"> |
| 137 | + Step 3: Serve from any webserver |
| 138 | + </a> |
| 139 | + </h2> |
| 140 | + <p>We use <a href="https://pages.github.com/">Github Pages</a> to serve the above example. Check in all your source code, turn on Github Pages and your whole repository is available from the web. Point a browser at the root and composer should be running.</p> |
| 141 | +</div> |
| 142 | + <div class="blog-footer linear-navigation"> |
| 143 | + <div class="item"> |
| 144 | + |
| 145 | + </div> |
| 146 | + <div class="item"> |
| 147 | + <a href="/blog//2022-11-25-composing-queries" |
| 148 | + >Next Post<img |
| 149 | + src="/img/next.svg" |
| 150 | + alt="previous" /></a |
| 151 | + > |
| 152 | + </div> |
| 153 | + </div> |
| 154 | + </div> |
| 155 | + </div> |
| 156 | + <script src="/js/view_toggles.js"></script> |
| 157 | + <script src="/js/jump_to_hash.js"></script> |
| 158 | + </div> |
| 159 | + </div> |
| 160 | + <div id="banner_wrapper"> |
| 161 | + <div id="banner"> |
| 162 | + <div> |
| 163 | + This site uses cookies from Google to deliver its services and to analyze |
| 164 | + traffic. |
| 165 | + <a |
| 166 | + href="https://policies.google.com/technologies/cookies" |
| 167 | + target="_blank" |
| 168 | + > |
| 169 | + Learn more |
| 170 | + </a> |
| 171 | + </div> |
| 172 | + <button id="banner_button">I Understand</button> |
| 173 | + </div> |
| 174 | + </div> |
| 175 | + <script src="/js/banner.js"></script> |
| 176 | + </body> |
| 177 | +</html> |
0 commit comments