'Add new data traces to a graph.
If `new_indices` isn\'t specified, they are simply appended.
Args:
traces (dict or list of dicts, or class of plotly.graph_objs):trace
new_indices (list[int]|None), optional: The final indices the
added traces should occupy in the graph.
Examples:
Initialization - Start each example below with this setup:
from plotly.widgets import GraphWidget
from plotly.graph_objs import Scatter
from IPython.display import display
graph = GraphWidget(\'https://plot.ly/~chris/3979\')
display(graph)
Example 1 - Add a scatter/line trace to the graph
graph.add_traces(Scatter(x = [1, 2, 3], y = [5, 4, 5]))
Example 2 - Add a scatter trace and set it to to be the
second trace. This will appear as the second
item in the legend.
graph.add_traces(Scatter(x = [1, 2, 3], y = [5, 6, 5]),
new_indices=[1])
Example 3 - Add multiple traces to the graph
graph.add_traces([
Scatter(x = [1, 2, 3], y = [5, 6, 5]),
Scatter(x = [1, 2.5, 3], y = [5, 8, 5])'

def add_traces(self, traces, new_indices=None):

    message = {'task': 'addTraces', 'traces': traces, 'graphId': self._graphId}
    if (new_indices is not None):
        message['newIndices'] = new_indices
    self._handle_outgoing_message(message)
