UNPKG

@visactor/vgrammar-wordcloud-shape

Version:

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

17 lines (16 loc) 1.16 kB
import type { CloudWordType, 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 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;