mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-11-03 20:34:20 +01:00
Merge from upstream new-shapes branch
This commit is contained in:
@@ -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:
|
||||
Reference in New Issue
Block a user