Skip to content
Open
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
1 change: 1 addition & 0 deletions draftlogs/7864_fix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Preserve `colorbars` edit types for colorbar attributes on map traces [[#7864](https://github.com/plotly/plotly.js/pull/7864)]
6 changes: 5 additions & 1 deletion src/traces/scattergeo/attributes.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ var scatterMarkerAttrs = scatterAttrs.marker;
var scatterLineAttrs = scatterAttrs.line;
var scatterMarkerLineAttrs = scatterMarkerAttrs.line;

module.exports = overrideAll(
const attrs = overrideAll(
{
lon: {
valType: 'data_array',
Expand Down Expand Up @@ -170,3 +170,7 @@ module.exports = overrideAll(
'calc',
'nested'
);

attrs.marker.colorbar = require('../../components/colorbar/attributes');

module.exports = attrs;
6 changes: 5 additions & 1 deletion src/traces/scattermap/attributes.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ var mapLayoutAtributes = require('../../plots/map/layout_attributes');
var lineAttrs = scatterGeoAttrs.line;
var markerAttrs = scatterGeoAttrs.marker;

module.exports = overrideAll(
const attrs = overrideAll(
{
lon: scatterGeoAttrs.lon,
lat: scatterGeoAttrs.lat,
Expand Down Expand Up @@ -178,3 +178,7 @@ module.exports = overrideAll(
'calc',
'nested'
);

attrs.marker.colorbar = require('../../components/colorbar/attributes');

module.exports = attrs;
14 changes: 14 additions & 0 deletions test/jasmine/tests/colorbar_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,20 @@ var drag = require('../assets/drag');
describe('Test colorbar:', function() {
'use strict';

describe('map trace attribute edit types:', () => {
const colorbarAttrs = require('../../../src/components/colorbar/attributes');
const traceAttrs = {
scattergeo: require('../../../src/traces/scattergeo/attributes'),
scattermap: require('../../../src/traces/scattermap/attributes')
};

Object.keys(traceAttrs).forEach((name) => {
it(`${name} should preserve colorbar edit types`, () => {
expect(traceAttrs[name].marker.colorbar).toEqual(colorbarAttrs);
});
});
});

describe('supplyDefaults:', function() {
function _supply(trace, layout) {
var gd = {
Expand Down
Loading