Open bcliang opened 4 years ago
Very expecting
Looks like dash-core-components.Graph
will be getting a prependData()
method. https://github.com/plotly/dash-core-components/pull/850
Add that to scope here.
Plotly.prependTraces
APIVery expecting
@hxse, which use case do you have in mind? I have not been working on this feature as I have been loaded with work. If you can describe what you need, that would help make a decision on how to implement the above. If it's a small use case it might be easier to do a partial implementation (e.g just creating an additional prop specifically for prependData
, deleteTrace
or insertTrace
)
Background
35 requested support for a "sorted" extend
39 asked about updating data within a trace
Unfortunately, the plotly.js graphing library doesn't support this type of "data update". In both cases, the feature could be implemented on the callback side provided there is/was a way to replace (or just delete) an existing trace.
Imagined use-case within a callback:
In the above case, it may be better to go with update in order to support preserving the trace order for the figure (for future indexing)
Considerations
extendData
callback, and possibly rename it to a more general name e.g.updateData
. Pros: It already supports specifying the trace index. In this implementation, I suppose there would be an additional input allowing the user to specify whether to extend, replace, or just delete a trace. Cons: complexity increasesprependData
prop / adding it to theextendData
prop?Plotly.prependTraces()
exists, and this is a special case for updating a trace. I'm sure there's a use case, though no one has explicitly requested it.Requires