SVG Table Type Reference(Core)

This page provides a comprehensive reference for all the types used in the SVG Table library. Click on a type name to jump to its description.

Table of Contents

Type Definitions

  • PrimitiveNode
    type PrimitiveNode = object;

    Represents a primitive node object.

  • Widths
    type Widths = | [number, number] /** top/bottom, left/right */ | [number, number, number, number] /** top, right, bottom, left */ | number; /** top/bottom/left/right */

    Represents widths for various elements, allowing for uniform or individual side specification.

  • ColorsOnWidth
    type ColorsOnWidth = | [string, string] // [top/bottom, left/right] | [string, string, string, string] // [top, right, bottom, left] | string; // single value

    Defines colors for borders, allowing for single, dual, or quad color specifications.

  • PatternArrays
    type PatternArrays = | [number[], number[]] // [top/bottom, left/right] | [number[], number[], number[], number[]] // [top, right, bottom, left] | number[] // single pattern | undefined; // no pattern

    Specifies dash patterns for borders, supporting various configurations for different sides.

  • PatternShape
    type PatternShape = SVGAttributes<SVGPathElement>['strokeLinecap'];

    Specifies the shape of the stroke caps for dashed borders.

  • PatternShapes
    type PatternShapes = | [PatternShape, PatternShape] // [top/bottom, left/right] | [PatternShape, PatternShape, PatternShape, PatternShape] // [top, right, bottom, left] | PatternShape; // single shape

    Defines stroke cap shapes for borders, with configurations for different sides.

  • BorderStyles
    type BorderStyles = { borderWidths: Widths; borderColors: ColorsOnWidth; borderPatterns: PatternArrays; borderShapes: PatternShapes; };

    Combines all border style properties into a single type.

  • TextHAlign
    type TextHAlign = 'left' | 'center' | 'right';

    Horizontal alignment options for text.

  • TextVAlign
    type TextVAlign = 'top' | 'center' | 'bottom';

    Vertical alignment options for text.

  • GroupProps
    type GroupProps = { x: number; y: number; width: number; height: number; };

    Properties for SVG group elements, including position and dimensions.

  • RowStyle
    type RowStyle = { height: number; bgColor?: string; };

    Style properties for table rows, including height and optional background color.

  • TableStyle
    type TableStyle = { margins: Widths; bgColor?: string; colGaps: number; rowGaps: number; svgStyle: HTMLAttributes<'svg'>['style']; } & Partial<BorderStyles>;

    Style properties for the table, including margins, gaps, and optional background color.

  • WidthPos
    type WidthPos = 'left' | 'right' | 'top' | 'bottom';

    Represents the position of a width value, used for specifying which side of an element a particular width applies to.