Options
All
  • Public
  • Public/Protected
  • All
Menu

UpSet.js Bundle - v1.9.1

Index

Namespaces

Interfaces

Type aliases

Functions

Type aliases

ICategories

ICategories: readonly ICategory[]

ICategoryBins

ICategoryBins: readonly ICategoryBin[]

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, CSSStyleDeclaration, UpSetReactElement, string>

Type parameters

  • T = any

KarnaughMapProps

KarnaughMapProps<T>: KarnaughMapPropsG<T, CSSStyleDeclaration, UpSetReactElement, string>

Type parameters

  • T = any

NumericScaleTick

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

Type declaration

  • Optional label?: string
  • value: number

QuantilesMethod

QuantilesMethod: "hinges" | "fivenum" | "type7" | "quantiles" | "linear" | "lower" | "higher" | "nearest" | "midpoint"

SetCombinationType

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

UpSetAddon

UpSetAddon<T>: UpSetAddonImpl<ISetLike<T>, T, UpSetReactElement>

Type parameters

  • T

UpSetAddonHandlerInfos

UpSetAddonHandlerInfos: readonly (UpSetAddonHandlerInfo | null)[]

UpSetAddons

UpSetAddons<T>: readonly UpSetAddon<T>[]

Type parameters

  • T

UpSetCompressedIndices

UpSetCompressedIndices: readonly number[] | string

UpSetFullProps

UpSetFullProps<T>: UpSetFullPropsG<T, CSSStyleDeclaration, UpSetReactElement, string>

Type parameters

  • T = any

UpSetProps

UpSetProps<T>: UpSetPropsG<T, CSSStyleDeclaration, UpSetReactElement, string>

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

UpSetReactElement

UpSetReactElement: any

UpSetStyleClassNames

UpSetStyleClassNames: UpSetMultiStyle<string>

UpSetThemes

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

VennDiagramFullProps

VennDiagramFullProps<T>: VennDiagramFullPropsG<T, CSSStyleDeclaration, UpSetReactElement, string>

Type parameters

  • T = any

VennDiagramProps

VennDiagramProps<T>: VennDiagramPropsG<T, CSSStyleDeclaration, UpSetReactElement, string>

Type parameters

  • T = any

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

        • Parameters

          • s: S

          Returns ISets<T>

    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

boxplot

  • boxplot(data: readonly number[] | Float32Array | Float64Array, options?: BoxplotStatsOptions): IBoxPlot
  • Parameters

    Returns IBoxPlot

boxplotAddon

  • boxplotAddon<T>(prop: keyof T | ((v: T) => number), elems: readonly T[] | { max: number; min: number }, options?: Partial<Pick<UpSetAddon<T>, "size" | "position" | "name">> & IBoxplotStyleProps): UpSetAddon<T>
  • generates a boxplot addon to render box plots as UpSet.js addon for aggregated set data

    Type parameters

    • T

    Parameters

    • prop: keyof T | ((v: T) => number)

      accessor or name of the property within the element

    • elems: readonly T[] | { max: number; min: number }

      list of elements or their minimum / maximum value for specifying the data domain

    • options: Partial<Pick<UpSetAddon<T>, "size" | "position" | "name">> & IBoxplotStyleProps = ...

      additional options

    Returns UpSetAddon<T>

boxplotAggregatedAddon

  • boxplotAggregatedAddon<T>(acc: (v: readonly T[]) => IBoxPlot, domain: { max: number; min: number }, options?: Partial<Pick<UpSetAddon<T>, "size" | "position" | "name">> & IBoxplotStyleProps): UpSetAddon<T>
  • generates a boxplot addon to render box plots as UpSet.js addon for aggregated set data

    Type parameters

    • T

    Parameters

    • acc: (v: readonly T[]) => IBoxPlot

      accessor

        • (v: readonly T[]): IBoxPlot
        • Parameters

          • v: readonly T[]

          Returns IBoxPlot

    • domain: { max: number; min: number }
      • max: number
      • min: number
    • options: Partial<Pick<UpSetAddon<T>, "size" | "position" | "name">> & IBoxplotStyleProps = ...

      additional options

    Returns UpSetAddon<T>

categoricalAddon

  • generates a categorical addon to render categorical distribution as UpSet.js addon for aggregated set data

    Type parameters

    • T

    Parameters

    • prop: keyof T | ((v: T) => string)

      accessor or name of the property within the element

    • elems: readonly T[] | { categories: readonly (string | ICategory)[] }

      list of elements or their minimum / maximum value for specifying the data domain

    • options: Partial<Pick<UpSetAddon<T>, "size" | "position" | "name">> & ICategoricalStyleProps = ...

      additional options

    Returns UpSetAddon<T>

categoricalAggregatedAddon

categoricalHistogram

  • categoricalHistogram(values: readonly string[], categories: readonly (string | ICategory)[], base?: readonly string[], dark?: boolean): readonly ICategoryBin[]
  • Parameters

    • values: readonly string[]
    • categories: readonly (string | ICategory)[]
    • Optional base: readonly string[]
    • Optional dark: boolean

    Returns readonly ICategoryBin[]

createVennJSAdapter

  • createVennJSAdapter<O>(layout: IVennJSLayoutFunction<O>, options?: O): IVennDiagramLayoutGenerator
  • Type parameters

    • O: { height?: undefined | number; width?: undefined | number }

    Parameters

    • layout: IVennJSLayoutFunction<O>
    • Optional options: O

    Returns IVennDiagramLayoutGenerator

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>

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

fillKarnaughMapDefaults

fillVennDiagramDefaults

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>[]
      • 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: readonly readonly number[][] | string, 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: readonly readonly number[][] | string

      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

hydrate

  • hydrate<T>(node: HTMLElement, props: UpSetProps<T>): void
  • hydrates the UpSetJS component when applied on a server rendered version

    Type parameters

    • T = any

    Parameters

    • node: HTMLElement

      the DOM node to render the component into

    • props: UpSetProps<T>

      the properties of the component

    Returns void

hydrateKarnaughMap

  • hydrates the KarnaughMap component when applied on a server rendered version

    Type parameters

    • T = any

    Parameters

    • node: HTMLElement

      the DOM node to render the component into

    • props: KarnaughMapProps<T>

      the properties of the component

    Returns void

hydrateKarnaughMapSkeleton

  • hydrates the KarnaughMap Skeleton component when applied on a server rendered version

    Parameters

    • node: HTMLElement

      the DOM node to render the component into

    • props: UpSetJSSkeletonProps

      the properties of the component

    Returns void

hydrateSkeleton

  • hydrates the UpSetJS Skeleton component when applied on a server rendered version

    Parameters

    • node: HTMLElement

      the DOM node to render the component into

    • props: UpSetJSSkeletonProps

      the properties of the component

    Returns void

Const hydrateUpSet

  • hydrateUpSet<T>(node: HTMLElement, props: UpSetProps<T>): void
  • hydrates the UpSetJS component when applied on a server rendered version

    Type parameters

    • T = any

    Parameters

    • node: HTMLElement

      the DOM node to render the component into

    • props: UpSetProps<T>

      the properties of the component

    Returns void

hydrateVennDiagram

  • hydrates the VennDiagram component when applied on a server rendered version

    Type parameters

    • T = any

    Parameters

    • node: HTMLElement

      the DOM node to render the component into

    • props: VennDiagramProps<T>

      the properties of the component

    Returns void

hydrateVennDiagramSkeleton

  • hydrates the VennDiagram Skeleton component when applied on a server rendered version

    Parameters

    • node: HTMLElement

      the DOM node to render the component into

    • props: UpSetJSSkeletonProps

      the properties of the component

    Returns void

isCalcQuery

  • Type parameters

    • T

    Parameters

    Returns q is UpSetCalcQuery<T>

isElemQuery

  • Type parameters

    • T

    Parameters

    Returns q is UpSetElemQuery<T>

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

  • Type parameters

    • T

    Parameters

    Returns q is UpSetSetQuery<T>

isUpSetQuery

  • Parameters

    • v: any

    Returns v is UpSetQuery<any>

Const linearScale

Const logScale

mergeColors

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

    • colors: readonly (string | undefined)[]

    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

      • Parameters

        Returns readonly T[] | null

queryOverlap

render

  • render<T>(node: HTMLElement, props: UpSetProps<T>): void
  • renders the UpSetJS component

    Type parameters

    • T = any

    Parameters

    • node: HTMLElement

      the DOM node to render the component into

    • props: UpSetProps<T>

      the properties of the component

    Returns void

renderKarnaughMap

  • renders the KarnaughMap component

    Type parameters

    • T = any

    Parameters

    • node: HTMLElement

      the DOM node to render the component into

    • props: KarnaughMapProps<T>

      the properties of the component

    Returns void

renderKarnaughMapSkeleton

renderSkeleton

renderUpSet

  • renderUpSet<T>(node: HTMLElement, props: UpSetProps<T>): void
  • renders the UpSetJS component

    Type parameters

    • T = any

    Parameters

    • node: HTMLElement

      the DOM node to render the component into

    • props: UpSetProps<T>

      the properties of the component

    Returns void

renderVennDiagram

  • renders the VennDiagram component

    Type parameters

    • T = any

    Parameters

    • node: HTMLElement

      the DOM node to render the component into

    • props: VennDiagramProps<T>

      the properties of the component

    Returns void

renderVennDiagramSkeleton

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?: "no" | "yes" | "auto"; 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?: "no" | "yes" | "auto"; sortAble?: boolean }
      • Optional compress?: "no" | "yes" | "auto"
      • 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

  • toUpSetJSDump(dump: IUpSetDump, elements: readonly (number | string | any)[], props: Partial<UpSetProps<any>>, author?: string, mode?: "upset" | "venn" | "kmap"): IUpSetJSDump

toUpSetJSStaticDump