Giter Site home page Giter Site logo

Weight example about prunecluster HOT 2 CLOSED

sintef-9012 avatar sintef-9012 commented on May 21, 2024
Weight example

from prunecluster.

Comments (2)

fungiboletus avatar fungiboletus commented on May 21, 2024

Hello.

Yes a weight example is missing. But it should no be very different than categories. By default, each marker has "1" as weight but you can change the value with marker.weight = newvalue

Reusing the random.10000-categories example, it's something like this :

for (var i = 0; i < size; ++i) {
    var marker = new PruneCluster.Marker(59.91111 + (Math.random() - 0.5) * Math.random() * 0.00001 * size, 10.752778 + (Math.random() - 0.5) * Math.random() * 0.00002 * size);

    marker.category = Math.floor(Math.random() * Math.random() * colors.length);

    // Set a random weight between 1 and 3
    marker.weight = Math.ceil(Math.random() * 3);

    markers.push(marker);
    leafletView.RegisterMarker(marker);
}

I would like to provide better examples including this feature, but I am not sure if this feature is very useful.

from prunecluster.

PaulArchambault avatar PaulArchambault commented on May 21, 2024

Merci pour votre réponse rapide. La fonctionnalité de pondération est très utile pour les data que je souhaite publier : ici une base de 1.2M de points représentative du commerce de proximité en France agrégée par segment de rue. Chaque point étant noté/pondéré en fonction du nombre et de la surface des commerces présents dans chaque segment. En fait, je souhaite afficher des clusters pondérés sur les long/lat et afficher la somme des pondérations sur chaque marker.

J’ai vu par défaut la pondération égale 1.
J’ai testé sur votre exemple (random.10000-categories example) qui prends bien en considération les poids sur les X et Y mais cela n’a pas d’effet sur l’affichage des comptages de chaque marker. Il faudrait afficher la variable totalWeight à la place de la variable population mais cela à des impacts sur l’icône d’affichage en particulier lorsque l’on ajoute une analyse par catégorie. Il y a donc un peu de tunning à faire sur le code pour une fonctionnalité de pondération complètement satisfaisante.

Votre travail est fantastique !

In English :
Thank you for your quick response. The weighting feature is very useful for the data that I want to publish: 1.2M points of the retail shops in France aggregated by street segment. Each point/street segment weighted according to the number and the importance of business present in each segment. In fact, I want to display the weighted long / lat and the sum of the weights on each marker clusters.

I saw the default weighting equal to 1.
I have tested with your random.10000-categories example. That is OK for the weighted calculation of the long/lat but this has no effect on the display of the counting on each marker. It should display the variable “totalWeight” instead of the variable “population”. But this has some impacts on the icon display especially when combining with an analysis by category. So there could be a bit of tuning on the code for a completely satisfactory weighting feature.

This work is fantastic! I have tested another 2M non weighted point data and it is working fine.


Paul Archambault
Analytic & Data Consulting Southern Europe
MapInfo - Pitney Bowes Software
134, rue Danton 92593 Levallois-Perret Cédex
Fixe : + 33 (0)1 46 17 54 47| Fax : +33 (0)1 46 17 54 64 | Mobile : + 33 (0)6 73 99 86 33
http://www.mapinfo.com/

De : Antoine Pultier [mailto:[email protected]]
Envoyé : mardi 26 août 2014 10:17
À : SINTEF-9012/PruneCluster
Cc : Paul Archambault
Objet : Re: [PruneCluster] Weight example (#17)

Hello.

Yes a weight example is missing. But it should no be very different than categories. By default, each marker has "1" as weight but you can change the value with marker.weight = newvalue

Reusing the random.10000-categories example, it's something like this :

for (var i = 0; i < size; ++i) {

var marker = new PruneCluster.Marker(59.91111 + (Math.random() - 0.5) * Math.random() * 0.00001 * size, 10.752778 + (Math.random() - 0

.5) * Math.random() * 0.00002 * size);

marker.category = Math.floor(Math.random() * Math.random() * colors.length);



// Set a random weight between 1 and 3

marker.weight = Math.ceil(Math.random() * 3);



markers.push(marker);

leafletView.RegisterMarker(marker);

}

I would like to provide better examples including this feature, but I am not sure if this feature is very useful.


Reply to this email directly or view it on GitHubhttps://github.com//issues/17#issuecomment-53388908.


from prunecluster.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.