Skip to content

Commit 39ed838

Browse files
committed
handle voronoi in other places in src
1 parent 31f6252 commit 39ed838

File tree

7 files changed

+12
-4
lines changed

7 files changed

+12
-4
lines changed

src/plot_api/plot_api.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3802,12 +3802,15 @@ function makePlotFramework(gd) {
38023802
// single pie layer for the whole plot
38033803
fullLayout._pielayer = fullLayout._paper.append('g').classed('pielayer', true);
38043804

3805-
// single treemap layer for the whole plot
3805+
// single icicle layer for the whole plot
38063806
fullLayout._iciclelayer = fullLayout._paper.append('g').classed('iciclelayer', true);
38073807

38083808
// single treemap layer for the whole plot
38093809
fullLayout._treemaplayer = fullLayout._paper.append('g').classed('treemaplayer', true);
38103810

3811+
// single voronoi layer for the whole plot
3812+
fullLayout._voronoilayer = fullLayout._paper.append('g').classed('voronoilayer', true);
3813+
38113814
// single sunburst layer for the whole plot
38123815
fullLayout._sunburstlayer = fullLayout._paper.append('g').classed('sunburstlayer', true);
38133816

src/plots/plots.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3035,10 +3035,11 @@ plots.doCalcdata = function(gd, traces) {
30353035
gd._hmpixcount = 0;
30363036
gd._hmlumcount = 0;
30373037

3038-
// for sharing colors across pies / sunbursts / treemap / icicle / funnelarea (and for legend)
3038+
// for sharing colors across pies / sunbursts / treemap / voronoi / icicle / funnelarea (and for legend)
30393039
fullLayout._piecolormap = {};
30403040
fullLayout._sunburstcolormap = {};
30413041
fullLayout._treemapcolormap = {};
3042+
fullLayout._voronoicolormap = {};
30423043
fullLayout._iciclecolormap = {};
30433044
fullLayout._funnelareacolormap = {};
30443045

src/traces/bar/uniform_text.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ function resizeText(gd, gTrace, traceType) {
1717
selector = 'g.slice';
1818
break;
1919
case 'treemap' :
20+
case 'voronoi' :
2021
case 'icicle' :
2122
selector = 'g.slice, g.pathbar';
2223
break;

src/traces/pie/defaults.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ function handleMarkerDefaults(traceIn, traceOut, layout, coerce, isPie) {
4141
if(lineWidth) {
4242
coerce('marker.line.color',
4343
isPie ? undefined :
44-
layout.paper_bgcolor // case of funnelarea, sunburst, icicle, treemap
44+
layout.paper_bgcolor // case of funnelarea, sunburst, icicle, treemap, voronoi
4545
);
4646
}
4747

src/traces/sunburst/attributes.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ module.exports = {
208208
editType: 'calc',
209209
dflt: 'rgba(0,0,0,0)',
210210
description: [
211-
'sets the color of the root node for a sunburst/treemap/icicle trace.',
211+
'sets the color of the root node for a sunburst/treemap/voronoi/icicle trace.',
212212
'this has no effect when a colorscale is used to set the markers.'
213213
].join(' ')
214214
},

src/traces/sunburst/calc.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ var ALMOST_EQUAL = require('../../constants/numerical').ALMOST_EQUAL;
1313

1414
var sunburstExtendedColorWays = {};
1515
var treemapExtendedColorWays = {};
16+
var voronoiExtendedColorWays = {};
1617
var icicleExtendedColorWays = {};
1718

1819
exports.calc = function(gd, trace) {
@@ -248,6 +249,7 @@ exports._runCrossTraceCalc = function(desiredType, gd) {
248249
colorWay = generateExtendedColors(colorWay,
249250
desiredType === 'icicle' ? icicleExtendedColorWays :
250251
desiredType === 'treemap' ? treemapExtendedColorWays :
252+
desiredType === 'voronoi' ? voronoiExtendedColorWays :
251253
sunburstExtendedColorWays
252254
);
253255
}

src/traces/sunburst/fx.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ module.exports = function attachFxHandlers(sliceTop, entry, gd, cd, opts) {
2020
var isSunburst = trace.type === 'sunburst';
2121
var isTreemapOrIcicle =
2222
trace.type === 'treemap' ||
23+
trace.type === 'voronoi' ||
2324
trace.type === 'icicle';
2425

2526
// hover state vars

0 commit comments

Comments
 (0)