Some notes on how to use hyperx as a replacement for JSX. Need to try this out.
Uses d3-force
to disperse overlapping markers on a mapbox-gl
map.
Markers are tethered to their actual location, but have a collision force based on the radius of the icon. An additional force pulls icons towards their previous location (locations are calculated each time you move the map) to avoid markers jumping around excessively as they settle into different local minima on each re-draw.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const functions = require('firebase-functions') | |
const path = require('path') | |
const gcs = require('@google-cloud/storage')() | |
module.exports = functions.storage.object().onChange(event => { | |
const object = event.data | |
const bucket = gcs.bucket(object.bucket) | |
// Exit if this is triggered on a file that is not an image. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
index ec505de..ff29709 100644 | |
--- a/index.js | |
+++ b/index.js | |
@@ -191,25 +191,13 @@ DB.prototype.del = function (key, opts, cb) { | |
// OsmVersion, Opts -> [OsmBatchOp] | |
DB.prototype._getDocumentDeletionBatchOps = function (key, opts, cb) { | |
var self = this | |
- self.kv.get(key, function (err, docs) { | |
+ self.kv.get(key, {fields: true}, function (err, docs) { | |
if (err) return cb(err) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/--- A1 <---\ | |
A0 <---- ---- A3 (deleted) | |
\--- A2 <---/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"value": { | |
"refs": [ | |
"A", | |
"C", | |
"A", | |
"D" | |
], | |
"d": "F" | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/index.js b/index.js | |
index 79f78e4..e9897c0 100644 | |
--- a/index.js | |
+++ b/index.js | |
@@ -101,7 +101,8 @@ KV.prototype.del = function (key, opts, cb) { | |
} | |
if (!opts) opts = {} | |
if (!cb) cb = noop | |
- self._put(key, { d: key }, opts, function (err, node) { | |
+ var value = xtend(opts.fields || {}, { k: key, d: true, v: opts.value }) |
I hereby claim:
- I am gmaclennan on github.
- I am gmaclennan (https://keybase.io/gmaclennan) on keybase.
- I have a public key ASBkNcWJZSORRsuupjzXIeg2sMS2fE_Kou6h5fEc5_UAGwo
To claim this, I am signing this object:
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.