cluster-2.js

total 0
used 0
limit 0
/* categories: clusters files: ../point_src/core/head.js ../point_src/pointpen.js ../point_src/pointdraw.js ../point_src/extras.js ../point_src/math.js ../point_src/point-content.js ../point_src/stage.js ../point_src/point.js ../point_src/distances.js pointlist ../point_src/events.js dragging ../point_src/table.js ../point_src/cluster.js ../point_src/velocity.js stroke mouse */ var points = PointList.generate.random(100, 500); points.forEach(p => { p.vx = 0 p.vy = 0 p.radius = 5 }) class MainStage extends Stage { mounted() { this.target = this.center.copy() this.dragging.add(this.target) } draw(ctx) { this.clear(ctx) let target = this.target simpleCluster(points, target, { func: gravitateSquareDistance // clusterStyleB // clusterStable // func: clusterStable }) points.forEach(faceVelocity) target.pen.indicator(ctx, {color:'red'}) // points.pen.lines(ctx, 'red', {color:'#33aa99'}) points.pen.indicators(ctx, {color:'#33aa99'}) points.centerOfMass().pen.indicator(ctx, {color: 'pink'}) } } const stage = new MainStage('playspace') stage.loopDraw() // stage.go()
Run
Meta Data
imports ()
files ('../point_src/core/head.js', '../point_src/pointpen.js', '../point_src/pointdraw.js', '../point_src/extras.js', '../point_src/math.js', '../point_src/point-content.js', '../point_src/stage.js', '../point_src/point.js', '../point_src/distances.js', 'pointlist', '../point_src/events.js', 'dragging', '../point_src/table.js', '../point_src/cluster.js', '../point_src/velocity.js', 'stroke', 'mouse')
unused_keys ('title',)
unknown_keys ('categories',)
categories ['clusters']
filepath_exists True
path cluster-2.js
filepath cluster-2.js
clean_files ('../point_src/core/head.js', '../point_src/pointpen.js', '../point_src/pointdraw.js', '../point_src/extras.js', '../point_src/math.js', '../point_src/compass.js', '../point_src/center.js', '../point_src/point-content.js', '../point_src/stage-resize.js', '../point_src/functions/resolve.js', '../point_src/stage.js', '../point_src/relative-xy.js', '../point_src/pointcast.js', '../point_src/point.js', '../point_src/distances.js', '../point_src/pointlistdraw.js', '../point_src/pointlistgradient.js', '../point_src/pointlistshape.js', '../point_src/pointlistgenerator.js', '../point_src/unpack.js', '../point_src/pointlist.js', '../point_src/pointlistpen.js', '../point_src/events.js', '../point_src/functions/clamp.js', '../point_src/protractor.js', '../point_src/text/beta.js', '../point_src/dragging.js', '../point_src/table.js', '../point_src/cluster.js', '../point_src/velocity.js', '../point_src/setunset.js', '../point_src/stroke.js', '../point_src/automouse.js')
markdown {'html': '', 'content': 'categories: clusters\nfiles:\n ../point_src/core/head.js\n ../point_src/pointpen.js\n ../point_src/pointdraw.js\n ../point_src/extras.js\n ../point_src/math.js\n ../point_src/point-content.js\n ../point_src/stage.js\n ../point_src/point.js\n ../point_src/distances.js\n pointlist\n ../point_src/events.js\n dragging\n ../point_src/table.js\n ../point_src/cluster.js\n ../point_src/velocity.js\n stroke\n mouse'}