summaryrefslogtreecommitdiff
path: root/assets/viz/2/clojure/set.js
diff options
context:
space:
mode:
authorBrian Picciano <mediocregopher@gmail.com>2018-11-13 00:24:09 -0500
committerBrian Picciano <mediocregopher@gmail.com>2018-11-13 00:24:09 -0500
commit2b4757367470d8e36bc00901dac567e375796ed4 (patch)
tree72368624006c21d28228a100ee88590c7bf95e58 /assets/viz/2/clojure/set.js
parent5ed62d23b4bbbf7717de4adfa0eaf2af19365408 (diff)
update viz 2 to use the newest version, which has some performance improvements and is easier to read the code for. also update the description
Diffstat (limited to 'assets/viz/2/clojure/set.js')
-rw-r--r--assets/viz/2/clojure/set.js273
1 files changed, 132 insertions, 141 deletions
diff --git a/assets/viz/2/clojure/set.js b/assets/viz/2/clojure/set.js
index 4f9c5dc..3be3f0b 100644
--- a/assets/viz/2/clojure/set.js
+++ b/assets/viz/2/clojure/set.js
@@ -1,12 +1,12 @@
-// Compiled by ClojureScript 1.9.473 {}
+// Compiled by ClojureScript 1.10.439 {}
goog.provide('clojure.set');
goog.require('cljs.core');
clojure.set.bubble_max_key = (function clojure$set$bubble_max_key(k,coll){
var max = cljs.core.apply.call(null,cljs.core.max_key,k,coll);
return cljs.core.cons.call(null,max,cljs.core.remove.call(null,((function (max){
-return (function (p1__9452_SHARP_){
-return (max === p1__9452_SHARP_);
+return (function (p1__2145_SHARP_){
+return (max === p1__2145_SHARP_);
});})(max))
,coll));
});
@@ -14,23 +14,8 @@ return (max === p1__9452_SHARP_);
* Return a set that is the union of the input sets
*/
clojure.set.union = (function clojure$set$union(var_args){
-var args9453 = [];
-var len__7927__auto___9459 = arguments.length;
-var i__7928__auto___9460 = (0);
-while(true){
-if((i__7928__auto___9460 < len__7927__auto___9459)){
-args9453.push((arguments[i__7928__auto___9460]));
-
-var G__9461 = (i__7928__auto___9460 + (1));
-i__7928__auto___9460 = G__9461;
-continue;
-} else {
-}
-break;
-}
-
-var G__9458 = args9453.length;
-switch (G__9458) {
+var G__2150 = arguments.length;
+switch (G__2150) {
case 0:
return clojure.set.union.cljs$core$IFn$_invoke$arity$0();
@@ -44,8 +29,23 @@ return clojure.set.union.cljs$core$IFn$_invoke$arity$2((arguments[(0)]),(argumen
break;
default:
-var argseq__7946__auto__ = (new cljs.core.IndexedSeq(args9453.slice((2)),(0),null));
-return clojure.set.union.cljs$core$IFn$_invoke$arity$variadic((arguments[(0)]),(arguments[(1)]),argseq__7946__auto__);
+var args_arr__4662__auto__ = [];
+var len__4641__auto___2152 = arguments.length;
+var i__4642__auto___2153 = (0);
+while(true){
+if((i__4642__auto___2153 < len__4641__auto___2152)){
+args_arr__4662__auto__.push((arguments[i__4642__auto___2153]));
+
+var G__2154 = (i__4642__auto___2153 + (1));
+i__4642__auto___2153 = G__2154;
+continue;
+} else {
+}
+break;
+}
+
+var argseq__4663__auto__ = (new cljs.core.IndexedSeq(args_arr__4662__auto__.slice((2)),(0),null));
+return clojure.set.union.cljs$core$IFn$_invoke$arity$variadic((arguments[(0)]),(arguments[(1)]),argseq__4663__auto__);
}
});
@@ -71,12 +71,14 @@ var bubbled_sets = clojure.set.bubble_max_key.call(null,cljs.core.count,cljs.cor
return cljs.core.reduce.call(null,cljs.core.into,cljs.core.first.call(null,bubbled_sets),cljs.core.rest.call(null,bubbled_sets));
});
-clojure.set.union.cljs$lang$applyTo = (function (seq9454){
-var G__9455 = cljs.core.first.call(null,seq9454);
-var seq9454__$1 = cljs.core.next.call(null,seq9454);
-var G__9456 = cljs.core.first.call(null,seq9454__$1);
-var seq9454__$2 = cljs.core.next.call(null,seq9454__$1);
-return clojure.set.union.cljs$core$IFn$_invoke$arity$variadic(G__9455,G__9456,seq9454__$2);
+/** @this {Function} */
+clojure.set.union.cljs$lang$applyTo = (function (seq2147){
+var G__2148 = cljs.core.first.call(null,seq2147);
+var seq2147__$1 = cljs.core.next.call(null,seq2147);
+var G__2149 = cljs.core.first.call(null,seq2147__$1);
+var seq2147__$2 = cljs.core.next.call(null,seq2147__$1);
+var self__4628__auto__ = this;
+return self__4628__auto__.cljs$core$IFn$_invoke$arity$variadic(G__2148,G__2149,seq2147__$2);
});
clojure.set.union.cljs$lang$maxFixedArity = (2);
@@ -85,23 +87,8 @@ clojure.set.union.cljs$lang$maxFixedArity = (2);
* Return a set that is the intersection of the input sets
*/
clojure.set.intersection = (function clojure$set$intersection(var_args){
-var args9464 = [];
-var len__7927__auto___9470 = arguments.length;
-var i__7928__auto___9471 = (0);
-while(true){
-if((i__7928__auto___9471 < len__7927__auto___9470)){
-args9464.push((arguments[i__7928__auto___9471]));
-
-var G__9472 = (i__7928__auto___9471 + (1));
-i__7928__auto___9471 = G__9472;
-continue;
-} else {
-}
-break;
-}
-
-var G__9469 = args9464.length;
-switch (G__9469) {
+var G__2160 = arguments.length;
+switch (G__2160) {
case 1:
return clojure.set.intersection.cljs$core$IFn$_invoke$arity$1((arguments[(0)]));
@@ -111,8 +98,23 @@ return clojure.set.intersection.cljs$core$IFn$_invoke$arity$2((arguments[(0)]),(
break;
default:
-var argseq__7946__auto__ = (new cljs.core.IndexedSeq(args9464.slice((2)),(0),null));
-return clojure.set.intersection.cljs$core$IFn$_invoke$arity$variadic((arguments[(0)]),(arguments[(1)]),argseq__7946__auto__);
+var args_arr__4662__auto__ = [];
+var len__4641__auto___2162 = arguments.length;
+var i__4642__auto___2163 = (0);
+while(true){
+if((i__4642__auto___2163 < len__4641__auto___2162)){
+args_arr__4662__auto__.push((arguments[i__4642__auto___2163]));
+
+var G__2164 = (i__4642__auto___2163 + (1));
+i__4642__auto___2163 = G__2164;
+continue;
+} else {
+}
+break;
+}
+
+var argseq__4663__auto__ = (new cljs.core.IndexedSeq(args_arr__4662__auto__.slice((2)),(0),null));
+return clojure.set.intersection.cljs$core$IFn$_invoke$arity$variadic((arguments[(0)]),(arguments[(1)]),argseq__4663__auto__);
}
});
@@ -124,10 +126,10 @@ return s1;
clojure.set.intersection.cljs$core$IFn$_invoke$arity$2 = (function (s1,s2){
while(true){
if((cljs.core.count.call(null,s2) < cljs.core.count.call(null,s1))){
-var G__9474 = s2;
-var G__9475 = s1;
-s1 = G__9474;
-s2 = G__9475;
+var G__2165 = s2;
+var G__2166 = s1;
+s1 = G__2165;
+s2 = G__2166;
continue;
} else {
return cljs.core.reduce.call(null,((function (s1,s2){
@@ -145,18 +147,20 @@ break;
});
clojure.set.intersection.cljs$core$IFn$_invoke$arity$variadic = (function (s1,s2,sets){
-var bubbled_sets = clojure.set.bubble_max_key.call(null,(function (p1__9463_SHARP_){
-return (- cljs.core.count.call(null,p1__9463_SHARP_));
+var bubbled_sets = clojure.set.bubble_max_key.call(null,(function (p1__2155_SHARP_){
+return (- cljs.core.count.call(null,p1__2155_SHARP_));
}),cljs.core.conj.call(null,sets,s2,s1));
return cljs.core.reduce.call(null,clojure.set.intersection,cljs.core.first.call(null,bubbled_sets),cljs.core.rest.call(null,bubbled_sets));
});
-clojure.set.intersection.cljs$lang$applyTo = (function (seq9465){
-var G__9466 = cljs.core.first.call(null,seq9465);
-var seq9465__$1 = cljs.core.next.call(null,seq9465);
-var G__9467 = cljs.core.first.call(null,seq9465__$1);
-var seq9465__$2 = cljs.core.next.call(null,seq9465__$1);
-return clojure.set.intersection.cljs$core$IFn$_invoke$arity$variadic(G__9466,G__9467,seq9465__$2);
+/** @this {Function} */
+clojure.set.intersection.cljs$lang$applyTo = (function (seq2157){
+var G__2158 = cljs.core.first.call(null,seq2157);
+var seq2157__$1 = cljs.core.next.call(null,seq2157);
+var G__2159 = cljs.core.first.call(null,seq2157__$1);
+var seq2157__$2 = cljs.core.next.call(null,seq2157__$1);
+var self__4628__auto__ = this;
+return self__4628__auto__.cljs$core$IFn$_invoke$arity$variadic(G__2158,G__2159,seq2157__$2);
});
clojure.set.intersection.cljs$lang$maxFixedArity = (2);
@@ -165,23 +169,8 @@ clojure.set.intersection.cljs$lang$maxFixedArity = (2);
* Return a set that is the first set without elements of the remaining sets
*/
clojure.set.difference = (function clojure$set$difference(var_args){
-var args9476 = [];
-var len__7927__auto___9482 = arguments.length;
-var i__7928__auto___9483 = (0);
-while(true){
-if((i__7928__auto___9483 < len__7927__auto___9482)){
-args9476.push((arguments[i__7928__auto___9483]));
-
-var G__9484 = (i__7928__auto___9483 + (1));
-i__7928__auto___9483 = G__9484;
-continue;
-} else {
-}
-break;
-}
-
-var G__9481 = args9476.length;
-switch (G__9481) {
+var G__2171 = arguments.length;
+switch (G__2171) {
case 1:
return clojure.set.difference.cljs$core$IFn$_invoke$arity$1((arguments[(0)]));
@@ -191,8 +180,23 @@ return clojure.set.difference.cljs$core$IFn$_invoke$arity$2((arguments[(0)]),(ar
break;
default:
-var argseq__7946__auto__ = (new cljs.core.IndexedSeq(args9476.slice((2)),(0),null));
-return clojure.set.difference.cljs$core$IFn$_invoke$arity$variadic((arguments[(0)]),(arguments[(1)]),argseq__7946__auto__);
+var args_arr__4662__auto__ = [];
+var len__4641__auto___2173 = arguments.length;
+var i__4642__auto___2174 = (0);
+while(true){
+if((i__4642__auto___2174 < len__4641__auto___2173)){
+args_arr__4662__auto__.push((arguments[i__4642__auto___2174]));
+
+var G__2175 = (i__4642__auto___2174 + (1));
+i__4642__auto___2174 = G__2175;
+continue;
+} else {
+}
+break;
+}
+
+var argseq__4663__auto__ = (new cljs.core.IndexedSeq(args_arr__4662__auto__.slice((2)),(0),null));
+return clojure.set.difference.cljs$core$IFn$_invoke$arity$variadic((arguments[(0)]),(arguments[(1)]),argseq__4663__auto__);
}
});
@@ -219,12 +223,14 @@ clojure.set.difference.cljs$core$IFn$_invoke$arity$variadic = (function (s1,s2,s
return cljs.core.reduce.call(null,clojure.set.difference,s1,cljs.core.conj.call(null,sets,s2));
});
-clojure.set.difference.cljs$lang$applyTo = (function (seq9477){
-var G__9478 = cljs.core.first.call(null,seq9477);
-var seq9477__$1 = cljs.core.next.call(null,seq9477);
-var G__9479 = cljs.core.first.call(null,seq9477__$1);
-var seq9477__$2 = cljs.core.next.call(null,seq9477__$1);
-return clojure.set.difference.cljs$core$IFn$_invoke$arity$variadic(G__9478,G__9479,seq9477__$2);
+/** @this {Function} */
+clojure.set.difference.cljs$lang$applyTo = (function (seq2168){
+var G__2169 = cljs.core.first.call(null,seq2168);
+var seq2168__$1 = cljs.core.next.call(null,seq2168);
+var G__2170 = cljs.core.first.call(null,seq2168__$1);
+var seq2168__$2 = cljs.core.next.call(null,seq2168__$1);
+var self__4628__auto__ = this;
+return self__4628__auto__.cljs$core$IFn$_invoke$arity$variadic(G__2169,G__2170,seq2168__$2);
});
clojure.set.difference.cljs$lang$maxFixedArity = (2);
@@ -245,18 +251,18 @@ return cljs.core.disj.call(null,s,k);
* Returns a rel of the elements of xrel with only the keys in ks
*/
clojure.set.project = (function clojure$set$project(xrel,ks){
-return cljs.core.set.call(null,cljs.core.map.call(null,(function (p1__9486_SHARP_){
-return cljs.core.select_keys.call(null,p1__9486_SHARP_,ks);
+return cljs.core.set.call(null,cljs.core.map.call(null,(function (p1__2176_SHARP_){
+return cljs.core.select_keys.call(null,p1__2176_SHARP_,ks);
}),xrel));
});
/**
* Returns the map with the keys in kmap renamed to the vals in kmap
*/
clojure.set.rename_keys = (function clojure$set$rename_keys(map,kmap){
-return cljs.core.reduce.call(null,(function (m,p__9491){
-var vec__9492 = p__9491;
-var old = cljs.core.nth.call(null,vec__9492,(0),null);
-var new$ = cljs.core.nth.call(null,vec__9492,(1),null);
+return cljs.core.reduce.call(null,(function (m,p__2177){
+var vec__2178 = p__2177;
+var old = cljs.core.nth.call(null,vec__2178,(0),null);
+var new$ = cljs.core.nth.call(null,vec__2178,(1),null);
if(cljs.core.contains_QMARK_.call(null,map,old)){
return cljs.core.assoc.call(null,m,new$,cljs.core.get.call(null,map,old));
} else {
@@ -268,8 +274,8 @@ return m;
* Returns a rel of the maps in xrel with the keys in kmap renamed to the vals in kmap
*/
clojure.set.rename = (function clojure$set$rename(xrel,kmap){
-return cljs.core.set.call(null,cljs.core.map.call(null,(function (p1__9495_SHARP_){
-return clojure.set.rename_keys.call(null,p1__9495_SHARP_,kmap);
+return cljs.core.set.call(null,cljs.core.map.call(null,(function (p1__2181_SHARP_){
+return clojure.set.rename_keys.call(null,p1__2181_SHARP_,kmap);
}),xrel));
});
/**
@@ -286,10 +292,10 @@ return cljs.core.assoc.call(null,m,ik,cljs.core.conj.call(null,cljs.core.get.cal
* Returns the map with the vals mapped to the keys.
*/
clojure.set.map_invert = (function clojure$set$map_invert(m){
-return cljs.core.reduce.call(null,(function (m__$1,p__9500){
-var vec__9501 = p__9500;
-var k = cljs.core.nth.call(null,vec__9501,(0),null);
-var v = cljs.core.nth.call(null,vec__9501,(1),null);
+return cljs.core.reduce.call(null,(function (m__$1,p__2182){
+var vec__2183 = p__2182;
+var k = cljs.core.nth.call(null,vec__2183,(0),null);
+var v = cljs.core.nth.call(null,vec__2183,(1),null);
return cljs.core.assoc.call(null,m__$1,v,k);
}),cljs.core.PersistentArrayMap.EMPTY,m);
});
@@ -299,23 +305,8 @@ return cljs.core.assoc.call(null,m__$1,v,k);
* keys.
*/
clojure.set.join = (function clojure$set$join(var_args){
-var args9508 = [];
-var len__7927__auto___9517 = arguments.length;
-var i__7928__auto___9518 = (0);
-while(true){
-if((i__7928__auto___9518 < len__7927__auto___9517)){
-args9508.push((arguments[i__7928__auto___9518]));
-
-var G__9519 = (i__7928__auto___9518 + (1));
-i__7928__auto___9518 = G__9519;
-continue;
-} else {
-}
-break;
-}
-
-var G__9510 = args9508.length;
-switch (G__9510) {
+var G__2191 = arguments.length;
+switch (G__2191) {
case 2:
return clojure.set.join.cljs$core$IFn$_invoke$arity$2((arguments[(0)]),(arguments[(1)]));
@@ -325,31 +316,31 @@ return clojure.set.join.cljs$core$IFn$_invoke$arity$3((arguments[(0)]),(argument
break;
default:
-throw (new Error([cljs.core.str.cljs$core$IFn$_invoke$arity$1("Invalid arity: "),cljs.core.str.cljs$core$IFn$_invoke$arity$1(args9508.length)].join('')));
+throw (new Error(["Invalid arity: ",cljs.core.str.cljs$core$IFn$_invoke$arity$1(arguments.length)].join('')));
}
});
clojure.set.join.cljs$core$IFn$_invoke$arity$2 = (function (xrel,yrel){
-if((cljs.core.seq.call(null,xrel)) && (cljs.core.seq.call(null,yrel))){
+if(((cljs.core.seq.call(null,xrel)) && (cljs.core.seq.call(null,yrel)))){
var ks = clojure.set.intersection.call(null,cljs.core.set.call(null,cljs.core.keys.call(null,cljs.core.first.call(null,xrel))),cljs.core.set.call(null,cljs.core.keys.call(null,cljs.core.first.call(null,yrel))));
-var vec__9511 = (((cljs.core.count.call(null,xrel) <= cljs.core.count.call(null,yrel)))?new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [xrel,yrel], null):new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [yrel,xrel], null));
-var r = cljs.core.nth.call(null,vec__9511,(0),null);
-var s = cljs.core.nth.call(null,vec__9511,(1),null);
+var vec__2192 = (((cljs.core.count.call(null,xrel) <= cljs.core.count.call(null,yrel)))?new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [xrel,yrel], null):new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [yrel,xrel], null));
+var r = cljs.core.nth.call(null,vec__2192,(0),null);
+var s = cljs.core.nth.call(null,vec__2192,(1),null);
var idx = clojure.set.index.call(null,r,ks);
-return cljs.core.reduce.call(null,((function (ks,vec__9511,r,s,idx){
+return cljs.core.reduce.call(null,((function (ks,vec__2192,r,s,idx){
return (function (ret,x){
var found = idx.call(null,cljs.core.select_keys.call(null,x,ks));
if(cljs.core.truth_(found)){
-return cljs.core.reduce.call(null,((function (found,ks,vec__9511,r,s,idx){
-return (function (p1__9504_SHARP_,p2__9505_SHARP_){
-return cljs.core.conj.call(null,p1__9504_SHARP_,cljs.core.merge.call(null,p2__9505_SHARP_,x));
-});})(found,ks,vec__9511,r,s,idx))
+return cljs.core.reduce.call(null,((function (found,ks,vec__2192,r,s,idx){
+return (function (p1__2186_SHARP_,p2__2187_SHARP_){
+return cljs.core.conj.call(null,p1__2186_SHARP_,cljs.core.merge.call(null,p2__2187_SHARP_,x));
+});})(found,ks,vec__2192,r,s,idx))
,ret,found);
} else {
return ret;
}
-});})(ks,vec__9511,r,s,idx))
+});})(ks,vec__2192,r,s,idx))
,cljs.core.PersistentHashSet.EMPTY,s);
} else {
return cljs.core.PersistentHashSet.EMPTY;
@@ -357,24 +348,24 @@ return cljs.core.PersistentHashSet.EMPTY;
});
clojure.set.join.cljs$core$IFn$_invoke$arity$3 = (function (xrel,yrel,km){
-var vec__9514 = (((cljs.core.count.call(null,xrel) <= cljs.core.count.call(null,yrel)))?new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [xrel,yrel,clojure.set.map_invert.call(null,km)], null):new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [yrel,xrel,km], null));
-var r = cljs.core.nth.call(null,vec__9514,(0),null);
-var s = cljs.core.nth.call(null,vec__9514,(1),null);
-var k = cljs.core.nth.call(null,vec__9514,(2),null);
+var vec__2195 = (((cljs.core.count.call(null,xrel) <= cljs.core.count.call(null,yrel)))?new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [xrel,yrel,clojure.set.map_invert.call(null,km)], null):new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [yrel,xrel,km], null));
+var r = cljs.core.nth.call(null,vec__2195,(0),null);
+var s = cljs.core.nth.call(null,vec__2195,(1),null);
+var k = cljs.core.nth.call(null,vec__2195,(2),null);
var idx = clojure.set.index.call(null,r,cljs.core.vals.call(null,k));
-return cljs.core.reduce.call(null,((function (vec__9514,r,s,k,idx){
+return cljs.core.reduce.call(null,((function (vec__2195,r,s,k,idx){
return (function (ret,x){
var found = idx.call(null,clojure.set.rename_keys.call(null,cljs.core.select_keys.call(null,x,cljs.core.keys.call(null,k)),k));
if(cljs.core.truth_(found)){
-return cljs.core.reduce.call(null,((function (found,vec__9514,r,s,k,idx){
-return (function (p1__9506_SHARP_,p2__9507_SHARP_){
-return cljs.core.conj.call(null,p1__9506_SHARP_,cljs.core.merge.call(null,p2__9507_SHARP_,x));
-});})(found,vec__9514,r,s,k,idx))
+return cljs.core.reduce.call(null,((function (found,vec__2195,r,s,k,idx){
+return (function (p1__2188_SHARP_,p2__2189_SHARP_){
+return cljs.core.conj.call(null,p1__2188_SHARP_,cljs.core.merge.call(null,p2__2189_SHARP_,x));
+});})(found,vec__2195,r,s,k,idx))
,ret,found);
} else {
return ret;
}
-});})(vec__9514,r,s,k,idx))
+});})(vec__2195,r,s,k,idx))
,cljs.core.PersistentHashSet.EMPTY,s);
});
@@ -384,17 +375,17 @@ clojure.set.join.cljs$lang$maxFixedArity = 3;
* Is set1 a subset of set2?
*/
clojure.set.subset_QMARK_ = (function clojure$set$subset_QMARK_(set1,set2){
-return ((cljs.core.count.call(null,set1) <= cljs.core.count.call(null,set2))) && (cljs.core.every_QMARK_.call(null,(function (p1__9521_SHARP_){
-return cljs.core.contains_QMARK_.call(null,set2,p1__9521_SHARP_);
-}),set1));
+return (((cljs.core.count.call(null,set1) <= cljs.core.count.call(null,set2))) && (cljs.core.every_QMARK_.call(null,(function (p1__2199_SHARP_){
+return cljs.core.contains_QMARK_.call(null,set2,p1__2199_SHARP_);
+}),set1)));
});
/**
* Is set1 a superset of set2?
*/
clojure.set.superset_QMARK_ = (function clojure$set$superset_QMARK_(set1,set2){
-return ((cljs.core.count.call(null,set1) >= cljs.core.count.call(null,set2))) && (cljs.core.every_QMARK_.call(null,(function (p1__9522_SHARP_){
-return cljs.core.contains_QMARK_.call(null,set1,p1__9522_SHARP_);
-}),set2));
+return (((cljs.core.count.call(null,set1) >= cljs.core.count.call(null,set2))) && (cljs.core.every_QMARK_.call(null,(function (p1__2200_SHARP_){
+return cljs.core.contains_QMARK_.call(null,set1,p1__2200_SHARP_);
+}),set2)));
});
-//# sourceMappingURL=set.js.map \ No newline at end of file
+//# sourceMappingURL=set.js.map