Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 897e309

Browse files
committed
Merge branch 'master' into custom-modebar
2 parents de960ab + 0dff67a commit 897e309

16 files changed

+60
-68
lines changed

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@
4141
"3d-view": "^2.0.0",
4242
"alpha-shape": "^1.0.0",
4343
"arraytools": "^1.0.0",
44-
"browserify": "^12.0.1",
4544
"convex-hull": "^1.0.3",
4645
"d3": "3.5.6",
4746
"delaunay-triangulate": "^1.1.6",
@@ -73,14 +72,13 @@
7372
"robust-orientation": "^1.1.3",
7473
"sane-topojson": "^1.2.0",
7574
"superscript-text": "^1.0.0",
76-
"through2": "^2.0.0",
7775
"tinycolor2": "1.1.2",
7876
"topojson": "^1.6.19",
79-
"uglify-js": "^2.5.0",
8077
"xml2js": "^0.4.15"
8178
},
8279
"devDependencies": {
8380
"brfs": "^1.4.1",
81+
"browserify": "^12.0.1",
8482
"browserify-transform-tools": "^1.5.0",
8583
"ecstatic": "^1.2.0",
8684
"jasmine-core": "^2.3.4",
@@ -93,6 +91,8 @@
9391
"karma-jasmine": "^0.3.6",
9492
"open": "0.0.5",
9593
"prettysize": "0.0.3",
96-
"watchify": "^3.6.0"
94+
"through2": "^2.0.0",
95+
"watchify": "^3.6.0",
96+
"uglify-js": "^2.5.0"
9797
}
9898
}

src/assets/geo_assets.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,7 @@
99

1010
var saneTopojson = require('sane-topojson');
1111

12+
// export the version found in the package.json
13+
exports.version = require('../../package.json').version;
14+
1215
exports.topojson = saneTopojson;

src/components/drawing/index.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -296,8 +296,11 @@ var TEXTOFFSETSIGN = {start:1, end:-1, middle:0, bottom:1, top:-1},
296296
LINEEXPAND = 1.3;
297297
drawing.textPointStyle = function(s, trace) {
298298
s.each(function(d){
299-
var p = d3.select(this);
300-
if(!d.tx && !trace.text) {
299+
var p = d3.select(this),
300+
text = d.tx || trace.text;
301+
if(!text || Array.isArray(text)) {
302+
// isArray test handles the case of (intentionally) missing
303+
// or empty text within a text array
301304
p.remove();
302305
return;
303306
}
@@ -320,7 +323,7 @@ drawing.textPointStyle = function(s, trace) {
320323
fontSize,
321324
d.tc || trace.textfont.color)
322325
.attr('text-anchor',h)
323-
.text(d.tx || trace.text)
326+
.text(text)
324327
.call(Plotly.util.convertToTspans);
325328
var pgroup = d3.select(this.parentNode),
326329
tspans = p.selectAll('tspan.line'),

src/fonts/ploticon/_ploticon.scss

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,5 @@
3939
.ploticon-3d_rotate:before { content: '\e80c'; } /* '' */
4040
.ploticon-camera:before { content: '\e80d'; } /* '' */
4141
.ploticon-movie:before { content: '\e80e'; } /* '' */
42-
.ploticon-disk:before { content: '\e80f'; } /* '' */
42+
.ploticon-question:before { content: '\e80f'; } /* '' */
43+
.ploticon-disk:before { content: '\e810'; } /* '' */

src/fonts/ploticon/config.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1468,6 +1468,12 @@
14681468
"code": 59394,
14691469
"src": "fontawesome"
14701470
},
1471+
{
1472+
"uid": "17ebadd1e3f274ff0205601eef7b9cc4",
1473+
"css": "question",
1474+
"code": 59407,
1475+
"src": "fontawesome"
1476+
},
14711477
{
14721478
"uid": "d7271d490b71df4311e32cdacae8b331",
14731479
"css": "home",
@@ -1479,6 +1485,12 @@
14791485
"css": "undo",
14801486
"code": 59392,
14811487
"src": "fontawesome"
1488+
},
1489+
{
1490+
"uid": "f4445feb55521283572ee88bc304f928",
1491+
"css": "disk",
1492+
"code": 59408,
1493+
"src": "fontawesome"
14821494
}
14831495
]
14841496
}

src/fonts/ploticon/ploticon.eot

224 Bytes
Binary file not shown.

src/fonts/ploticon/ploticon.svg

Lines changed: 5 additions & 4 deletions
Loading

src/fonts/ploticon/ploticon.ttf

224 Bytes
Binary file not shown.

src/fonts/ploticon/ploticon.woff

176 Bytes
Binary file not shown.

src/index.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@
1616

1717
var Plotly = require('./plotly');
1818

19+
// export the version found in the package.json
20+
exports.version = require('../package.json').version;
21+
1922
// plot api
2023
exports.plot = Plotly.plot;
2124
exports.newPlot = Plotly.newPlot;

tasks/bundle.js

Lines changed: 4 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ var browserify = require('browserify');
44
var UglifyJS = require('uglify-js');
55

66
var compressAttributes = require('./util/compress_attributes');
7-
var appendVersion = require('./util/append_version');
87
var constants = require('./util/constants');
98

109
/*
@@ -48,19 +47,11 @@ browserify(constants.pathToPlotlySrc, {
4847
if(!DEV) {
4948
fs.writeFile(
5049
constants.pathToPlotlyDistMin,
51-
UglifyJS.minify(buf.toString(), constants.uglifyOptions).code,
52-
function() {
53-
appendVersion(
54-
constants.pathToPlotlyDistMin, {object: 'Plotly'}
55-
);
56-
}
50+
UglifyJS.minify(buf.toString(), constants.uglifyOptions).code
5751
);
5852
}
5953
})
60-
.pipe(fs.createWriteStream(constants.pathToPlotlyDist))
61-
.on('finish', function() {
62-
appendVersion(constants.pathToPlotlyDist, {object: 'Plotly', DEV: DEV});
63-
});
54+
.pipe(fs.createWriteStream(constants.pathToPlotlyDist));
6455

6556

6657
// Browserify the geo assets
@@ -70,10 +61,7 @@ browserify(constants.pathToPlotlyGeoAssetsSrc, {
7061
.bundle(function(err) {
7162
if(err) throw err;
7263
})
73-
.pipe(fs.createWriteStream(constants.pathToPlotlyGeoAssetsDist))
74-
.on('finish', function() {
75-
appendVersion(constants.pathToPlotlyGeoAssetsDist, {object: 'PlotlyGeoAssets'});
76-
});
64+
.pipe(fs.createWriteStream(constants.pathToPlotlyGeoAssetsDist));
7765

7866

7967
// Browserify the plotly.js with meta
@@ -84,7 +72,4 @@ browserify(constants.pathToPlotlySrc, {
8472
.bundle(function(err) {
8573
if(err) throw err;
8674
})
87-
.pipe(fs.createWriteStream(constants.pathToPlotlyDistWithMeta))
88-
.on('finish', function() {
89-
appendVersion(constants.pathToPlotlyDistWithMeta, {object: 'Plotly', DEV: DEV});
90-
});
75+
.pipe(fs.createWriteStream(constants.pathToPlotlyDistWithMeta));

tasks/cibundle.js

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ var fs = require('fs');
33
var browserify = require('browserify');
44

55
var compressAttributes = require('./util/compress_attributes');
6-
var appendVersion = require('./util/append_version');
76
var constants = require('./util/constants');
87

98
/*
@@ -24,10 +23,7 @@ browserify(constants.pathToPlotlySrc, {
2423
.bundle(function(err) {
2524
if(err) throw err;
2625
})
27-
.pipe(fs.createWriteStream(constants.pathToPlotlyBuild))
28-
.on('finish', function() {
29-
appendVersion(constants.pathToPlotlyBuild, {object: 'Plotly'});
30-
});
26+
.pipe(fs.createWriteStream(constants.pathToPlotlyBuild));
3127

3228

3329
// Browserify the geo assets
@@ -37,7 +33,4 @@ browserify(constants.pathToPlotlyGeoAssetsSrc, {
3733
.bundle(function(err) {
3834
if(err) throw err;
3935
})
40-
.pipe(fs.createWriteStream(constants.pathToPlotlyGeoAssetsDist))
41-
.on('finish', function() {
42-
appendVersion(constants.pathToPlotlyGeoAssetsDist, {object: 'PlotlyGeoAssets'});
43-
});
36+
.pipe(fs.createWriteStream(constants.pathToPlotlyGeoAssetsDist));

tasks/util/append_version.js

Lines changed: 0 additions & 24 deletions
This file was deleted.

tasks/util/make_watchified_bundle.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ var browserify = require('browserify');
44
var watchify = require('watchify');
55

66
var compressAttributes = require('./compress_attributes');
7-
var appendVersion = require('./append_version');
87
var formatBundleMsg = require('./format_bundle_msg');
98
var constants = require('./constants');
109

@@ -53,9 +52,6 @@ module.exports = function makeWatchifiedBundle(onFirstBundleCallback) {
5352
.pipe(
5453
fs.createWriteStream(constants.pathToPlotlyBuild)
5554
)
56-
.on('finish', function() {
57-
appendVersion(constants.pathToPlotlyBuild, {object: 'Plotly', DEV: true});
58-
});
5955
}
6056

6157
return bundle;
1.48 KB
Loading

test/image/mocks/text_chart_arrays.json

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,25 @@
8585
],
8686
"type": "scatter",
8787
"uid": "f8361c"
88+
},
89+
{
90+
"x": [
91+
0,
92+
1,
93+
2
94+
],
95+
"y": [
96+
1.5,
97+
1.5,
98+
1.5
99+
],
100+
"mode": "text",
101+
"name": "missing text",
102+
"text": [
103+
"a",
104+
"",
105+
"b"
106+
]
88107
}
89108
],
90109
"layout": {

0 commit comments

Comments
 (0)