2 Walkthrough 👣
Let us briefly explore the Std.lang transpiler.
2.1 Setup
ns stdlang-book.walkthrough
(:require [std.lang :as l]
(:as kind]
[scicloj.kindly.v4.kind :as kindly])) [scicloj.kindly.v4.api
:js) (l/script
:lang :js,
{:runtime :default,
:bootstrap false,
:context :lang/js,
:module stdlang-book.walkthrough,
:module/internal {stdlang-book.walkthrough -},
:module/primary #{}}
2.2 Basic examples
+ 1 2)) (!.js (
"1 + 2;"
2.3 Data visualization with Javascript
(kind/hiccup:div
[:script
[
(!.jsdo (var m (L.map document.currentScript.parentElement))
(37.84 144.95]
(m.setView [-11)
-> (L.tileLayer.provider "OpenStreetMap.Mapnik")
(
(. (addTo m)))-> [-37.9 144.8]
(
L.marker
(. (addTo m))"<i style='color:purple'>Have you been here?</i>"))
(. (bindPopup
(. (openPopup)))))]]:html/deps [:leaflet]
{:style {:height "400px"}})