-
-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Documenter.jl
committed
Mar 3, 2025
1 parent
28bddb9
commit 5509800
Showing
70 changed files
with
41,542 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"documenter":{"julia_version":"1.11.3","generation_timestamp":"2025-03-03T18:32:12","documenter_version":"1.8.1"}} |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><title>Assets · Bonito</title><meta name="title" content="Assets · Bonito"/><meta property="og:title" content="Assets · Bonito"/><meta property="twitter:title" content="Assets · Bonito"/><meta name="description" content="Documentation for Bonito."/><meta property="og:description" content="Documentation for Bonito."/><meta property="twitter:description" content="Documentation for Bonito."/><script data-outdated-warner src="assets/warner.js"></script><link href="https://cdnjs.cloudflare.com/ajax/libs/lato-font/3.0.0/css/lato-font.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/juliamono/0.050/juliamono.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/fontawesome.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/solid.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/brands.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.16.8/katex.min.css" rel="stylesheet" type="text/css"/><script>documenterBaseURL="."</script><script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js" data-main="assets/documenter.js"></script><script src="search_index.js"></script><script src="siteinfo.js"></script><script src="../versions.js"></script><link class="docs-theme-link" rel="stylesheet" type="text/css" href="assets/themes/catppuccin-mocha.css" data-theme-name="catppuccin-mocha"/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="assets/themes/catppuccin-macchiato.css" data-theme-name="catppuccin-macchiato"/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="assets/themes/catppuccin-frappe.css" data-theme-name="catppuccin-frappe"/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="assets/themes/catppuccin-latte.css" data-theme-name="catppuccin-latte"/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="assets/themes/documenter-dark.css" data-theme-name="documenter-dark" data-theme-primary-dark/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="assets/themes/documenter-light.css" data-theme-name="documenter-light" data-theme-primary/><script src="assets/themeswap.js"></script></head><body><div id="documenter"><nav class="docs-sidebar"><div class="docs-package-name"><span class="docs-autofit"><a href="index.html">Bonito</a></span></div><button class="docs-search-query input is-rounded is-small is-clickable my-2 mx-auto py-1 px-2" id="documenter-search-query">Search docs (Ctrl + /)</button><ul class="docs-menu"><li><a class="tocitem" href="index.html">Home</a></li><li><span class="tocitem">Components</span><ul><li><a class="tocitem" href="styling.html">Styling</a></li><li><a class="tocitem" href="components.html">Components</a></li><li><a class="tocitem" href="layouting.html">Layouting</a></li><li><a class="tocitem" href="widgets.html">Widgets</a></li><li><a class="tocitem" href="interactions.html">Interactions</a></li></ul></li><li><span class="tocitem">Examples</span><ul><li><a class="tocitem" href="plotting.html">Plotting</a></li><li><a class="tocitem" href="javascript-libraries.html">Wrapping JS libraries</a></li><li class="is-active"><a class="tocitem" href="assets.html">Assets</a></li><li><a class="tocitem" href="extending.html">Extending</a></li></ul></li><li><a class="tocitem" href="deployment.html">Deployment</a></li><li><a class="tocitem" href="static.html">Static Sites</a></li><li><a class="tocitem" href="api.html">Api</a></li></ul><div class="docs-version-selector field has-addons"><div class="control"><span class="docs-label button is-static is-size-7">Version</span></div><div class="docs-selector control is-expanded"><div class="select is-fullwidth is-size-7"><select id="documenter-version-selector"></select></div></div></div></nav><div class="docs-main"><header class="docs-navbar"><a class="docs-sidebar-button docs-navbar-link fa-solid fa-bars is-hidden-desktop" id="documenter-sidebar-button" href="#"></a><nav class="breadcrumb"><ul class="is-hidden-mobile"><li><a class="is-disabled">Examples</a></li><li class="is-active"><a href="assets.html">Assets</a></li></ul><ul class="is-hidden-tablet"><li class="is-active"><a href="assets.html">Assets</a></li></ul></nav><div class="docs-right"><a class="docs-navbar-link" href="https://github.com/SimonDanisch/Bonito.jl" title="View the repository on GitHub"><span class="docs-icon fa-brands"></span><span class="docs-label is-hidden-touch">GitHub</span></a><a class="docs-navbar-link" href="https://github.com/SimonDanisch/Bonito.jl/blob/master/docs/src/assets.md" title="Edit source on GitHub"><span class="docs-icon fa-solid"></span></a><a class="docs-settings-button docs-navbar-link fa-solid fa-gear" id="documenter-settings-button" href="#" title="Settings"></a><a class="docs-article-toggle-button fa-solid fa-chevron-up" id="documenter-article-toggle-button" href="javascript:;" title="Collapse all docstrings"></a></div></header><article class="content" id="documenter-page"><h1 id="Assets"><a class="docs-heading-anchor" href="#Assets">Assets</a><a id="Assets-1"></a><a class="docs-heading-anchor-permalink" href="#Assets" title="Permalink"></a></h1><pre><code class="language-julia hljs">some_file = Asset("path/to/local/file") | ||
# ES6Module creates an Asset with the flags set appropriately to | ||
# treat it as a module | ||
jsmodule = ES6Module("path/to/local/es6module.js")::Asset | ||
|
||
# These assets can be interpolated into DOM elements and js strings: | ||
js""" | ||
// this will result in importing jsmodule | ||
// Doing this in many places will only import jsmodule once | ||
$(jsmodule).then(jsmodule=> { | ||
// Do something with the module :) | ||
}) | ||
// This will give you the raw bytes as a Uint8Array | ||
$(some_file).then(raw_bytes => { | ||
// do something with bytes | ||
}) | ||
""" | ||
|
||
# This will resolve to a valid URL depending on the used asset server | ||
DOM.img(src=some_file) | ||
|
||
# This will also resolve to a valid URL and load jsmodule as an es6 module | ||
DOM.script(src=jsmodule, type="module") | ||
|
||
# Assets also work with online sources. | ||
# Usage is exactly the same as when using local files | ||
THREE = ES6Module("https://unpkg.com/three@0.136.0/build/three.js") | ||
# Also offer an easy way to use packages from a CDN (currently esm.sh): | ||
THREE = CDNSource("three"; version="0.137.5")</code></pre><pre><code class="language-julia hljs"># Javascript & CSS dependencies can be declared locally and | ||
# freely interpolated in the DOM / js string, and will make sure it loads | ||
# Note, that they will be a `Promise` though, so to use them you need to call `module.then(module=> ...)`. | ||
const THREE = ES6Module("https://cdn.esm.sh/v66/three@0.136/es2021/three.js") | ||
|
||
app = App() do session, request | ||
width = 500; height = 500 | ||
dom = DOM.div(width = width, height = height) | ||
Bonito.onload(session, dom, js""" | ||
function (container){ | ||
$(THREE).then(THREE=> { | ||
var renderer = new THREE.WebGLRenderer({antialias: true}); | ||
renderer.setSize($width, $height); | ||
renderer.setClearColor("#ffffff"); | ||
container.appendChild(renderer.domElement); | ||
var scene = new THREE.Scene(); | ||
var camera = new THREE.PerspectiveCamera(75, $width / $height, 0.1, 1000); | ||
camera.position.z = 4; | ||
var ambientLight = new THREE.AmbientLight(0xcccccc, 0.4); | ||
scene.add(ambientLight); | ||
var pointLight = new THREE.PointLight(0xffffff, 0.8); | ||
camera.add(pointLight); | ||
scene.add(camera); | ||
var geometry = new THREE.SphereGeometry(1.0, 32, 32); | ||
var material = new THREE.MeshPhongMaterial({color: 0xffff00}); | ||
var sphere = new THREE.Mesh(geometry, material); | ||
scene.add(sphere); | ||
renderer.render(scene, camera); | ||
}) | ||
} | ||
""") | ||
return dom | ||
end</code></pre><div> | ||
<div class="bonito-fragment" id="e11ac37d-bfef-4342-9899-8cece3e4ceec" data-jscall-id="root"> | ||
<div> | ||
<script src="bonito/js/Bonito.bundled18337850317416755547.js" type="module"></script> | ||
<style></style> | ||
<div></div> | ||
</div> | ||
<div> | ||
<script type="module">Bonito.lock_loading(() => Bonito.init_session('e11ac37d-bfef-4342-9899-8cece3e4ceec', null, 'root', false))</script> | ||
<span></span> | ||
</div> | ||
</div> | ||
<div class="bonito-fragment" id="8b91a4d7-1459-4371-92d6-9d21e154b0ff" data-jscall-id="subsession-application-dom"> | ||
<div> | ||
<style></style> | ||
<div></div> | ||
</div> | ||
<div> | ||
<script type="module"> Bonito.lock_loading(() => { | ||
return Bonito.fetch_binary('bonito/bin/8450da94e0ca169ba0230a7f4348d31946d5153a-4837996471758746152.bin').then(msgs=> Bonito.init_session('8b91a4d7-1459-4371-92d6-9d21e154b0ff', msgs, 'sub', false)); | ||
}) | ||
</script> | ||
<div height="500" data-jscall-id="1" width="500"></div> | ||
</div> | ||
</div> | ||
</div></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="javascript-libraries.html">« Wrapping JS libraries</a><a class="docs-footer-nextpage" href="extending.html">Extending »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="auto">Automatic (OS)</option><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="catppuccin-latte">catppuccin-latte</option><option value="catppuccin-frappe">catppuccin-frappe</option><option value="catppuccin-macchiato">catppuccin-macchiato</option><option value="catppuccin-mocha">catppuccin-mocha</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.8.1 on <span class="colophon-date" title="Monday 3 March 2025 18:32">Monday 3 March 2025</span>. Using Julia version 1.11.3.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html> |
Oops, something went wrong.