8000 DRY up color attributes by monfera · Pull Request #609 · plotly/plotly.js · GitHub
[go: up one dir, main page]

Skip to content

DRY up color attributes #609

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 15 commits into from
Jun 7, 2016
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
581a dry colors - heatmap
  • Loading branch information
monfera committed Jun 7, 2016
commit 4aed9b40d2e3c52fd5e1da23d717a7d5b03c32f2
143 changes: 69 additions & 74 deletions src/traces/heatmap/attributes.js < 8000 div aria-live="polite" aria-atomic="true" class="sr-only" data-clipboard-copy-feedback>
Original file line number Diff line number Diff line change
Expand Up @@ -14,78 +14,73 @@ var colorscaleAttrs = require('../../components/colorscale/attributes');
var extendFlat = require('../../lib/extend').extendFlat;


module.exports = {
z: {
valType: 'data_array',
description: 'Sets the z data.'
},
x: scatterAttrs.x,
x0: scatterAttrs.x0,
dx: scatterAttrs.dx,
y: scatterAttrs.y,
y0: scatterAttrs.y0,
dy: scatterAttrs.dy,
text: {
valType: 'data_array',
description: 'Sets the text elements associated with each z value.'
},
transpose: {
valType: 'boolean',
dflt: false,
role: 'info',
description: 'Transposes the z data.'
},
xtype: {
valType: 'enumerated',
values: ['array', 'scaled'],
role: 'info',
description: [
'If *array*, the heatmap\'s x coordinates are given by *x*',
'(the default behavior when `x` is provided).',
'If *scaled*, the heatmap\'s x coordinates are given by *x0* and *dx*',
'(the default behavior when `x` is not provided).'
].join(' ')
},
ytype: {
valType: 'enumerated',
values: ['array', 'scaled'],
role: 'info',
description: [
'If *array*, the heatmap\'s y coordinates are given by *y*',
'(the default behavior when `y` is provided)',
'If *scaled*, the heatmap\'s y coordinates are given by *y0* and *dy*',
'(the default behavior when `y` is not provided)'
].join(' ')
},
zauto: colorscaleAttrs.zauto,
zmin: colorscaleAttrs.zmin,
zmax: colorscaleAttrs.zmax,
colorscale: colorscaleAttrs.colorscale,
autocolorscale: extendFlat({}, colorscaleAttrs.autocolorscale,
{dflt: false}),
reversescale: colorscaleAttrs.reversescale,
showscale: colorscaleAttrs.showscale,
zsmooth: {
valType: 'enumerated',
values: ['fast', 'best', false],
dflt: false,
role: 'style',
description: [
'Picks a smoothing algorithm use to smooth `z` data.'
].join(' ')
},
connectgaps: {
valType: 'boolean',
dflt: false,
role: 'info',
description: [
'Determines whether or not gaps',
'(i.e. {nan} or missing values)',
'in the `z` data are filled in.'
].join(' ')
},
module.exports = extendFlat({},
colorscaleAttrs,
{autocolorscale: extendFlat({}, colorscaleAttrs.autocolorscale, {dflt: false})},
{
z: {
valType: 'data_array',
description: 'Sets the z data.'
},
x: scatterAttrs.x,
x0: scatterAttrs.x0,
dx: scatterAttrs.dx,
y: scatterAttrs.y,
y0: scatterAttrs.y0,
dy: scatterAttrs.dy,
text: {
valType: 'data_array',
description: 'Sets the text elements associated with each z value.'
},
transpose: {
valType: 'boolean',
dflt: false,
role: 'info',
description: 'Transposes the z data.'
},
xtype: {
valType: 'enumerated',
values: ['array', 'scaled'],
role: 'info',
description: [
'If *array*, the heatmap\'s x coordinates are given by *x*',
'(the default behavior when `x` is provided).',
'If *scaled*, the heatmap\'s x coordinates are given by *x0* and *dx*',
'(the default behavior when `x` is not provided).'
].join(' ')
},
ytype: {
valType: 'enumerated',
values: ['array', 'scaled'],
role: 'info',
description: [
'If *array*, the heatmap\'s y coordinates are given by *y*',
'(the default behavior when `y` is provided)',
'If *scaled*, the heatmap\'s y coordinates are given by *y0* and *dy*',
'(the default behavior when `y` is not provided)'
].join(' ')
},
zsmooth: {
valType: 'enumerated',
values: ['fast', 'best', false],
dflt: false,
role: 'style',
description: [
'Picks a smoothing algorithm use to smooth `z` data.'
].join(' ')
},
connectgaps: {
valType: 'boolean',
dflt: false,
role: 'info',
description: [
'Determines whether or not gaps',
'(i.e. {nan} or missing values)',
'in the `z` data are filled in.'
].join(' ')
},

_nestedModules: {
'colorbar': 'Colorbar'
}
};
_nestedModules: {
'colorbar': 'Colorbar'
}
});
0