Options
All
  • Public
  • Public/Protected
  • All
Menu

UpSet.js React - v1.11.0

Index

References

Namespaces

Interfaces

Type aliases

Properties

Variables

Functions

References

default

Renames and re-exports UpSetJS

Type aliases

ISetCombination

union of all set combination types

Type parameters

  • T = any

ISetCombinations

ISetCombinations<T>: readonly ISetCombination<T>[]

readonly array of set combinations

Type parameters

  • T = any

ISetLike

ISetLike<T>: ISet<T> | ISetCombination<T>

union of a set or a set combination

Type parameters

  • T = any

ISetLikes

ISetLikes<T>: readonly ISetLike<T>[]

readonly array of set like objects

Type parameters

  • T = any

ISets

ISets<T>: readonly ISet<T>[]

readonly array of sets

Type parameters

  • T = any

KarnaughMapFullProps

KarnaughMapFullProps<T>: KarnaughMapFullPropsG<T, React.CSSProperties, React.ReactNode, React.ReactNode>

Type parameters

  • T = any

KarnaughMapProps

KarnaughMapProps<T>: KarnaughMapPropsG<T, React.CSSProperties, React.ReactNode, React.ReactNode>

Type parameters

  • T = any

NumericScaleTick

NumericScaleTick: { label?: string; value: number }

Type declaration

  • Optional label?: string
  • value: number

SetCombinationType

SetCombinationType: "intersection" | "union" | "composite" | "distinctIntersection"

UpSetAddonHandlerInfos

UpSetAddonHandlerInfos: readonly (UpSetAddonHandlerInfo | null)[]

UpSetAddons

UpSetAddons<S, T, N>: readonly UpSetAddon<S, T, N>[]

Type parameters

UpSetCompressedIndices

UpSetCompressedIndices: readonly number[] | string

UpSetExtraTheme

UpSetExtraTheme: { backgroundColor: string }

Type declaration

  • backgroundColor: string

UpSetFullProps

UpSetFullProps<T>: UpSetFullPropsG<T, React.CSSProperties, React.ReactNode, React.ReactNode>

Type parameters

  • T = any

UpSetProps

UpSetProps<T>: UpSetPropsG<T, React.CSSProperties, React.ReactNode, React.ReactNode>

Type parameters

  • T = any

UpSetQueries

UpSetQueries<T>: readonly UpSetQuery<T>[]

Type parameters

  • T = any

UpSetQuery

UpSetQuery<T>: UpSetElemQuery<T> | UpSetCalcQuery<T> | UpSetSetQuery<T>

Type parameters

  • T = any

UpSetSelection

UpSetSelection<T>: ISetLike<T> | null | readonly T[] | ((s: ISetLike<T>) => number)

Type parameters

  • T

UpSetStyleClassNames

UpSetStyleClassNames: UpSetMultiStyle<string>

UpSetThemes

UpSetThemes: "light" | "dark" | "vega"

VennDiagramFullProps

VennDiagramFullProps<T>: VennDiagramFullPropsG<T, React.CSSProperties, React.ReactNode, React.ReactNode>

Type parameters

  • T = any

VennDiagramProps

VennDiagramProps<T>: VennDiagramPropsG<T, React.CSSProperties, React.ReactNode, React.ReactNode>

Type parameters

  • T = any

Properties

KarnaughMap

KarnaughMap: <T>(p: KarnaughMapProps<T> & RefAttributes<SVGSVGElement>) => ReactElement<any, string | JSXElementConstructor<any>>

Type declaration

    • <T>(p: KarnaughMapProps<T> & RefAttributes<SVGSVGElement>): ReactElement<any, string | JSXElementConstructor<any>>
    • Type parameters

      • T

      Parameters

      Returns ReactElement<any, string | JSXElementConstructor<any>>

UpSetJS

UpSetJS: <T>(p: UpSetProps<T> & RefAttributes<SVGSVGElement>) => ReactElement<any, string | JSXElementConstructor<any>>

Type declaration

VennDiagram

VennDiagram: <T>(p: VennDiagramProps<T> & RefAttributes<SVGSVGElement>) => ReactElement<any, string | JSXElementConstructor<any>>

Type declaration

    • <T>(p: VennDiagramProps<T> & RefAttributes<SVGSVGElement>): ReactElement<any, string | JSXElementConstructor<any>>
    • Type parameters

      • T

      Parameters

      Returns ReactElement<any, string | JSXElementConstructor<any>>

Variables

KarnaughMapSkeleton

KarnaughMapSkeleton: FC<UpSetJSSkeletonProps & RefAttributes<SVGSVGElement>> = ...

KV Diagram Skeleton a simple KarnaughMap skeleton

with React.forwardRef support to specify a reference to the SVG element

SET_JOINERS

SET_JOINERS: { composite: string; distinctIntersection: string; intersection: string; union: string }
upsetjs/model

https://github.com/upsetjs/upsetjs

Copyright (c) 2021 Samuel Gratzl sam@sgratzl.com

Type declaration

  • composite: string
  • distinctIntersection: string
  • intersection: string
  • union: string

UpSetJSSkeleton

UpSetJSSkeleton: FC<UpSetJSSkeletonProps & RefAttributes<SVGSVGElement>> = ...

UpSetJS Skeleton a simple UpSetJS skeleton

with React.forwardRef support to specify a reference to the SVG element

VennDiagramSkeleton

VennDiagramSkeleton: FC<UpSetJSSkeletonProps & RefAttributes<SVGSVGElement>> = ...

VennDiagram Skeleton a simple VennDiagram skeleton

with React.forwardRef support to specify a reference to the SVG element

Functions

asCombination

  • helper to create a proper data structures for UpSet.js sets by adding extra properties

    Type parameters

    • T

    • S: { elems: readonly T[]; name: string }

    Parameters

    Returns S & ISetCombination<T>

asCombinations

  • helper to create a proper data structures for UpSet.js sets by adding extra properties

    Type parameters

    • T

    • S: { elems: readonly T[]; name: string }

    Parameters

    • sets: readonly S[]

      set like structures

    • type: SetCombinationType

      hint for the type of combinations

    • toSets: (s: S) => ISets<T>

      resolver of the contained sets

    Returns (S & ISetCombination<T>)[]

asSet

  • asSet<T, S>(set: S): S & ISet<T>
  • helper method to create proper UpSet.js structures by adding extra properties

    Type parameters

    • T

    • S: { elems: readonly T[]; name: string }

    Parameters

    • set: S

      the set to complete

    Returns S & ISet<T>

asSets

  • helper to create a proper data structures for UpSet.js sets by adding extra properties

    Type parameters

    • T

    • S: { elems: readonly T[]; name: string }

    Parameters

    • sets: readonly S[]

      set like structures

    • Optional options: PostprocessSetOptions

      additional postprocessing options

    Returns (S & ISet<T>)[]

Const bandScale

  • bandScale(domain: string[], size: number, padding: number): BandScaleLike
  • Parameters

    • domain: string[]
    • size: number
    • padding: number

    Returns BandScaleLike

createVennJSAdapter

downloadUrl

  • downloadUrl(url: string, title: string, doc: Document): void
  • helper method to download a given url in the browser

    Parameters

    • url: string

      the url to download

    • title: string

      the desired file name

    • doc: Document

      the root document

    Returns void

exportSVG

  • exportSVG(node: SVGSVGElement, options: { title?: string; toRemove?: string; type?: "png" | "svg" }): Promise<void>
  • helper method to export an download an SVG image

    Parameters

    • node: SVGSVGElement

      the SVG element to download

    • options: { title?: string; toRemove?: string; type?: "png" | "svg" }

      additional options

      • Optional title?: string
      • Optional toRemove?: string
      • Optional type?: "png" | "svg"

    Returns Promise<void>

exportVegaLite

  • exportVegaLite(svg: SVGSVGElement, __namedParameters?: { title?: string }): void

extractCombinations

  • extract sets out of a given element array, where an accessor is used to specify the set names

    Type parameters

    • T

    Parameters

    • elements: readonly T[]

      list of elements

    • acc: (elem: T) => string[]

      accessor to get the list of sets the element belong to

        • (elem: T): string[]
        • Parameters

          • elem: T

          Returns string[]

    • Optional options: ExtractCombinationsOptions<T>

      postprocess options

    Returns { combinations: ISetCombinations<T>; sets: ISets<T> }

  • extract sets out of a given element array which have a .sets property

    Type parameters

    • T: { sets: string[] }

    Parameters

    Returns { combinations: ISetCombinations<T>; sets: ISets<T> }

extractFromExpression

  • extract sets and combinations out of a given list of static combination information. In addition an accessor is used to specify the set names

    Type parameters

    • T: { cardinality: number }

    Parameters

    • combinations: readonly T[]

      list of combinations

    • accessor: (elem: T) => string[]

      accessor to get the list of sets the combination belong to

        • (elem: T): string[]
        • Parameters

          • elem: T

          Returns string[]

    • Optional options: ExtractFromExpressionOptions

      hints about the given combinations

    Returns { combinations: readonly (T & ISetCombination<unknown>)[]; sets: ISets<unknown> }

  • extract sets out of a given element array which have a .sets property

    Type parameters

    • T: { cardinality: number; sets: string[] }

    Parameters

    Returns { combinations: readonly (T & ISetCombination<unknown>)[]; sets: ISets<unknown> }

extractSets

  • extract sets out of a given element array, where an accessor is used to specify the set names

    Type parameters

    • T

    Parameters

    • elements: readonly T[]

      list of elements

    • acc: (elem: T) => string[]

      accessor to get the list of sets the element belong to

        • (elem: T): string[]
        • Parameters

          • elem: T

          Returns string[]

    • Optional options: PostprocessSetOptions

      postprocess options

    Returns ISets<T>

  • extract sets out of a given element array which have a .sets property

    Type parameters

    • T: { sets: string[] }

    Parameters

    Returns ISets<T>

fillDefaults

fillDefaultsG

fillKarnaughMapDefaults

fillKarnaughMapDefaultsG

fillVennDiagramDefaults

fillVennDiagramDefaultsG

fromDump

fromIndicesArray

  • fromIndicesArray<T>(indices: string | readonly number[], elements: readonly T[]): readonly T[]
  • reverse operation of toIndicesArray by supporting compressed indices notation

    Type parameters

    • T

    Parameters

    • indices: string | readonly number[]

      the (compressed) indices

    • elements: readonly T[]

      the elements to refer by index

    Returns readonly T[]

fromSetName

  • fromSetName<T>(sets: ISets<T>, symbol?: RegExp): (s: { name: string }) => ISet<T>[]
  • helper method to extract the sets in a set combination from its name, e.g. S1&S2 => S1,S2

    Type parameters

    • T

    Parameters

    • sets: ISets<T>

      the list of possible sets

    • Optional symbol: RegExp

      the regex to split a name

    Returns (s: { name: string }) => ISet<T>[]

      • (s: { name: string }): ISet<T>[]
      • helper method to extract the sets in a set combination from its name, e.g. S1&S2 => S1,S2

        Parameters

        • s: { name: string }
          • name: string

        Returns ISet<T>[]

fromStaticDump

generateCombinations

  • generate set intersection/unions for a given list of sets

    Type parameters

    • T = any

    Parameters

    Returns ISetCombinations<T>

generateDistinctOverlapFunction

generateIntersectionOverlapFunction

generateOverlapFunction

generateOverlapLookup

  • generate a (compressed) overlap lookup matrix that can be dumped and later used to lookup overlaps

    Type parameters

    • T

    Parameters

    Returns readonly readonly number[][] | string

generateOverlapLookupFunction

  • generateOverlapLookupFunction<T>(matrix: string | readonly readonly number[][], sets: ISets<T>, combinations: ISetCombinations<T>, toKey?: (v: ISetLike<T>) => string): { combinationIndex: Map<string, number>; compute: ISetOverlapFunction<T>; setIndex: Map<string, number> }
  • uses the given overlap lookup function to generate a compute and indices functions

    Type parameters

    • T

    Parameters

    • matrix: string | readonly readonly number[][]

      the compressed overlap matrix

    • sets: ISets<T>

      the sets of the plot

    • combinations: ISetCombinations<T>

      the set combinations of the plot

    • Optional toKey: (v: ISetLike<T>) => string

    Returns { combinationIndex: Map<string, number>; compute: ISetOverlapFunction<T>; setIndex: Map<string, number> }

    • combinationIndex: Map<string, number>
    • compute: ISetOverlapFunction<T>
    • setIndex: Map<string, number>

generateUnionOverlapFunction

getDefaultTheme

isCalcQuery

isElemQuery

isEllipse

isGenerateSetCombinationOptions

isSet

  • isSet(v: any): v is ISet<any>

isSetCombination

  • Parameters

    • v: any

    Returns v is ISetCombination<any>

isSetLike

  • Parameters

    • v: any

    Returns v is ISetLike<any>

isSetQuery

isUpSetQuery

  • Parameters

    • v: any

    Returns v is UpSetQuery<any>

Const linearScale

Const logScale

mergeColors

  • mergeColors(colors: readonly (undefined | string)[]): string | undefined
  • Parameters

    • colors: readonly (undefined | string)[]

    Returns string | undefined

parseColor

  • parseColor(color?: string): [number, number, number]
  • Parameters

    • Optional color: string

    Returns [number, number, number]

queryElemOverlap

  • helper method to create an overlap function of elements for a given query

    Type parameters

    • T

    Parameters

    • query: UpSetQuery<T>

      the query

    • what: keyof SetElemOverlap<T>

      type of overlap

    • Optional toElemKey: (e: T) => string

      optional key function

        • (e: T): string
        • Parameters

          • e: T

          Returns string

    Returns (s: ISetLike<T>) => readonly T[] | null

      • helper method to create an overlap function of elements for a given query

        Parameters

        Returns readonly T[] | null

queryOverlap

  • helper method to create an overlap function for a given query

    Type parameters

    • T

    Parameters

    • query: UpSetQuery<T>

      the query

    • what: keyof SetOverlap

      type of overlap

    • Optional toElemKey: (e: T) => string

      optional key function

        • (e: T): string
        • Parameters

          • e: T

          Returns string

    Returns (s: ISetLike<T> | readonly T[]) => number

      • helper method to create an overlap function for a given query

        Parameters

        Returns number

setElemIntersectionFactory

  • setElemIntersectionFactory<T>(a: Set<T> | readonly T[], toElemKey?: (e: T) => string): (b: Set<T> | readonly T[]) => readonly T[]
  • Type parameters

    • T

    Parameters

    • a: Set<T> | readonly T[]
    • Optional toElemKey: (e: T) => string
        • (e: T): string
        • Parameters

          • e: T

          Returns string

    Returns (b: Set<T> | readonly T[]) => readonly T[]

      • (b: Set<T> | readonly T[]): readonly T[]
      • Parameters

        • b: Set<T> | readonly T[]

        Returns readonly T[]

setElemOverlap

  • setElemOverlap<T>(a: Set<T> | readonly T[], b: Set<T> | readonly T[], toElemKey?: (e: T) => string): SetElemOverlap<T>
  • Type parameters

    • T

    Parameters

    • a: Set<T> | readonly T[]
    • b: Set<T> | readonly T[]
    • Optional toElemKey: (e: T) => string
        • (e: T): string
        • Parameters

          • e: T

          Returns string

    Returns SetElemOverlap<T>

setElemOverlapFactory

  • setElemOverlapFactory<T>(a: Set<T> | readonly T[], toElemKey?: (e: T) => string): (b: Set<T> | readonly T[]) => SetElemOverlap<T>
  • Type parameters

    • T

    Parameters

    • a: Set<T> | readonly T[]
    • Optional toElemKey: (e: T) => string
        • (e: T): string
        • Parameters

          • e: T

          Returns string

    Returns (b: Set<T> | readonly T[]) => SetElemOverlap<T>

setOverlap

  • setOverlap<T>(a: Set<T> | readonly T[], b: Set<T> | readonly T[], toElemKey?: (e: T) => string): SetOverlap
  • Type parameters

    • T

    Parameters

    • a: Set<T> | readonly T[]
    • b: Set<T> | readonly T[]
    • Optional toElemKey: (e: T) => string
        • (e: T): string
        • Parameters

          • e: T

          Returns string

    Returns SetOverlap

setOverlapFactory

  • setOverlapFactory<T>(a: Set<T> | readonly T[], toElemKey?: (e: T) => string): (b: Set<T> | readonly T[]) => SetOverlap
  • Type parameters

    • T

    Parameters

    • a: Set<T> | readonly T[]
    • Optional toElemKey: (e: T) => string
        • (e: T): string
        • Parameters

          • e: T

          Returns string

    Returns (b: Set<T> | readonly T[]) => SetOverlap

toDump

toIndicesArray

  • toIndicesArray<T>(arr: readonly T[], toIndex: (v: T) => number, __namedParameters?: { compress?: "auto" | "no" | "yes"; sortAble?: boolean }): string | readonly number[]
  • creates an (compressed) indices array for the given array of elements

    Type parameters

    • T

    Parameters

    • arr: readonly T[]

      the array to compress

    • toIndex: (v: T) => number

      the element to index function

        • (v: T): number
        • Parameters

          • v: T

          Returns number

    • Optional __namedParameters: { compress?: "auto" | "no" | "yes"; sortAble?: boolean }
      • Optional compress?: "auto" | "no" | "yes"
      • Optional sortAble?: boolean

    Returns string | readonly number[]

toKey

  • helper method to generate a key for a given set

    Parameters

    • s: ISetLike<any>

      the set to compute the key for

    Returns string

toStaticDump

toUpSetJSDump

toUpSetJSStaticDump