Envision Gallery
This gallery contains sample Envision scripts and sample datasets.
Pretty-print Envision scripts
To pretty-print Envision scripts in a web page, you should:
- include the JavaScript file
https://docs.lokad.com/js/envision.min.js
- use
<code class=language-envision data-lang=envision>
blocks to introduce you scripts. - call
syntax.highlightElementsWithClass('language-envision')
The following minimal HTML page illustrates the process:
<!DOCTYPE html>
<html lang="en">
<head>
<script src=https://docs.lokad.com/js/envision.min.js></script>
</head>
<body>
<code class=language-envision data-lang=envision>
montecarlo 1000 with // approximate π value
x = random.uniform(-1, 1)
y = random.uniform(-1, 1)
inCircle = x^2 + y^2 < 1
sample approxPi = avg(if inCircle then 4 else 0)
show scalar "π approximation" with approxPi // 3.22
</code>
<script>
syntax.highlightElementsWithClass('language-envision');
</script>
</body>
</html>
Lokad grants you the right to host a local copy Envision.min.js
.