UNPKG

venny

Version:

Declarative Venn diagrams

15 lines (14 loc) 1.12 kB
import { Area, Circle, CircleMap, LayoutParameter } from '../interfaces'; /** given a list of set objects, and their corresponding overlaps. updates the (x, y, radius) attribute on each set such that their positions roughly correspond to the desired overlaps */ export declare function venn(areas: Area[], parameters?: LayoutParameter): CircleMap; /** Given a bunch of sets, and the desired overlaps between these sets - computes the distance from the actual overlaps to the desired overlaps. Note that this method ignores overlaps of more than 2 circles */ export declare function lossFunction(sets: CircleMap, overlaps: Area[]): number; export declare function normalizeSolution(solution: CircleMap, orientation: number | null, orientationOrder?: (a: Circle, b: Circle) => number): CircleMap; /** Scales a solution from venn.venn or venn.greedyLayout such that it fits in a rectangle of width/height - with padding around the borders. also centers the diagram in the available space at the same time */ export declare function scaleSolution(solution: CircleMap, width: number, height: number, padding: number): CircleMap;