8000 More consistent geo maps configs by etpinard · Pull Request #4 · plotly/plotly.js · GitHub
[go: up one dir, main page]

Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
lint
  • Loading branch information
etpinard committed Nov 16, 2015
commit dc28064ffb1328fc519ee4d9c83ebd5324eb467e
4 changes: 2 additions & 2 deletions src/components/modebar/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -450,14 +450,14 @@ proto.toImage = function() {

var ev = Plotly.Snapshot.toImage(this.graphInfo, {format: format});

var filename = this.graphInfo.fn || "newplot";
var filename = this.graphInfo.fn || 'newplot';
filename += '.' + format;

ev.once('success', function(result) {

_this._snapshotInProgress = false;

var downloadLink = document.createElement("a");
var downloadLink = document.createElement('a');
downloadLink.href = result;
downloadLink.download = filename; // only supported by FF and Chrome

Expand Down
2 changes: 2 additions & 0 deletions src/lib/events.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
'use strict';

/* global $:false */

var EventEmitter = require('events').EventEmitter;

var Events = {
Expand Down
15 changes: 13 additions & 2 deletions src/plots/geo/projections.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
// jshint ignore: start

/**
* Forked from https://github.com/d3/d3-geo-projection
* Pasted from https://github.com/etpinard/d3-geo-projection
*
* Containing only the 'most useful' projection types
* and compatible with CommonJs
*
*/

var d3 = require('d3');

function addProjectionToD3() {
Expand Down Expand Up @@ -61,7 +72,7 @@ function addProjectionToD3() {
d3_geo_projectPoints.push([ x, y ]);
},
lineEnd: function() {
if (d3_geo_projectPoints.length) d3_geo_projectLines.push(d3_geo_projectPoints),
if (d3_geo_projectPoints.length) d3_geo_projectLines.push(d3_geo_projectPoints),
d3_geo_projectPoints = [];
},
result: function() {
Expand Down Expand Up @@ -188,7 +199,7 @@ function addProjectionToD3() {
};
var projection = d3.geo.projection(forward), stream_ = projection.stream;
projection.stream = function(stream) {
var rotate = projection.rotate(), rotateStream = stream_(stream), sphereStream = (projection.rotate([ 0, 0 ]),
var rotate = projection.rotate(), rotateStream = stream_(stream), sphereStream = (projection.rotate([ 0, 0 ]),
stream_(stream));
projection.rotate(rotate);
rotateStream.sphere = function() {
Expand Down
2 changes: 1 addition & 1 deletion src/plots/gl3d/camera.js
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ function createCamera(element, options) {
return true;
});

mouseWheel(element, function(dx, dy, dz) {
mouseWheel(element, function(dx, dy) {
var flipX = camera.flipX ? 1 : -1;
var flipY = camera.flipY ? 1 : -1;
var t = now();
Expand Down
2 changes: 2 additions & 0 deletions src/plots/polar/micropolar.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// jshint ignore: start

var Plotly = require('../../plotly');
var d3 = require('d3');

Expand Down
2 changes: 2 additions & 0 deletions src/plots/polar/undo_manager.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// jshint ignore: start

'use strict';

//Modified from https://github.com/ArthurClemens/Javascript-Undo-Manager
Expand Down
2 changes: 1 addition & 1 deletion src/traces/boxes/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ boxes.supplyDefaults = function(traceIn, traceOut, defaultColor) {
coerce('marker.line.width');

if(boxpoints==='suspectedoutliers') {
coerce('marker.line.outliercolor', traceOut.marker.color)
coerce('marker.line.outliercolor', traceOut.marker.color);
coerce('marker.line.outlierwidth');
}
}
Expand Down
2 changes: 2 additions & 0 deletions src/traces/histogram/attributes.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

var barAttrs = require('../bars/attributes');


Expand Down
6 changes: 4 additions & 2 deletions src/traces/scatter3d/convert.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,9 @@ function constructDelaunay(points, color, axis) {
var v = (axis+2)%3;
var filteredPoints = [];
var 6E3B filteredIds = [];
for(var i=0; i<points.length; ++i) {
var i;

for(i=0; i<points.length; ++i) {
var p = points[i];
if(isNaN(p[u]) || !isFinite(p[u]) ||
isNaN(p[v]) || !isFinite(p[v])) {
Expand All @@ -80,7 +82,7 @@ function constructDelaunay(points, color, axis) {
filteredIds.push(i);
}
var cells = triangulate(filteredPoints);
for(var i=0; i<cells.length; ++i) {
for(i=0; i<cells.length; ++i) {
var c = cells[i];
for(var j=0; j<c.length; ++j) {
c[j] = filteredIds[c[j]];
Expand Down
0