diff --git a/docs/clay_book.emmy_viewers.html b/docs/clay_book.emmy_viewers.html index c161c7fc..17452524 100644 --- a/docs/clay_book.emmy_viewers.html +++ b/docs/clay_book.emmy_viewers.html @@ -235,7 +235,7 @@
:color :blue}) (mafs/of-x e/sin {
- (reagent.core/with-let"y0001" " return Math.sin(y0001);")]
- [G__95022 (js/Function. :y G__95022}]) [mafs.plot/OfX {
By default, it is inferred to be of :kind/emmy-viewers
, and is handle accordingly.
Equivalently, we could also handle it more explicitly with :kind/reagent
:
Try moving the pink mark. 👆
diff --git a/docs/clay_book.examples.html b/docs/clay_book.examples.html index a8ccd135..5696928f 100644 --- a/docs/clay_book.examples.html +++ b/docs/clay_book.examples.html @@ -349,7 +349,7 @@From the reagent tutorial:
@@ -362,7 +362,7 @@ (kind/reagent:input {:type "button" :value "Click me!"
[:on-click #(swap! *click-count inc)}]])))])
take 5 people-as-maps) (
:preferred-language "clojurescript", :age 31}
- ({:preferred-language "clojurescript", :age 42}
- {:preferred-language "babashka", :age 75}
- {:preferred-language "clojurescript", :age 21}
- {:preferred-language "babashka", :age 32}) {
:preferred-language "clojurescript", :age 54}
+ ({:preferred-language "babashka", :age 31}
+ {:preferred-language "babashka", :age 97}
+ {:preferred-language "clojurescript", :age 14}
+ {:preferred-language "clojure", :age 30}) {
take 5 people-as-vectors) (
"clojurescript" 31]
- (["clojurescript" 42]
- ["babashka" 75]
- ["clojurescript" 21]
- ["babashka" 32]) [
"clojurescript" 54]
+ (["babashka" 31]
+ ["babashka" 97]
+ ["clojurescript" 14]
+ ["clojure" 30]) [
->> people-as-vectors
@@ -569,11 +569,11 @@ (<
set)
"clojurescript" 42]
- #{["clojurescript" 31]
- ["babashka" 32]
- ["clojurescript" 21]
- ["babashka" 75]} [
"clojurescript" 14]
+ #{["babashka" 31]
+ ["babashka" 97]
+ ["clojurescript" 54]
+ ["clojure" 30]} [
When something inside needs to be displayed in a special kind of way, the data structures are printed in a way that makes that clear.
preferred-language | age |
---|---|
clojurescript | 31 |
clojurescript | 42 |
babashka | 75 |
clojurescript | 21 |
babashka | 32 |
clojure | 76 |
clojure | 18 |
clojurescript | 39 |
clojure | 19 |
clojurescript | 53 |
clojurescript | 40 |
clojure | 61 |
clojurescript | 34 |
clojurescript | 0 |
clojurescript | 96 |
clojurescript | 1 |
clojure | 9 |
babashka | 77 |
babashka | 5 |
babashka | 5 |
clojurescript | 10 |
clojurescript | 22 |
clojurescript | 10 |
clojurescript | 80 |
clojurescript | 28 |
clojure | 46 |
clojure | 11 |
clojure | 12 |
clojure | 68 |
preferred-language | age |
---|---|
clojurescript | 54 |
babashka | 31 |
babashka | 97 |
clojurescript | 14 |
clojure | 30 |
clojurescript | 46 |
clojurescript | 87 |
clojure | 29 |
babashka | 75 |
babashka | 54 |
clojure | 60 |
babashka | 65 |
clojurescript | 86 |
babashka | 35 |
babashka | 53 |
clojurescript | 63 |
clojurescript | 29 |
babashka | 26 |
clojure | 2 |
clojure | 73 |
clojure | 64 |
babashka | 8 |
clojure | 3 |
clojurescript | 40 |
babashka | 37 |
clojure | 87 |
clojure | 59 |
babashka | 87 |
babashka | 66 |
preferred-language | age |
---|---|
clojurescript | 31 |
clojurescript | 42 |
babashka | 75 |
clojurescript | 21 |
babashka | 32 |
clojure | 76 |
clojure | 18 |
clojurescript | 39 |
clojure | 19 |
clojurescript | 53 |
clojurescript | 40 |
clojure | 61 |
clojurescript | 34 |
clojurescript | 0 |
clojurescript | 96 |
clojurescript | 1 |
clojure | 9 |
babashka | 77 |
babashka | 5 |
babashka | 5 |
clojurescript | 10 |
clojurescript | 22 |
clojurescript | 10 |
clojurescript | 80 |
clojurescript | 28 |
clojure | 46 |
clojure | 11 |
clojure | 12 |
clojure | 68 |
preferred-language | age |
---|---|
clojurescript | 54 |
babashka | 31 |
babashka | 97 |
clojurescript | 14 |
clojure | 30 |
clojurescript | 46 |
clojurescript | 87 |
clojure | 29 |
babashka | 75 |
babashka | 54 |
clojure | 60 |
babashka | 65 |
clojurescript | 86 |
babashka | 35 |
babashka | 53 |
clojurescript | 63 |
clojurescript | 29 |
babashka | 26 |
clojure | 2 |
clojure | 73 |
clojure | 64 |
babashka | 8 |
clojure | 3 |
clojurescript | 40 |
babashka | 37 |
clojure | 87 |
clojure | 59 |
babashka | 87 |
babashka | 66 |
9) (random-vega-lite-plot
When the vega/vega-lite data is given in CSV format, Clay will serve it in a separate CSV file alongside the generated HTML.
-> {:data {:values "x,y
@@ -2133,7 +2133,7 @@ (;; Note we need to mention the dependency:
:html/deps [:leaflet]}) {
Using 3Dmol within your code (inspired by these examples):
defonce pdb-2POR
@@ -2444,7 +2444,7 @@ (;; Note we need to mention the dependency:
:html/deps [:three-d-mol]}) {
kind/vega-lite
kind/vega-lite
kind/reagent
+kind/vega-lite
kind/vega-lite
kind/reagent
[
_unnamed [3 2]:
+[
_unnamed [3 2]:
0 | -0.39064448 | +0.74322600 | ||||||
1 | -0.82195591 | +0.92957445 | ||||||
2 | -0.64312053 | +0.27296352 |
y&&(m=K,K=y,y=m);return(void 0===x||x?K<=F:K E?"0"+E.toString(16):E.toString(16),F+=E;return F;case "utf8":case "utf-8":return ab(this,F,p);case "ascii":M=F;F="";for(p=Math.min(this.length,p);M p&&(p=-2147483648);
+p=+p;p!==p&&(p=pa?0:M.length-1);0>p&&(p=M.length+p);if(p>=M.length){if(pa)return-1;p=M.length-1}else if(0>p)if(pa)p=0;else return-1;"string"===typeof F&&(F=e.from(F,E));if(e.isBuffer(F))return 0===F.length?-1:za(M,F,p,E,pa);if("number"===typeof F)return F&=255,"function"===typeof Uint8Array.prototype.indexOf?pa?Uint8Array.prototype.indexOf.call(M,F,p):Uint8Array.prototype.lastIndexOf.call(M,F,p):za(M,[F],p,E,pa);throw new TypeError("val must be string, number or Buffer");}function za(M,F,p,E,pa){function qa(va,
+fb){return 1===bb?va[fb]:va.readUInt16BE(fb*bb)}var bb=1,na=M.length,ja=F.length;if(void 0!==E&&(E=String(E).toLowerCase(),"ucs2"===E||"ucs-2"===E||"utf16le"===E||"utf-16le"===E)){if(2>M.length||2>F.length)return-1;bb=2;na/=2;ja/=2;p/=2}if(pa)for(E=-1;p p){-1<(F-=3)&&qa.push(239,191,189);pa=p;continue}p=(pa-55296<<10|p-56320)+65536}else pa&&-1<(F-=3)&&qa.push(239,191,189);pa=null;if(128>p){if(0>--F)break;qa.push(p)}else if(2048>p){if(0>(F-=2))break;qa.push(p>>6|192,
+p&63|128)}else if(65536>p){if(0>(F-=3))break;qa.push(p>>12|224,p>>6&63|128,p&63|128)}else if(1114112>p){if(0>(F-=4))break;qa.push(p>>18|240,p>>12&63|128,p>>6&63|128,p&63|128)}else throw Error("Invalid code point");}return qa}function ka(M){for(var F=[],p=0;p 0 ra=G);I.requests=0;I.done=()=>{0===--I.requests&&(Z._pending=null,ra(Z))};return Z._pending=I}function Fb(Z,ra,I,G,F,y){const x=e.extend({},y,fa);let t;e.isFunction(I)||(I=e.constant(I));void 0===G?F=K=>Z.touch(I(K)):e.isFunction(G)?(t=new Hb(null,G,F,!1),F=K=>{t.evaluate(K);K=I(K);const m=t.value;pb(m)?Z.pulse(K,m,y):
-Z.update(K,m,x)}):F=K=>Z.update(I(K),G,x);ra.apply(F)}function Gb(Z,ra,I,G,F,y){void 0===G?ra.targets().add(I):(y=y||{},G=new Hb(null,zb(I,G),F,!1),G.modified(y.force),G.rank=ra.rank,ra.targets().add(G),I&&(G.skip(!0),G.value=I.value,G.targets().add(I),Z.connect(I,[G])))}function zb(Z,ra){ra=e.isFunction(ra)?ra:e.constant(ra);return Z?function(I,G){I=ra(I,G);Z.skip()||(Z.skip(I!==this.value).value=I);return I}:ra}function dc(Z,ra,I){this.dataflow=Z;this.stamp=null==ra?-1:ra;this.add=[];this.rem=[];
-this.mod=[];this.fields=null;this.encode=I||null}function ua(Z,ra){const I=[];e.visitArray(Z,ra,G=>I.push(G));return I}function ea(Z,ra){const I={};Z.visit(ra,G=>{I[G[B]]=1});return G=>I[G[B]]?null:G}function Ia(Z,ra){return Z?(I,G)=>Z(I,G)&&ra(I,G):ra}function ya(Z,ra,I,G){let F=0;this.dataflow=Z;this.stamp=ra;this.fields=null;this.encode=G||null;this.pulses=I;for(const y of I)if(y.stamp===ra){if(y.fields){Z=this.fields||(this.fields={});for(const x in y.fields)Z[x]=1}y.changed(this.ADD)&&(F|=this.ADD);
-y.changed(this.REM)&&(F|=this.REM);y.changed(this.MOD)&&(F|=this.MOD)}this.changes=F}function Ba(Z){Z.error("Dataflow already running. Use runAsync() to chain invocations.");return Z}function ha(Z,ra){if(ra&&ra.stamp===Z.stamp)return ra;Z=Z.fork();ra&&ra!==sa&&(Z.source=ra.source);return Z}function Ra(Z){let ra=[];return{clear:()=>ra=[],size:()=>ra.length,peek:()=>ra[0],push:I=>{ra.push(I);return La(ra,0,ra.length-1,Z)},pop:()=>{var I=ra.pop();let G;if(ra.length){G=ra[0];ra[0]=I;I=ra;var F=0;const y=
-F,x=I.length,t=I[F];let K=(F<<1)+1,m;for(;K Fa);const x=I.length,t=new Float64Array(x);let K=0,m=1,p=y(I[0]),R=p,V=p+G,xa;for(;mq&&(q=-2147483648);
-q=+q;q!==q&&(q=na?0:N.length-1);0>q&&(q=N.length+q);if(q>=N.length){if(na)return-1;q=N.length-1}else if(0>q)if(na)q=0;else return-1;"string"===typeof E&&(E=e.from(E,B));if(e.isBuffer(E))return 0===E.length?-1:Ha(N,E,q,B,na);if("number"===typeof E)return E&=255,"function"===typeof Uint8Array.prototype.indexOf?na?Uint8Array.prototype.indexOf.call(N,E,q):Uint8Array.prototype.lastIndexOf.call(N,E,q):Ha(N,[E],q,B,na);throw new TypeError("val must be string, number or Buffer");}function Ha(N,E,q,B,na){function oa(sa,
-ab){return 1===Za?sa[ab]:sa.readUInt16BE(ab*Za)}var Za=1,ma=N.length,fa=E.length;if(void 0!==B&&(B=String(B).toLowerCase(),"ucs2"===B||"ucs-2"===B||"utf16le"===B||"utf-16le"===B)){if(2>N.length||2>E.length)return-1;Za=2;ma/=2;fa/=2;q/=2}if(na)for(B=-1;q
q){-1<(E-=3)&&oa.push(239,191,189);na=q;continue}q=(na-55296<<10|q-56320)+65536}else na&&-1<(E-=3)&&oa.push(239,191,189);na=null;if(128>q){if(0>--E)break;oa.push(q)}else if(2048>q){if(0>(E-=2))break;oa.push(q>>6|192,
-q&63|128)}else if(65536>q){if(0>(E-=3))break;oa.push(q>>12|224,q>>6&63|128,q&63|128)}else if(1114112>q){if(0>(E-=4))break;oa.push(q>>18|240,q>>12&63|128,q>>6&63|128,q&63|128)}else throw Error("Invalid code point");}return oa}function ua(N){for(var E=[],q=0;q
x&&(m=L,L=x,x=m);return(void 0===y||y?L<=G:L
(na-=2));++Za){var ma=B.charCodeAt(Za);N=ma>>8;ma%=256;oa.push(ma);oa.push(N)}return Ia(oa,
-this,E,q);default:if(na)throw new TypeError("Unknown encoding: "+B);B=(""+B).toLowerCase();na=!0}};e.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var La=4096;e.prototype.slice=function(N,E){var q=this.length;N=~~N;E=void 0===E?q:~~E;0>N?(N+=q,0>N&&(N=0)):N>q&&(N=q);0>E?(E+=q,0>E&&(E=0)):E>q&&(E=q);E
=128*B&&(na-=Math.pow(2,8*E));return na};e.prototype.readInt8=function(N,E){N>>>=0;E||wb(N,1,this.length);return this[N]&128?-1*(255-this[N]+1):this[N]};e.prototype.readInt16LE=function(N,E){N>>>=0;E||wb(N,2,this.length);N=this[N]|this[N+1]<<8;return N&32768?N|4294901760:N};e.prototype.readInt16BE=function(N,E){N>>>=0;E||wb(N,2,this.length);N=this[N+1]|this[N]<<8;return N&32768?N|4294901760:N};e.prototype.readInt32LE=function(N,E){N>>>=0;E||wb(N,
-4,this.length);return this[N]|this[N+1]<<8|this[N+2]<<16|this[N+3]<<24};e.prototype.readInt32BE=function(N,E){N>>>=0;E||wb(N,4,this.length);return this[N]<<24|this[N+1]<<16|this[N+2]<<8|this[N+3]};e.prototype.readFloatLE=function(N,E){N>>>=0;E||wb(N,4,this.length);return ha.read(this,N,!0,23,4)};e.prototype.readFloatBE=function(N,E){N>>>=0;E||wb(N,4,this.length);return ha.read(this,N,!1,23,4)};e.prototype.readDoubleLE=function(N,E){N>>>=0;E||wb(N,8,this.length);return ha.read(this,N,!0,52,8)};e.prototype.readDoubleBE=
-function(N,E){N>>>=0;E||wb(N,8,this.length);return ha.read(this,N,!1,52,8)};e.prototype.writeUIntLE=function(N,E,q,B){N=+N;E>>>=0;q>>>=0;B||ub(this,N,E,q,Math.pow(2,8*q)-1,0);B=1;var na=0;for(this[E]=N&255;++na
>>=0;q>>>=0;B||ub(this,N,E,q,Math.pow(2,8*q)-1,0);B=q-1;var na=1;for(this[E+B]=N&255;0<=--B&&(na*=256);)this[E+B]=N/na&255;return E+q};e.prototype.writeUInt8=function(N,E,q){N=+N;E>>>=0;q||ub(this,
-N,E,1,255,0);this[E]=N&255;return E+1};e.prototype.writeUInt16LE=function(N,E,q){N=+N;E>>>=0;q||ub(this,N,E,2,65535,0);this[E]=N&255;this[E+1]=N>>>8;return E+2};e.prototype.writeUInt16BE=function(N,E,q){N=+N;E>>>=0;q||ub(this,N,E,2,65535,0);this[E]=N>>>8;this[E+1]=N&255;return E+2};e.prototype.writeUInt32LE=function(N,E,q){N=+N;E>>>=0;q||ub(this,N,E,4,4294967295,0);this[E+3]=N>>>24;this[E+2]=N>>>16;this[E+1]=N>>>8;this[E]=N&255;return E+4};e.prototype.writeUInt32BE=function(N,E,q){N=+N;E>>>=0;q||
-ub(this,N,E,4,4294967295,0);this[E]=N>>>24;this[E+1]=N>>>16;this[E+2]=N>>>8;this[E+3]=N&255;return E+4};e.prototype.writeIntLE=function(N,E,q,B){N=+N;E>>>=0;B||(B=Math.pow(2,8*q-1),ub(this,N,E,q,B-1,-B));B=0;var na=1,oa=0;for(this[E]=N&255;++B
N&&0===oa&&0!==this[E+B-1]&&(oa=1),this[E+B]=(N/na>>0)-oa&255;return E+q};e.prototype.writeIntBE=function(N,E,q,B){N=+N;E>>>=0;B||(B=Math.pow(2,8*q-1),ub(this,N,E,q,B-1,-B));B=q-1;var na=1,oa=0;for(this[E+B]=N&255;0<=--B&&(na*=256);)0>N&&0===
-oa&&0!==this[E+B+1]&&(oa=1),this[E+B]=(N/na>>0)-oa&255;return E+q};e.prototype.writeInt8=function(N,E,q){N=+N;E>>>=0;q||ub(this,N,E,1,127,-128);0>N&&(N=255+N+1);this[E]=N&255;return E+1};e.prototype.writeInt16LE=function(N,E,q){N=+N;E>>>=0;q||ub(this,N,E,2,32767,-32768);this[E]=N&255;this[E+1]=N>>>8;return E+2};e.prototype.writeInt16BE=function(N,E,q){N=+N;E>>>=0;q||ub(this,N,E,2,32767,-32768);this[E]=N>>>8;this[E+1]=N&255;return E+2};e.prototype.writeInt32LE=function(N,E,q){N=+N;E>>>=0;q||ub(this,
-N,E,4,2147483647,-2147483648);this[E]=N&255;this[E+1]=N>>>8;this[E+2]=N>>>16;this[E+3]=N>>>24;return E+4};e.prototype.writeInt32BE=function(N,E,q){N=+N;E>>>=0;q||ub(this,N,E,4,2147483647,-2147483648);0>N&&(N=4294967295+N+1);this[E]=N>>>24;this[E+1]=N>>>16;this[E+2]=N>>>8;this[E+3]=N&255;return E+4};e.prototype.writeFloatLE=function(N,E,q){return Gb(this,N,E,!0,q)};e.prototype.writeFloatBE=function(N,E,q){return Gb(this,N,E,!1,q)};e.prototype.writeDoubleLE=function(N,E,q){return zb(this,N,E,!0,q)};
-e.prototype.writeDoubleBE=function(N,E,q){return zb(this,N,E,!1,q)};e.prototype.copy=function(N,E,q,B){if(!e.isBuffer(N))throw new TypeError("argument should be a Buffer");q||(q=0);B||0===B||(B=this.length);E>=N.length&&(E=N.length);E||(E=0);0E)throw new RangeError("targetStart out of bounds");if(0>q||q>=this.length)throw new RangeError("Index out of range");if(0>B)throw new RangeError("sourceEnd out of bounds");B>this.length&&(B=
-this.length);N.length-E
new Promise((sa,ab)=>{ma.readFile(fa,(Xa,Z)=>{Xa?ab(Xa):sa(Z)})}):pb}async function pb(){v.error("No file system access.")}function cb(ma){return ma?async function(fa,sa){const ab=v.extend({},this.options.http,sa);sa=sa&&sa.response;fa=await ma(fa,
-ab);return fa.ok?v.isFunction(fa[sa])?fa[sa]():fa.text():v.error(fa.status+""+fa.statusText)}:ob}async function ob(){v.error("No HTTP fetch method available.")}function Hb(ma,fa){if(!ma||!ma.length)return"unknown";const sa=ma.length,ab=N.length,Xa=N.map((Z,ra)=>ra+1);for(let Z=0,ra=0,I,G;Z