Skip to content

Better polar setConvert + a few misc polar touch ups #2895

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 18 commits into from
Aug 15, 2018
Merged
Show file tree
Hide file tree
Changes from 3 commits
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
5 changes: 5 additions & 0 deletions src/lib/angles.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,8 @@ exports.wrap180 = function(deg) {
if(Math.abs(deg) > 180) deg -= Math.round(deg / 360) * 360;
return deg;
};

exports.isFullCircle = function(sector) {
var arc = Math.abs(sector[1] - sector[0]);
return arc === 360;
};
1 change: 1 addition & 0 deletions src/lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ lib.deg2rad = anglesModule.deg2rad;
lib.rad2deg = anglesModule.rad2deg;
lib.wrap360 = anglesModule.wrap360;
lib.wrap180 = anglesModule.wrap180;
lib.isFullCircle = anglesModule.isFullCircle;

var geom2dModule = require('./geometry2d');
lib.segmentsIntersect = geom2dModule.segmentsIntersect;
Expand Down
61 changes: 0 additions & 61 deletions src/plots/polar/helpers.js

This file was deleted.

7 changes: 2 additions & 5 deletions src/plots/polar/layout_defaults.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,9 @@ var handleTickLabelDefaults = require('../cartesian/tick_label_defaults');
var handleCategoryOrderDefaults = require('../cartesian/category_order_defaults');
var handleLineGridDefaults = require('../cartesian/line_grid_defaults');
var autoType = require('../cartesian/axis_autotype');
var setConvert = require('../cartesian/set_convert');

var setConvertAngular = require('./helpers').setConvertAngular;
var layoutAttributes = require('./layout_attributes');
var setConvert = require('./set_convert');
var constants = require('./constants');
var axisNames = constants.axisNames;

Expand Down Expand Up @@ -66,7 +65,7 @@ function handleDefaults(contIn, contOut, coerce, opts) {
});

var visible = coerceAxis('visible');
setConvert(axOut, layoutOut);
setConvert(axOut, contOut, layoutOut);

var dfltColor;
var dfltFontColor;
Expand Down Expand Up @@ -140,8 +139,6 @@ function handleDefaults(contIn, contOut, coerce, opts) {

var direction = coerceAxis('direction');
coerceAxis('rotation', {counterclockwise: 0, clockwise: 90}[direction]);

setConvertAngular(axOut);
break;
}

Expand Down
Loading