Skip to content

Ternary w/o ticks fixes #2993

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 4 commits into from
Sep 11, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
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
20 changes: 16 additions & 4 deletions src/plots/ternary/index.js
Original file line number Diff line number Diff line change
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');
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good call flattening this structure 👍


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.

Original file line number Diff line number Diff line change
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');
Loading