✨ Announcing our seed funding led by Lux Capital! Read more about it on our blog
DocsBlogChangelog

Search documentation...

/

Star

12k+

[ Learn ]

[ Concepts ]

[ Reference ]

Voronoi


Voronoi is a wrapper component that renders a voronoi graph.

Data


Voronoi accepts a data prop, which is an array of dictionaries with x and y keys. You can contruct your own data as input, or use the rx.data helper function to generate a data array from a x and y list.
data = rx.data(
    "voronoi", x=[1, 2, 3, 4, 5], y=[1, 2, 3, 4, 10]
)
Which will render as:
data = [
    {"x": 1, "y": 1},
    {"x": 2, "y": 2},
    {"x": 3, "y": 3},
    {"x": 4, "y": 4},
    {"x": 5, "y": 10},
]

Examples


The following example shows a basic rx.voronoi component.
1.02.03.04.05.0246810
rx.chart(
    rx.voronoi(
        data=rx.data(
            "voronoi", x=[1, 2, 3, 4, 5], y=[1, 2, 3, 4, 10]
        ),
        style={
            "data": {
                "fill": "none",
                "stroke": "black",
                "strokeWidth": 1,
            }
        },
    ),
)
The following example shows a rx.voronoi component with multiple data sets and custom styles.
1.02.03.04.05.06.07.08.0246810
rx.chart(
    rx.voronoi(
        data=rx.data(
            "voronoi", x=[1, 2, 3, 4, 5], y=[1, 2, 3, 4, 10]
        ),
        style={
            "data": {
                "fill": "none",
                "stroke": "#000C66",
                "strokeWidth": 1,
            }
        },
    ),
    rx.voronoi(
        data=rx.data(
            "voronoi", x=[1, 3, 5, 7, 8], y=[1, 5, 6, 9, 10]
        ),
        style={
            "data": {
                "fill": "#7EC8E3",
                "stroke": "#050A30",
                "strokeWidth": 1,
                "opacity": 0.5,
            }
        },
    ),
)

Voronoi


Display a victory Voronoi.


  • No props for Voronoi.

  • Base Event Triggers

← ScatterPlotly →

Copyright © 2023 Pynecone, Inc.