Skip to content

wishlist for potential breaking changes since v1 #420

Closed
@etpinard

Description

@etpinard
Contributor

Leave this text box for planned improvements

  • upgrade d3 to v4.0.0 (now v5) - should be mostly a matter of updating the general update pattern.
    remove es-promise polyfill from bundle - and thus make IE users add their own Promise polyfill.
    drop jQuery event support
    Make components (e.g. Annotations, Shapes, RangeSlider, ...) register-able and remove them from the core bundle.
    revamp set of default colorscales
    make config arguments consistent Minor inconsistency in config #839
    remove config.plot3dPixelRatio map for backward compatibility
    Incorporate /remove all unofficial exposed methods (i.e Plotly.Plots, Plotly.Fx, Plotly.Snapshot, Plotly.PlotSchema, Plotly.Queue)
    drop event-based Plotly.Snapshot.toImage and merge src/snapshot in plot_api/to_image.js
    remove (some) components for lib/core.js - see Add registry of component modules #845
    drop Plotly.relayout handlers for the 'remove' and 'add' special values - see Consistent container update / removal  #1086
    for log axes, have layout express everything in data units instead of linearized units. This applies to range, tick0, and annotation and image positions.
    remove support for dates provided as epoch milliseconds
    remove the distinction between axis name and axis id (ie xaxis2 vs x2) probably by only using the name.
    rename current gl marker symbol 'cross' -> 'cross-thin' (i.e. revert c0eb065)

Activity

etpinard

etpinard commented on Apr 13, 2016

@etpinard
ContributorAuthor

On my list:

  • Incorporate /remove all unofficial exposed methods (i.e Plotly.Plots, Plotly.Fx, Plotly.Snapshot, Plotly.PlotSchema, Plotly.Queue)
  • Use proper state object instead of storing state in graph DOM element.
  • Add OO API e.g :
var plot = Plotly.createPlot('graph', data, layout, config);

plot.restyle(/* */);
plot.relayout(/* */);
plot.resize();
// ...
  • Drop jQuery event support
  • Better, more-consistent events data
  • Better, more-consistent config options
added this to the v2.0.0 milestone on Apr 13, 2016
mdtusz

mdtusz commented on Apr 13, 2016

@mdtusz
Contributor

Ooooooh boy.

  • use only d3 modules we need (fingers crossed)
  • standardize interfaces across all traces/plots
  • svg/gl parity
  • no DOM state (virtual dom + diffing would be awesomeeeee)
  • discrete process/render modules.
  • immutable plot state (i.e. the returned myPlot contains methods, plotstate, and history, but it's current plotstate is always overwritten, and old state is pushed onto a history list)
  • es6 - it's definitely mature enough, and there's a lot of niceties that we could take advantage of
  • agreed upon standard lib/prelude

edit: April 14

  • logging utils that can be set to either verbose or silent (part of our prelude perhaps). Done

edit: April 22

  • slimmed down interface. We could likely reduce the method count to 3-5, namely a constructor Plotly.plot, and instance methods Plot.update, Plot.export and maybe a few others that don't fit as an update.

edit: April 26

  • tooling to verify public interfaces meet standards, e.g. checking that all attribute names are snake_case or camelCase (depending on what we choose)

edit: May 3rd

  • all positioning in normalized units (margins specifically)
monfera

monfera commented on Apr 13, 2016

@monfera
Contributor

Besides agreeing with the above two lists, based on very limited work, take it with huge grain of salt:

  1. D3 might be used in some places; e.g. category scales/axes could be done via the ordinal scale even if mapping is made to logical points (e.g. the index of the axis tick); sometimes two D3 scales are linked (range of one is domain of the other). Might not work out but D3 scales are pretty powerful, especially in the upcoming D3 4.0.
  2. Smaller, and to the extent possible, pure functions, immutability as the default.
  3. (long term) Thinking about reactive visualization, e.g. streaming in new data points into a plot; it would smoothly transition to a possibly enlarged x/y domain; similar behavior with controls. Maybe it's mostly covered, I haven't seen enough. The reason for mentioning it is, it chimes with pure functions and immutability in that it's easier to base dynamic behavior atop of less imperative code.
  4. lodash/fp to replace typical, repeating code patterns, it's a painstakingly optimized library, it isn't just using slow [].map etc.
  5. I saw that some Jasmine test require PlotlyInternal (rather than Plotly); maybe worth using the public API for all tests, but again, maybe PlotlyInternal is much like an API except some of it is not (yet) user-exposed.
mdtusz

mdtusz commented on Apr 13, 2016

@mdtusz
Contributor

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!

cpsievert

cpsievert commented on Apr 14, 2016

@cpsievert

Add OO API e.g :

This seems like a good place to discuss smooth transitions as well (requested in #142, and experimented with in plotly/plotly.R#547). It'd be awesome if plot worked like a d3 selection wrt transitions:

plot
  .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:

plot
  .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.

meglio

meglio commented on Apr 20, 2016

@meglio
  • Please allow callbacks for labels, text, values etc, so that their number can be specified and a callback provided to retrieve values, labels, text, hover text etc by index (passed to callback as a parameter).
  • Let us build hover text with a callback by index, and allow any HTML in the hover text
cpsievert

cpsievert commented on May 11, 2016

@cpsievert

all positioning in normalized units (margins specifically)

+💯

etpinard

etpinard commented on Jun 15, 2016

@etpinard
ContributorAuthor

Remove our es6-promise polyfill and ask IE9, IE8, IE11 (ref) to use their own Promise polyfills.

etpinard

etpinard commented on Jun 23, 2016

@etpinard
ContributorAuthor

Revamp our set of default colorscales.

monfera

monfera commented on Jun 24, 2016

@monfera
Contributor

⬆️ 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.

115 remaining items

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P3backlog

Type

No type

Projects

No projects

Relationships

None yet

    Development

    No branches or pull requests

      Participants

      @nite@finger563@meglio@rreusser@szechyjs

      Issue actions

        wishlist for potential breaking changes since v1 · Issue #420 · plotly/plotly.js