UNPKG

@visactor/vgrammar-wordcloud-shape

Version:

Layout WordCloud in specified shape, this is a transform for VGrammar.

26 lines (25 loc) 1.49 kB
import type { CachedWordMeasure, CloudWordType, IWordMeasureCache, LayoutConfigType, SegmentationOutputType } from './interface'; export declare enum WORDCLOUD_SHAPE_HOOK_EVENT { BEFORE_WORDCLOUD_SHAPE_LAYOUT = "beforeWordcloudShapeLayout", AFTER_WORDCLOUD_SHAPE_LAYOUT = "afterWordcloudShapeLayout", AFTER_WORDCLOUD_SHAPE_DRAW = "afterWordcloudShapeDraw" } export declare class MapWordMeasureCache implements IWordMeasureCache { private _map; private _maxSize; constructor(maxSize?: number); get(key: string): CachedWordMeasure | undefined; set(key: string, value: CachedWordMeasure): void; clear(): void; size(): number; } export declare const colorListEqual: (arr0: string[], arr1: string[]) => boolean; export declare const fakeRandom: () => () => number; export declare const isChinese: (text: string) => boolean; export declare const calTextLength: (text: string, textLengthLimit?: number) => number; export declare function loadImage(url: string): Promise<unknown>; export declare function paintLabels(segmentationOutput: SegmentationOutputType): void; export declare function paint(board: number[], paintSize: [number, number]): void; export declare function draw(words: CloudWordType[], fillingWords: CloudWordType[], layoutConfig: LayoutConfigType, resizeFactor?: number): void; export declare function drawSpiral(spiral: any, center: [number, number], maxR: number, size: [number, number]): void; export declare function functor(d: any): any;