@@ -176,8 +236,11 @@ const LegendDemo = () => (
+
+ {/* CustomIcon */}
+
+ {/* CustomIcon with events*/}
+
);
diff --git a/demo/ts/components/victory-scatter-demo.tsx b/demo/ts/components/victory-scatter-demo.tsx
index 10d2f99c4..afdcd22d5 100644
--- a/demo/ts/components/victory-scatter-demo.tsx
+++ b/demo/ts/components/victory-scatter-demo.tsx
@@ -1,5 +1,5 @@
/* eslint-disable no-magic-numbers,react/no-multi-comp */
-import React from "react";
+import React, { useState } from "react";
import PropTypes from "prop-types";
import { random, range } from "lodash";
import { VictoryScatter } from "victory-scatter";
@@ -11,6 +11,11 @@ import {
} from "victory-core";
import bubbleData from "./bubble-data";
import symbolData from "./symbol-data";
+import {
+ FaMoon,
+ FaFootballBall,
+ FaSun,
+} from "react-icons/fa";
type DataType = {
x?: string | number;
@@ -94,6 +99,41 @@ const symbolStyle = {
fill: "grey",
},
};
+const CustomSunIcon = (props) => (
+
+);
+
+const CustomCustomIconWithEvents = (props) => {
+ const [iconColor, setIconColor] = useState(props?.style?.fill || "green");
+ const [icon, setIcon] = useState("moon");
+ if (icon === "moon") {
+ return (
+
{
+ setIcon("star");
+ setIconColor("red");
+ }}
+ />
+ );
+ }
+ return (
+ {
+ setIcon("moon");
+ setIconColor("blue");
+ }}
+ />
+ );
+};
+
class CatPoint extends React.Component {
static propTypes = {
@@ -289,6 +329,28 @@ export default class VictoryScatterDemo extends React.Component<
x="a.x"
y="a.b[0]y"
/>
+ {/* custom icons */}
+ }
+ />
+ }
+ size={25}
+ samples={10}
+ />
);
}
diff --git a/docs/package.json b/docs/package.json
index 1160c4ef1..088825cb3 100644
--- a/docs/package.json
+++ b/docs/package.json
@@ -42,6 +42,7 @@
"prism-react-renderer": "^2.3.1",
"react-cool-inview": "^3.0.1",
"react-copy-to-clipboard": "^5.1.0",
+ "react-icons": "^5.3.0",
"react-inlinesvg": "^4.1.1",
"react-live": "^4.1.6",
"react-markdown": "^9.0.1",
diff --git a/docs/src/content/docs/victory-legend.md b/docs/src/content/docs/victory-legend.md
index e0f629d95..88b7e7915 100644
--- a/docs/src/content/docs/victory-legend.md
+++ b/docs/src/content/docs/victory-legend.md
@@ -3,7 +3,8 @@ id: 16
title: VictoryLegend
category: more
type: docs
-scope: null
+scope:
+ - reactIconsFa
---
# VictoryLegend
@@ -112,7 +113,7 @@ containerComponent={