Skip to content

Commit 1fceea8

Browse files
authored
Merge pull request #2993 from plotly/ternary-noticks
Ternary w/o ticks fixes
2 parents f034c62 + 68e0628 commit 1fceea8

12 files changed

+358
-284
lines changed

src/plots/ternary/index.js

+16-4
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,29 @@ var TERNARY = 'ternary';
1717

1818
exports.name = TERNARY;
1919

20-
exports.attr = 'subplot';
20+
var attr = exports.attr = 'subplot';
2121

2222
exports.idRoot = TERNARY;
2323

2424
exports.idRegex = exports.attrRegex = counterRegex(TERNARY);
2525

26-
exports.attributes = require('./layout/attributes');
26+
var attributes = exports.attributes = {};
27+
attributes[attr] = {
28+
valType: 'subplotid',
29+
role: 'info',
30+
dflt: 'ternary',
31+
editType: 'calc',
32+
description: [
33+
'Sets a reference between this trace\'s data coordinates and',
34+
'a ternary subplot.',
35+
'If *ternary* (the default value), the data refer to `layout.ternary`.',
36+
'If *ternary2*, the data refer to `layout.ternary2`, and so on.'
37+
].join(' ')
38+
};
2739

28-
exports.layoutAttributes = require('./layout/layout_attributes');
40+
exports.layoutAttributes = require('./layout_attributes');
2941

30-
exports.supplyLayoutDefaults = require('./layout/defaults');
42+
exports.supplyLayoutDefaults = require('./layout_defaults');
3143

3244
exports.plot = function plotTernary(gd) {
3345
var fullLayout = gd._fullLayout;

src/plots/ternary/layout/attributes.js

-25
This file was deleted.

src/plots/ternary/layout/axis_defaults.js

-76
This file was deleted.

src/plots/ternary/layout/defaults.js

-63
This file was deleted.

src/plots/ternary/layout/layout_attributes.js

-38
This file was deleted.

src/plots/ternary/layout/axis_attributes.js renamed to src/plots/ternary/layout_attributes.js

+30-4
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,14 @@
88

99
'use strict';
1010

11+
var colorAttrs = require('../../components/color/attributes');
12+
var domainAttrs = require('../domain').attributes;
13+
var axesAttrs = require('../cartesian/layout_attributes');
1114

12-
var axesAttrs = require('../../cartesian/layout_attributes');
13-
var extendFlat = require('../../../lib/extend').extendFlat;
15+
var overrideAll = require('../../plot_api/edit_types').overrideAll;
16+
var extendFlat = require('../../lib/extend').extendFlat;
1417

15-
16-
module.exports = {
18+
var ternaryAxesAttrs = {
1719
title: axesAttrs.title,
1820
titlefont: axesAttrs.titlefont,
1921
color: axesAttrs.color,
@@ -63,3 +65,27 @@ module.exports = {
6365
].join(' ')
6466
}
6567
};
68+
69+
module.exports = overrideAll({
70+
domain: domainAttrs({name: 'ternary'}),
71+
72+
bgcolor: {
73+
valType: 'color',
74+
role: 'style',
75+
dflt: colorAttrs.background,
76+
description: 'Set the background color of the subplot'
77+
},
78+
sum: {
79+
valType: 'number',
80+
role: 'info',
81+
dflt: 1,
82+
min: 0,
83+
description: [
84+
'The number each triplet should sum to,',
85+
'and the maximum range of each axis'
86+
].join(' ')
87+
},
88+
aaxis: ternaryAxesAttrs,
89+
baxis: ternaryAxesAttrs,
90+
caxis: ternaryAxesAttrs
91+
}, 'plot', 'from-root');

0 commit comments

Comments
 (0)