Merge from upstream new-shapes branch

This commit is contained in:
Ashish Jain
2024-09-17 09:57:30 +02:00
10 changed files with 642 additions and 643 deletions

View File

@@ -2,7 +2,7 @@
>
> ## THIS IS AN AUTOGENERATED FILE. DO NOT EDIT.
>
> ## Please edit the corresponding file in [/packages/mermaid/src/docs/adding_new_shape/Readme.md](../../packages/mermaid/src/docs/adding_new_shape/Readme.md).
> ## Please edit the corresponding file in [/packages/mermaid/src/docs/adding-new-shape/Readme.md](../../packages/mermaid/src/docs/adding-new-shape/Readme.md).
# Custom SVG Shapes Library
@@ -101,9 +101,13 @@ To add a new shape:
- **Example**:
```typescript
import { Node } from '../../types.d.ts';
import { Node, RenderOptions } from '../../types.d.ts';
export const myNewShape = async (parent: SVGAElement, node: Node) => {
export const myNewShape = async (
parent: SVGAElement,
node: Node,
renderOptions: RenderOptions
) => {
// Create your shape here
const shape = parent.insert('g').attr('class', 'my-new-shape');
// Add other elements or styles as needed
@@ -209,7 +213,7 @@ To run the Cypress tests, follow these steps:
1. Ensure you have all dependencies installed by running:
```bash
npm install
pnpm install
```
2. Start the Cypress test runner: