Skip to content

heatmapgl in main bundle #1197

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

Merged
merged 6 commits into from
Nov 29, 2016
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
1 change: 1 addition & 0 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ Plotly.register([

require('./scattergl'),
require('./pointcloud'),
require('./heatmapgl'),

require('./scattermapbox'),

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
"gl-contour2d": "^1.1.2",
"gl-error2d": "^1.2.1",
"gl-error3d": "^1.0.0",
"gl-heatmap2d": "^1.0.2",
"gl-heatmap2d": "^1.0.3",
"gl-line2d": "^1.4.1",
"gl-line3d": "^1.1.0",
"gl-mat4": "^1.1.2",
Expand Down
28 changes: 27 additions & 1 deletion src/traces/heatmapgl/attributes.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,31 @@


var heatmapAttrs = require('../scatter/attributes');
var colorscaleAttrs = require('../../components/colorscale/attributes');
var colorbarAttrs = require('../../components/colorbar/attributes');

module.exports = heatmapAttrs;
var extendFlat = require('../../lib/extend').extendFlat;

var commonList = [
'z',
'x', 'x0', 'dx',
'y', 'y0', 'dy',
'text', 'transpose',
'xtype', 'ytype'
];

var attrs = {};

for(var i = 0; i < commonList.length; i++) {
var k = commonList[i];
attrs[k] = heatmapAttrs[k];
}

extendFlat(
attrs,
colorscaleAttrs,
{ autocolorscale: extendFlat({}, colorscaleAttrs.autocolorscale, {dflt: false}) },
{ colorbar: colorbarAttrs }
);

module.exports = attrs;
2 changes: 1 addition & 1 deletion src/traces/heatmapgl/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ HeatmapGl.basePlotModule = require('../../plots/gl2d');
HeatmapGl.categories = ['gl2d', '2dMap'];
HeatmapGl.meta = {
description: [
'WebGL heatmap (beta)'
'WebGL version of the heatmap trace type.'
].join(' ')
};

Expand Down
Binary file added test/image/baselines/gl2d_heatmapgl.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
134 changes: 134 additions & 0 deletions test/image/mocks/gl2d_heatmapgl.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
{
"data": [
{
"type": "heatmapgl",
"z": [
[
125,
106,
89,
74,
61,
50,
41,
34,
29,
26
],
[
116,
97,
80,
65,
52,
41,
32,
25,
20,
17
],
[
109,
90,
73,
58,
45,
34,
25,
18,
13,
10
],
[
104,
85,
68,
53,
40,
29,
20,
13,
8,
5
],
[
101,
82,
65,
50,
37,
26,
17,
10,
5,
2
],
[
100,
81,
64,
49,
36,
25,
16,
9,
4,
1
],
[
101,
82,
65,
50,
37,
26,
17,
10,
5,
2
],
[
104,
85,
68,
53,
40,
29,
20,
13,
8,
5
],
[
109,
90,
73,
58,
45,
34,
25,
18,
13,
10
],
[
116,
97,
80,
65,
52,
41,
32,
25,
20,
17
]
],
"colorscale": "Viridis"
}
],
"layout": {
"height": 450,
"width": 550
}
}
5 changes: 5 additions & 0 deletions test/jasmine/tests/gl2d_click_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ var hasWebGLSupport = require('../assets/has_webgl_support');
var click = require('../assets/timed_click');
var hover = require('../assets/hover');

// contourgl is not part of the dist plotly.js bundle initially
Plotly.register([
require('@lib/contourgl')
]);

describe('Test hover and click interactions', function() {

if(!hasWebGLSupport('gl2d_click_test')) return;
Expand Down
3 changes: 1 addition & 2 deletions test/jasmine/tests/gl2d_scatterplot_contour_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@ var Plotly = require('@lib/index');
var Lib = require('@src/lib');
var d3 = require('d3');

// heatmapgl & contourgl is not part of the dist plotly.js bundle initially
// contourgl is not part of the dist plotly.js bundle initially
Plotly.register([
require('@lib/heatmapgl'),
require('@lib/contourgl')
]);

Expand Down