-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
[email protected] + improvements #3987
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Changes from 10 commits
Commits
Show all changes
49 commits
Select commit
Hold shift + click to select a range
2d4fe9b
bump mapbox-gl to 1.0.0 :tada:
etpinard 95240e2
:hocho: clean navigation block
etpinard e0c684f
add missing .catch(failTest)
etpinard 889abb6
adapt tests for mapbox-gl@v1
etpinard 41d167f
adapt find-mapbox-access-token for maps that don't use Mapbox styles
etpinard 1ee02da
mv DOM-related Lib function to src/lib/dom.js
etpinard 5b43b8c
add mapbox-gl CSS when registering mapbox basePlotModule
etpinard a2d2522
modernize createMapbox API
etpinard 1987b22
update mapbox baseline (using mapbox-gl@v1)
etpinard 23ffe4f
add mapbox using OSM map raster style mock
etpinard 43c568f
improve Choropleth.calc
etpinard 91e0319
add dflt to choropleth marker.line.color
etpinard 8fc1dbe
add choroplethmapbox attributes
etpinard 70878b7
add `PlotlyGeoAssets` to window during Plotly.register
etpinard 012a749
fetch GeoJSON URLs found in calcdata before updateData()
etpinard 5d27983
introducing choroplethmapbox trace module
etpinard f7f3190
sort all choroplethmapbox traces below scattermapbox traces
etpinard 4e88075
add GeoJSON feature 'properties' to eventData
etpinard a166761
improve mapbox hover after drag
etpinard 9a602ba
first cut choroplethmapbox tests
etpinard a457722
allow numbers as *locations* items when using custom *geojson*
etpinard 1359307
fixup choroplethmapbox hover content post-#3968
etpinard 4d7e0aa
implement *below* in choroplethmapbox traces
etpinard cb202a8
add :three: choroplethmapbox mocks
etpinard e509047
mojtaba-proof a few things
etpinard 7dd04e7
fixup choroplethmapbox "below" test
etpinard 654c08e
do not coerce choropleth* marker.line.color
etpinard 22c2a1e
add missing @gl tag to mapbox tests
etpinard fe6782d
add doNotFailOnEmptyTestSuite CLI option
etpinard 7e15d81
add densitymapbox attributes
etpinard 91a9bc4
implement densitymapbox
etpinard 4f42d1b
add densitymapbox jasmine tests
etpinard 4299857
add :three: densitymapbox mocks
etpinard 1add90e
remove layers from last to first
etpinard 36e3f06
add *open-street-map* `mapbox.style` value
etpinard ca48461
Merge pull request #3993 from plotly/densitymapbox-pr
etpinard a765249
raster support
7dcc506
fix syntax test
0c99017
do not decode raster source URL
etpinard 153c6b4
add support for `sourcetype: 'image'` layers
etpinard 54efdad
add some layer sourcetype -> type logic
etpinard 0b17b62
add raster/raster and image/raster layers
etpinard f5bc2e4
bump mapbox-gl to 1.1.0
etpinard b69cf4b
Merge pull request #4006 from plotly/mapbox-raster-layer
etpinard 6d7929c
Merge branch 'mapbox-v1' into choroplethmapbox-pr
etpinard eb04b4c
Merge pull request #3988 from plotly/choroplethmapbox-pr
etpinard a646575
Merge branch 'master' into mapbox-v1
etpinard 8c48aa2
fixup package-lock
etpinard dfa4ec7
rm unnecessary --showSkipped CLI arg
etpinard File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or 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 hidden or 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 hidden or 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,101 @@ | ||
/** | ||
* Copyright 2012-2019, Plotly, Inc. | ||
* All rights reserved. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
||
'use strict'; | ||
|
||
var d3 = require('d3'); | ||
var loggers = require('./loggers'); | ||
|
||
/** | ||
* Allow referencing a graph DOM element either directly | ||
* or by its id string | ||
* | ||
* @param {HTMLDivElement|string} gd: a graph element or its id | ||
* | ||
* @returns {HTMLDivElement} the DOM element of the graph | ||
*/ | ||
function getGraphDiv(gd) { | ||
var gdElement; | ||
|
||
if(typeof gd === 'string') { | ||
gdElement = document.getElementById(gd); | ||
|
||
if(gdElement === null) { | ||
throw new Error('No DOM element with id \'' + gd + '\' exists on the page.'); | ||
} | ||
|
||
return gdElement; | ||
} else if(gd === null || gd === undefined) { | ||
throw new Error('DOM element provided is null or undefined'); | ||
} | ||
|
||
// otherwise assume that gd is a DOM element | ||
return gd; | ||
} | ||
|
||
function isPlotDiv(el) { | ||
var el3 = d3.select(el); | ||
return el3.node() instanceof HTMLElement && | ||
el3.size() && | ||
el3.classed('js-plotly-plot'); | ||
} | ||
|
||
function removeElement(el) { | ||
var elParent = el && el.parentNode; | ||
if(elParent) elParent.removeChild(el); | ||
} | ||
|
||
/** | ||
* for dynamically adding style rules | ||
* makes one stylesheet that contains all rules added | ||
* by all calls to this function | ||
*/ | ||
function addStyleRule(selector, styleString) { | ||
addRelatedStyleRule('global', selector, styleString); | ||
} | ||
|
||
/** | ||
* for dynamically adding style rules | ||
* to a stylesheet uniquely identified by a uid | ||
*/ | ||
function addRelatedStyleRule(uid, selector, styleString) { | ||
var id = 'plotly.js-style-' + uid; | ||
var style = document.getElementById(id); | ||
if(!style) { | ||
style = document.createElement('style'); | ||
style.setAttribute('id', id); | ||
// WebKit hack :( | ||
style.appendChild(document.createTextNode('')); | ||
document.head.appendChild(style); | ||
} | ||
var styleSheet = style.sheet; | ||
|
||
if(styleSheet.insertRule) { | ||
styleSheet.insertRule(selector + '{' + styleString + '}', 0); | ||
} else if(styleSheet.addRule) { | ||
styleSheet.addRule(selector, styleString, 0); | ||
} else loggers.warn('addStyleRule failed'); | ||
} | ||
|
||
/** | ||
* to remove from the page a stylesheet identified by a given uid | ||
*/ | ||
function deleteRelatedStyleRule(uid) { | ||
var id = 'plotly.js-style-' + uid; | ||
var style = document.getElementById(id); | ||
if(style) removeElement(style); | ||
} | ||
|
||
module.exports = { | ||
getGraphDiv: getGraphDiv, | ||
isPlotDiv: isPlotDiv, | ||
removeElement: removeElement, | ||
addStyleRule: addStyleRule, | ||
addRelatedStyleRule: addRelatedStyleRule, | ||
deleteRelatedStyleRule: deleteRelatedStyleRule | ||
}; |
This file was deleted.
Oops, something went wrong.
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice clean up here 👍