Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 5f573c0

Browse files
committed
make surface calc step its own module (to be used in heatmapgl too)
1 parent 2112994 commit 5f573c0

File tree

2 files changed

+19
-6
lines changed

2 files changed

+19
-6
lines changed

src/traces/surface/calc.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
/**
2+
* Copyright 2012-2015, Plotly, Inc.
3+
* All rights reserved.
4+
*
5+
* This source code is licensed under the MIT license found in the
6+
* LICENSE file in the root directory of this source tree.
7+
*/
8+
9+
10+
'use strict';
11+
12+
var Colorscale = require('../../components/colorscale');
13+
14+
15+
// Compute auto-z and autocolorscale if applicable
16+
module.exports = function calc(gd, trace) {
17+
Colorscale.calc(trace, trace.z, '', 'z');
18+
};

src/traces/surface/index.js

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,4 @@ Surface.supplyDefaults = require('./defaults');
3232

3333
Surface.colorbar = require('../heatmap/colorbar');
3434

35-
Surface.calc = function(gd, trace) {
36-
37-
// auto-z and autocolorscale if applicable
38-
Plotly.Colorscale.calc(trace, trace.z, '', 'z');
39-
40-
};
35+
Surface.calc = require('./calc');

0 commit comments

Comments
 (0)