Skip to content

Docs/README update request: styles options #252

Open
@matthewshim-ms

Description

@matthewshim-ms

It would be nice to include a list of available SVG/styling properties are available for the links, nodes etc.

The docs provide an example in the Styling section:

links: {
     stroke: 'blue',
     strokeWidth: 1
}

Which is nice, but not all SVG/CSS properties seem to be available. In addition, the properties are not direct. For example, the above uses 'strokeWidth' in camel case, whereas official docs use 'stroke-width'.

**Edit: To clarify, I know that props for SVG specific attributes can be located in index.d.ts, for example:

...
 string?: number | string;
        stroke?: string;
        strokeDasharray?: string | number;
        strokeDashoffset?: string | number;
        strokeLinecap?: "butt" | "round" | "square" | "inherit";
        strokeLinejoin?: "miter" | "round" | "bevel" | "inherit";
        strokeMiterlimit?: number | string;
        strokeOpacity?: number | string;
        strokeWidth?: number | string;
        surfaceScale?: number | string;
        systemLanguage?: number | string;
        tableValues?: number | string;
        targetX?: number | string;
        targetY?: number | string;
        textAnchor?: string;
        textDecoration?: number | string;
        textLength?: number | string;
        textRendering?: number | string;
        to?: number | string;
        transform?: string;
...

But not all seem to apply, or at least the defaults overriding whatever I pass through.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions