@joint/react
Version:
React bindings and hooks for JointJS to build interactive diagrams and graphs.
52 lines (38 loc) • 1.33 kB
text/mdx
import { Meta, Story, Canvas, Controls, Markdown } from '@storybook/blocks';
import * as Stories from './story';
import Code from './code?raw';
<Meta of={Stories} />
This example demonstrates how to render elements with [highlighters](https://docs.jointjs.com/api/highlighters) applied around them. Highlighters are visual effects that can be used to emphasize specific elements in your graph.
Below is a live demo showcasing the default highlighter in action:
<Canvas of={Stories.Default} />
The highlighter is configured using the `highlighters` property of the `GraphProvider` component. Here is the code used in this example:
<Markdown>
{`\`\`\`tsx
${Code}
\`\`\``}
</Markdown>
Here are the different types of highlighters you can use. Each highlighter provides a unique way to emphasize elements:
```tsx
import { Highlighter } from '@joint/react';
return <Highlighter.Mask />;
```
```tsx
import { Highlighter } from '@joint/react';
return <Highlighter.Opacity />;
```
```tsx
import { Highlighter } from '@joint/react';
return <Highlighter.Stroke />;
```
```tsx
import { Highlighter } from '@joint/react';
return <Highlighter.Custom />;
```