mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-12 03:49:43 +02:00
updated type and function signature
This commit is contained in:
@@ -101,9 +101,13 @@ To add a new shape:
|
|||||||
- **Example**:
|
- **Example**:
|
||||||
|
|
||||||
```typescript
|
```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
|
// Create your shape here
|
||||||
const shape = parent.insert('g').attr('class', 'my-new-shape');
|
const shape = parent.insert('g').attr('class', 'my-new-shape');
|
||||||
// Add other elements or styles as needed
|
// Add other elements or styles as needed
|
||||||
|
@@ -95,9 +95,13 @@ To add a new shape:
|
|||||||
- **Example**:
|
- **Example**:
|
||||||
|
|
||||||
```typescript
|
```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
|
// Create your shape here
|
||||||
const shape = parent.insert('g').attr('class', 'my-new-shape');
|
const shape = parent.insert('g').attr('class', 'my-new-shape');
|
||||||
// Add other elements or styles as needed
|
// Add other elements or styles as needed
|
||||||
|
Reference in New Issue
Block a user