Keplerjs / Kepler

The open source geosocial network platform written in NodeJs
https://kepler.opengeo.tech
BSD 2-Clause "Simplified" License
176 stars 44 forks source link

keplerjs:stats - classification #5

Open stefanocudini opened 7 years ago

stefanocudini commented 7 years ago

@simogeo thank you so much! If I could ask you a question about my use of Geostats that's probably not correct. I wanted to get a classification in a given range of outpout values(for example from 3 to 30) that matches the radius of the circles in the map. Do you think this is the best sort of classification? https://github.com/Keplerjs/Kepler/blob/master/packages/keplerjs-stats/server/places.js#L34 the Leflet map client is here: https://github.com/Keplerjs/keplerjs.github.io/blob/master/js/main.js#L54

But I'm forced to use Math.min()/max() methods... the result is not good because it does not show well my statistics.. :(

thank you for your time. Stefano

simogeo commented 7 years ago

You probably missunderstood something,

Let's say, you have a serie, with N values containing values from 0 to 3. Passing the serie to geostats and calling getClassQuantile(4) will return an array such as array(0, 0.75, 1.5, 2.25, 3) see the code

you will, then choose / set radius size (in leaflet) related to the given item - see getRangeNum() method which will probably help you.

Your radius will have 4 different values in my example and 10 in yours.

Could you copy / paste, the content of factors array ?