Skip to content

Commit

Permalink
[ARCBUGS-4562] Now plotly.restyle() does not clear axisType. It was c…
Browse files Browse the repository at this point in the history
…learing axisType even when set via API.
  • Loading branch information
michelezanda committed Jun 6, 2018
1 parent 38c2a16 commit 650a344
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 11 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG_ION.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# plotly.js ION changelog

## [1.33.1-ion12] -- 2018-06-06

### [ARCBUGS-4562] Now plotly.restyle() does not clear axisType. It was clearing axisType even when set via API.


## [1.33.1-ion11] -- 2018-05-07

### [TPORTAL-5717] Maxium call stack exceeded for horizontal bar chart, with screen large monitor 1920x1080.
Expand Down
7 changes: 4 additions & 3 deletions dist_ion/plotly-ion.js
Original file line number Diff line number Diff line change
Expand Up @@ -32817,7 +32817,7 @@ exports.svgAttrs = {
var Plotly = require('./plotly');

// package version injected by `npm run preprocess`
exports.version = '1.33.1-ion11';
exports.version = '1.33.1-ion12';

// inject promise polyfill
require('es6-promise').polyfill();
Expand Down Expand Up @@ -39310,8 +39310,9 @@ exports.clearAxisTypes = function(gd, traces, layoutUpdate) {
for(var j = 0; j < 3; j++) {
var ax = getFromTrace(gd, trace, axLetters[j]);

// do not clear log type - that's never an auto result so must have been intentional
if(ax && ax.type !== 'log') {
// do not clear log or category type - that's never an auto result so must have been intentional
// Category type added to fix ARCBUGS-4562: restyle otherwise nullifies axisType
if(ax && (ax.type !== 'log' && ax.type !== 'category')) {
var axAttr = ax._name;
var sceneName = ax._id.substr(1);
if(sceneName.substr(0, 5) === 'scene') {
Expand Down
2 changes: 1 addition & 1 deletion dist_ion/plotly-ion.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "plotly.js",
"version": "1.33.1-ion11",
"version": "1.33.1-ion12",
"description": "The open source javascript graphing library that powers plotly",
"license": "MIT",
"main": "./lib/index.js",
Expand Down
10 changes: 8 additions & 2 deletions samples/chart_perf.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
var trace1 = {
x: ['2017', '2018', '2019'],
y: [2, 3, 4, 6,7, 8, 9, 10, 11, 12, 13, 50],
// y: [-40, 50, 60],
// x: ['2017-01-04', '2017-01-05', '2017-01-06'],
Expand All @@ -22,7 +23,7 @@ var trace1 = {
hoverinfo: 'text',

boxpoints: false,
type: 'box',
type: 'bar',
name: 'MZ',
opacity: 0.5
};
Expand All @@ -41,6 +42,9 @@ var data = [trace1];

var layout = {
title: 'Double Y Axis Example',
xaxis: {
type: 'category'
},
yaxis: {title: 'yaxis title'},
yaxis2: {
title: 'yaxis2 title',
Expand All @@ -53,4 +57,6 @@ var layout = {

var plotDiv = document.getElementById('myDiv');

Plotly.newPlot(plotDiv, data, layout);
Plotly.newPlot(plotDiv, data, layout);

Plotly.restyle(plotDiv, {marker: {color: 'red'}});
2 changes: 1 addition & 1 deletion src/assets/geo_assets.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ var saneTopojson = require('sane-topojson');


// package version injected by `npm run preprocess`
exports.version = '1.33.1-ion11';exports.topojson = saneTopojson;
exports.version = '1.33.1-ion12';exports.topojson = saneTopojson;
2 changes: 1 addition & 1 deletion src/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
var Plotly = require('./plotly');

// package version injected by `npm run preprocess`
exports.version = '1.33.1-ion11';
exports.version = '1.33.1-ion12';

// inject promise polyfill
require('es6-promise').polyfill();
Expand Down
5 changes: 3 additions & 2 deletions src/plot_api/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -536,8 +536,9 @@ exports.clearAxisTypes = function(gd, traces, layoutUpdate) {
for(var j = 0; j < 3; j++) {
var ax = getFromTrace(gd, trace, axLetters[j]);

// do not clear log type - that's never an auto result so must have been intentional
if(ax && ax.type !== 'log') {
// do not clear log or category type - that's never an auto result so must have been intentional
// Category type added to fix ARCBUGS-4562: restyle otherwise nullifies axisType
if(ax && (ax.type !== 'log' && ax.type !== 'category')) {
var axAttr = ax._name;
var sceneName = ax._id.substr(1);
if(sceneName.substr(0, 5) === 'scene') {
Expand Down

0 comments on commit 650a344

Please sign in to comment.