Skip to content
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

Ternary phase diagrams #390

Merged
merged 79 commits into from Apr 12, 2016
Merged

Ternary phase diagrams #390

merged 79 commits into from Apr 12, 2016

Conversation

alexcjohnson
Copy link
Contributor

In brief

Add ternary subplots, plus a scatterternary type to put on them.
Also a bunch of refactoring to make this (and future) integrations easier:

  • collapse axisid, sceneid, geoid into a single subplotid attribute type. Ternary subplots are managed by a subplot attribute and the next step will be to use this for 3d and geo too rather than attributes called scene and geo. Potentially also for cartesian, ie subplot='x2y2' - but I'm not going to change those ones in this PR.
  • provide axis.color as an attribute that sets the default for all the other colors associated with the axis. The one kind of tricky part of this is gridcolor, which has to be lightened from axis.color relative to the background color it will appear on.
  • break up graph_interact some more, creating a new dragElement component, a new cartesian dragBox module, and a new setCursor function in lib
  • unwind all the ugly conditionals in Titles.draw, instead passing a configuration object from each caller.

I still need to make some test plots, but I think this is ready for review.

Limitations

  • Only the scatterternary trace trypes. contourternary will be in a future iteration
  • Fills (i.e scatter attributes 'fill' and 'fillcolor') aren't supported at the moment

cc @etpinard @mdtusz @jackparmer

@@ -319,7 +319,7 @@ function hover(gd, evt, subplot) {
}),
yaArray = subplots.map(function(spId) {
var ternary = (gd._fullLayout[spId] || {})._ternary;
if(ternary) return ternary.xaxis;
if(ternary) return ternary.yaxis;
Copy link
Contributor

Choose a reason for hiding this comment

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

coerce('hoverinfo', (layout._dataLength === 1) ? 'a+b+c+text' : undefined);

// until 'fill' and 'fillcolor' are supported
traceOut.fill = 'none';
Copy link
Contributor

Choose a reason for hiding this comment

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

@alexcjohnson feel free to git revert this commit when you'll get to fills.

@@ -23,6 +23,10 @@ var dragElement = require('../../components/dragelement');

var fx = module.exports = {};

// TODO remove this in version 2.0
// copy on Fx for backward compatible
fx.unhover = dragElement.unhover;
Copy link
Contributor

Choose a reason for hiding this comment

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

@alexcjohnson fyi:

image

more info in: #390 (comment)

@mdtusz
Copy link
Contributor

mdtusz commented Apr 12, 2016

💃 Let's do itttt

@etpinard etpinard merged commit 980cebd into master Apr 12, 2016
@etpinard etpinard deleted the ternary branch April 12, 2016 22:01
@mdtusz mdtusz mentioned this pull request Apr 18, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants