plotly.js
Version:
The open source javascript graphing library that powers plotly
25 lines (19 loc) • 717 B
JavaScript
/**
* Copyright 2012-2020, 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.
*/
;
var Lib = require('../../lib');
var attributes = require('./attributes');
var handleHoverLabelDefaults = require('./hoverlabel_defaults');
module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout) {
function coerce(attr, dflt) {
return Lib.coerce(traceIn, traceOut, attributes, attr, dflt);
}
var opts = Lib.extendFlat({}, layout.hoverlabel);
if(traceOut.hovertemplate) opts.namelength = -1;
handleHoverLabelDefaults(traceIn, traceOut, coerce, opts);
};