Skip to content

Commit

Permalink
feat: add voronoi controls to theme builder
Browse files Browse the repository at this point in the history
  • Loading branch information
ramenhog committed Nov 19, 2024
1 parent b412817 commit 1675e72
Showing 1 changed file with 51 additions and 0 deletions.
51 changes: 51 additions & 0 deletions demo/ts/components/theme-builder/options-config.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { VictoryLegend } from "victory-legend";
import { VictoryLine } from "victory-line";
import { VictoryPie } from "victory-pie";
import { VictoryScatter } from "victory-scatter";
import { VictoryVoronoi } from "victory-voronoi";

type ThemeBuilderFieldConfig =
| {
Expand Down Expand Up @@ -843,6 +844,56 @@ const optionsConfig: ThemeBuilderOptionsConfig = [
},
],
},
{
type: "section",
title: "Voronoi",
content: (props) => (
<VictoryVoronoi
{...props}
data={[
{ x: 1, y: 2 },
{ x: 2, y: 3 },
{ x: 3, y: 5 },
{ x: 4, y: 4 },
{ x: 5, y: 7 },
]}
/>
),
fields: [
{
type: "section",
label: "General",
fields: [
{
type: "colorPicker",
label: "Fill",
default: "#FFFFFF",
path: "voronoi.style.data.fill",
},
{
type: "colorPicker",
label: "Stroke",
default: defaultFill,
path: "voronoi.style.data.stroke",
},
{
type: "slider",
label: "Stroke Width",
min: 0,
max: 5,
unit: "px",
default: 2,
path: "voronoi.style.data.strokeWidth",
},
],
},
{
type: "section",
label: "Labels",
fields: getBaseLabelsConfig("voronoi.style.labels"),
},
],
},
];

export default optionsConfig;

0 comments on commit 1675e72

Please sign in to comment.