// Compiled by ClojureScript 1.10.520 {}
goog.provide('vmt.clouds');
goog.require('cljs.core');
goog.require('goog.string');
goog.require('goog.string.format');
goog.require('hoplon.svg');
goog.require('weathergen.math');
goog.require('weathergen.ui.common');
weathergen.ui.common.register_class_BANG_.call(null,new cljs.core.Keyword("vmt.clouds","coverage-icon","vmt.clouds/coverage-icon",1613030054),new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.PersistentArrayMap(null, 5, [new cljs.core.Keyword(null,"stroke","stroke",1741823555),"black",new cljs.core.Keyword(null,"stroke-width","stroke-width",716836435),0.08,new cljs.core.Keyword(null,"fill","fill",883462889),"none",new cljs.core.Keyword(null,"pointer-events","pointer-events",-1053858853),"none",new cljs.core.Keyword(null,"opacity","opacity",397153780),0.7], null)], null));
/**
 * Given a coverage type, returns SVG for the icon representing it on
 *   the map. Coordinate system has its origin at the center of the
 *   cell.
 */
vmt.clouds.coverage_icon = (function vmt$clouds$coverage_icon(coverage,towering_QMARK_){
var ri = 0.3;
var ro = 0.45;
var radius = ri;
var angle = weathergen.math.deg__GT_rad.call(null,(30));
return hoplon.svg.g.call(null,new cljs.core.Keyword(null,"attr","attr",-604132353),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"class","class",-2030961996),weathergen.ui.common.class_for.call(null,new cljs.core.Keyword("vmt.clouds","coverage-icon","vmt.clouds/coverage-icon",1613030054))], null),(cljs.core.truth_(towering_QMARK_)?(function (){var xi = (ri * Math.sin(angle));
var yi = (ri * Math.cos(angle));
var xo = (ro * Math.sin(angle));
var yo = (ro * Math.cos(angle));
return hoplon.svg.path.call(null,new cljs.core.Keyword(null,"d","d",1972142424),goog.string.format("M %f,-%f L %f,-%f A -%f,%f 0 0,0 -%f,-%f L -%f,-%f",xi,yi,xo,yo,ro,ro,xo,yo,xi,yi));
})():null),(function (){var G__40320 = coverage;
var G__40320__$1 = (((G__40320 instanceof cljs.core.Keyword))?G__40320.fqn:null);
switch (G__40320__$1) {
case "none":
return hoplon.svg.circle.call(null,new cljs.core.Keyword(null,"cx","cx",1272694324),(0),new cljs.core.Keyword(null,"cy","cy",755331060),(0),new cljs.core.Keyword(null,"r","r",-471384190),radius);

break;
case "few":
return hoplon.svg.g.call(null,hoplon.svg.circle.call(null,new cljs.core.Keyword(null,"cx","cx",1272694324),(0),new cljs.core.Keyword(null,"cy","cy",755331060),(0),new cljs.core.Keyword(null,"r","r",-471384190),radius),hoplon.svg.line.call(null,new cljs.core.Keyword(null,"x1","x1",-1863922247),(0),new cljs.core.Keyword(null,"y1","y1",589123466),(- radius),new cljs.core.Keyword(null,"x2","x2",-1362513475),(0),new cljs.core.Keyword(null,"y2","y2",-718691301),radius));

break;
case "scattered":
return hoplon.svg.g.call(null,hoplon.svg.circle.call(null,new cljs.core.Keyword(null,"cx","cx",1272694324),(0),new cljs.core.Keyword(null,"cy","cy",755331060),(0),new cljs.core.Keyword(null,"r","r",-471384190),radius),hoplon.svg.path.call(null,new cljs.core.Keyword(null,"attr","attr",-604132353),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"fill","fill",883462889),"black"], null),new cljs.core.Keyword(null,"d","d",1972142424),goog.string.format("M 0 0 L %f 0 A %f,%f 0 0,0 0,-%f L 0 0 Z",radius,radius,radius,radius)));

break;
case "broken":
return hoplon.svg.g.call(null,hoplon.svg.circle.call(null,new cljs.core.Keyword(null,"cx","cx",1272694324),(0),new cljs.core.Keyword(null,"cy","cy",755331060),(0),new cljs.core.Keyword(null,"r","r",-471384190),radius),hoplon.svg.path.call(null,new cljs.core.Keyword(null,"attr","attr",-604132353),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"fill","fill",883462889),"black"], null),new cljs.core.Keyword(null,"d","d",1972142424),goog.string.format("M 0 0 L 0,-%f A %f,%f 0 1,1 -%f,0 L 0 0 Z",radius,radius,radius,radius)));

break;
case "overcast":
return hoplon.svg.circle.call(null,new cljs.core.Keyword(null,"attr","attr",-604132353),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"fill","fill",883462889),"black"], null),new cljs.core.Keyword(null,"cx","cx",1272694324),(0),new cljs.core.Keyword(null,"cy","cy",755331060),(0),new cljs.core.Keyword(null,"r","r",-471384190),radius);

break;
default:
throw (new Error(["No matching clause: ",cljs.core.str.cljs$core$IFn$_invoke$arity$1(G__40320__$1)].join('')));

}
})());
});
