Skip to content

Commit

Permalink
chore: Move icons to architecture
Browse files Browse the repository at this point in the history
We are planning to release an icons library separately. Till we figure out the APIs for those, all external surface for icons are removed, to avoid making a breaking change when the new library comes.
  • Loading branch information
sidharthv96 committed Aug 28, 2024
1 parent 08d59d3 commit bed6c5d
Show file tree
Hide file tree
Showing 27 changed files with 187 additions and 3,792 deletions.
2 changes: 1 addition & 1 deletion docs/config/icons.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
>
> ## Please edit the corresponding file in [/packages/mermaid/src/docs/config/icons.md](../../packages/mermaid/src/docs/config/icons.md).
# SVG Icons (v???+)
# SVG Icons (v\<MERMAID_RELEASE_VERSION>+)

SVG Icons can be used with supported diagrams. Alongside the icon packs included with Mermaid, 3rd party libraries can be included in the configuration to cover additional use-cases.

Expand Down
26 changes: 13 additions & 13 deletions docs/config/setup/interfaces/mermaid.Mermaid.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ page.

#### Defined in

[packages/mermaid/src/mermaid.ts:441](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaid.ts#L441)
[packages/mermaid/src/mermaid.ts:435](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaid.ts#L435)

---

Expand Down Expand Up @@ -59,7 +59,7 @@ A graph definition key

#### Defined in

[packages/mermaid/src/mermaid.ts:443](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaid.ts#L443)
[packages/mermaid/src/mermaid.ts:437](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaid.ts#L437)

---

Expand Down Expand Up @@ -89,7 +89,7 @@ Use [initialize](mermaid.Mermaid.md#initialize) and [run](mermaid.Mermaid.md#run

#### Defined in

[packages/mermaid/src/mermaid.ts:436](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaid.ts#L436)
[packages/mermaid/src/mermaid.ts:430](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaid.ts#L430)

---

Expand All @@ -116,7 +116,7 @@ This function should be called before the run function.

#### Defined in

[packages/mermaid/src/mermaid.ts:440](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaid.ts#L440)
[packages/mermaid/src/mermaid.ts:434](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaid.ts#L434)

---

Expand All @@ -130,7 +130,7 @@ Use [parse](mermaid.Mermaid.md#parse) and [render](mermaid.Mermaid.md#render) in

#### Defined in

[packages/mermaid/src/mermaid.ts:430](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaid.ts#L430)
[packages/mermaid/src/mermaid.ts:424](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaid.ts#L424)

---

Expand Down Expand Up @@ -180,7 +180,7 @@ Error if the diagram is invalid and parseOptions.suppressErrors is false or not

#### Defined in

[packages/mermaid/src/mermaid.ts:431](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaid.ts#L431)
[packages/mermaid/src/mermaid.ts:425](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaid.ts#L425)

---

Expand All @@ -190,7 +190,7 @@ Error if the diagram is invalid and parseOptions.suppressErrors is false or not

#### Defined in

[packages/mermaid/src/mermaid.ts:425](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaid.ts#L425)
[packages/mermaid/src/mermaid.ts:419](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaid.ts#L419)

---

Expand Down Expand Up @@ -218,7 +218,7 @@ Used to register external diagram types.

#### Defined in

[packages/mermaid/src/mermaid.ts:439](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaid.ts#L439)
[packages/mermaid/src/mermaid.ts:433](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaid.ts#L433)

---

Expand All @@ -242,7 +242,7 @@ Used to register external diagram types.

#### Defined in

[packages/mermaid/src/mermaid.ts:438](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaid.ts#L438)
[packages/mermaid/src/mermaid.ts:432](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaid.ts#L432)

---

Expand All @@ -268,7 +268,7 @@ Used to register external diagram types.

#### Defined in

[packages/mermaid/src/mermaid.ts:432](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaid.ts#L432)
[packages/mermaid/src/mermaid.ts:426](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaid.ts#L426)

---

Expand Down Expand Up @@ -316,7 +316,7 @@ Renders the mermaid diagrams

#### Defined in

[packages/mermaid/src/mermaid.ts:437](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaid.ts#L437)
[packages/mermaid/src/mermaid.ts:431](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaid.ts#L431)

---

Expand Down Expand Up @@ -351,7 +351,7 @@ to it (eg. dart interop wrapper). (Initially there is no parseError member of me

#### Defined in

[packages/mermaid/src/mermaid.ts:442](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaid.ts#L442)
[packages/mermaid/src/mermaid.ts:436](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaid.ts#L436)

---

Expand All @@ -361,4 +361,4 @@ to it (eg. dart interop wrapper). (Initially there is no parseError member of me

#### Defined in

[packages/mermaid/src/mermaid.ts:424](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaid.ts#L424)
[packages/mermaid/src/mermaid.ts:418](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaid.ts#L418)
37 changes: 12 additions & 25 deletions docs/config/setup/interfaces/mermaid.MermaidConfig.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

#### Defined in

[packages/mermaid/src/config.type.ts:193](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L193)
[packages/mermaid/src/config.type.ts:194](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L194)

---

Expand All @@ -49,7 +49,7 @@ This matters if you are using base tag settings.

#### Defined in

[packages/mermaid/src/config.type.ts:199](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L199)
[packages/mermaid/src/config.type.ts:200](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L200)

---

Expand All @@ -59,7 +59,7 @@ This matters if you are using base tag settings.

#### Defined in

[packages/mermaid/src/config.type.ts:196](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L196)
[packages/mermaid/src/config.type.ts:197](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L197)

---

Expand Down Expand Up @@ -121,7 +121,7 @@ should not change unless content is changed.

#### Defined in

[packages/mermaid/src/config.type.ts:200](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L200)
[packages/mermaid/src/config.type.ts:201](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L201)

---

Expand Down Expand Up @@ -183,7 +183,7 @@ See <https://developer.mozilla.org/en-US/docs/Web/CSS/font-family>

#### Defined in

[packages/mermaid/src/config.type.ts:202](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L202)
[packages/mermaid/src/config.type.ts:203](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L203)

---

Expand Down Expand Up @@ -217,7 +217,7 @@ If set to true, ignores legacyMathML.

#### Defined in

[packages/mermaid/src/config.type.ts:195](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L195)
[packages/mermaid/src/config.type.ts:196](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L196)

---

Expand All @@ -243,19 +243,6 @@ Defines the seed to be used when using handDrawn look. This is important for the

---

### iconLibraries

`Optional` **iconLibraries**: ([`IconLibrary`](../modules/mermaid.md#iconlibrary) | `"aws:common"` | `"aws:full"` | `"github"` | `"digital-ocean"`)\[]

This option specifies an object contianing a mappig of SVG icon names to a resolver that returns the svg code.
For supported diagrams (i.e., Architecture), their syntax allows refering to key names in this object to display the corresponding SVG icon in the rendered diagram.

#### Defined in

[packages/mermaid/src/config.type.ts:152](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L152)

---

### journey

`Optional` **journey**: `JourneyDiagramConfig`
Expand Down Expand Up @@ -323,7 +310,7 @@ Defines which main look to use for the diagram.

#### Defined in

[packages/mermaid/src/config.type.ts:203](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L203)
[packages/mermaid/src/config.type.ts:204](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L204)

---

Expand Down Expand Up @@ -357,7 +344,7 @@ The maximum allowed size of the users text diagram

#### Defined in

[packages/mermaid/src/config.type.ts:194](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L194)
[packages/mermaid/src/config.type.ts:195](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L195)

---

Expand All @@ -367,7 +354,7 @@ The maximum allowed size of the users text diagram

#### Defined in

[packages/mermaid/src/config.type.ts:198](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L198)
[packages/mermaid/src/config.type.ts:199](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L199)

---

Expand Down Expand Up @@ -407,7 +394,7 @@ The maximum allowed size of the users text diagram

#### Defined in

[packages/mermaid/src/config.type.ts:197](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L197)
[packages/mermaid/src/config.type.ts:198](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L198)

---

Expand Down Expand Up @@ -478,7 +465,7 @@ This is useful when you want to control how to handle syntax errors in your appl

#### Defined in

[packages/mermaid/src/config.type.ts:209](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L209)
[packages/mermaid/src/config.type.ts:210](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L210)

---

Expand Down Expand Up @@ -531,7 +518,7 @@ You may also use `themeCSS` to override this value.

#### Defined in

[packages/mermaid/src/config.type.ts:201](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L201)
[packages/mermaid/src/config.type.ts:202](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/config.type.ts#L202)

---

Expand Down
8 changes: 4 additions & 4 deletions docs/config/setup/interfaces/mermaid.RunOptions.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ The nodes to render. If this is set, `querySelector` will be ignored.

#### Defined in

[packages/mermaid/src/mermaid.ts:54](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaid.ts#L54)
[packages/mermaid/src/mermaid.ts:48](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaid.ts#L48)

---

Expand All @@ -44,7 +44,7 @@ A callback to call after each diagram is rendered.

#### Defined in

[packages/mermaid/src/mermaid.ts:58](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaid.ts#L58)
[packages/mermaid/src/mermaid.ts:52](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaid.ts#L52)

---

Expand All @@ -56,7 +56,7 @@ The query selector to use when finding elements to render. Default: `".mermaid"`

#### Defined in

[packages/mermaid/src/mermaid.ts:50](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaid.ts#L50)
[packages/mermaid/src/mermaid.ts:44](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaid.ts#L44)

---

Expand All @@ -68,4 +68,4 @@ If `true`, errors will be logged to the console, but not thrown. Default: `false

#### Defined in

[packages/mermaid/src/mermaid.ts:62](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaid.ts#L62)
[packages/mermaid/src/mermaid.ts:56](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaid.ts#L56)
62 changes: 1 addition & 61 deletions docs/config/setup/modules/mermaid.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,41 +26,6 @@

## Type Aliases

### IconLibrary

Ƭ **IconLibrary**: `Record`<`string`, [`IconResolver`](mermaid.md#iconresolver)>

#### Defined in

[packages/mermaid/src/rendering-util/svgRegister.ts:7](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/svgRegister.ts#L7)

---

### IconResolver

Ƭ **IconResolver**: (`parent`: `Selection`<`SVGGElement`, `unknown`, `Element` | `null`, `unknown`>, `width?`: `number`) => `Selection`<`SVGGElement`, `unknown`, `Element` | `null`, `unknown`>

#### Type declaration

▸ (`parent`, `width?`): `Selection`<`SVGGElement`, `unknown`, `Element` | `null`, `unknown`>

##### Parameters

| Name | Type |
| :------- | :-------------------------------------------------------------------- |
| `parent` | `Selection`<`SVGGElement`, `unknown`, `Element` \| `null`, `unknown`> |
| `width?` | `number` |

##### Returns

`Selection`<`SVGGElement`, `unknown`, `Element` | `null`, `unknown`>

#### Defined in

[packages/mermaid/src/rendering-util/svgRegister.ts:3](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/svgRegister.ts#L3)

---

### InternalHelpers

Ƭ **InternalHelpers**: typeof `internalHelpers`
Expand Down Expand Up @@ -122,29 +87,4 @@

#### Defined in

[packages/mermaid/src/mermaid.ts:446](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaid.ts#L446)

## Functions

### createIcon

**createIcon**(`icon`, `originalSize`): [`IconResolver`](mermaid.md#iconresolver)

Converts an SVG Icon passed as a string into a properly formatted IconResolver

#### Parameters

| Name | Type | Description |
| :------------- | :------- | :-------------------------------------------------------------------------- |
| `icon` | `string` | html code for the svg icon as a string (the SVG tag should not be included) |
| `originalSize` | `number` | the original size of the SVG Icon in pixels |

#### Returns

[`IconResolver`](mermaid.md#iconresolver)

IconResolver

#### Defined in

[packages/mermaid/src/rendering-util/svgRegister.ts:15](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/rendering-util/svgRegister.ts#L15)
[packages/mermaid/src/mermaid.ts:440](https://github.com/mermaid-js/mermaid/blob/master/packages/mermaid/src/mermaid.ts#L440)
9 changes: 0 additions & 9 deletions packages/mermaid/src/config.type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -154,15 +154,6 @@ export interface MermaidConfig {
*
*/
legacyMathML?: boolean;
/**
* This option specifies an object contianing a mappig of SVG icon names to a resolver that returns the svg code.
* For supported diagrams (i.e., Architecture), their syntax allows refering to key names in this object to display the corresponding SVG icon in the rendered diagram.
*
*/
iconLibraries?: Array<
| import('./rendering-util/svgRegister.js').IconLibrary
| import('./rendering-util/svg/index.js').IconNamespaceKeys
>;
/**
* This option forces Mermaid to rely on KaTeX's own stylesheet for rendering MathML. Due to differences between OS
* fonts and browser's MathML implementation, this option is recommended if consistent rendering is important.
Expand Down
Loading

0 comments on commit bed6c5d

Please sign in to comment.