_Leave this text box for planned improvements_
d3 to v4.0.0 (now v5) - should be mostly a matter of updating the general update pattern.es-promise polyfill from bundle - and thus make IE users add their own Promise polyfill.Annotations, Shapes, RangeSlider, ...) register-able and remove them from the core bundle.config.plot3dPixelRatio map for backward compatibilityPlotly.Snapshot.toImage and merge src/snapshot in plot_api/to_image.jslib/core.js - see https://github.com/plotly/plotly.js/pull/845Plotly.relayout handlers for the 'remove' and 'add' special values - see https://github.com/plotly/plotly.js/pull/1086 layout express everything in data units instead of linearized units. This applies to range, tick0, and annotation and image positions.xaxis2 vs x2) probably by only using the name.'cross' -> 'cross-thin' (i.e. revert https://github.com/plotly/plotly.js/pull/1482/commits/c0eb06599db481f2137ed97e79bab5cb2bc31351)On my list:
Plotly.Plots, Plotly.Fx, Plotly.Snapshot, Plotly.PlotSchema, Plotly.Queue)var plot = Plotly.createPlot('graph', data, layout, config);
plot.restyle(/* */);
plot.relayout(/* */);
plot.resize();
// ...
Ooooooh boy.
myPlot contains methods, plotstate, and history, but it's current plotstate is always overwritten, and _old_ state is pushed onto a history list)_edit: April 14_
_edit: April 22_
Plotly.plot, and instance methods Plot.update, Plot.export and maybe a few others that don't fit as an update._edit: April 26_
snake_case or camelCase (depending on what we choose)_edit: May 3rd_
Besides agreeing with the above two lists, based on very limited work, take it with huge grain of salt:
To add to @monfera's testing comments - I'm personally not a fan of tests that just test the internal workings of code - they end up being quite brittle and often only ensure that code remains the way it was originally written. I'd love to see tests specific to plotting _only_ use the public API and inspect the returned object - if we no longer keep state in the DOM, this will be infinitely easier as well and rendering tests can be handled separately using mocks (and obviously, maintain unit tests for well specified functions) . As well - without the need for a real browser DOM, we'd be able to run tests (excluding image tests) headless!
Add OO API e.g :
This seems like a good place to discuss smooth transitions as well (requested in #142, and experimented with in https://github.com/ropensci/plotly/pull/547). It'd be awesome if plot worked like a d3 selection wrt transitions:
.transition({duration: 100, ease: 'cubic'})
.restyle('marker.color', 'red')
Also, in my mind, transitioning _positions_ (x/y) is the most important use case, so it'd be super useful if restyle() (or some other method) could also support this:
.transition({duration: 100, ease: 'linear'})
.restyle('scatter', {x: [1, 2], y: [1, 2]})
There are multiple ways to transition a path, but I think I'd almost always want to transition the transform.
all positioning in normalized units (margins specifically)
+馃挴
Remove our es6-promise polyfill and ask IE9, IE8, IE11 (ref) to use their own Promise polyfills.
Revamp our set of default colorscales.
猬嗭笍 there is palette overlap between plotly.js and some of its webgl renderers, with a different resolution. Slight restructuring would make room for one shared palette set definition at a finer than current resolution.
Drop 'add' and 'remove' relayout values from adding and removing annotations and shapes.
Use e.g:
// to add a blank annotation:
Plotly.relayout(gd, 'annotations[2]', {});
// to remove a shape:
Plotly.relayout(gd, 'shapes[2]', null);
Maybe we should drop Plotly.redraw in v2.0.0 ?
@etpinard 馃憤 for removing unofficial exposed methods.
[0.1, 100] rather than [-1, 2]. For dates we're doing this in #1078 but I can't see a backward-compatible way to do it for logs. This also applies to annotation and image positions (but shapes already get it right!) and tick0. Perhaps in 2.0 we also remove the compatibility transform that #1078 introduces for dates that supports the old range-as-epoch-milliseconds format.'x', 'x2', 'y2' etc. instead of 'xaxis', 'xaxis2', 'yaxis2' so you can go straight from xref/yref to the axis object and we can get rid of Axes.id2name and name2idIn principle this allows us to also change log axis ranges to data values backward-compatibly, since you can't make a log axis without explicitly specifying the container. The only downside I see to this is attribute names are a bit overloaded: trace.x, annotation.x, scene.domain.x etc are data values or arrays of data values, but layout.x and scene.x are axis objects. Doesn't seem too confusing to me but it should be discussed.
rename all the axis objects 'x', 'x2', 'y2' etc. instead of 'xaxis', 'xaxis2', 'yaxis2'
I'd vote for the opposite. Rename all axis ids 'xaxis', 'xaxis2', 'yaxis2', ...
I'd vote for not having "names" that require parsing at all - put them as indexed elements in a list.
I'd vote for the opposite. Rename all axis ids
'xaxis','xaxis2','yaxis2', ...
That could work. It gives us the same simplification, clears up the ambiguity, and is a smaller change for users to adapt to. Means we have to do something more clever to manage backward compatibility but maybe that's unavoidable.
I'd vote for not having "names" that require parsing at all - put them as indexed elements in a list.
Like layout.xaxes=[{...}, {...}, {...}]? two things bother me with that idea:
Maybe we should drop support for colorscales in histogram traces. See https://github.com/plotly/plotly.js/issues/1495 and https://github.com/plotly/plotly.js/pull/1500
Regarding the removal of support for specifying date as epoch time in ms, is there no desire to support plots which specify time as epoch nanoseconds? Seeing as I have just such plots I'd be very interested to know :)
is there no desire to support plots which specify time as epoch nanoseconds?
The precision we have right now - 100 microseconds, one digit better than native dates support - is the best I found I was able to reliably handle using a single javascript number to specify the coordinate. I could imagine a system supporting arbitrary precision within a restricted range where the zero point of the axis linearization is allowed to float - this would be a fairly big project but could be done if someone was sufficiently interested in sponsoring it ;)
Note that this wouldn't imply any backward incompatibility, so need not be associated with v2
We should take some time thinking about the config argument during the v2 push. For example,
Plotly.newPlot reset the context, like Plotly.purge does?config values to be updated via Plotly.udpate and/or should we add a granular Plotly.reconfig method?config values logic to a more supply-default-esque framwork as https://github.com/plotly/plotly.js/pull/1188 attempted?data and layout attributes and output them in the plot-schema - see #1188 restyle and relayout and our other API methods - we used these in our old workspace, but this is really not the right level to be managing this issue, as plots may be coupled to other application state (ie changes in data arrays) and using our queue would muck up that correspondence.relayout(gd, {'xaxis.reverse': true}) and change the handling of axis.autorange: 'reversed' from a weird disappearing setting to regular behavior where autorange: true always results in an increasing range and autorange: 'reversed' is always reversed. Would also require the doubleclick interactions to choose whether to set autorange to true or 'reversed' in order to behave the way they do today, but editing behavior would be more intuitive.array and arrayminus attributes in favor of arrayOk versions of value and valueminustraceref and tracerefminus - which are already unused within plotly.js but may still be used by the old workspace.axis.reverse mentioned above, there's orientationaxes, swapxy, and swapxyaxes here - seems like these should be dropped and just managed by editing apps.orientation has special handling to swap the x/y attributes. We should probably drop this special handling too, and just let the user/editor do the swapping they want.from https://github.com/plotly/plotly.js/pull/1999#issuecomment-329318166
scrollZoom: true, but the scrollZoom default is faise. PlotlyGeoAssets global with some field on Plotly. No need to have another global variables.from @etpinard above:
Make geo subplot respect the scrollZoom config option #143
and from #2041:
@etpinard - I think in
v2all subplot types should obeyscrollZoom. Moreover, I think should add a correspondinglayoutattribute as people might want to turn on/off scroll interactions via arelayoutcall.
@rreusser - Agreed. Including gl3d. I actually rather dislike scrollZoom being a config parameter. I find embedplot, for one, suddenly has dramatic scroll interactions I never saw when developing the plot.
We definitely need saner management of scrollZoom. The current behavior grew accidentally but does have a sort of logic to it:
scrollZoom was originally made a config option because you want to be able to avoid it in scrolling environments. For example a plotly plot in a blog post or news story: you scroll down quickly and suddenly discover that page scrolling has stopped and you're looking at a mostly blank plot, because you've accidentally zoomed way out before even looking at it. This is why plot.ly embeds have scrollZoom: false but the same plot displayed in a non-scrolling environment (such as plot.ly shareplot) have it enabled.scrollZoom: false, not sure if it was an explicit decision with maps or not but it fits that logic.So what would "saner management" look like, given these constraints? One proposal (incorporating some of the above ideas):
false unless you have one of the subplot types that can only be zoomed this way, but that lets creators choose, and applies to all subplots of all types (per-subplot control seems confusing and unnecessary).To add some more detail to "better, more consistent event data":
calcdata before. #2117 fixed a lot of that but left v and i in place for backward compatibility - remove them.I would love to see autosizing fixed so that it works in flexbox or any dynamically sized containers. If a container's width/height is auto the plot size always defaults to 700x450px. This then requires the use of resize events and Plots.resize() to get things to behave. It would be nice to refactor the svg plotting to just be sized to 100% of the container instead of using explicit pixels values.
Related to @szechyjs' https://github.com/plotly/plotly.js/issues/420#issuecomment-345755199: https://github.com/plotly/plotly.js/issues/106
Plotly.setPlotConfig) - @etpinard suggests a top-level method for it like Plotly.setLogLevellayout.separators and only support locales (#2207)visible: false - increment default colors. Currently we have a kind of strange situation where traces that the user marks visible: false do NOT increment the default color (it's like they don't exist at all) but traces that plotly invalidates (eg for lacking data arrays) DO increment the default color. Seems kind of weird to hide and show traces and have that effect the color of other traces. See https://github.com/plotly/plotly.js/pull/2227#discussion_r159031147plotly_selected event with undefined data that gets emitted when clicking on the plot area in a select mode - see #2241 On the topic of timestamps, in response to @alexcjohnson
The precision we have right now - 100 microseconds, one digit better than native dates support - is the best I found I was able to reliably handle using a single javascript number to specify the coordinate. I could imagine a system supporting arbitrary precision within a restricted range where the zero point of the axis linearization is allowed to float - this would be a fairly big project but could be done if someone was sufficiently interested in sponsoring it ;)
Is it possible to do something simpler for dateless timestamps? Time of day to nanosecond precision requires 47 bits and fits comfortably in double. It would be quite useful for financial time series on intraday tick data.
showlegend to legend.visible in line with most of our other containers. So the rule would be: if attributes are grouped in a container describing an object, the container should have a visible attribute inside, but visibility of features without their own containers continue to get show* attributes. (As mentioned in #2341)Suggestion: now that Plotly.react got implemented in https://github.com/plotly/plotly.js/pull/2341, perhaps we start thinking about removing :hocho: Plotly.plot, Plotly.redraw, Plotly.restyle, Plotly.relayout, Plotly.update and Plotly.moveTraces entirely from the library make Plotly.react the only official way to update an existing plotly graph? The restyle call signature has always been hard to grasp for new plotly.js users. As Plotly.react has the small call signature as Plotly.newPlot, this should be an improvement.
We could probably remove Plotly.extendTraces and Plotly.preprendTraces at some point too, but it might best to keep them and turn them into fast(er) :racehorse: routine optimize for streaming data.
Just a thought. Maybe some users _really_ like Plotly.restyle and Plotly.relayout ...
axis.automargin true by default - as proposed in https://github.com/plotly/plotly.js/pull/2243#issuecomment-356988681Add TypeScript definitions types with every new Plotly.js release and link to NPM @types repo
https://www.npmjs.com/package/@types/plotly.js
@acats-dkolev that's not a breaking change. You can follow https://github.com/plotly/plotly.js/issues/28 for the latest development info
tickformat - see #2468 Continuing from @etpinard comment https://github.com/plotly/plotly.js/issues/420#issuecomment-364454752
Instead of deprecating Plotly.plot rename Plotly.react to Plotly.plot. react may be a somewhat unfortunate name for a method that has the "whole plot specification" of Plotly.plot and the performance of Plotly.update. Also it is highly useful for those using JQuery, Angular, Vue etc.
My wishlist is around making the graphs more dynamic and responsive:
Expanding on
Make components (e.g. Annotations, Shapes, RangeSlider, ...) register-able and remove them from the core bundle.
ErrorBars should also be made optional. To do so, we'll need to add another flavor of Registry.getComponentMethod that returns false if the component in question isn't registered.
layout.hovermode from 'x' (compare) to 'closest'. In #778 we discussed setting restrictions on when cartesian plots could default to compare mode (we already separate out non-cartesian and horizontal traces here) but this is both difficult to do (requires digging into data arrays during supplyDefaults) and potentially error-prone, and can still be a source of confusion (see clickmode #1852, spikelines). Seems better just to default to 'closest' and make compare modes explicitly opt-in.To add to the ancient discussion about axis names. Subplot naming for non-cartesian could be made more consistent. I.e. have scene and geo renamed to subplot like the rest. Perhaps gl3d to scene.
Proposal from @etpinard, came up during stacked area #2960:
Make 'fill' part of the mode flaglist, then the fill value just determines how to fill, not whether to fill.
fill: 'none''fill' flag in scatter mode'fill' flag the mode default whenever stackgroup is setfill (that maybe we should call fills similar to the markers and lines attribute containers) only if 'fill' is part of modetonexty the only valid fills value when stackgroup is set (tonextx for horizontal stacks). Lib.log something if some other value is set.I might even go one step further, now that we have orientation (which is so far just used by the stackgroup, and if we did this it would still only have one value within a stack group but outside that it would be a per-trace attribute), we could 馃敧 the 'x' and 'y' suffixes, determine that from orientation, and just let fill take values 'tozero', 'tonext', and 'toself'
PR https://github.com/plotly/plotly.js/pull/2944 added layout.clickmode with default value 'event' which fires plotly_click event when clicking on data points. In v2, we could consider making 'select' or 'event+select' the default enabling click-to-select by default.
auto* attributes: if a value is needed and not provided, that's enough to indicate that it should be determined automatically, just like all other defaults. This might be too broad a statement, but I think it's mostly the right goal. There are a few bits of functionality we will need to find a new home for, like autorange: 'reversed'gd.data or gd.layout during Plotly.plot. This requirement has been hinted at elsewhere in this issue but I don't think it was explicitly stated._private attributes to stash values determined during calc rather than supplyDefaultsFrom https://github.com/plotly/plotly.js/issues/3248
plotly_selected (with event data undefined) when clicking on graphs under dragmode 'select' or 'lasso.We're going to do this in (at least) 4 major releases next year instead of one massive major release. Will have a lot to celebrate by next year's holiday party!
Roughly:
traces and data March-June 2019Giving these items plenty of time so that the Chart Studio, Dash, and Plotly.py teams have time to adjust to each major change.
//cc @jonmmease @etpinard @alexcjohnson @nicolaskruchten @chriddyp @bpostlethwaite
From https://github.com/plotly/plotly.js/issues/3450#issuecomment-455693468 (and cc https://github.com/plotly/plotly.js/pull/3553):
Agreed that the end state should be no
textattributes that only ever appear on hover. But we should look at the traces that currently have no on-graph text and figure out which ones we can imagine adding it to in the future, before actually removing thetextattribute (in a major bump).
Any plans to support react-native? I found a third party dev who build this: https://github.com/rynobax/react-native-plotly any thoughts?
We're going to do this in (at least) 4 major releases next year instead of one massive major release. Will have a lot to celebrate by next year's holiday party!
Roughly:
- [ ] v2.0 New styling defaults (colorway, reduce margin size, left-align title, etc) _Jan-Feb 2019_
- [ ] v3.0 Separate
tracesanddata_March-June 2019_
3.
Hi - is this still active? Is there an updated roadmap/release date for 2.0.0? Is there RC/branch we could try out?
@nite sorry for the lack of update in this issue. We chose to prioritize new chart types (https://github.com/plotly/plotly.js/issues/2221) this year. We're still searching for a large company or consortium of companies to sponsor a v2 plotly.js API: https://plot.ly/products/consulting-and-oem/
Most helpful comment
On my list:
Plotly.Plots,Plotly.Fx,Plotly.Snapshot,Plotly.PlotSchema,Plotly.Queue)