streamlit-elements icon indicating copy to clipboard operation
streamlit-elements copied to clipboard

Custom layers on Sunburst chart?

Open fralik opened this issue 3 years ago • 0 comments

I see in documentation that Nivo Sunburst supports custom layers via it's layers property. However, I do not understand what can be provided as a custom layer. I see that it may be a function, so I made one. However, attempting to return a string from it or an object, results in exception.

def custom_layer(obj):
    nodes = obj['nodes']
    centerX = obj['centerX']
    centerY = obj['centerY']
    print(f"centerX: {centerX}, centerY: {centerY}")
    return html.div("custom_layer")

nivo.Sunburst(data=DATA, enableArcLabels=True, arcLabel="id", layers=["arcs", 'arcLabels', custom_layer])

It throws an non-identifiable exception since react is minified.

fralik avatar Jun 16 '22 22:06 fralik