diff --git a/src/traces/box/index.js b/src/traces/box/index.js index 174a3d6bb36..bbc160fac16 100644 --- a/src/traces/box/index.js +++ b/src/traces/box/index.js @@ -8,41 +8,39 @@ 'use strict'; -var Box = {}; +module.exports = { + attributes: require('./attributes'), + layoutAttributes: require('./layout_attributes'), + supplyDefaults: require('./defaults').supplyDefaults, + crossTraceDefaults: require('./defaults').crossTraceDefaults, + supplyLayoutDefaults: require('./layout_defaults').supplyLayoutDefaults, + calc: require('./calc'), + crossTraceCalc: require('./cross_trace_calc').crossTraceCalc, + plot: require('./plot').plot, + style: require('./style').style, + styleOnSelect: require('./style').styleOnSelect, + hoverPoints: require('./hover').hoverPoints, + eventData: require('./event_data'), + selectPoints: require('./select'), -Box.attributes = require('./attributes'); -Box.layoutAttributes = require('./layout_attributes'); -Box.supplyDefaults = require('./defaults').supplyDefaults; -Box.crossTraceDefaults = require('./defaults').crossTraceDefaults; -Box.supplyLayoutDefaults = require('./layout_defaults').supplyLayoutDefaults; -Box.calc = require('./calc'); -Box.crossTraceCalc = require('./cross_trace_calc').crossTraceCalc; -Box.plot = require('./plot').plot; -Box.style = require('./style').style; -Box.styleOnSelect = require('./style').styleOnSelect; -Box.hoverPoints = require('./hover').hoverPoints; -Box.eventData = require('./event_data'); -Box.selectPoints = require('./select'); - -Box.moduleType = 'trace'; -Box.name = 'box'; -Box.basePlotModule = require('../../plots/cartesian'); -Box.categories = ['cartesian', 'svg', 'symbols', 'oriented', 'box-violin', 'showLegend', 'boxLayout', 'zoomScale']; -Box.meta = { - description: [ - 'In vertical (horizontal) box plots,', - 'statistics are computed using `y` (`x`) values.', - 'By supplying an `x` (`y`) array, one box per distinct x (y) value', - 'is drawn', - 'If no `x` (`y`) {array} is provided, a single box is drawn.', - 'That box position is then positioned with', - 'with `name` or with `x0` (`y0`) if provided.', - 'Each box spans from quartile 1 (Q1) to quartile 3 (Q3).', - 'The second quartile (Q2) is marked by a line inside the box.', - 'By default, the whiskers correspond to the box\' edges', - '+/- 1.5 times the interquartile range (IQR = Q3-Q1),', - 'see *boxpoints* for other options.' - ].join(' ') + moduleType: 'trace', + name: 'box', + basePlotModule: require('../../plots/cartesian'), + categories: ['cartesian', 'svg', 'symbols', 'oriented', 'box-violin', 'showLegend', 'boxLayout', 'zoomScale'], + meta: { + description: [ + 'In vertical (horizontal) box plots,', + 'statistics are computed using `y` (`x`) values.', + 'By supplying an `x` (`y`) array, one box per distinct x (y) value', + 'is drawn', + 'If no `x` (`y`) {array} is provided, a single box is drawn.', + 'That box position is then positioned with', + 'with `name` or with `x0` (`y0`) if provided.', + 'Each box spans from quartile 1 (Q1) to quartile 3 (Q3).', + 'The second quartile (Q2) is marked by a line inside the box.', + 'By default, the whiskers correspond to the box\' edges', + '+/- 1.5 times the interquartile range (IQR: Q3-Q1),', + 'see *boxpoints* for other options.' + ].join(' ') + } }; - -module.exports = Box; diff --git a/src/traces/carpet/index.js b/src/traces/carpet/index.js index b2b2cc48323..9b078ac791f 100644 --- a/src/traces/carpet/index.js +++ b/src/traces/carpet/index.js @@ -6,32 +6,29 @@ * LICENSE file in the root directory of this source tree. */ - 'use strict'; -var Carpet = {}; - -Carpet.attributes = require('./attributes'); -Carpet.supplyDefaults = require('./defaults'); -Carpet.plot = require('./plot'); -Carpet.calc = require('./calc'); -Carpet.animatable = true; -Carpet.isContainer = true; // so carpet traces get `calc` before other traces +module.exports = { + attributes: require('./attributes'), + supplyDefaults: require('./defaults'), + plot: require('./plot'), + calc: require('./calc'), + animatable: true, + isContainer: true, // so carpet traces get `calc` before other traces -Carpet.moduleType = 'trace'; -Carpet.name = 'carpet'; -Carpet.basePlotModule = require('../../plots/cartesian'); -Carpet.categories = ['cartesian', 'svg', 'carpet', 'carpetAxis', 'notLegendIsolatable', 'noMultiCategory']; -Carpet.meta = { - description: [ - 'The data describing carpet axis layout is set in `y` and (optionally)', - 'also `x`. If only `y` is present, `x` the plot is interpreted as a', - 'cheater plot and is filled in using the `y` values.', + moduleType: 'trace', + name: 'carpet', + basePlotModule: require('../../plots/cartesian'), + categories: ['cartesian', 'svg', 'carpet', 'carpetAxis', 'notLegendIsolatable', 'noMultiCategory'], + meta: { + description: [ + 'The data describing carpet axis layout is set in `y` and (optionally)', + 'also `x`. If only `y` is present, `x` the plot is interpreted as a', + 'cheater plot and is filled in using the `y` values.', - '`x` and `y` may either be 2D arrays matching with each dimension matching', - 'that of `a` and `b`, or they may be 1D arrays with total length equal to', - 'that of `a` and `b`.' - ].join(' ') + '`x` and `y` may either be 2D arrays matching with each dimension matching', + 'that of `a` and `b`, or they may be 1D arrays with total length equal to', + 'that of `a` and `b`.' + ].join(' ') + } }; - -module.exports = Carpet; diff --git a/src/traces/choropleth/index.js b/src/traces/choropleth/index.js index 1e87f637a26..62e536a7002 100644 --- a/src/traces/choropleth/index.js +++ b/src/traces/choropleth/index.js @@ -6,33 +6,30 @@ * LICENSE file in the root directory of this source tree. */ - 'use strict'; -var Choropleth = {}; - -Choropleth.attributes = require('./attributes'); -Choropleth.supplyDefaults = require('./defaults'); -Choropleth.colorbar = require('../heatmap/colorbar'); -Choropleth.calc = require('./calc'); -Choropleth.plot = require('./plot'); -Choropleth.style = require('./style').style; -Choropleth.styleOnSelect = require('./style').styleOnSelect; -Choropleth.hoverPoints = require('./hover'); -Choropleth.eventData = require('./event_data'); -Choropleth.selectPoints = require('./select'); +module.exports = { + attributes: require('./attributes'), + supplyDefaults: require('./defaults'), + colorbar: require('../heatmap/colorbar'), + calc: require('./calc'), + plot: require('./plot'), + style: require('./style').style, + styleOnSelect: require('./style').styleOnSelect, + hoverPoints: require('./hover'), + eventData: require('./event_data'), + selectPoints: require('./select'), -Choropleth.moduleType = 'trace'; -Choropleth.name = 'choropleth'; -Choropleth.basePlotModule = require('../../plots/geo'); -Choropleth.categories = ['geo', 'noOpacity']; -Choropleth.meta = { - description: [ - 'The data that describes the choropleth value-to-color mapping', - 'is set in `z`.', - 'The geographic locations corresponding to each value in `z`', - 'are set in `locations`.' - ].join(' ') + moduleType: 'trace', + name: 'choropleth', + basePlotModule: require('../../plots/geo'), + categories: ['geo', 'noOpacity'], + meta: { + description: [ + 'The data that describes the choropleth value-to-color mapping', + 'is set in `z`.', + 'The geographic locations corresponding to each value in `z`', + 'are set in `locations`.' + ].join(' ') + } }; - -module.exports = Choropleth; diff --git a/src/traces/contour/index.js b/src/traces/contour/index.js index 6705100c048..efec750b0ed 100644 --- a/src/traces/contour/index.js +++ b/src/traces/contour/index.js @@ -6,34 +6,31 @@ * LICENSE file in the root directory of this source tree. */ - 'use strict'; -var Contour = {}; - -Contour.attributes = require('./attributes'); -Contour.supplyDefaults = require('./defaults'); -Contour.calc = require('./calc'); -Contour.plot = require('./plot').plot; -Contour.style = require('./style'); -Contour.colorbar = require('./colorbar'); -Contour.hoverPoints = require('./hover'); +module.exports = { + attributes: require('./attributes'), + supplyDefaults: require('./defaults'), + calc: require('./calc'), + plot: require('./plot').plot, + style: require('./style'), + colorbar: require('./colorbar'), + hoverPoints: require('./hover'), -Contour.moduleType = 'trace'; -Contour.name = 'contour'; -Contour.basePlotModule = require('../../plots/cartesian'); -Contour.categories = ['cartesian', 'svg', '2dMap', 'contour', 'showLegend']; -Contour.meta = { - description: [ - 'The data from which contour lines are computed is set in `z`.', - 'Data in `z` must be a {2D array} of numbers.', + moduleType: 'trace', + name: 'contour', + basePlotModule: require('../../plots/cartesian'), + categories: ['cartesian', 'svg', '2dMap', 'contour', 'showLegend'], + meta: { + description: [ + 'The data from which contour lines are computed is set in `z`.', + 'Data in `z` must be a {2D array} of numbers.', - 'Say that `z` has N rows and M columns, then by default,', - 'these N rows correspond to N y coordinates', - '(set in `y` or auto-generated) and the M columns', - 'correspond to M x coordinates (set in `x` or auto-generated).', - 'By setting `transpose` to *true*, the above behavior is flipped.' - ].join(' ') + 'Say that `z` has N rows and M columns, then by default,', + 'these N rows correspond to N y coordinates', + '(set in `y` or auto-generated) and the M columns', + 'correspond to M x coordinates (set in `x` or auto-generated).', + 'By setting `transpose` to *true*, the above behavior is flipped.' + ].join(' ') + } }; - -module.exports = Contour; diff --git a/src/traces/contourcarpet/index.js b/src/traces/contourcarpet/index.js index ea31b588084..850ef1dfa20 100644 --- a/src/traces/contourcarpet/index.js +++ b/src/traces/contourcarpet/index.js @@ -8,27 +8,25 @@ 'use strict'; -var ContourCarpet = {}; +module.exports = { + attributes: require('./attributes'), + supplyDefaults: require('./defaults'), + colorbar: require('../contour/colorbar'), + calc: require('./calc'), + plot: require('./plot'), + style: require('../contour/style'), -ContourCarpet.attributes = require('./attributes'); -ContourCarpet.supplyDefaults = require('./defaults'); -ContourCarpet.colorbar = require('../contour/colorbar'); -ContourCarpet.calc = require('./calc'); -ContourCarpet.plot = require('./plot'); -ContourCarpet.style = require('../contour/style'); - -ContourCarpet.moduleType = 'trace'; -ContourCarpet.name = 'contourcarpet'; -ContourCarpet.basePlotModule = require('../../plots/cartesian'); -ContourCarpet.categories = ['cartesian', 'svg', 'carpet', 'contour', 'symbols', 'showLegend', 'hasLines', 'carpetDependent']; -ContourCarpet.meta = { - hrName: 'contour_carpet', - description: [ - 'Plots contours on either the first carpet axis or the', - 'carpet axis with a matching `carpet` attribute. Data `z`', - 'is interpreted as matching that of the corresponding carpet', - 'axis.' - ].join(' ') + moduleType: 'trace', + name: 'contourcarpet', + basePlotModule: require('../../plots/cartesian'), + categories: ['cartesian', 'svg', 'carpet', 'contour', 'symbols', 'showLegend', 'hasLines', 'carpetDependent'], + meta: { + hrName: 'contour_carpet', + description: [ + 'Plots contours on either the first carpet axis or the', + 'carpet axis with a matching `carpet` attribute. Data `z`', + 'is interpreted as matching that of the corresponding carpet', + 'axis.' + ].join(' ') + } }; - -module.exports = ContourCarpet; diff --git a/src/traces/contourgl/index.js b/src/traces/contourgl/index.js index 81d0fbe182d..05ebe352277 100644 --- a/src/traces/contourgl/index.js +++ b/src/traces/contourgl/index.js @@ -6,28 +6,25 @@ * LICENSE file in the root directory of this source tree. */ - 'use strict'; var overrideAll = require('../../plot_api/edit_types').overrideAll; -var ContourGl = {}; - -ContourGl.attributes = overrideAll(require('../contour/attributes'), 'calc', 'nested'); -ContourGl.supplyDefaults = require('../contour/defaults'); -ContourGl.colorbar = require('../contour/colorbar'); - -ContourGl.calc = require('../contour/calc'); -ContourGl.plot = require('./convert'); - -ContourGl.moduleType = 'trace'; -ContourGl.name = 'contourgl'; -ContourGl.basePlotModule = require('../../plots/gl2d'); -ContourGl.categories = ['gl', 'gl2d', '2dMap']; -ContourGl.meta = { - description: [ - 'WebGL contour (beta)' - ].join(' ') +module.exports = { + attributes: overrideAll(require('../contour/attributes'), 'calc', 'nested'), + supplyDefaults: require('../contour/defaults'), + colorbar: require('../contour/colorbar'), + + calc: require('../contour/calc'), + plot: require('./convert'), + + moduleType: 'trace', + name: 'contourgl', + basePlotModule: require('../../plots/gl2d'), + categories: ['gl', 'gl2d', '2dMap'], + meta: { + description: [ + 'WebGL contour (beta)' + ].join(' ') + } }; - -module.exports = ContourGl; diff --git a/src/traces/heatmap/index.js b/src/traces/heatmap/index.js index 7b72e2b9774..cea242fc0ac 100644 --- a/src/traces/heatmap/index.js +++ b/src/traces/heatmap/index.js @@ -6,48 +6,45 @@ * LICENSE file in the root directory of this source tree. */ - 'use strict'; -var Heatmap = {}; - -Heatmap.attributes = require('./attributes'); -Heatmap.supplyDefaults = require('./defaults'); -Heatmap.calc = require('./calc'); -Heatmap.plot = require('./plot'); -Heatmap.colorbar = require('./colorbar'); -Heatmap.style = require('./style'); -Heatmap.hoverPoints = require('./hover'); - -Heatmap.moduleType = 'trace'; -Heatmap.name = 'heatmap'; -Heatmap.basePlotModule = require('../../plots/cartesian'); -Heatmap.categories = ['cartesian', 'svg', '2dMap']; -Heatmap.meta = { - description: [ - 'The data that describes the heatmap value-to-color mapping', - 'is set in `z`.', - 'Data in `z` can either be a {2D array} of values (ragged or not)', - 'or a 1D array of values.', - - 'In the case where `z` is a {2D array},', - 'say that `z` has N rows and M columns.', - 'Then, by default, the resulting heatmap will have N partitions along', - 'the y axis and M partitions along the x axis.', - 'In other words, the i-th row/ j-th column cell in `z`', - 'is mapped to the i-th partition of the y axis', - '(starting from the bottom of the plot) and the j-th partition', - 'of the x-axis (starting from the left of the plot).', - 'This behavior can be flipped by using `transpose`.', - 'Moreover, `x` (`y`) can be provided with M or M+1 (N or N+1) elements.', - 'If M (N), then the coordinates correspond to the center of the', - 'heatmap cells and the cells have equal width.', - 'If M+1 (N+1), then the coordinates correspond to the edges of the', - 'heatmap cells.', - - 'In the case where `z` is a 1D {array}, the x and y coordinates must be', - 'provided in `x` and `y` respectively to form data triplets.' - ].join(' ') +module.exports = { + attributes: require('./attributes'), + supplyDefaults: require('./defaults'), + calc: require('./calc'), + plot: require('./plot'), + colorbar: require('./colorbar'), + style: require('./style'), + hoverPoints: require('./hover'), + + moduleType: 'trace', + name: 'heatmap', + basePlotModule: require('../../plots/cartesian'), + categories: ['cartesian', 'svg', '2dMap'], + meta: { + description: [ + 'The data that describes the heatmap value-to-color mapping', + 'is set in `z`.', + 'Data in `z` can either be a {2D array} of values (ragged or not)', + 'or a 1D array of values.', + + 'In the case where `z` is a {2D array},', + 'say that `z` has N rows and M columns.', + 'Then, by default, the resulting heatmap will have N partitions along', + 'the y axis and M partitions along the x axis.', + 'In other words, the i-th row/ j-th column cell in `z`', + 'is mapped to the i-th partition of the y axis', + '(starting from the bottom of the plot) and the j-th partition', + 'of the x-axis (starting from the left of the plot).', + 'This behavior can be flipped by using `transpose`.', + 'Moreover, `x` (`y`) can be provided with M or M+1 (N or N+1) elements.', + 'If M (N), then the coordinates correspond to the center of the', + 'heatmap cells and the cells have equal width.', + 'If M+1 (N+1), then the coordinates correspond to the edges of the', + 'heatmap cells.', + + 'In the case where `z` is a 1D {array}, the x and y coordinates must be', + 'provided in `x` and `y` respectively to form data triplets.' + ].join(' ') + } }; - -module.exports = Heatmap; diff --git a/src/traces/heatmapgl/index.js b/src/traces/heatmapgl/index.js index 4b0fdab3da7..cf034be652e 100644 --- a/src/traces/heatmapgl/index.js +++ b/src/traces/heatmapgl/index.js @@ -6,26 +6,23 @@ * LICENSE file in the root directory of this source tree. */ - 'use strict'; -var HeatmapGl = {}; - -HeatmapGl.attributes = require('./attributes'); -HeatmapGl.supplyDefaults = require('../heatmap/defaults'); -HeatmapGl.colorbar = require('../heatmap/colorbar'); +module.exports = { + attributes: require('./attributes'), + supplyDefaults: require('../heatmap/defaults'), + colorbar: require('../heatmap/colorbar'), -HeatmapGl.calc = require('../heatmap/calc'); -HeatmapGl.plot = require('./convert'); + calc: require('../heatmap/calc'), + plot: require('./convert'), -HeatmapGl.moduleType = 'trace'; -HeatmapGl.name = 'heatmapgl'; -HeatmapGl.basePlotModule = require('../../plots/gl2d'); -HeatmapGl.categories = ['gl', 'gl2d', '2dMap']; -HeatmapGl.meta = { - description: [ - 'WebGL version of the heatmap trace type.' - ].join(' ') + moduleType: 'trace', + name: 'heatmapgl', + basePlotModule: require('../../plots/gl2d'), + categories: ['gl', 'gl2d', '2dMap'], + meta: { + description: [ + 'WebGL version of the heatmap trace type.' + ].join(' ') + } }; - -module.exports = HeatmapGl; diff --git a/src/traces/histogram/index.js b/src/traces/histogram/index.js index 4272c6304b6..71861c67a46 100644 --- a/src/traces/histogram/index.js +++ b/src/traces/histogram/index.js @@ -6,7 +6,6 @@ * LICENSE file in the root directory of this source tree. */ - 'use strict'; /** @@ -22,37 +21,34 @@ * to allow quadrature combination of errors in summed histograms... */ - -var Histogram = {}; - -Histogram.attributes = require('./attributes'); -Histogram.layoutAttributes = require('../bar/layout_attributes'); -Histogram.supplyDefaults = require('./defaults'); -Histogram.crossTraceDefaults = require('./cross_trace_defaults'); -Histogram.supplyLayoutDefaults = require('../bar/layout_defaults'); -Histogram.calc = require('./calc'); -Histogram.crossTraceCalc = require('../bar/cross_trace_calc').crossTraceCalc; -Histogram.plot = require('../bar/plot'); -Histogram.layerName = 'barlayer'; -Histogram.style = require('../bar/style').style; -Histogram.styleOnSelect = require('../bar/style').styleOnSelect; -Histogram.colorbar = require('../scatter/marker_colorbar'); -Histogram.hoverPoints = require('./hover'); -Histogram.selectPoints = require('../bar/select'); -Histogram.eventData = require('./event_data'); - -Histogram.moduleType = 'trace'; -Histogram.name = 'histogram'; -Histogram.basePlotModule = require('../../plots/cartesian'); -Histogram.categories = ['cartesian', 'svg', 'bar', 'histogram', 'oriented', 'errorBarsOK', 'showLegend']; -Histogram.meta = { - description: [ - 'The sample data from which statistics are computed is set in `x`', - 'for vertically spanning histograms and', - 'in `y` for horizontally spanning histograms.', - 'Binning options are set `xbins` and `ybins` respectively', - 'if no aggregation data is provided.' - ].join(' ') +module.exports = { + attributes: require('./attributes'), + layoutAttributes: require('../bar/layout_attributes'), + supplyDefaults: require('./defaults'), + crossTraceDefaults: require('./cross_trace_defaults'), + supplyLayoutDefaults: require('../bar/layout_defaults'), + calc: require('./calc'), + crossTraceCalc: require('../bar/cross_trace_calc').crossTraceCalc, + plot: require('../bar/plot'), + layerName: 'barlayer', + style: require('../bar/style').style, + styleOnSelect: require('../bar/style').styleOnSelect, + colorbar: require('../scatter/marker_colorbar'), + hoverPoints: require('./hover'), + selectPoints: require('../bar/select'), + eventData: require('./event_data'), + + moduleType: 'trace', + name: 'histogram', + basePlotModule: require('../../plots/cartesian'), + categories: ['cartesian', 'svg', 'bar', 'histogram', 'oriented', 'errorBarsOK', 'showLegend'], + meta: { + description: [ + 'The sample data from which statistics are computed is set in `x`', + 'for vertically spanning histograms and', + 'in `y` for horizontally spanning histograms.', + 'Binning options are set `xbins` and `ybins` respectively', + 'if no aggregation data is provided.' + ].join(' ') + } }; - -module.exports = Histogram; diff --git a/src/traces/histogram2d/index.js b/src/traces/histogram2d/index.js index 450d5baf5de..8b37378820e 100644 --- a/src/traces/histogram2d/index.js +++ b/src/traces/histogram2d/index.js @@ -6,36 +6,34 @@ * LICENSE file in the root directory of this source tree. */ - 'use strict'; -var Histogram2D = {}; +module.exports = { -Histogram2D.attributes = require('./attributes'); -Histogram2D.supplyDefaults = require('./defaults'); -Histogram2D.crossTraceDefaults = require('./cross_trace_defaults'); -Histogram2D.calc = require('../heatmap/calc'); -Histogram2D.plot = require('../heatmap/plot'); -Histogram2D.layerName = 'heatmaplayer'; -Histogram2D.colorbar = require('../heatmap/colorbar'); -Histogram2D.style = require('../heatmap/style'); -Histogram2D.hoverPoints = require('./hover'); -Histogram2D.eventData = require('../histogram/event_data'); + attributes: require('./attributes'), + supplyDefaults: require('./defaults'), + crossTraceDefaults: require('./cross_trace_defaults'), + calc: require('../heatmap/calc'), + plot: require('../heatmap/plot'), + layerName: 'heatmaplayer', + colorbar: require('../heatmap/colorbar'), + style: require('../heatmap/style'), + hoverPoints: require('./hover'), + eventData: require('../histogram/event_data'), -Histogram2D.moduleType = 'trace'; -Histogram2D.name = 'histogram2d'; -Histogram2D.basePlotModule = require('../../plots/cartesian'); -Histogram2D.categories = ['cartesian', 'svg', '2dMap', 'histogram']; -Histogram2D.meta = { - hrName: 'histogram_2d', - description: [ - 'The sample data from which statistics are computed is set in `x`', - 'and `y` (where `x` and `y` represent marginal distributions,', - 'binning is set in `xbins` and `ybins` in this case)', - 'or `z` (where `z` represent the 2D distribution and binning set,', - 'binning is set by `x` and `y` in this case).', - 'The resulting distribution is visualized as a heatmap.' - ].join(' ') + moduleType: 'trace', + name: 'histogram2d', + basePlotModule: require('../../plots/cartesian'), + categories: ['cartesian', 'svg', '2dMap', 'histogram'], + meta: { + hrName: 'histogram_2d', + description: [ + 'The sample data from which statistics are computed is set in `x`', + 'and `y` (where `x` and `y` represent marginal distributions,', + 'binning is set in `xbins` and `ybins` in this case)', + 'or `z` (where `z` represent the 2D distribution and binning set,', + 'binning is set by `x` and `y` in this case).', + 'The resulting distribution is visualized as a heatmap.' + ].join(' ') + } }; - -module.exports = Histogram2D; diff --git a/src/traces/histogram2dcontour/index.js b/src/traces/histogram2dcontour/index.js index f7d1446da74..46d6cfc60be 100644 --- a/src/traces/histogram2dcontour/index.js +++ b/src/traces/histogram2dcontour/index.js @@ -6,35 +6,32 @@ * LICENSE file in the root directory of this source tree. */ - 'use strict'; -var Histogram2dContour = {}; - -Histogram2dContour.attributes = require('./attributes'); -Histogram2dContour.supplyDefaults = require('./defaults'); -Histogram2dContour.crossTraceDefaults = require('../histogram2d/cross_trace_defaults'); -Histogram2dContour.calc = require('../contour/calc'); -Histogram2dContour.plot = require('../contour/plot').plot; -Histogram2dContour.layerName = 'contourlayer'; -Histogram2dContour.style = require('../contour/style'); -Histogram2dContour.colorbar = require('../contour/colorbar'); -Histogram2dContour.hoverPoints = require('../contour/hover'); +module.exports = { + attributes: require('./attributes'), + supplyDefaults: require('./defaults'), + crossTraceDefaults: require('../histogram2d/cross_trace_defaults'), + calc: require('../contour/calc'), + plot: require('../contour/plot').plot, + layerName: 'contourlayer', + style: require('../contour/style'), + colorbar: require('../contour/colorbar'), + hoverPoints: require('../contour/hover'), -Histogram2dContour.moduleType = 'trace'; -Histogram2dContour.name = 'histogram2dcontour'; -Histogram2dContour.basePlotModule = require('../../plots/cartesian'); -Histogram2dContour.categories = ['cartesian', 'svg', '2dMap', 'contour', 'histogram', 'showLegend']; -Histogram2dContour.meta = { - hrName: 'histogram_2d_contour', - description: [ - 'The sample data from which statistics are computed is set in `x`', - 'and `y` (where `x` and `y` represent marginal distributions,', - 'binning is set in `xbins` and `ybins` in this case)', - 'or `z` (where `z` represent the 2D distribution and binning set,', - 'binning is set by `x` and `y` in this case).', - 'The resulting distribution is visualized as a contour plot.' - ].join(' ') + moduleType: 'trace', + name: 'histogram2dcontour', + basePlotModule: require('../../plots/cartesian'), + categories: ['cartesian', 'svg', '2dMap', 'contour', 'histogram', 'showLegend'], + meta: { + hrName: 'histogram_2d_contour', + description: [ + 'The sample data from which statistics are computed is set in `x`', + 'and `y` (where `x` and `y` represent marginal distributions,', + 'binning is set in `xbins` and `ybins` in this case)', + 'or `z` (where `z` represent the 2D distribution and binning set,', + 'binning is set by `x` and `y` in this case).', + 'The resulting distribution is visualized as a contour plot.' + ].join(' ') + } }; - -module.exports = Histogram2dContour; diff --git a/src/traces/isosurface/index.js b/src/traces/isosurface/index.js index d201c17758b..193167ba186 100644 --- a/src/traces/isosurface/index.js +++ b/src/traces/isosurface/index.js @@ -6,31 +6,28 @@ * LICENSE file in the root directory of this source tree. */ - 'use strict'; -var Isosurface = {}; - -Isosurface.attributes = require('./attributes'); -Isosurface.supplyDefaults = require('./defaults').supplyDefaults; -Isosurface.calc = require('./calc'); -Isosurface.colorbar = { - min: 'cmin', - max: 'cmax' -}; -Isosurface.plot = require('./convert').createIsosurfaceTrace; +module.exports = { + attributes: require('./attributes'), + supplyDefaults: require('./defaults').supplyDefaults, + calc: require('./calc'), + colorbar: { + min: 'cmin', + max: 'cmax' + }, + plot: require('./convert').createIsosurfaceTrace, -Isosurface.moduleType = 'trace'; -Isosurface.name = 'isosurface', -Isosurface.basePlotModule = require('../../plots/gl3d'); -Isosurface.categories = ['gl3d']; -Isosurface.meta = { - description: [ - 'Draws isosurfaces between iso-min and iso-max values with coordinates given by', - 'four 1-dimensional arrays containing the `value`, `x`, `y` and `z` of every vertex', - 'of a uniform or non-uniform 3-D grid. Horizontal or vertical slices, caps as well as', - 'spaceframe between iso-min and iso-max values could also be drawn using this trace.' - ].join(' ') + moduleType: 'trace', + name: 'isosurface', + basePlotModule: require('../../plots/gl3d'), + categories: ['gl3d'], + meta: { + description: [ + 'Draws isosurfaces between iso-min and iso-max values with coordinates given by', + 'four 1-dimensional arrays containing the `value`, `x`, `y` and `z` of every vertex', + 'of a uniform or non-uniform 3-D grid. Horizontal or vertical slices, caps as well as', + 'spaceframe between iso-min and iso-max values could also be drawn using this trace.' + ].join(' ') + } }; - -module.exports = Isosurface; diff --git a/src/traces/mesh3d/index.js b/src/traces/mesh3d/index.js index 9b4ba011927..a1277d17e56 100644 --- a/src/traces/mesh3d/index.js +++ b/src/traces/mesh3d/index.js @@ -6,33 +6,30 @@ * LICENSE file in the root directory of this source tree. */ - 'use strict'; -var Mesh3D = {}; - -Mesh3D.attributes = require('./attributes'); -Mesh3D.supplyDefaults = require('./defaults'); -Mesh3D.calc = require('./calc'); -Mesh3D.colorbar = { - min: 'cmin', - max: 'cmax' -}; -Mesh3D.plot = require('./convert'); +module.exports = { + attributes: require('./attributes'), + supplyDefaults: require('./defaults'), + calc: require('./calc'), + colorbar: { + min: 'cmin', + max: 'cmax' + }, + plot: require('./convert'), -Mesh3D.moduleType = 'trace'; -Mesh3D.name = 'mesh3d', -Mesh3D.basePlotModule = require('../../plots/gl3d'); -Mesh3D.categories = ['gl3d']; -Mesh3D.meta = { - description: [ - 'Draws sets of triangles with coordinates given by', - 'three 1-dimensional arrays in `x`, `y`, `z` and', - '(1) a sets of `i`, `j`, `k` indices', - '(2) Delaunay triangulation or', - '(3) the Alpha-shape algorithm or', - '(4) the Convex-hull algorithm' - ].join(' ') + moduleType: 'trace', + name: 'mesh3d', + basePlotModule: require('../../plots/gl3d'), + categories: ['gl3d'], + meta: { + description: [ + 'Draws sets of triangles with coordinates given by', + 'three 1-dimensional arrays in `x`, `y`, `z` and', + '(1) a sets of `i`, `j`, `k` indices', + '(2) Delaunay triangulation or', + '(3) the Alpha-shape algorithm or', + '(4) the Convex-hull algorithm' + ].join(' ') + } }; - -module.exports = Mesh3D; diff --git a/src/traces/parcats/index.js b/src/traces/parcats/index.js index 91737b4d787..d5a67290c10 100644 --- a/src/traces/parcats/index.js +++ b/src/traces/parcats/index.js @@ -8,26 +8,24 @@ 'use strict'; -var Parcats = {}; +module.exports = { + attributes: require('./attributes'), + supplyDefaults: require('./defaults'), + calc: require('./calc'), + plot: require('./plot'), + colorbar: { + container: 'line', + min: 'cmin', + max: 'cmax' + }, -Parcats.attributes = require('./attributes'); -Parcats.supplyDefaults = require('./defaults'); -Parcats.calc = require('./calc'); -Parcats.plot = require('./plot'); -Parcats.colorbar = { - container: 'line', - min: 'cmin', - max: 'cmax' + moduleType: 'trace', + name: 'parcats', + basePlotModule: require('./base_plot'), + categories: ['noOpacity'], + meta: { + description: [ + 'Parallel categories diagram for multidimensional categorical data.' + ].join(' ') + } }; - -Parcats.moduleType = 'trace'; -Parcats.name = 'parcats'; -Parcats.basePlotModule = require('./base_plot'); -Parcats.categories = ['noOpacity']; -Parcats.meta = { - description: [ - 'Parallel categories diagram for multidimensional categorical data.' - ].join(' ') -}; - -module.exports = Parcats; diff --git a/src/traces/parcoords/index.js b/src/traces/parcoords/index.js index 897406f2212..d432141cc59 100644 --- a/src/traces/parcoords/index.js +++ b/src/traces/parcoords/index.js @@ -8,28 +8,26 @@ 'use strict'; -var Parcoords = {}; +module.exports = { + attributes: require('./attributes'), + supplyDefaults: require('./defaults'), + calc: require('./calc'), + plot: require('./plot'), + colorbar: { + container: 'line', + min: 'cmin', + max: 'cmax' + }, -Parcoords.attributes = require('./attributes'); -Parcoords.supplyDefaults = require('./defaults'); -Parcoords.calc = require('./calc'); -Parcoords.plot = require('./plot'); -Parcoords.colorbar = { - container: 'line', - min: 'cmin', - max: 'cmax' + moduleType: 'trace', + name: 'parcoords', + basePlotModule: require('./base_plot'), + categories: ['gl', 'regl', 'noOpacity', 'noHover'], + meta: { + description: [ + 'Parallel coordinates for multidimensional exploratory data analysis.', + 'The samples are specified in `dimensions`.', + 'The colors are set in `line.color`.' + ].join(' ') + } }; - -Parcoords.moduleType = 'trace'; -Parcoords.name = 'parcoords'; -Parcoords.basePlotModule = require('./base_plot'); -Parcoords.categories = ['gl', 'regl', 'noOpacity', 'noHover']; -Parcoords.meta = { - description: [ - 'Parallel coordinates for multidimensional exploratory data analysis.', - 'The samples are specified in `dimensions`.', - 'The colors are set in `line.color`.' - ].join(' ') -}; - -module.exports = Parcoords; diff --git a/src/traces/pie/index.js b/src/traces/pie/index.js index f8ec9c13fdf..71b2594aa01 100644 --- a/src/traces/pie/index.js +++ b/src/traces/pie/index.js @@ -8,31 +8,28 @@ 'use strict'; -var Pie = {}; +module.exports = { + attributes: require('./attributes'), + supplyDefaults: require('./defaults'), + supplyLayoutDefaults: require('./layout_defaults'), + layoutAttributes: require('./layout_attributes'), -Pie.attributes = require('./attributes'); -Pie.supplyDefaults = require('./defaults'); -Pie.supplyLayoutDefaults = require('./layout_defaults'); -Pie.layoutAttributes = require('./layout_attributes'); + calc: require('./calc').calc, + crossTraceCalc: require('./calc').crossTraceCalc, -var calcModule = require('./calc'); -Pie.calc = calcModule.calc; -Pie.crossTraceCalc = calcModule.crossTraceCalc; + plot: require('./plot').plot, + style: require('./style'), + styleOne: require('./style_one'), -Pie.plot = require('./plot').plot; -Pie.style = require('./style'); -Pie.styleOne = require('./style_one'); - -Pie.moduleType = 'trace'; -Pie.name = 'pie'; -Pie.basePlotModule = require('./base_plot'); -Pie.categories = ['pie', 'showLegend']; -Pie.meta = { - description: [ - 'A data visualized by the sectors of the pie is set in `values`.', - 'The sector labels are set in `labels`.', - 'The sector colors are set in `marker.colors`' - ].join(' ') + moduleType: 'trace', + name: 'pie', + basePlotModule: require('./base_plot'), + categories: ['pie', 'showLegend'], + meta: { + description: [ + 'A data visualized by the sectors of the pie is set in `values`.', + 'The sector labels are set in `labels`.', + 'The sector colors are set in `marker.colors`' + ].join(' ') + } }; - -module.exports = Pie; diff --git a/src/traces/pointcloud/index.js b/src/traces/pointcloud/index.js index eb71aa95fdb..717b67488d3 100644 --- a/src/traces/pointcloud/index.js +++ b/src/traces/pointcloud/index.js @@ -8,24 +8,22 @@ 'use strict'; -var pointcloud = {}; +module.exports = { + attributes: require('./attributes'), + supplyDefaults: require('./defaults'), -pointcloud.attributes = require('./attributes'); -pointcloud.supplyDefaults = require('./defaults'); + // reuse the Scatter3D 'dummy' calc step so that legends know what to do + calc: require('../scatter3d/calc'), + plot: require('./convert'), -// reuse the Scatter3D 'dummy' calc step so that legends know what to do -pointcloud.calc = require('../scatter3d/calc'); -pointcloud.plot = require('./convert'); - -pointcloud.moduleType = 'trace'; -pointcloud.name = 'pointcloud'; -pointcloud.basePlotModule = require('../../plots/gl2d'); -pointcloud.categories = ['gl', 'gl2d', 'showLegend']; -pointcloud.meta = { - description: [ - 'The data visualized as a point cloud set in `x` and `y`', - 'using the WebGl plotting engine.' - ].join(' ') + moduleType: 'trace', + name: 'pointcloud', + basePlotModule: require('../../plots/gl2d'), + categories: ['gl', 'gl2d', 'showLegend'], + meta: { + description: [ + 'The data visualized as a point cloud set in `x` and `y`', + 'using the WebGl plotting engine.' + ].join(' ') + } }; - -module.exports = pointcloud; diff --git a/src/traces/sankey/index.js b/src/traces/sankey/index.js index 677d08ca7ea..6801140763d 100644 --- a/src/traces/sankey/index.js +++ b/src/traces/sankey/index.js @@ -8,24 +8,22 @@ 'use strict'; -var Plot = {}; +module.exports = { + attributes: require('./attributes'), + supplyDefaults: require('./defaults'), + calc: require('./calc'), + plot: require('./plot'), -Plot.attributes = require('./attributes'); -Plot.supplyDefaults = require('./defaults'); -Plot.calc = require('./calc'); -Plot.plot = require('./plot'); - -Plot.moduleType = 'trace'; -Plot.name = 'sankey'; -Plot.basePlotModule = require('./base_plot'); -Plot.selectPoints = require('./select.js'); -Plot.categories = ['noOpacity']; -Plot.meta = { - description: [ - 'Sankey plots for network flow data analysis.', - 'The nodes are specified in `nodes` and the links between sources and targets in `links`.', - 'The colors are set in `nodes[i].color` and `links[i].color`; otherwise defaults are used.' - ].join(' ') + moduleType: 'trace', + name: 'sankey', + basePlotModule: require('./base_plot'), + selectPoints: require('./select.js'), + categories: ['noOpacity'], + meta: { + description: [ + 'Sankey plots for network flow data analysis.', + 'The nodes are specified in `nodes` and the links between sources and targets in `links`.', + 'The colors are set in `nodes[i].color` and `links[i].color`, otherwise defaults are used.' + ].join(' ') + } }; - -module.exports = Plot; diff --git a/src/traces/scatter/index.js b/src/traces/scatter/index.js index 9cecc772579..b86d16c981f 100644 --- a/src/traces/scatter/index.js +++ b/src/traces/scatter/index.js @@ -6,46 +6,44 @@ * LICENSE file in the root directory of this source tree. */ - 'use strict'; -var Scatter = {}; - var subtypes = require('./subtypes'); -Scatter.hasLines = subtypes.hasLines; -Scatter.hasMarkers = subtypes.hasMarkers; -Scatter.hasText = subtypes.hasText; -Scatter.isBubble = subtypes.isBubble; -Scatter.attributes = require('./attributes'); -Scatter.supplyDefaults = require('./defaults'); -Scatter.crossTraceDefaults = require('./cross_trace_defaults'); -Scatter.calc = require('./calc').calc; -Scatter.crossTraceCalc = require('./cross_trace_calc'); -Scatter.arraysToCalcdata = require('./arrays_to_calcdata'); -Scatter.plot = require('./plot'); -Scatter.colorbar = require('./marker_colorbar'); -Scatter.style = require('./style').style; -Scatter.styleOnSelect = require('./style').styleOnSelect; -Scatter.hoverPoints = require('./hover'); -Scatter.selectPoints = require('./select'); -Scatter.animatable = true; +module.exports = { + hasLines: subtypes.hasLines, + hasMarkers: subtypes.hasMarkers, + hasText: subtypes.hasText, + isBubble: subtypes.isBubble, -Scatter.moduleType = 'trace'; -Scatter.name = 'scatter'; -Scatter.basePlotModule = require('../../plots/cartesian'); -Scatter.categories = [ - 'cartesian', 'svg', 'symbols', 'errorBarsOK', 'showLegend', 'scatter-like', - 'zoomScale' -]; -Scatter.meta = { - description: [ - 'The scatter trace type encompasses line charts, scatter charts, text charts, and bubble charts.', - 'The data visualized as scatter point or lines is set in `x` and `y`.', - 'Text (appearing either on the chart or on hover only) is via `text`.', - 'Bubble charts are achieved by setting `marker.size` and/or `marker.color`', - 'to numerical arrays.' - ].join(' ') -}; + attributes: require('./attributes'), + supplyDefaults: require('./defaults'), + crossTraceDefaults: require('./cross_trace_defaults'), + calc: require('./calc').calc, + crossTraceCalc: require('./cross_trace_calc'), + arraysToCalcdata: require('./arrays_to_calcdata'), + plot: require('./plot'), + colorbar: require('./marker_colorbar'), + style: require('./style').style, + styleOnSelect: require('./style').styleOnSelect, + hoverPoints: require('./hover'), + selectPoints: require('./select'), + animatable: true, -module.exports = Scatter; + moduleType: 'trace', + name: 'scatter', + basePlotModule: require('../../plots/cartesian'), + categories: [ + 'cartesian', 'svg', 'symbols', 'errorBarsOK', 'showLegend', 'scatter-like', + 'zoomScale' + ], + meta: { + description: [ + 'The scatter trace type encompasses line charts, scatter charts, text charts, and bubble charts.', + 'The data visualized as scatter point or lines is set in `x` and `y`.', + 'Text (appearing either on the chart or on hover only) is via `text`.', + 'Bubble charts are achieved by setting `marker.size` and/or `marker.color`', + 'to numerical arrays.' + ].join(' ') + } +}; diff --git a/src/traces/scatter3d/index.js b/src/traces/scatter3d/index.js index ef3dfcaf0d6..98fecd71957 100644 --- a/src/traces/scatter3d/index.js +++ b/src/traces/scatter3d/index.js @@ -8,39 +8,37 @@ 'use strict'; -var Scatter3D = {}; +module.exports = { + plot: require('./convert'), + attributes: require('./attributes'), + markerSymbols: require('../../constants/gl3d_markers'), + supplyDefaults: require('./defaults'), + colorbar: [ + { + container: 'marker', + min: 'cmin', + max: 'cmax' + }, { + container: 'line', + min: 'cmin', + max: 'cmax' + } + ], + calc: require('./calc'), -Scatter3D.plot = require('./convert'); -Scatter3D.attributes = require('./attributes'); -Scatter3D.markerSymbols = require('../../constants/gl3d_markers'); -Scatter3D.supplyDefaults = require('./defaults'); -Scatter3D.colorbar = [ - { - container: 'marker', - min: 'cmin', - max: 'cmax' - }, { - container: 'line', - min: 'cmin', - max: 'cmax' + moduleType: 'trace', + name: 'scatter3d', + basePlotModule: require('../../plots/gl3d'), + categories: ['gl3d', 'symbols', 'showLegend'], + meta: { + hrName: 'scatter_3d', + description: [ + 'The data visualized as scatter point or lines in 3D dimension', + 'is set in `x`, `y`, `z`.', + 'Text (appearing either on the chart or on hover only) is via `text`.', + 'Bubble charts are achieved by setting `marker.size` and/or `marker.color`', + 'Projections are achieved via `projection`.', + 'Surface fills are achieved via `surfaceaxis`.' + ].join(' ') } -]; -Scatter3D.calc = require('./calc'); - -Scatter3D.moduleType = 'trace'; -Scatter3D.name = 'scatter3d'; -Scatter3D.basePlotModule = require('../../plots/gl3d'); -Scatter3D.categories = ['gl3d', 'symbols', 'showLegend']; -Scatter3D.meta = { - hrName: 'scatter_3d', - description: [ - 'The data visualized as scatter point or lines in 3D dimension', - 'is set in `x`, `y`, `z`.', - 'Text (appearing either on the chart or on hover only) is via `text`.', - 'Bubble charts are achieved by setting `marker.size` and/or `marker.color`', - 'Projections are achieved via `projection`.', - 'Surface fills are achieved via `surfaceaxis`.' - ].join(' ') }; - -module.exports = Scatter3D; diff --git a/src/traces/scattercarpet/index.js b/src/traces/scattercarpet/index.js index c15df7bef17..b18dc5b603b 100644 --- a/src/traces/scattercarpet/index.js +++ b/src/traces/scattercarpet/index.js @@ -8,29 +8,27 @@ 'use strict'; -var ScatterCarpet = {}; +module.exports = { + attributes: require('./attributes'), + supplyDefaults: require('./defaults'), + colorbar: require('../scatter/marker_colorbar'), + calc: require('./calc'), + plot: require('./plot'), + style: require('../scatter/style').style, + styleOnSelect: require('../scatter/style').styleOnSelect, + hoverPoints: require('./hover'), + selectPoints: require('../scatter/select'), + eventData: require('./event_data'), -ScatterCarpet.attributes = require('./attributes'); -ScatterCarpet.supplyDefaults = require('./defaults'); -ScatterCarpet.colorbar = require('../scatter/marker_colorbar'); -ScatterCarpet.calc = require('./calc'); -ScatterCarpet.plot = require('./plot'); -ScatterCarpet.style = require('../scatter/style').style; -ScatterCarpet.styleOnSelect = require('../scatter/style').styleOnSelect; -ScatterCarpet.hoverPoints = require('./hover'); -ScatterCarpet.selectPoints = require('../scatter/select'); -ScatterCarpet.eventData = require('./event_data'); - -ScatterCarpet.moduleType = 'trace'; -ScatterCarpet.name = 'scattercarpet'; -ScatterCarpet.basePlotModule = require('../../plots/cartesian'); -ScatterCarpet.categories = ['svg', 'carpet', 'symbols', 'showLegend', 'carpetDependent', 'zoomScale']; -ScatterCarpet.meta = { - hrName: 'scatter_carpet', - description: [ - 'Plots a scatter trace on either the first carpet axis or the', - 'carpet axis with a matching `carpet` attribute.' - ].join(' ') + moduleType: 'trace', + name: 'scattercarpet', + basePlotModule: require('../../plots/cartesian'), + categories: ['svg', 'carpet', 'symbols', 'showLegend', 'carpetDependent', 'zoomScale'], + meta: { + hrName: 'scatter_carpet', + description: [ + 'Plots a scatter trace on either the first carpet axis or the', + 'carpet axis with a matching `carpet` attribute.' + ].join(' ') + } }; - -module.exports = ScatterCarpet; diff --git a/src/traces/scattergeo/index.js b/src/traces/scattergeo/index.js index 1eb31a9b56c..bb47c95f94d 100644 --- a/src/traces/scattergeo/index.js +++ b/src/traces/scattergeo/index.js @@ -6,33 +6,30 @@ * LICENSE file in the root directory of this source tree. */ - 'use strict'; -var ScatterGeo = {}; - -ScatterGeo.attributes = require('./attributes'); -ScatterGeo.supplyDefaults = require('./defaults'); -ScatterGeo.colorbar = require('../scatter/marker_colorbar'); -ScatterGeo.calc = require('./calc'); -ScatterGeo.plot = require('./plot'); -ScatterGeo.style = require('./style'); -ScatterGeo.styleOnSelect = require('../scatter/style').styleOnSelect; -ScatterGeo.hoverPoints = require('./hover'); -ScatterGeo.eventData = require('./event_data'); -ScatterGeo.selectPoints = require('./select'); +module.exports = { + attributes: require('./attributes'), + supplyDefaults: require('./defaults'), + colorbar: require('../scatter/marker_colorbar'), + calc: require('./calc'), + plot: require('./plot'), + style: require('./style'), + styleOnSelect: require('../scatter/style').styleOnSelect, + hoverPoints: require('./hover'), + eventData: require('./event_data'), + selectPoints: require('./select'), -ScatterGeo.moduleType = 'trace'; -ScatterGeo.name = 'scattergeo'; -ScatterGeo.basePlotModule = require('../../plots/geo'); -ScatterGeo.categories = ['geo', 'symbols', 'showLegend', 'scatter-like']; -ScatterGeo.meta = { - hrName: 'scatter_geo', - description: [ - 'The data visualized as scatter point or lines on a geographic map', - 'is provided either by longitude/latitude pairs in `lon` and `lat`', - 'respectively or by geographic location IDs or names in `locations`.' - ].join(' ') + moduleType: 'trace', + name: 'scattergeo', + basePlotModule: require('../../plots/geo'), + categories: ['geo', 'symbols', 'showLegend', 'scatter-like'], + meta: { + hrName: 'scatter_geo', + description: [ + 'The data visualized as scatter point or lines on a geographic map', + 'is provided either by longitude/latitude pairs in `lon` and `lat`', + 'respectively or by geographic location IDs or names in `locations`.' + ].join(' ') + } }; - -module.exports = ScatterGeo; diff --git a/src/traces/scattermapbox/index.js b/src/traces/scattermapbox/index.js index a546c66ca91..f1193815a2e 100644 --- a/src/traces/scattermapbox/index.js +++ b/src/traces/scattermapbox/index.js @@ -8,36 +8,33 @@ 'use strict'; +module.exports = { + attributes: require('./attributes'), + supplyDefaults: require('./defaults'), + colorbar: require('../scatter/marker_colorbar'), + calc: require('../scattergeo/calc'), + plot: require('./plot'), + hoverPoints: require('./hover'), + eventData: require('./event_data'), + selectPoints: require('./select'), -var ScatterMapbox = {}; + style: function(_, cd) { + if(cd) { + var trace = cd[0].trace; + trace._glTrace.update(cd); + } + }, -ScatterMapbox.attributes = require('./attributes'); -ScatterMapbox.supplyDefaults = require('./defaults'); -ScatterMapbox.colorbar = require('../scatter/marker_colorbar'); -ScatterMapbox.calc = require('../scattergeo/calc'); -ScatterMapbox.plot = require('./plot'); -ScatterMapbox.hoverPoints = require('./hover'); -ScatterMapbox.eventData = require('./event_data'); -ScatterMapbox.selectPoints = require('./select'); - -ScatterMapbox.style = function(_, cd) { - if(cd) { - var trace = cd[0].trace; - trace._glTrace.update(cd); + moduleType: 'trace', + name: 'scattermapbox', + basePlotModule: require('../../plots/mapbox'), + categories: ['mapbox', 'gl', 'symbols', 'showLegend', 'scatterlike'], + meta: { + hrName: 'scatter_mapbox', + description: [ + 'The data visualized as scatter point, lines or marker symbols', + 'on a Mapbox GL geographic map', + 'is provided by longitude/latitude pairs in `lon` and `lat`.' + ].join(' ') } }; - -ScatterMapbox.moduleType = 'trace'; -ScatterMapbox.name = 'scattermapbox'; -ScatterMapbox.basePlotModule = require('../../plots/mapbox'); -ScatterMapbox.categories = ['mapbox', 'gl', 'symbols', 'showLegend', 'scatterlike']; -ScatterMapbox.meta = { - hrName: 'scatter_mapbox', - description: [ - 'The data visualized as scatter point, lines or marker symbols', - 'on a Mapbox GL geographic map', - 'is provided by longitude/latitude pairs in `lon` and `lat`.' - ].join(' ') -}; - -module.exports = ScatterMapbox; diff --git a/src/traces/scatterternary/index.js b/src/traces/scatterternary/index.js index a3255bc61df..2e06b157032 100644 --- a/src/traces/scatterternary/index.js +++ b/src/traces/scatterternary/index.js @@ -8,29 +8,27 @@ 'use strict'; -var ScatterTernary = {}; +module.exports = { + attributes: require('./attributes'), + supplyDefaults: require('./defaults'), + colorbar: require('../scatter/marker_colorbar'), + calc: require('./calc'), + plot: require('./plot'), + style: require('../scatter/style').style, + styleOnSelect: require('../scatter/style').styleOnSelect, + hoverPoints: require('./hover'), + selectPoints: require('../scatter/select'), + eventData: require('./event_data'), -ScatterTernary.attributes = require('./attributes'); -ScatterTernary.supplyDefaults = require('./defaults'); -ScatterTernary.colorbar = require('../scatter/marker_colorbar'); -ScatterTernary.calc = require('./calc'); -ScatterTernary.plot = require('./plot'); -ScatterTernary.style = require('../scatter/style').style; -ScatterTernary.styleOnSelect = require('../scatter/style').styleOnSelect; -ScatterTernary.hoverPoints = require('./hover'); -ScatterTernary.selectPoints = require('../scatter/select'); -ScatterTernary.eventData = require('./event_data'); - -ScatterTernary.moduleType = 'trace'; -ScatterTernary.name = 'scatterternary'; -ScatterTernary.basePlotModule = require('../../plots/ternary'); -ScatterTernary.categories = ['ternary', 'symbols', 'showLegend', 'scatter-like']; -ScatterTernary.meta = { - hrName: 'scatter_ternary', - description: [ - 'Provides similar functionality to the *scatter* type but on a ternary phase diagram.', - 'The data is provided by at least two arrays out of `a`, `b`, `c` triplets.' - ].join(' ') + moduleType: 'trace', + name: 'scatterternary', + basePlotModule: require('../../plots/ternary'), + categories: ['ternary', 'symbols', 'showLegend', 'scatter-like'], + meta: { + hrName: 'scatter_ternary', + description: [ + 'Provides similar functionality to the *scatter* type but on a ternary phase diagram.', + 'The data is provided by at least two arrays out of `a`, `b`, `c` triplets.' + ].join(' ') + } }; - -module.exports = ScatterTernary; diff --git a/src/traces/surface/index.js b/src/traces/surface/index.js index 1f794c5d61c..72434cfa3c8 100644 --- a/src/traces/surface/index.js +++ b/src/traces/surface/index.js @@ -6,39 +6,36 @@ * LICENSE file in the root directory of this source tree. */ - 'use strict'; -var Surface = {}; - -Surface.attributes = require('./attributes'); -Surface.supplyDefaults = require('./defaults'); -Surface.colorbar = { - min: 'cmin', - max: 'cmax' -}; -Surface.calc = require('./calc'); -Surface.plot = require('./convert'); - -Surface.moduleType = 'trace'; -Surface.name = 'surface'; -Surface.basePlotModule = require('../../plots/gl3d'); -Surface.categories = ['gl3d', '2dMap', 'noOpacity']; -Surface.meta = { - description: [ - 'The data the describes the coordinates of the surface is set in `z`.', - 'Data in `z` should be a {2D array}.', - - 'Coordinates in `x` and `y` can either be 1D {arrays}', - 'or {2D arrays} (e.g. to graph parametric surfaces).', - - 'If not provided in `x` and `y`, the x and y coordinates are assumed', - 'to be linear starting at 0 with a unit step.', - - 'The color scale corresponds to the `z` values by default.', - 'For custom color scales, use `surfacecolor` which should be a {2D array},', - 'where its bounds can be controlled using `cmin` and `cmax`.' - ].join(' ') +module.exports = { + attributes: require('./attributes'), + supplyDefaults: require('./defaults'), + colorbar: { + min: 'cmin', + max: 'cmax' + }, + calc: require('./calc'), + plot: require('./convert'), + + moduleType: 'trace', + name: 'surface', + basePlotModule: require('../../plots/gl3d'), + categories: ['gl3d', '2dMap', 'noOpacity'], + meta: { + description: [ + 'The data the describes the coordinates of the surface is set in `z`.', + 'Data in `z` should be a {2D array}.', + + 'Coordinates in `x` and `y` can either be 1D {arrays}', + 'or {2D arrays} (e.g. to graph parametric surfaces).', + + 'If not provided in `x` and `y`, the x and y coordinates are assumed', + 'to be linear starting at 0 with a unit step.', + + 'The color scale corresponds to the `z` values by default.', + 'For custom color scales, use `surfacecolor` which should be a {2D array},', + 'where its bounds can be controlled using `cmin` and `cmax`.' + ].join(' ') + } }; - -module.exports = Surface; diff --git a/src/traces/table/index.js b/src/traces/table/index.js index d00f64d2d16..5e6941e021d 100644 --- a/src/traces/table/index.js +++ b/src/traces/table/index.js @@ -8,24 +8,22 @@ 'use strict'; -var Table = {}; +module.exports = { + attributes: require('./attributes'), + supplyDefaults: require('./defaults'), + calc: require('./calc'), + plot: require('./plot'), -Table.attributes = require('./attributes'); -Table.supplyDefaults = require('./defaults'); -Table.calc = require('./calc'); -Table.plot = require('./plot'); - -Table.moduleType = 'trace'; -Table.name = 'table'; -Table.basePlotModule = require('./base_plot'); -Table.categories = ['noOpacity']; -Table.meta = { - description: [ - 'Table view for detailed data viewing.', - 'The data are arranged in a grid of rows and columns.', - 'Most styling can be specified for columns, rows or individual cells.', - 'Table is using a column-major order, ie. the grid is represented as a vector of column vectors.' - ].join(' ') + moduleType: 'trace', + name: 'table', + basePlotModule: require('./base_plot'), + categories: ['noOpacity'], + meta: { + description: [ + 'Table view for detailed data viewing.', + 'The data are arranged in a grid of rows and columns.', + 'Most styling can be specified for columns, rows or individual cells.', + 'Table is using a column-major order, ie. the grid is represented as a vector of column vectors.' + ].join(' ') + } }; - -module.exports = Table; diff --git a/src/traces/volume/index.js b/src/traces/volume/index.js index f5b0c43f9a2..37c187a1555 100644 --- a/src/traces/volume/index.js +++ b/src/traces/volume/index.js @@ -6,31 +6,28 @@ * LICENSE file in the root directory of this source tree. */ - 'use strict'; -var Volume = {}; - -Volume.attributes = require('./attributes'); -Volume.supplyDefaults = require('./defaults'); -Volume.calc = require('../isosurface/calc'); -Volume.colorbar = { - min: 'cmin', - max: 'cmax' -}; -Volume.plot = require('./convert'); +module.exports = { + attributes: require('./attributes'), + supplyDefaults: require('./defaults'), + calc: require('../isosurface/calc'), + colorbar: { + min: 'cmin', + max: 'cmax' + }, + plot: require('./convert'), -Volume.moduleType = 'trace'; -Volume.name = 'volume', -Volume.basePlotModule = require('../../plots/gl3d'); -Volume.categories = ['gl3d']; -Volume.meta = { - description: [ - 'Draws volume trace between iso-min and iso-max values with coordinates given by', - 'four 1-dimensional arrays containing the `value`, `x`, `y` and `z` of every vertex', - 'of a uniform or non-uniform 3-D grid. Horizontal or vertical slices, caps as well as', - 'spaceframe between iso-min and iso-max values could also be drawn using this trace.' - ].join(' ') + moduleType: 'trace', + name: 'volume', + basePlotModule: require('../../plots/gl3d'), + categories: ['gl3d'], + meta: { + description: [ + 'Draws volume trace between iso-min and iso-max values with coordinates given by', + 'four 1-dimensional arrays containing the `value`, `x`, `y` and `z` of every vertex', + 'of a uniform or non-uniform 3-D grid. Horizontal or vertical slices, caps as well as', + 'spaceframe between iso-min and iso-max values could also be drawn using this trace.' + ].join(' ') + } }; - -module.exports = Volume; diff --git a/src/traces/waterfall/index.js b/src/traces/waterfall/index.js index 1263189fced..9547c170b40 100644 --- a/src/traces/waterfall/index.js +++ b/src/traces/waterfall/index.js @@ -8,33 +8,31 @@ 'use strict'; -var Waterfall = {}; +module.exports = { + attributes: require('./attributes'), + layoutAttributes: require('./layout_attributes'), + supplyDefaults: require('./defaults').supplyDefaults, + crossTraceDefaults: require('./defaults').crossTraceDefaults, + supplyLayoutDefaults: require('./layout_defaults'), + calc: require('./calc'), + crossTraceCalc: require('./cross_trace_calc'), + plot: require('./plot'), + style: require('./style').style, + hoverPoints: require('./hover'), + selectPoints: require('../bar/select'), -Waterfall.attributes = require('./attributes'); -Waterfall.layoutAttributes = require('./layout_attributes'); -Waterfall.supplyDefaults = require('./defaults').supplyDefaults; -Waterfall.crossTraceDefaults = require('./defaults').crossTraceDefaults; -Waterfall.supplyLayoutDefaults = require('./layout_defaults'); -Waterfall.calc = require('./calc'); -Waterfall.crossTraceCalc = require('./cross_trace_calc'); -Waterfall.plot = require('./plot'); -Waterfall.style = require('./style').style; -Waterfall.hoverPoints = require('./hover'); -Waterfall.selectPoints = require('../bar/select'); - -Waterfall.moduleType = 'trace'; -Waterfall.name = 'waterfall'; -Waterfall.basePlotModule = require('../../plots/cartesian'); -Waterfall.categories = ['cartesian', 'svg', 'oriented', 'showLegend', 'zoomScale']; -Waterfall.meta = { - description: [ - 'Draws waterfall trace which is useful graph to displays the', - 'contribution of various elements (either positive or negative)', - 'in a bar chart. The data visualized by the span of the bars is', - 'set in `y` if `orientation` is set th *v* (the default) and the', - 'labels are set in `x`.', - 'By setting `orientation` to *h*, the roles are interchanged.' - ].join(' ') + moduleType: 'trace', + name: 'waterfall', + basePlotModule: require('../../plots/cartesian'), + categories: ['cartesian', 'svg', 'oriented', 'showLegend', 'zoomScale'], + meta: { + description: [ + 'Draws waterfall trace which is useful graph to displays the', + 'contribution of various elements (either positive or negative)', + 'in a bar chart. The data visualized by the span of the bars is', + 'set in `y` if `orientation` is set th *v* (the default) and the', + 'labels are set in `x`.', + 'By setting `orientation` to *h*, the roles are interchanged.' + ].join(' ') + } }; - -module.exports = Waterfall;