I’m new to Plotly and Dash, so please bear with me. I cannot, for the life of me, figure out how to combine both a layout and a transform.
This code works:
data: [{
"x": x,
"y": y,
"mode": 'markers',
"transforms": [{
"type": 'aggregate',
"groups": x,
"aggregations": [{
"target": 'y',
"func": 'count',
"enabled": True,
}]
}]
}]
plot_div = py.plot(
{'data': data},
validate=False,
output_type='div')
This code works:
plot_div = py.plot({
"data": [{
"x": x,
"y": y,
"mode":'markers',
}],
"layout": {
"title": "hello world"
},
}, output_type='div')
But I want to have something like the following and I can’t figure it out. For what it’s worth, x & y come from a pandas dataframe. I didn’t include that info in the code snippets above, since both of the previous code snippets work, I’m pretty sure it’s just something I’m doing wrong in the syntax below. Any help is appreciated:
plot_div = py.plot({
"data": data,
"layout": {"title": "hello world"},
}, output_type='div')