Database-BI
view release on metacpan or search on metacpan
website/html/canvas.html view on Meta::CPAN
</p>
<h2>Bookmarks and undo</h2>
<p>
Bookmarks record the canvas's state, including parameters, and undo and redo
step through them. Because the state lives in the URL as well as in the
document, a bookmark is a link that can be sent; because the range inside it
is relative, the link still means the same thing when it is opened next month.
</p>
<h2 id="sharing">Sharing and embedding</h2>
<dl class="spec">
<dt><code>/a/:id</code></dt>
<dd>The canvas itself, with cross-filter, drill, parameter and range parameters. With a <a href="install.html#login">password</a> set, it needs the login.</dd>
<dt><code>/share/:id</code></dt>
<dd>A share link, signed with an HMAC-SHA256 token, for handing a canvas to someone who should not need an account. The canvas toolbar's <b>Share…</b> panel makes one, valid for 30 days. It opens without the login. The key is <code>share_secr...
<dt><code>/embed/:id</code></dt>
<dd>A page with no navigation, for putting the canvas inside another page; the Share panel gives its <code><iframe></code> code. Like every page, it is sent with <code>X-Frame-Options: SAMEORIGIN</code> and with <code>frame-ancestors 'self'</c...
<dt><code>/catalog</code></dt>
<dd>Every saved canvas in one place, as cards that open.</dd>
</dl>
<h2>Exporting from a canvas</h2>
<p>
Each card (like each chart page) asks where to save and what to call the file,
in browsers that can, and otherwise downloads it. Each card can save itself whole — SVG, PNG or a one-page PDF — including
the parts that hang outside the viewBox, such as rotated axis labels. A pie's
HTML legend is drawn into the saved copy, and a map or table card keeps the
image buttons hidden because there is no chart to save. A card's data can
also be downloaded as CSV, from the canvas's own rows rather than from any
other source. The whole canvas prints to paper or PDF. Saved cards and printed
canvases use the light colours, whichever <a href="index.html#preferences">theme</a>
the reader has chosen.
</p>
<h3 id="alerts">Alerts</h3>
<p>
A saved canvas's <b>Alerts…</b> panel sets limits on numbers worked out
from its data — the rows, or a total, average, smallest, largest or count
of different values of a column — so that cron is not needed.
<b>Check now</b> checks at once and <b>Try it</b> does so without recording or
sending anything. A limit that stays crossed can be announced again at most
every period you choose, and the end of a crossing can be announced too. What
was announced is listed under <em>Recent alerts</em>. Set
<a href="install.html#settings"><code>alert_every</code></a> and the running
server checks on its own; set <code>alert_notify_cmd</code> and it runs that
command for each announcement. The memory that throttles an alert is the file
<code>script/bi-alert</code> uses, so the two agree.
</p>
<p>
The canvas itself can be kept as a file: the Share panel's <b>Download as
JSON</b> saves it, and <b>Import canvas</b> on the Canvases page (<code>/canvases</code>, the
main navigation's Canvases link) makes a new canvas
from that file, on this server or another.
</p>
<div class="note">
<p>
Canvases live in <code>analyses.json</code> under the model directory, not
in a database. The JSON API can list, create, patch, import and export them,
and can append a visual without a browser — see
<a href="api.html#visuals">the visuals endpoint</a>.
</p>
</div>
<h2>Where the numbers come from</h2>
<p>
A canvas stores datasets, joins, calculated fields and visuals, not rows. Each
card runs the same pipeline as the page it was saved from
(<a href="data.html">Data</a> describes the stages), which is why a canvas
over a file that changed overnight shows this morning's figures, and why the
same canvas can be narrowed by a range without storing the dates it resolved
to.
</p>
</main>
<footer class="site-footer">
<div class="wrap">
<p>Database::BI by Nigel Horne. Released under the GPL2.</p>
<p>
<a href="https://metacpan.org/dist/Database-BI">MetaCPAN</a> ·
<a href="https://github.com/nigelhorne/Database-BI">GitHub</a>
</p>
</div>
</footer>
</body>
</html>
( run in 0.714 second using v1.01-cache-2.11-cpan-eb134014566 )