Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
37 changes: 37 additions & 0 deletions src/traces/scatterternary/event_data.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/**
* Copyright 2012-2017, Plotly, Inc.
* All rights reserved.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

'use strict';

module.exports = function eventData(out, pt, trace, cd, pointNumber) {
if(pt.xa) out.xaxis = pt.xa;
if(pt.ya) out.yaxis = pt.ya;

if(cd[pointNumber]) {
var cdi = cd[pointNumber];

// N.B. These are the scale coordinates !!!
//
// On master, hover events get the non-scaled coordinates
// whereas selection events get the scaled version.
// Note also that the hover labels show the scaled version.
//
// What about the 'raw' input coordinates?
// Should we include them in parallel here or replace a/b/c with them?
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think the scaled (normalized) coords are the most useful here, and folks can get the raw data back out easily enough using the indices, lets not add them here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done in c8d715b

out.a = cdi.a;
out.b = cdi.b;
out.c = cdi.c;
} else {
// for fill-hover only
out.a = pt.a;
out.b = pt.b;
out.c = pt.c;
}

return out;
};
3 changes: 2 additions & 1 deletion src/traces/scatterternary/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ ScatterTernary.calc = require('./calc');
ScatterTernary.plot = require('./plot');
ScatterTernary.style = require('./style');
ScatterTernary.hoverPoints = require('./hover');
ScatterTernary.selectPoints = require('./select');
ScatterTernary.selectPoints = require('../scatter/select');
ScatterTernary.eventData = require('./event_data');

ScatterTernary.moduleType = 'trace';
ScatterTernary.name = 'scatterternary';
Expand Down
33 changes: 0 additions & 33 deletions src/traces/scatterternary/select.js

This file was deleted.