Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

ZERO circular dependency #2429

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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 17 commits into from
Mar 2, 2018
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
馃敧 src/plotly.js !!!
  • Loading branch information
etpinard committed Mar 1, 2018
commit 204799c12e9cc455761fcfec6c9ce883a454fdf4
30 changes: 15 additions & 15 deletions 30 src/plot_api/plot_api.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ var d3 = require('d3');
var isNumeric = require('fast-isnumeric');
var hasHover = require('has-hover');

var Plotly = require('../plotly');
var Lib = require('../lib');
var Events = require('../lib/events');
var Queue = require('../lib/queue');
Expand All @@ -25,6 +24,7 @@ var Plots = require('../plots/plots');
var Polar = require('../plots/polar/legacy');
var initInteractions = require('../plots/cartesian/graph_interact');

var Axes = require('../plots/cartesian/axes');
var Drawing = require('../components/drawing');
var Color = require('../components/color');
var xmlnsNamespaces = require('../constants/xmlns_namespaces');
Expand Down Expand Up @@ -176,7 +176,7 @@ exports.plot = function(gd, data, layout, config) {
Drawing.initGradients(gd);

// save initial show spikes once per graph
if(graphWasEmpty) Plotly.Axes.saveShowSpikeInitial(gd);
if(graphWasEmpty) Axes.saveShowSpikeInitial(gd);

// prepare the data and find the autorange

Expand Down Expand Up @@ -327,24 +327,24 @@ exports.plot = function(gd, data, layout, config) {
function doAutoRangeAndConstraints() {
if(gd._transitioning) return;

var axList = Plotly.Axes.list(gd, '', true);
var axList = Axes.list(gd, '', true);
for(var i = 0; i < axList.length; i++) {
var ax = axList[i];
cleanAxisConstraints(gd, ax);

Plotly.Axes.doAutoRange(ax);
Axes.doAutoRange(ax);
}

enforceAxisConstraints(gd);

// store initial ranges *after* enforcing constraints, otherwise
// we will never look like we're at the initial ranges
if(graphWasEmpty) Plotly.Axes.saveRangeInitial(gd);
if(graphWasEmpty) Axes.saveRangeInitial(gd);
}

// draw ticks, titles, and calculate axis scaling (._b, ._m)
function drawAxes() {
return Plotly.Axes.doTicks(gd, 'redraw');
return Axes.doTicks(gd, 'redraw');
}

// Now plot the data
Expand Down Expand Up @@ -1440,7 +1440,7 @@ function _restyle(gd, aobj, traces) {

// for autoranging multiple axes
function addToAxlist(axid) {
var axName = Plotly.Axes.id2name(axid);
var axName = Axes.id2name(axid);
if(axlist.indexOf(axName) === -1) axlist.push(axName);
}

Expand Down Expand Up @@ -1639,7 +1639,7 @@ function _restyle(gd, aobj, traces) {

// swap the data attributes of the relevant x and y axes?
if(['swapxyaxes', 'orientationaxes'].indexOf(ai) !== -1) {
Plotly.Axes.swap(gd, traces);
Axes.swap(gd, traces);
}

// swap hovermode if set to "compare x/y data"
Expand Down Expand Up @@ -1676,7 +1676,7 @@ function _restyle(gd, aobj, traces) {

// do we need to force a recalc?
var autorangeOn = false;
var axList = Plotly.Axes.list(gd);
var axList = Axes.list(gd);
for(i = 0; i < axList.length; i++) {
if(axList[i].autorange) {
autorangeOn = true;
Expand Down Expand Up @@ -1721,7 +1721,7 @@ function _restyle(gd, aobj, traces) {
* attribute object `{astr1: val1, astr2: val2 ...}`
* allows setting multiple attributes simultaneously
*/
Plotly.relayout = function relayout(gd, astr, val) {
exports.relayout = function relayout(gd, astr, val) {
gd = Lib.getGraphDiv(gd);
helpers.clearPromiseQueue(gd);

Expand Down Expand Up @@ -1787,7 +1787,7 @@ function _relayout(gd, aobj) {
var layout = gd.layout,
fullLayout = gd._fullLayout,
keys = Object.keys(aobj),
axes = Plotly.Axes.list(gd),
axes = Axes.list(gd),
arrayEdits = {},
arrayStr,
i,
Expand Down Expand Up @@ -2131,7 +2131,7 @@ function _relayout(gd, aobj) {
function refAutorange(gd, obj, axLetter) {
if(!Lib.isPlainObject(obj)) return false;
var axRef = obj[axLetter + 'ref'] || axLetter,
ax = Plotly.Axes.getFromId(gd, axRef);
ax = Axes.getFromId(gd, axRef);

if(!ax && axRef.charAt(0) === axLetter) {
// fall back on the primary axis in case we've referenced a
Expand All @@ -2141,7 +2141,7 @@ function refAutorange(gd, obj, axLetter) {
// The only thing this is used for is to determine whether to
// do a full `recalc`, so the only ill effect of this error is
// to waste some time.
ax = Plotly.Axes.getFromId(gd, axLetter);
ax = Axes.getFromId(gd, axLetter);
}
return (ax || {}).autorange;
}
Expand Down Expand Up @@ -2403,8 +2403,8 @@ function diffData(gd, oldFullData, newFullData, immutable) {
for(i = 0; i < oldFullData.length; i++) {
trace = newFullData[i];
diffOpts.autoranged = trace.xaxis ? (
Plotly.Axes.getFromId(gd, trace.xaxis).autorange ||
Plotly.Axes.getFromId(gd, trace.yaxis).autorange
Axes.getFromId(gd, trace.xaxis).autorange ||
Axes.getFromId(gd, trace.yaxis).autorange
) : false;
getDiffFlags(oldFullData[i], trace, [], diffOpts);
}
Expand Down
9 changes: 4 additions & 5 deletions 9 src/plot_api/subroutines.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,9 @@
* LICENSE file in the root directory of this source tree.
*/


'use strict';

var d3 = require('d3');
var Plotly = require('../plotly');
var Registry = require('../registry');
var Plots = require('../plots/plots');
var Lib = require('../lib');
Expand All @@ -19,6 +17,7 @@ var Color = require('../components/color');
var Drawing = require('../components/drawing');
var Titles = require('../components/titles');
var ModeBar = require('../components/modebar');
var Axes = require('../plots/cartesian/axes');
var initInteractions = require('../plots/cartesian/graph_interact');
var cartesianConstants = require('../plots/cartesian/constants');
var alignmentConstants = require('../constants/alignment');
Expand Down Expand Up @@ -46,7 +45,7 @@ exports.lsInner = function(gd) {
var fullLayout = gd._fullLayout;
var gs = fullLayout._size;
var pad = gs.p;
var axList = Plotly.Axes.list(gd);
var axList = Axes.list(gd);

// _has('cartesian') means SVG specifically, not GL2D - but GL2D
// can still get here because it makes some of the SVG structure
Expand Down Expand Up @@ -339,7 +338,7 @@ exports.lsInner = function(gd) {
plotinfo.ylines.attr('d', yPath);
});

Plotly.Axes.makeClipPaths(gd);
Axes.makeClipPaths(gd);
exports.drawMainTitle(gd);
ModeBar.manage(gd);

Expand Down Expand Up @@ -471,7 +470,7 @@ exports.doLegend = function(gd) {
};

exports.doTicksRelayout = function(gd) {
Plotly.Axes.doTicks(gd, 'redraw');
Axes.doTicks(gd, 'redraw');
exports.drawMainTitle(gd);
return Plots.previousPromises(gd);
};
Expand Down
32 changes: 0 additions & 32 deletions 32 src/plotly.js

This file was deleted.

3 changes: 1 addition & 2 deletions 3 src/plots/plots.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,8 @@
var d3 = require('d3');
var isNumeric = require('fast-isnumeric');

var Plotly = require('../plotly');
var PlotSchema = require('../plot_api/plot_schema');
var Registry = require('../registry');
var PlotSchema = require('../plot_api/plot_schema');
var axisIDs = require('../plots/cartesian/axis_ids');
var Lib = require('../lib');
var _ = Lib._;
Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.