Skip to content

Commit

Permalink
Merge pull request #2993 from plotly/ternary-noticks
Browse files Browse the repository at this point in the history
Ternary w/o ticks fixes
  • Loading branch information
etpinard committed Sep 11, 2018
2 parents f034c62 + 68e0628 commit 1fceea8
Show file tree
Hide file tree
Showing 12 changed files with 358 additions and 284 deletions.
20 changes: 16 additions & 4 deletions src/plots/ternary/index.js
Expand Up @@ -17,17 +17,29 @@ var TERNARY = 'ternary';

exports.name = TERNARY;

exports.attr = 'subplot';
var attr = exports.attr = 'subplot';

exports.idRoot = TERNARY;

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

exports.attributes = require('./layout/attributes');
var attributes = exports.attributes = {};
attributes[attr] = {
valType: 'subplotid',
role: 'info',
dflt: 'ternary',
editType: 'calc',
description: [
'Sets a reference between this trace\'s data coordinates and',
'a ternary subplot.',
'If *ternary* (the default value), the data refer to `layout.ternary`.',
'If *ternary2*, the data refer to `layout.ternary2`, and so on.'
].join(' ')
};

exports.layoutAttributes = require('./layout/layout_attributes');
exports.layoutAttributes = require('./layout_attributes');

exports.supplyLayoutDefaults = require('./layout/defaults');
exports.supplyLayoutDefaults = require('./layout_defaults');

exports.plot = function plotTernary(gd) {
var fullLayout = gd._fullLayout;
Expand Down
25 changes: 0 additions & 25 deletions src/plots/ternary/layout/attributes.js

This file was deleted.

76 changes: 0 additions & 76 deletions src/plots/ternary/layout/axis_defaults.js

This file was deleted.

63 changes: 0 additions & 63 deletions src/plots/ternary/layout/defaults.js

This file was deleted.

38 changes: 0 additions & 38 deletions src/plots/ternary/layout/layout_attributes.js

This file was deleted.

Expand Up @@ -8,12 +8,14 @@

'use strict';

var colorAttrs = require('../../components/color/attributes');
var domainAttrs = require('../domain').attributes;
var axesAttrs = require('../cartesian/layout_attributes');

var axesAttrs = require('../../cartesian/layout_attributes');
var extendFlat = require('../../../lib/extend').extendFlat;
var overrideAll = require('../../plot_api/edit_types').overrideAll;
var extendFlat = require('../../lib/extend').extendFlat;


module.exports = {
var ternaryAxesAttrs = {
title: axesAttrs.title,
titlefont: axesAttrs.titlefont,
color: axesAttrs.color,
Expand Down Expand Up @@ -63,3 +65,27 @@ module.exports = {
].join(' ')
}
};

module.exports = overrideAll({
domain: domainAttrs({name: 'ternary'}),

bgcolor: {
valType: 'color',
role: 'style',
dflt: colorAttrs.background,
description: 'Set the background color of the subplot'
},
sum: {
valType: 'number',
role: 'info',
dflt: 1,
min: 0,
description: [
'The number each triplet should sum to,',
'and the maximum range of each axis'
].join(' ')
},
aaxis: ternaryAxesAttrs,
baxis: ternaryAxesAttrs,
caxis: ternaryAxesAttrs
}, 'plot', 'from-root');

0 comments on commit 1fceea8

Please sign in to comment.