Skip to content

Commit edb54d3

Browse files
committed
put all trace modules into src/traces/*/
1 parent ba421a8 commit edb54d3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+1686
-1607
lines changed

src/geo/defaults/choropleth.js

Lines changed: 0 additions & 61 deletions
This file was deleted.

src/gl3d/defaults/mesh3d.js

Lines changed: 0 additions & 94 deletions
This file was deleted.

src/traces/bars/attributes.js

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
'use strict';
2+
3+
var Plotly = require('../../plotly');
4+
5+
var scatterAttrs = Plotly.Scatter.attributes,
6+
scatterMarkerAttrs = scatterAttrs.marker,
7+
scatterMarkerLineAttrs = scatterMarkerAttrs.line;
8+
9+
10+
module.exports = {
11+
x: scatterAttrs.x,
12+
x0: scatterAttrs.x0,
13+
dx: scatterAttrs.dx,
14+
y: scatterAttrs.y,
15+
y0: scatterAttrs.y0,
16+
dy: scatterAttrs.dy,
17+
text: scatterAttrs.text,
18+
orientation: {
19+
valType: 'enumerated',
20+
role: 'info',
21+
values: ['v', 'h'],
22+
description: [
23+
'Sets the orientation of the bars.',
24+
'With *v* (*h*), the value of the each bar spans',
25+
'along the vertical (horizontal).'
26+
].join(' ')
27+
},
28+
marker: {
29+
color: scatterMarkerAttrs.color,
30+
colorscale: scatterMarkerAttrs.colorscale,
31+
cauto: scatterMarkerAttrs.cauto,
32+
cmax: scatterMarkerAttrs.cmax,
33+
cmin: scatterMarkerAttrs.cmin,
34+
autocolorscale: scatterMarkerAttrs.autocolorscale,
35+
reversescale: scatterMarkerAttrs.reversescale,
36+
showscale: scatterMarkerAttrs.showscale,
37+
line: {
38+
color: scatterMarkerLineAttrs.color,
39+
colorscale: scatterMarkerLineAttrs.colorscale,
40+
cauto: scatterMarkerLineAttrs.cauto,
41+
cmax: scatterMarkerLineAttrs.cmax,
42+
cmin: scatterMarkerLineAttrs.cmin,
43+
width: scatterMarkerLineAttrs.width,
44+
autocolorscale: scatterMarkerLineAttrs.autocolorscale,
45+
reversescale: scatterMarkerLineAttrs.reversescale
46+
}
47+
},
48+
49+
r: scatterAttrs.r, // FIXME this shouldn't get included in 'histogram'
50+
t: scatterAttrs.t,
51+
52+
_composedModules: { // composed module coupling
53+
'histogram': 'Histogram'
54+
},
55+
_nestedModules: { // nested module coupling
56+
'error_y': 'ErrorBars',
57+
'error_x': 'ErrorBars',
58+
'marker.colorbar': 'Colorbar'
59+
},
60+
61+
_deprecated: {
62+
bardir: {
63+
valType: 'enumerated',
64+
role: 'info',
65+
values: ['v', 'h'],
66+
description: 'Renamed to `orientation`.'
67+
}
68+
}
69+
};

src/bars.js renamed to src/traces/bars/bars.js

Lines changed: 4 additions & 116 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use strict';
22

3-
var Plotly = require('./plotly');
3+
var Plotly = require('../../plotly');
44
var d3 = require('d3');
55
var isNumeric = require('fast-isnumeric');
66

@@ -17,122 +17,10 @@ Plotly.Plots.register(bars, 'bar',
1717
].join(' ')
1818
});
1919

20-
// For coerce-level coupling
21-
var scatterAttrs = Plotly.Scatter.attributes,
22-
scatterMarkerAttrs = scatterAttrs.marker,
23-
scatterMarkerLineAttrs = scatterMarkerAttrs.line;
24-
25-
bars.attributes = {
26-
x: scatterAttrs.x,
27-
x0: scatterAttrs.x0,
28-
dx: scatterAttrs.dx,
29-
y: scatterAttrs.y,
30-
y0: scatterAttrs.y0,
31-
dy: scatterAttrs.dy,
32-
text: scatterAttrs.text,
33-
orientation: {
34-
valType: 'enumerated',
35-
role: 'info',
36-
values: ['v', 'h'],
37-
description: [
38-
'Sets the orientation of the bars.',
39-
'With *v* (*h*), the value of the each bar spans',
40-
'along the vertical (horizontal).'
41-
].join(' ')
42-
},
43-
marker: {
44-
color: scatterMarkerAttrs.color,
45-
colorscale: scatterMarkerAttrs.colorscale,
46-
cauto: scatterMarkerAttrs.cauto,
47-
cmax: scatterMarkerAttrs.cmax,
48-
cmin: scatterMarkerAttrs.cmin,
49-
autocolorscale: scatterMarkerAttrs.autocolorscale,
50-
reversescale: scatterMarkerAttrs.reversescale,
51-
showscale: scatterMarkerAttrs.showscale,
52-
line: {
53-
color: scatterMarkerLineAttrs.color,
54-
colorscale: scatterMarkerLineAttrs.colorscale,
55-
cauto: scatterMarkerLineAttrs.cauto,
56-
cmax: scatterMarkerLineAttrs.cmax,
57-
cmin: scatterMarkerLineAttrs.cmin,
58-
width: scatterMarkerLineAttrs.width,
59-
autocolorscale: scatterMarkerLineAttrs.autocolorscale,
60-
reversescale: scatterMarkerLineAttrs.reversescale
61-
}
62-
},
63-
64-
r: scatterAttrs.r, // FIXME this shouldn't get included in 'histogram'
65-
t: scatterAttrs.t,
66-
67-
_composedModules: { // composed module coupling
68-
'histogram': 'Histogram'
69-
},
70-
_nestedModules: { // nested module coupling
71-
'error_y': 'ErrorBars',
72-
'error_x': 'ErrorBars',
73-
'marker.colorbar': 'Colorbar'
74-
},
75-
76-
_deprecated: {
77-
bardir: {
78-
valType: 'enumerated',
79-
role: 'info',
80-
values: ['v', 'h'],
81-
description: 'Renamed to `orientation`.'
82-
}
83-
}
84-
};
8520

86-
bars.layoutAttributes = {
87-
barmode: {
88-
valType: 'enumerated',
89-
values: ['stack', 'group', 'overlay'],
90-
dflt: 'group',
91-
role: 'info',
92-
description: [
93-
'Determines how bars at the same location coordinate',
94-
'are displayed on the graph.',
95-
'With *stack*, the bars are stacked on top of one another',
96-
'With *group*, the bars are plotted next to one another',
97-
'centered around the shared location.',
98-
'With *overlay*, the bars are plotted over one another,',
99-
'you might need to an *opacity* to see multiple bars.'
100-
].join(' ')
101-
},
102-
barnorm: {
103-
valType: 'enumerated',
104-
values: ['', 'fraction', 'percent'],
105-
dflt: '',
106-
role: 'info',
107-
description: [
108-
'Sets the normalization for bar traces on the graph.',
109-
'With *fraction*, the value of each bar is divide by the sum of the',
110-
'values at the location coordinate.',
111-
'With *percent*, the results form *fraction* are presented in percents.'
112-
].join(' ')
113-
},
114-
bargap: {
115-
valType: 'number',
116-
min: 0,
117-
max: 1,
118-
role: 'style',
119-
description: [
120-
'Sets the gap (in plot fraction) between bars of',
121-
'adjacent location coordinates.'
122-
].join(' ')
123-
},
124-
bargroupgap: {
125-
valType: 'number',
126-
min: 0,
127-
max: 1,
128-
dflt: 0,
129-
role: 'style',
130-
description: [
131-
'Sets the gap (in plot fraction) between bars of',
132-
'the same location coordinate.'
133-
].join(' ')
134-
}
135-
};
21+
bars.attributes = require('./attributes');
22+
23+
bars.layoutAttributes = require('./layout_attributes');
13624

13725
bars.supplyDefaults = function(traceIn, traceOut, defaultColor, layout) {
13826
function coerce(attr, dflt) {

0 commit comments

Comments
 (0)