Liking cljdoc? Tell your friends :D

thereisnodot.utils.scale

A set of useful scaling functions

A set of useful scaling functions
raw docstring

euclidean-distanceclj

(euclidean-distance vec-a vec-b)

Will calculate Euclidean distance between two vectors of the same size.

Will calculate Euclidean distance between two vectors
of the same size. 
sourceraw docstring

font-size-in-a-tag-cloudclj

(font-size-in-a-tag-cloud min-font-size
                          max-font-size
                          items-in-the-biggest-tag
                          items)

Will linearly calculate font size of a tag in a tag cloud. Courtesy of: https://stackoverflow.com/a/3717340/3362518

Will linearly calculate font size of a tag in a tag cloud. 
Courtesy of: https://stackoverflow.com/a/3717340/3362518
sourceraw docstring

golden-ratioclj

(golden-ratio size step)

Will calculate golden ratio

Will calculate golden ratio
sourceraw docstring

haversineclj

(haversine lat-1 lng-1 lat-2 lng-2)
(haversine lat-1 lng-1 lat-2 lng-2 radius)

Will calculate Haversine distance between two points on a shphere Correctness checked at: https://www.vcalc.com/wiki/vCalc/Haversine+-+Distance

Will calculate Haversine distance between two points on a shphere
Correctness checked at: https://www.vcalc.com/wiki/vCalc/Haversine+-+Distance
sourceraw docstring

lat-lon->tile-x-yclj

(lat-lon->tile-x-y lat-deg lon-deg zoom)

Will calculate X and Y coordinates of a map tile, when given latitude longitude and a zoom level. Which you can check on OpenStreetMap: https://c.tile.openstreetmap.org/18/161421/97171.png

Will calculate X and Y coordinates of a map tile, 
when given latitude longitude and a zoom level. 
Which you can check on OpenStreetMap: 
https://c.tile.openstreetmap.org/18/161421/97171.png
sourceraw docstring

log-scaleclj

(log-scale x1 x2 y1 y2 x)

Will calculate log scaling (mapping) from one metric into another

Will calculate log scaling (mapping)
from one metric into another
sourceraw docstring

log-scale-roundclj

(log-scale-round x1 x2 y1 y2 x)

Will calculate rounded log scale

Will calculate rounded log scale
sourceraw docstring

paginateclj

(paginate current last-item)

Will create pagination based on current page and the amount of pages as input

Will create pagination based on 
current page and the amount of pages as input
sourceraw docstring

scaleclj

(scale A B C D X)

Will calculate linear scaling (mapping) from one metric into

Will calculate linear scaling (mapping) from one metric into 
sourceraw docstring

tag-font-log-normalizedclj

(tag-font-log-normalized items-in-the-biggest-tag items)

Will non linearly calculate font size of a tag in a tag cloud

Will non linearly calculate font size of a tag in a tag cloud
sourceraw docstring

x-y->tile-lat-lonclj

(x-y->tile-lat-lon xtile ytile zoom)

Will calculate latitude and longitude coordinates of a map tile, when given tile X Y and a zoom level. You can check example on OpenStreetMap: https://www.openstreetmap.org/#map=18/42.1440/41.6780

Will calculate latitude and longitude coordinates of a map tile, 
when given tile X Y and  a zoom level. 
You can check example on OpenStreetMap: 
https://www.openstreetmap.org/#map=18/42.1440/41.6780
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close