Skip to content

Commit

Permalink
[ATPWM-1192] Date axis: clicking near start or end of axis, renders a…
Browse files Browse the repository at this point in the history
… date time wrongly editable.
  • Loading branch information
michelezanda committed Jun 22, 2018
1 parent 650a344 commit 65b12e5
Show file tree
Hide file tree
Showing 8 changed files with 62 additions and 46 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-ion13] -- 2018-06-21

### [ATPWM-1192] Date axis: clicking near start or end of axis, renders a date time wrongly editable.


## [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.
Expand Down
38 changes: 19 additions & 19 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-ion12';
exports.version = '1.33.1-ion13';

// inject promise polyfill
require('es6-promise').polyfill();
Expand Down Expand Up @@ -48591,24 +48591,24 @@ function makeDragBox(gd, plotinfo, x, y, w, h, ns, ew) {
}
else if(ew === 'e') hAlign = 'right';

if(gd._context.showAxisRangeEntryBoxes) {
d3.select(dragger)
.call(svgTextUtils.makeEditable, {
gd: gd,
immediate: true,
background: fullLayout.paper_bgcolor,
text: String(initialText),
fill: ax.tickfont ? ax.tickfont.color : '#444',
horizontalAlign: hAlign,
verticalAlign: vAlign
})
.on('edit', function(text) {
var v = ax.d2r(text);
if(v !== undefined) {
Plotly.relayout(gd, attrStr, v);
}
});
}
// if(gd._context.showAxisRangeEntryBoxes) {
// d3.select(dragger)
// .call(svgTextUtils.makeEditable, {
// gd: gd,
// immediate: true,
// background: fullLayout.paper_bgcolor,
// text: String(initialText),
// fill: ax.tickfont ? ax.tickfont.color : '#444',
// horizontalAlign: hAlign,
// verticalAlign: vAlign
// })
// .on('edit', function(text) {
// var v = ax.d2r(text);
// if(v !== undefined) {
// Plotly.relayout(gd, attrStr, v);
// }
// });
// }
}
}
};
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-ion12",
"version": "1.33.1-ion13",
"description": "The open source javascript graphing library that powers plotly",
"license": "MIT",
"main": "./lib/index.js",
Expand Down
21 changes: 16 additions & 5 deletions samples/chart_perf.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
var trace1 = {
x: ['2017', '2018', '2019'],
//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'],
x: ['2017-01-04T09:15:23.456', '2017-01-05T09:15:23.456', '2017-01-06T09:15:23.456'],
// y: [-40, 50, 60],
close: [116.019997, 116.610001, 117.910004],

Expand All @@ -20,10 +20,20 @@ var trace1 = {
text: ['ciao1', 'ciao2', 'ciao3', 'ciao3', 'ciao3', 'ciao3', 'ciao3'],
textbox: [['goofy0', 'goofy1', 'goofy2', 'goofy3', 'goofy4'], ['goofy5', 'goofy6', 'goofy7']],

hoverinfo: 'text',
locations: ['FRA', 'DEU', 'RUS', 'ESP'],

hoverinfo: 'x+y+text',

boxpoints: false,
//type: 'scattergeo',
//type: 'date',
type: 'bar',
marker: {
size: [1, 20, 30, 40],
sizemin: 1,
sizeref: 0.1,
sizemode: 'area'
},
name: 'MZ',
opacity: 0.5
};
Expand All @@ -43,7 +53,8 @@ var data = [trace1];
var layout = {
title: 'Double Y Axis Example',
xaxis: {
type: 'category'
type: 'date',
tickformat: '%H:%M:%S'
},
yaxis: {title: 'yaxis title'},
yaxis2: {
Expand All @@ -59,4 +70,4 @@ var plotDiv = document.getElementById('myDiv');

Plotly.newPlot(plotDiv, data, layout);

Plotly.restyle(plotDiv, {marker: {color: 'red'}});
// 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-ion12';exports.topojson = saneTopojson;
exports.version = '1.33.1-ion13';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-ion12';
exports.version = '1.33.1-ion13';

// inject promise polyfill
require('es6-promise').polyfill();
Expand Down
36 changes: 18 additions & 18 deletions src/plots/cartesian/dragbox.js
Original file line number Diff line number Diff line change
Expand Up @@ -199,24 +199,24 @@ function makeDragBox(gd, plotinfo, x, y, w, h, ns, ew) {
}
else if(ew === 'e') hAlign = 'right';

if(gd._context.showAxisRangeEntryBoxes) {
d3.select(dragger)
.call(svgTextUtils.makeEditable, {
gd: gd,
immediate: true,
background: fullLayout.paper_bgcolor,
text: String(initialText),
fill: ax.tickfont ? ax.tickfont.color : '#444',
horizontalAlign: hAlign,
verticalAlign: vAlign
})
.on('edit', function(text) {
var v = ax.d2r(text);
if(v !== undefined) {
Plotly.relayout(gd, attrStr, v);
}
});
}
// if(gd._context.showAxisRangeEntryBoxes) {
// d3.select(dragger)
// .call(svgTextUtils.makeEditable, {
// gd: gd,
// immediate: true,
// background: fullLayout.paper_bgcolor,
// text: String(initialText),
// fill: ax.tickfont ? ax.tickfont.color : '#444',
// horizontalAlign: hAlign,
// verticalAlign: vAlign
// })
// .on('edit', function(text) {
// var v = ax.d2r(text);
// if(v !== undefined) {
// Plotly.relayout(gd, attrStr, v);
// }
// });
// }
}
}
};
Expand Down

0 comments on commit 65b12e5

Please sign in to comment.