-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Miscellaneous mapbox tweaks #681
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
Changes from 7 commits
9c72548
4a8563b
32973fc
17f3378
053058a
c1cd50c
a899283
34d5275
cf27e55
1620e61
51fa1ea
60e4285
0d082e4
0fdf70c
cb854fe
752c419
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,11 +9,7 @@ | |
|
||
'use strict'; | ||
|
||
var scatterMapboxAttrs = require('../../traces/scattermapbox/attributes'); | ||
var defaultLine = require('../../components/color').defaultLine; | ||
var extendFlat = require('../../lib').extendFlat; | ||
|
||
var lineAttrs = scatterMapboxAttrs.line; | ||
|
||
|
||
module.exports = { | ||
|
@@ -129,12 +125,14 @@ module.exports = { | |
|
||
type: { | ||
valType: 'enumerated', | ||
values: ['line', 'fill'], | ||
values: ['circle', 'line', 'fill'], | ||
dflt: 'line', | ||
role: 'info', | ||
description: [ | ||
'Sets the layer type.', | ||
'Support for *raster*, *background* types is coming soon.' | ||
'Support for *raster*, *background* types is coming soon.', | ||
'Note that *line* and *fill* are not compatible with Point', | ||
'GeoJSON geometry.' | ||
].join(' ') | ||
}, | ||
|
||
|
@@ -150,14 +148,68 @@ module.exports = { | |
].join(' ') | ||
}, | ||
|
||
circle: { | ||
radius: { | ||
valType: 'number', | ||
dflt: 15, | ||
role: 'style', | ||
description: [ | ||
'Sets the circle radius.', | ||
'Has an effect only when `type` is set to *circle*.' | ||
].join(' ') | ||
}, | ||
color: { | ||
valType: 'color', | ||
dflt: defaultLine, | ||
role: 'style', | ||
description: [ | ||
'Sets the circle color.', | ||
'Has an effect only when `type` is set to *circle*.' | ||
].join(' ') | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. missing There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
}, | ||
|
||
line: { | ||
color: extendFlat({}, lineAttrs.color, { | ||
dflt: defaultLine | ||
}), | ||
width: lineAttrs.width | ||
width: { | ||
valType: 'number', | ||
dflt: 2, | ||
role: 'style', | ||
description: [ | ||
'Sets the line radius.', | ||
'Has an effect only when `type` is set to *line*.' | ||
].join(' ') | ||
}, | ||
color: { | ||
valType: 'color', | ||
dflt: defaultLine, | ||
role: 'style', | ||
description: [ | ||
'Sets the line color.', | ||
'Has an effect only when `type` is set to *line*.' | ||
].join(' ') | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. missing opacity here? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. layers of different type don't need different There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ah yeah, isee now |
||
}, | ||
|
||
fillcolor: scatterMapboxAttrs.fillcolor, | ||
fill: { | ||
color: { | ||
valType: 'color', | ||
dflt: defaultLine, | ||
role: 'style', | ||
description: [ | ||
'Sets the fill color.', | ||
'Has an effect only when `type` is set to *fill*.' | ||
].join(' ') | ||
}, | ||
outlinecolor: { | ||
valType: 'color', | ||
dflt: defaultLine, | ||
role: 'style', | ||
description: [ | ||
'Sets the fill outline color.', | ||
'Has an effect only when `type` is set to *fill*.' | ||
].join(' ') | ||
} | ||
}, | ||
|
||
opacity: { | ||
valType: 'number', | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
'use strict'; | ||
|
||
|
||
module.exports = function hasWebGLSupport(testName) { | ||
var gl, canvas; | ||
|
||
try { | ||
canvas = document.createElement('canvas'); | ||
gl = canvas.getContext('webgl'); | ||
} | ||
catch(err) { | ||
gl = null; | ||
} | ||
|
||
var hasSupport = !!gl; | ||
|
||
if(!hasSupport) { | ||
console.warn('Cannot get WebGL context. Skip test *' + testName + '*'); | ||
} | ||
|
||
return hasSupport; | ||
}; |
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.
presumably
, *symbol*
too?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.
Yep. I could add it now if you want.