Class DiagramSettings

Diagram settings represent a collection of core and custom settings for a diagram.

Hierarchy

Constructors

Properties

_colors: Map<string, Map<ColorType, string>> = ...

Stores a collection of color settings grouped by context (type or module name).

_contextStrings: Map<string, Map<string, string>> = ...

Stores arbitrary string settings grouped by context (eg. some module, stencil type, etc.).

_fontFamily: Map<string, string> = ...

A collection of font family settings for different contexts (type or module names).

defaultBackgroundColor: string = '#fff'

Default background color.

defaultColor: string = '#000'

Default color.

defaultFillColor: string = '#ccc'

Default fill color.

defaultFontFamily: string = 'Helvetica, Arial, sans-serif'

Default font family.

defaultFontSize: FontSize = ...

Default font size.

defaultStrokeColor: string = ...

Default stroke (line) color.

defaultStrokeDasharray: string = ''

Default stroke dash array.

See

MDN stroke-dasharray docs for details.

defaultStrokeWidth: string = '1'

Default stroke width.

defaultTextColor: string = ...

Default text (font) color.

Methods

  • Returns a color setting by provided context and type of color.

    Parameters

    • context: string

      type or module name

    • type: ColorType

      color kind (text, fill, stroke, etc.)

    Returns string

    CSS color string for the context-type pair or the default color for the type.

  • Returns an arbitrary string setting for provided context and setting name.

    Example

    dashhArray = settings.getContextString('DiamondStencil', 'strokeDashArray');
    

    Parameters

    • context: string

      type or module name (or other context collection)

    • name: string

      setting name

    Returns undefined | string

    string setting for context-name pair or undefined, if not found.

  • Gets the stroke dash array setting for the provided type (context) or the default stroke dash array, if not found.

    Parameters

    • context: string

      type or module name (or other context)

    Returns string

    stroke dash array for the context or the defaultStrokeDasharray.

  • Returns special font family for the provided context or the default font family.

    Parameters

    • context: string

      type or module name (or other context)

    Returns string

    custom font family for the context or defaultFontFamily

  • Returns a custom font size for the specified context or the default font size.

    Parameters

    • context: string

      type or module name

    Returns FontSize

    custom font size or defaultFontSize

  • Returns stroke width for the specified context (type or module name) or the default stroke width.

    Parameters

    • context: string

      type or module name

    Returns string

    stroke width for the context or defaultStrokeWidth

  • Sets contextual color setting value.

    Parameters

    • context: string

      setting group (stencil or connector type, etc.)

    • type: ColorType

      type of color (text, stroke, fill, etc.)

    • color: string

      string color value.

    Returns void

  • Sets custom dash array for the provided context (type or module name).

    Parameters

    • context: string

      type or module name

    • value: string

      dash array value

    Returns void

  • Sets custom font family for the specified context.

    Parameters

    • context: string

      type or module name

    • value: string

      font family string

    Returns void

  • Sets custom font size for the supplied context.

    Parameters

    • context: string

      type or module name

    • value: FontSize

      font size value

    Returns void

  • Sets an arbitrary string setting for some context (type or module name) and setting name.

    Parameters

    • context: string

      type or module name (or some other context)

    • name: string

      setting name

    • value: string

      setting value

    Returns void

  • Sets custom stroke width for the provided context (type or module name).

    Parameters

    • context: string

      type or module name

    • value: string

      stroke width value

    Returns void

Generated using TypeDoc