Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,12 @@ The first parameter to `bubbles` should be an array of objects, each with **at l

Optionally, pass in `fillKey` to color code the bubble, and pass in any other data you want to render in a popup template which can be overridden in the options parameter.

For further customization, you can set these properties on each bubble to override the options parameter (or default options):

- `borderColor`
- `borderWidth`
- `fillOpacity`

The second parameter is the `options` param, where you can overide any of the default options (documented below)


Expand Down
12 changes: 9 additions & 3 deletions src/js/datamaps.js
Original file line number Diff line number Diff line change
Expand Up @@ -370,9 +370,15 @@
.attr('data-info', function(d) {
return JSON.stringify(d);
})
.style('stroke', options.borderColor)
.style('stroke-width', options.borderWidth)
.style('fill-opacity', options.fillOpacity)
.style('stroke', function ( datum ) {
return typeof datum.borderColor !== 'undefined' ? datum.borderColor : options.borderColor;
})
.style('stroke-width', function ( datum ) {
return typeof datum.borderWidth !== 'undefined' ? datum.borderWidth : options.borderWidth;
})
.style('fill-opacity', function ( datum ) {
return typeof datum.fillOpacity !== 'undefined' ? datum.fillOpacity : options.fillOpacity;
})
.style('fill', function ( datum ) {
var fillColor = fillData[ datum.fillKey ];
return fillColor || fillData.defaultFill;
Expand Down