Skip to content
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

v2 changes #5395

Closed
5 tasks done
nicolaskruchten opened this issue Jan 11, 2021 · 12 comments
Closed
5 tasks done

v2 changes #5395

nicolaskruchten opened this issue Jan 11, 2021 · 12 comments
Milestone

Comments

@nicolaskruchten
Copy link
Member

nicolaskruchten commented Jan 11, 2021

Here's what we're going to do for v2, targeting a release in January or February 2020:

  • switch to native-promise-only and officially drop support for IE9 and IE10
  • stop exporting D3
  • stop exporting Plotly.plot
  • drop area, contourgl and pointcloud traces
  • drop support for polar plots in scatter (aka "micropolar"?) i.e. scatter.r and scatter.t and layout.angularaxis and layout.radialaxis and anything else related (cc @alexcjohnson anything else I missed?)

For reference, the primary trigger for version 2.0 is the native-promise-only change, with which we fully drop support for IE 9/10, even though that support has been eroding severely over the last couple of years. This change is driven by a desire to remove function constructors from as many of our bundles as possible for security reasons, as tracked in #897. Since we're doing a v2, we're trying to shed as much deprecated stuff as we can without being otherwise too-disruptive.

@nicolaskruchten
Copy link
Member Author

nicolaskruchten commented Jan 11, 2021

@alexcjohnson suggested the following, which I approve if they take less than a day:

  • change isPlainObject - either just drop the second clause or use something like the new one I found in Validation fails when running via JsDom in NodeJs #5151 - in principle this needn’t be a major but it feels a bit risky to me for some straight JS users
  • drop some other exports: it also may be nice to strip Plotly.Fx to just {hover, unhover, loneHover, loneUnhover} and Plotly.Plots to just {graphJson, resize}

@nicolaskruchten
Copy link
Member Author

Note to self: the plotly.com/javascript docs will need to stop relying on the built-in D3 :)

@nicolaskruchten
Copy link
Member Author

@archmoj can you please provide a list as a comment in this issue of all the methods in our public API that have been dropped, so that folks like @cpsievert can easily grep for them in their own codebases. I've pinged the R/Julia/.Net downstream folks to let them know what's coming and directed them here :)

@archmoj
Copy link
Contributor

archmoj commented Jan 20, 2021

@archmoj can you please provide a list as a comment in this issue of all the methods in our public API that have been dropped, so that folks like @cpsievert can easily grep for them in their own codebases. I've pinged the R/Julia/.Net downstream folks to let them know what's coming and directed them here :)

Here is a list of Plotly methods that are going to be removed in v2:

"Plotly.d3",

"Plotly.plot",

"Plotly.Plots": [
    "modules",
    "allCategories",
    "allTypes",
    "subplotsRegistry",
    "transformsRegistry",
    "componentsRegistry",
    "layoutArrayContainers",
    "layoutArrayRegexes",
    "traceLayoutAttributes",
    "localeRegistry",
    "apiMethodRegistry",
    "collectableSubplotTypes",
    "register",
    "getModule",
    "traceIs",
    "getTransformIndices",
    "hasTransform",
    "getComponentMethod",
    "call",
    "attributes",
    "fontAttrs",
    "layoutAttributes",
    "fontWeight",
    "executeAPICommand",
    "computeAPICommandBindings",
    "manageCommandObserver",
    "hasSimpleAPICommandBindings",
    "redrawText",
    "previousPromises",
    "addLinks",
    "supplyDefaults",
    "supplyDefaultsUpdateCalc",
    "createTransitionData",
    "_hasPlotType",
    "cleanPlot",
    "linkSubplots",
    "clearExpandedTraceDefaultColors",
    "supplyDataDefaults",
    "supplyAnimationDefaults",
    "supplyAnimationFrameDefaults",
    "supplyAnimationTransitionDefaults",
    "supplyFrameDefaults",
    "supplyTraceDefaults",
    "hasMakesDataTransform",
    "supplyTransformDefaults",
    "supplyLayoutGlobalDefaults",
    "plotAutoSize",
    "supplyLayoutModuleDefaults",
    "purge",
    "style",
    "sanitizeMargins",
    "clearAutoMarginIds",
    "allowAutoMargin",
    "autoMargin",
    "doAutoMargin",
    "didMarginChange",
    "modifyFrames",
    "computeFrame",
    "recomputeFrameHash",
    "extendObjectWithContainers",
    "dataArrayContainers",
    "extendTrace",
    "extendLayout",
    "transition",
    "transitionFromReact",
    "doCalcdata",
    "rehover",
    "redrag",
    "generalUpdatePerTraceModule",
    "plotBasePlot",
    "cleanBasePlot"
],

"Plotly.Fx": [
    "moduleType",
    "name",
    "constants",
    "schema",
    "attributes",
    "layoutAttributes",
    "supplyLayoutGlobalDefaults",
    "supplyDefaults",
    "supplyLayoutDefaults",
    "calc",
    "getDistanceFunction",
    "getClosest",
    "inbox",
    "quadrature",
    "appendArrayPointValue",
    "castHoverOption",
    "castHoverinfo",
    "click"
],

"Plotly.Queue": [
    "add",
    "startSequence",
    "stopSequence",
    "undo",
    "redo",
    "plotDo"
],

Milestone: https://github.com/plotly/plotly.js/milestone/60?closed=1

@nicolaskruchten
Copy link
Member Author

Hmmm is Plotly.purge() still around? and Plotly.extendTraces() ? I would expect that the only function from this page https://plotly.com/javascript/plotlyjs-function-reference/ to be removed would be Plotly.plot() no? @alexcjohnson confirm your intentions here plz?

@archmoj
Copy link
Contributor

archmoj commented Jan 20, 2021

Hmmm is Plotly.purge() still around? and Plotly.extendTraces() ? I would expect that the only function from this page https://plotly.com/javascript/plotlyjs-function-reference/ to be removed would be Plotly.plot() no? @alexcjohnson confirm your intentions here plz?

Yes Plotly.purge() and `Plotly.extendTraces() are still around.
The following methods are unchanged:

"Plotly": [
    "version",
    "register",
    "newPlot",
    "restyle",
    "relayout",
    "redraw",
    "update",
    "react",
    "extendTraces",
    "prependTraces",
    "addTraces",
    "deleteTraces",
    "moveTraces",
    "purge",
    "addFrames",
    "deleteFrames",
    "animate",
    "setPlotConfig",
    "toImage",
    "validate",
    "downloadImage",
    "makeTemplate",
    "validateTemplate",
    "Icons",
    "Snapshot",
    "PlotSchema"
]

@nicolaskruchten
Copy link
Member Author

Ah ok so in your message above, it's Plotly.Plots.purge that is going away, and that's an alias to Plotly.purge?

Also, in the message above, is Plotly.Plot the same thing as the Plotly.plot() function or something else? unsure if the capitalization matters here :)

@archmoj
Copy link
Contributor

archmoj commented Jan 20, 2021

Also, in the message above, is Plotly.Plot the same thing as the Plotly.plot() function or something else? unsure if the capitalization matters here :)

Thanks for catching that! I edited the message above so that Plotly.plot is not capital.

@archmoj
Copy link
Contributor

archmoj commented Jan 20, 2021

Ah ok so in your message above, it's Plotly.Plots.purge that is going away, and that's an alias to Plotly.purge?

No it is not an alias.
Plotly.purge() performs other operations in addition to calling Plotly.Plots.purge()

function purge(gd) {
gd = Lib.getGraphDiv(gd);
var fullLayout = gd._fullLayout || {};
var fullData = gd._fullData || [];
// remove gl contexts
Plots.cleanPlot([], {}, fullData, fullLayout);
// purge properties
Plots.purge(gd);
// purge event emitter methods
Events.purge(gd);
// remove plot container
if(fullLayout._container) fullLayout._container.remove();
// in contrast to _doPlots.purge which does NOT clear _context!
delete gd._context;
return gd;
}

@nicolaskruchten
Copy link
Member Author

Updates:

  1. we're keeping role: "object" in the schema (because they're useful and consistent) and dropping the other role values (because they're inconsistent and therefore potentially dangerous to use and Plotly.py and docs don't use them)
  2. we're keeping pointcloud and marking it deprecated
  3. we're marking heatmapgl as deprecated

@dhirschfeld
Copy link

Just wondering if #5230 will make it in 2.0?

@archmoj
Copy link
Contributor

archmoj commented Jan 28, 2021

Just wondering if #5230 will make it in 2.0?

I think new features like that could possibly be added in a minor afterwards e.g. v2.x.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants