-
Notifications
You must be signed in to change notification settings - Fork 14.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* simple mapbox viz use react-map-gl superclustering of long/lat points Added hook for map style, huge performance boost from bounding box fix, added count text on clusters variable gradient size based on metric count Ability to aggregate over any point property This needed a change in the supercluster npm module, a PR was placed here: mapbox/supercluster#12 Aggregator function option in explore, tweaked visual defaults better radius size management clustering radius, point metric/unit options scale cluster labels that don't fit, non-numeric labels for points Minor fixes, label field affects points, text changes serve mapbox apikey for slice global opacity, viewport saves (hacky), bug in point labels fixing mapbox-gl dependency mapbox_api_key in config expose row_limit, fix minor bugs Add renderWhileDragging flag, groupby. Only show numerical columns for point radius Implicitly group by lng/lat columns and error when label doesn't match groupby 'Fix' radius in miles problem, still some jankiness derived fields cannot be typed as of now -> reverting numerical number change better grouping error checking, expose count(*) for labelling Custom colour for clusters/points + smart text colouring Fixed bad positioning and overflow in explore view + small bugs + added thumbnail * landscaping & eslint & use izip * landscapin' * address js code review
- Loading branch information
Showing
16 changed files
with
772 additions
and
4 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
const d3 = window.d3 || require('d3'); | ||
|
||
export const EARTH_CIRCUMFERENCE_KM = 40075.16; | ||
export const LUMINANCE_RED_WEIGHT = 0.2126; | ||
export const LUMINANCE_GREEN_WEIGHT = 0.7152; | ||
export const LUMINANCE_BLUE_WEIGHT = 0.0722; | ||
export const MILES_PER_KM = 1.60934; | ||
export const DEFAULT_LONGITUDE = -122.405293; | ||
export const DEFAULT_LATITUDE = 37.772123; | ||
export const DEFAULT_ZOOM = 11; | ||
|
||
export function kmToPixels(kilometers, latitude, zoomLevel) { | ||
// Algorithm from: http://wiki.openstreetmap.org/wiki/Zoom_levels | ||
const latitudeRad = latitude * (Math.PI / 180); | ||
// Seems like the zoomLevel is off by one | ||
const kmPerPixel = EARTH_CIRCUMFERENCE_KM * Math.cos(latitudeRad) / Math.pow(2, zoomLevel + 9); | ||
return d3.round(kilometers / kmPerPixel, 2); | ||
} | ||
|
||
export function isNumeric(num) { | ||
return !isNaN(parseFloat(num)) && isFinite(num); | ||
} | ||
|
||
export function rgbLuminance(r, g, b) { | ||
// Formula: https://en.wikipedia.org/wiki/Relative_luminance | ||
return LUMINANCE_RED_WEIGHT*r + LUMINANCE_GREEN_WEIGHT*g + LUMINANCE_BLUE_WEIGHT*b; | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
div.widget .slice_container { | ||
cursor: grab; | ||
cursor: -moz-grab; | ||
cursor: -webkit-grab; | ||
overflow: hidden; | ||
} | ||
|
||
div.widget .slice_container:active { | ||
cursor: grabbing; | ||
cursor: -moz-grabbing; | ||
cursor: -webkit-grabbing; | ||
} | ||
|
||
.slice_container div { | ||
padding-top: 0px; | ||
} |
Oops, something went wrong.