plotly.js 2.8.1 → 2.8.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "plotly.js",
3
- "version": "2.8.1",
3
+ "version": "2.8.2",
4
4
  "description": "The open source javascript graphing library that powers plotly",
5
5
  "license": "MIT",
6
6
  "main": "./lib/index.js",
@@ -631,10 +631,11 @@ function calcTexttemplate(fullLayout, cd, index, xa, ya) {
631
631
  if(!texttemplate) return '';
632
632
  var isWaterfall = (trace.type === 'waterfall');
633
633
  var isFunnel = (trace.type === 'funnel');
634
+ var isHorizontal = trace.orientation === 'h';
634
635
 
635
636
  var pLetter, pAxis;
636
637
  var vLetter, vAxis;
637
- if(trace.orientation === 'h') {
638
+ if(isHorizontal) {
638
639
  pLetter = 'y';
639
640
  pAxis = ya;
640
641
  vLetter = 'x';
@@ -669,6 +670,11 @@ function calcTexttemplate(fullLayout, cd, index, xa, ya) {
669
670
  var pt = {};
670
671
  appendArrayPointValue(pt, trace, cdi.i);
671
672
 
673
+ if(pt.x === undefined) pt.x = isHorizontal ? obj.value : obj.label;
674
+ if(pt.y === undefined) pt.y = isHorizontal ? obj.label : obj.value;
675
+ if(pt.xLabel === undefined) pt.xLabel = isHorizontal ? obj.valueLabel : obj.labelLabel;
676
+ if(pt.yLabel === undefined) pt.yLabel = isHorizontal ? obj.labelLabel : obj.valueLabel;
677
+
672
678
  if(isWaterfall) {
673
679
  obj.delta = +cdi.rawS || cdi.s;
674
680
  obj.deltaLabel = formatNumber(obj.delta);
@@ -15,8 +15,9 @@ var getBinSpanLabelRound = require('./bin_label_vals');
15
15
  function calc(gd, trace) {
16
16
  var pos = [];
17
17
  var size = [];
18
- var pa = Axes.getFromId(gd, trace.orientation === 'h' ? trace.yaxis : trace.xaxis);
19
- var mainData = trace.orientation === 'h' ? 'y' : 'x';
18
+ var isHorizontal = trace.orientation === 'h';
19
+ var pa = Axes.getFromId(gd, isHorizontal ? trace.yaxis : trace.xaxis);
20
+ var mainData = isHorizontal ? 'y' : 'x';
20
21
  var counterData = {x: 'y', y: 'x'}[mainData];
21
22
  var calendar = trace[mainData + 'calendar'];
22
23
  var cumulativeSpec = trace.cumulative;
package/src/version.js CHANGED
@@ -1,4 +1,4 @@
1
1
  'use strict';
2
2
 
3
3
  // package version injected by `npm run preprocess`
4
- exports.version = '2.8.1';
4
+ exports.version = '2.8.2';