squarified 0.4.0 → 0.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/dom-event-BLJt9knO.mjs +1646 -0
- package/dist/dom-event-CeVZ44nB.js +1686 -0
- package/dist/index-BoUEaWVv.d.ts +520 -0
- package/dist/index.d.mts +1 -620
- package/dist/index.d.ts +1 -620
- package/dist/index.js +113 -100
- package/dist/index.mjs +82 -69
- package/dist/plugin.d.mts +74 -427
- package/dist/plugin.d.ts +74 -427
- package/dist/plugin.js +451 -372
- package/dist/plugin.mjs +440 -362
- package/package.json +9 -6
- package/dist/dom-event-BPqG0KO2.js +0 -1712
- package/dist/dom-event-DQ8OFrZa.mjs +0 -1471
package/dist/plugin.d.mts
CHANGED
|
@@ -1,431 +1,78 @@
|
|
|
1
|
-
|
|
2
|
-
type Any = any
|
|
1
|
+
import { P as PluginContext, D as DOMEventType, a as DOMEventMetadata, L as LayoutModule, b as DOMEvent, C as ColorMappings, B as BasicTreemapInstance } from './index-BoUEaWVv.js';
|
|
3
2
|
|
|
4
|
-
|
|
3
|
+
declare const presetHighlightPlugin: {
|
|
4
|
+
name: "treemap:preset-highlight";
|
|
5
|
+
onLoad(this: PluginContext): void;
|
|
6
|
+
onDOMEventTriggered<N extends DOMEventType>(this: PluginContext, name: N, _: DOMEventMetadata<N>, module: LayoutModule | null, { stateManager: state, matrix }: DOMEvent): void;
|
|
7
|
+
onResize(this: PluginContext): void;
|
|
8
|
+
onDispose(this: PluginContext): void;
|
|
9
|
+
meta: {
|
|
10
|
+
highlight: null;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
5
13
|
|
|
6
|
-
|
|
14
|
+
declare const presetDragElementPlugin: {
|
|
15
|
+
name: "treemap:preset-drag-element";
|
|
16
|
+
onDOMEventTriggered<N extends DOMEventType>(this: PluginContext, name: N, event: DOMEventMetadata<N>, module: LayoutModule | null, domEvent: DOMEvent): void;
|
|
17
|
+
meta: {
|
|
18
|
+
dragOptions: {
|
|
19
|
+
x: number;
|
|
20
|
+
y: number;
|
|
21
|
+
lastX: number;
|
|
22
|
+
lastY: number;
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
onResize(this: PluginContext, { matrix, stateManager: state }: DOMEvent): void;
|
|
26
|
+
};
|
|
7
27
|
|
|
28
|
+
declare const presetColorPlugin: {
|
|
29
|
+
name: "treemap:preset-color";
|
|
30
|
+
onModuleInit(this: PluginContext, modules: LayoutModule[]): {
|
|
31
|
+
colorMappings: ColorMappings;
|
|
32
|
+
};
|
|
33
|
+
};
|
|
8
34
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
weight: number;
|
|
54
|
-
};
|
|
55
|
-
|
|
56
|
-
declare type CascadedPluginHooks = Pick<PluginHooks, 'onModuleInit'>;
|
|
57
|
-
|
|
58
|
-
declare type ColorDecoratorResult = ColorDecoratorResultHLS | ColorDecoratorResultRGB;
|
|
59
|
-
|
|
60
|
-
declare interface ColorDecoratorResultHLS {
|
|
61
|
-
mode?: 'hsl';
|
|
62
|
-
desc: HLSColor;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
declare interface ColorDecoratorResultRGB {
|
|
66
|
-
mode: 'rgb';
|
|
67
|
-
desc: RGBColor;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
declare type ColorMappings = Record<string, ColorDecoratorResult>;
|
|
71
|
-
|
|
72
|
-
declare class Component extends Schedule {
|
|
73
|
-
pluginDriver: PluginDriver<Component>;
|
|
74
|
-
data: NativeModule[];
|
|
75
|
-
colorMappings: ColorMappings;
|
|
76
|
-
rectLayer: Box;
|
|
77
|
-
textLayer: Box;
|
|
78
|
-
layoutNodes: LayoutModule[];
|
|
79
|
-
config: GraphicConfig;
|
|
80
|
-
caches: DefaultMap<string, number>;
|
|
81
|
-
constructor(config: GraphicConfig, ...args: ConstructorParameters<typeof Schedule>);
|
|
82
|
-
private drawBroundRect;
|
|
83
|
-
private drawText;
|
|
84
|
-
draw(flush?: boolean, update?: boolean): void;
|
|
85
|
-
cleanup(): void;
|
|
86
|
-
calculateLayoutNodes(data: NativeModule[], rect: Parameters<typeof squarify>[1], scale?: number): LayoutModule[];
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
declare type DefaultEventDefinition = Record<string, EventCallback>;
|
|
90
|
-
|
|
91
|
-
declare class DefaultMap<K, V> extends Map<K, V> {
|
|
92
|
-
private defaultFactory;
|
|
93
|
-
constructor(defaultFactory: () => V, entries?: readonly [K, V][] | null);
|
|
94
|
-
get(key: K): V;
|
|
95
|
-
getOrInsert(key: K, value?: V): V;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
declare abstract class Display {
|
|
99
|
-
parent: Display | null;
|
|
100
|
-
id: number;
|
|
101
|
-
matrix: Matrix2D;
|
|
102
|
-
abstract get __instanceOf__(): DisplayType;
|
|
103
|
-
constructor();
|
|
104
|
-
destory(): void;
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
declare const enum DisplayType {
|
|
108
|
-
Graph = "Graph",
|
|
109
|
-
Box = "Box",
|
|
110
|
-
Text = "Text",
|
|
111
|
-
RoundRect = "RoundRect",
|
|
112
|
-
Bitmap = "Bitmap"
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
declare const DOM_EVENTS: readonly ["click", "mousedown", "mousemove", "mouseup", "mouseover", "mouseout", "wheel", "contextmenu"];
|
|
116
|
-
|
|
117
|
-
declare class DOMEvent extends Event_2<DOMEVEntDefinition> {
|
|
118
|
-
domEvents: Array<ReturnType<typeof bindDOMEvent>>;
|
|
119
|
-
el: HTMLElement | null;
|
|
120
|
-
currentModule: LayoutModule | null;
|
|
121
|
-
component: Component;
|
|
122
|
-
matrix: Matrix2D;
|
|
123
|
-
stateManager: StateManager;
|
|
124
|
-
constructor(component: Component);
|
|
125
|
-
destory(): void;
|
|
126
|
-
private dispatch;
|
|
127
|
-
findRelativeNode(e: DOMEventMetadata): LayoutModule | null;
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
declare type DOMEventCallback<T extends DOMEventType> = (metadata: DOMEventMetadata<T>) => void;
|
|
131
|
-
|
|
132
|
-
declare type DOMEVEntDefinition<API = unknown> = {
|
|
133
|
-
[K in DOMEventType]: BindThisParameter<DOMEventCallback<K>, API>;
|
|
134
|
-
} & {
|
|
135
|
-
__exposed__: (type: DOMEventType, metadata: PrimitiveEventMetadata<DOMEventType>) => void;
|
|
136
|
-
};
|
|
137
|
-
|
|
138
|
-
declare interface DOMEventMetadata<T extends keyof HTMLElementEventMap = Any> {
|
|
139
|
-
native: HTMLElementEventMap[T];
|
|
140
|
-
readonly kind: T;
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
declare type DOMEventType = typeof DOM_EVENTS[number];
|
|
144
|
-
|
|
145
|
-
declare class Event_2<EvtDefinition extends DefaultEventDefinition = DefaultEventDefinition> {
|
|
146
|
-
eventCollections: EventCollections<EvtDefinition>;
|
|
147
|
-
constructor();
|
|
148
|
-
on<C, Evt extends keyof EvtDefinition>(evt: Evt, handler: BindThisParameter<EvtDefinition[Evt], unknown extends C ? this : C>, c?: C): void;
|
|
149
|
-
off(evt: keyof EvtDefinition, handler?: BindThisParameter<EvtDefinition[keyof EvtDefinition], unknown>): void;
|
|
150
|
-
silent(evt: keyof EvtDefinition, handler?: BindThisParameter<EvtDefinition[keyof EvtDefinition], unknown>): void;
|
|
151
|
-
active(evt: keyof EvtDefinition, handler?: BindThisParameter<EvtDefinition[keyof EvtDefinition], unknown>): void;
|
|
152
|
-
emit(evt: keyof EvtDefinition, ...args: Parameters<EvtDefinition[keyof EvtDefinition]>): void;
|
|
153
|
-
bindWithContext<C>(c: C): (evt: keyof EvtDefinition, handler: BindThisParameter<EvtDefinition[keyof EvtDefinition], unknown extends C ? this : C>) => void;
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
declare type EventCallback<P = Any[]> = P extends Any[] ? (...args: P) => Any : never;
|
|
157
|
-
|
|
158
|
-
declare interface EventCollectionData<EvtDefinition extends DefaultEventDefinition, C = unknown> {
|
|
159
|
-
name: string;
|
|
160
|
-
handler: BindThisParameter<EvtDefinition[keyof EvtDefinition], C>;
|
|
161
|
-
ctx: C;
|
|
162
|
-
silent: boolean;
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
declare type EventCollections<EvtDefinition extends DefaultEventDefinition> = Record<keyof EvtDefinition, EventCollectionData<EvtDefinition>[]>;
|
|
166
|
-
|
|
167
|
-
declare interface GraphicConfig {
|
|
168
|
-
layout?: GraphicLayout;
|
|
169
|
-
font?: GraphicFont;
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
declare interface GraphicFont {
|
|
173
|
-
color?: string;
|
|
174
|
-
fontSize?: Series<number>;
|
|
175
|
-
family?: string;
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
declare interface GraphicLayout {
|
|
179
|
-
rectRadius?: number;
|
|
180
|
-
rectGap?: number;
|
|
181
|
-
titleAreaHeight?: Series<number>;
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
declare interface HLSColor {
|
|
185
|
-
h: number;
|
|
186
|
-
l: number;
|
|
187
|
-
s: number;
|
|
188
|
-
a?: number;
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
declare interface LayoutModule {
|
|
192
|
-
node: SquarifiedModule;
|
|
193
|
-
layout: [number, number, number, number];
|
|
194
|
-
children: LayoutModule[];
|
|
195
|
-
config: {
|
|
196
|
-
titleAreaHeight: number;
|
|
197
|
-
rectGap: number;
|
|
198
|
-
rectRadius: number;
|
|
199
|
-
};
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
declare class Matrix2D implements MatrixLoc {
|
|
203
|
-
a: number;
|
|
204
|
-
b: number;
|
|
205
|
-
c: number;
|
|
206
|
-
d: number;
|
|
207
|
-
e: number;
|
|
208
|
-
f: number;
|
|
209
|
-
constructor(loc?: Partial<MatrixLoc>);
|
|
210
|
-
create(loc: MatrixLoc): this;
|
|
211
|
-
transform(x: number, y: number, scaleX: number, scaleY: number, rotation: number, skewX: number, skewY: number): this;
|
|
212
|
-
translation(x: number, y: number): this;
|
|
213
|
-
scale(a: number, d: number): this;
|
|
214
|
-
private skew;
|
|
215
|
-
private roate;
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
declare interface MatrixLoc {
|
|
219
|
-
a: number;
|
|
220
|
-
b: number;
|
|
221
|
-
c: number;
|
|
222
|
-
d: number;
|
|
223
|
-
e: number;
|
|
224
|
-
f: number;
|
|
225
|
-
}
|
|
226
|
-
|
|
227
|
-
declare type Module = ReturnType<typeof c2m>;
|
|
228
|
-
|
|
229
|
-
declare type NativeModule = ReturnType<typeof bindParentForModule>[number] & {
|
|
230
|
-
id: string;
|
|
231
|
-
parent: NativeModule | null;
|
|
232
|
-
groups: NativeModule[];
|
|
233
|
-
};
|
|
234
|
-
|
|
235
|
-
declare interface OnModuleInitResult {
|
|
236
|
-
colorMappings?: ColorMappings;
|
|
237
|
-
}
|
|
238
|
-
|
|
239
|
-
declare interface Plugin_2<T = string, M = Any> extends PluginHooks {
|
|
240
|
-
name: T;
|
|
241
|
-
meta?: M;
|
|
242
|
-
}
|
|
243
|
-
|
|
244
|
-
declare interface PluginContext {
|
|
245
|
-
resolveModuleById: (id: string) => LayoutModule | null;
|
|
246
|
-
getPluginMetadata: <M = Any>(pluginName: string) => M | null;
|
|
247
|
-
get instance(): Component;
|
|
248
|
-
}
|
|
249
|
-
|
|
250
|
-
declare class PluginDriver<T extends Component> {
|
|
251
|
-
private plugins;
|
|
252
|
-
private pluginContext;
|
|
253
|
-
constructor(component: T);
|
|
254
|
-
use(plugin: Plugin_2): void;
|
|
255
|
-
runHook<K extends keyof BasicPluginHooks>(hookName: K, ...args: Parameters<NonNullable<BasicPluginHooks[K]>>): void;
|
|
256
|
-
cascadeHook<K extends keyof CascadedPluginHooks>(hookName: K, ...args: Parameters<NonNullable<CascadedPluginHooks[K]>>): ReturnType<NonNullable<CascadedPluginHooks[K]>>;
|
|
257
|
-
getPluginMetadata<M = Any>(pluginName: string): M | null;
|
|
258
|
-
}
|
|
259
|
-
|
|
260
|
-
declare interface PluginHooks {
|
|
261
|
-
onLoad?: (this: PluginContext, treemapContext: BasicTreemapInstance, domEvent: DOMEvent) => void | Record<string, Any>;
|
|
262
|
-
onModuleInit?: (this: PluginContext, modules: LayoutModule[]) => OnModuleInitResult | void;
|
|
263
|
-
onDOMEventTriggered?: <N extends DOMEventType>(this: PluginContext, name: N, event: DOMEventMetadata<N>, module: LayoutModule | null, domEvent: DOMEvent) => void;
|
|
264
|
-
onResize?: (this: PluginContext, domEvent: DOMEvent) => void;
|
|
265
|
-
onDispose?: (this: PluginContext) => void;
|
|
266
|
-
}
|
|
267
|
-
|
|
268
|
-
export declare const presetColorPlugin: {
|
|
269
|
-
name: "treemap:preset-color";
|
|
270
|
-
onModuleInit(this: PluginContext, modules: LayoutModule[]): {
|
|
271
|
-
colorMappings: ColorMappings;
|
|
272
|
-
};
|
|
273
|
-
};
|
|
274
|
-
|
|
275
|
-
export declare const presetDragElementPlugin: {
|
|
276
|
-
name: "treemap:preset-drag-element";
|
|
277
|
-
onDOMEventTriggered<N extends DOMEventType>(this: PluginContext, name: N, event: DOMEventMetadata<N>, module: LayoutModule | null, domEvent: DOMEvent): void;
|
|
278
|
-
meta: {
|
|
279
|
-
dragOptions: {
|
|
280
|
-
x: number;
|
|
281
|
-
y: number;
|
|
282
|
-
lastX: number;
|
|
283
|
-
lastY: number;
|
|
284
|
-
};
|
|
285
|
-
};
|
|
286
|
-
onResize(this: PluginContext, { matrix, stateManager: state }: DOMEvent): void;
|
|
287
|
-
};
|
|
288
|
-
|
|
289
|
-
export declare const presetHighlightPlugin: {
|
|
290
|
-
name: "treemap:preset-highlight";
|
|
291
|
-
onLoad(this: PluginContext): void;
|
|
292
|
-
onDOMEventTriggered<N extends DOMEventType>(this: PluginContext, name: N, _: DOMEventMetadata<N>, module: LayoutModule | null, { stateManager: state, matrix }: DOMEvent): void;
|
|
293
|
-
onResize(this: PluginContext): void;
|
|
294
|
-
onDispose(this: PluginContext): void;
|
|
295
|
-
meta: {
|
|
296
|
-
highlight: null;
|
|
297
|
-
};
|
|
298
|
-
};
|
|
299
|
-
|
|
300
|
-
export declare function presetScalePlugin(options?: ScalePluginOptions): {
|
|
301
|
-
name: "treemap:preset-scale";
|
|
302
|
-
onDOMEventTriggered<N extends DOMEventType>(this: PluginContext, _: N, event: DOMEventMetadata<N>, module: LayoutModule | null, evt: DOMEvent): void;
|
|
303
|
-
meta: {
|
|
304
|
-
scaleOptions: {
|
|
305
|
-
scale: number;
|
|
306
|
-
minScale: number;
|
|
307
|
-
maxScale: number;
|
|
308
|
-
scaleFactor: number;
|
|
309
|
-
};
|
|
310
|
-
};
|
|
311
|
-
onResize(this: PluginContext, { matrix, stateManager: state }: DOMEvent): void;
|
|
312
|
-
};
|
|
313
|
-
|
|
314
|
-
export declare const presetZoomablePlugin: {
|
|
315
|
-
name: "treemap:preset-zoomable";
|
|
316
|
-
onLoad(this: PluginContext, treemap: BasicTreemapInstance, { stateManager: state, matrix }: DOMEvent): BasicTreemapInstance & {
|
|
317
|
-
zoom: (id: string) => void;
|
|
318
|
-
} & Record<string, never>;
|
|
319
|
-
meta: ZoomableMetadata;
|
|
320
|
-
};
|
|
321
|
-
|
|
322
|
-
declare interface PrimitiveEventMetadata<T extends keyof HTMLElementEventMap> {
|
|
323
|
-
native: HTMLElementEventMap[T];
|
|
324
|
-
module: LayoutModule | null;
|
|
325
|
-
}
|
|
326
|
-
|
|
327
|
-
declare type Rect = {
|
|
328
|
-
w: number;
|
|
329
|
-
h: number;
|
|
330
|
-
x: number;
|
|
331
|
-
y: number;
|
|
332
|
-
};
|
|
333
|
-
|
|
334
|
-
declare class Render {
|
|
335
|
-
options: RenderViewportOptions;
|
|
336
|
-
private container;
|
|
337
|
-
constructor(to: HTMLElement, options: RenderViewportOptions);
|
|
338
|
-
clear(width: number, height: number): void;
|
|
339
|
-
get canvas(): HTMLCanvasElement;
|
|
340
|
-
get ctx(): CanvasRenderingContext2D;
|
|
341
|
-
initOptions(userOptions?: Partial<RenderViewportOptions>): void;
|
|
342
|
-
destory(): void;
|
|
343
|
-
}
|
|
344
|
-
|
|
345
|
-
declare interface RenderViewportOptions {
|
|
346
|
-
width: number;
|
|
347
|
-
height: number;
|
|
348
|
-
devicePixelRatio: number;
|
|
349
|
-
shaow?: boolean;
|
|
350
|
-
}
|
|
351
|
-
|
|
352
|
-
declare interface RGBColor {
|
|
353
|
-
r: number;
|
|
354
|
-
g: number;
|
|
355
|
-
b: number;
|
|
356
|
-
a?: number;
|
|
357
|
-
}
|
|
358
|
-
|
|
359
|
-
declare interface ScalePluginOptions {
|
|
360
|
-
/**
|
|
361
|
-
* @default Infinity
|
|
362
|
-
* @description The maximum scale factor for the treemap.
|
|
363
|
-
*/
|
|
364
|
-
max?: number;
|
|
365
|
-
/**
|
|
366
|
-
* @default 0.1
|
|
367
|
-
* @description The minimum scale factor for the treemap.
|
|
368
|
-
*/
|
|
369
|
-
min?: number;
|
|
370
|
-
}
|
|
371
|
-
|
|
372
|
-
declare class Schedule<D extends DefaultEventDefinition = DefaultEventDefinition> extends Box {
|
|
373
|
-
render: Render;
|
|
374
|
-
to: HTMLElement;
|
|
375
|
-
event: Event_2<D>;
|
|
376
|
-
constructor(to: ApplyTo, renderOptions?: Partial<RenderViewportOptions>);
|
|
377
|
-
update(): void;
|
|
378
|
-
execute(render: Render, graph?: Display): void;
|
|
379
|
-
}
|
|
380
|
-
|
|
381
|
-
declare type Series<T> = {
|
|
382
|
-
max: T;
|
|
383
|
-
min: T;
|
|
384
|
-
};
|
|
385
|
-
|
|
386
|
-
declare type SquarifiedModule = NativeModule & {
|
|
387
|
-
parent: SquarifiedModule | null;
|
|
388
|
-
groups: SquarifiedModule[];
|
|
389
|
-
isCombinedNode?: boolean;
|
|
390
|
-
originalNodeCount?: number;
|
|
391
|
-
originalNodes?: SquarifiedModule[];
|
|
392
|
-
};
|
|
393
|
-
|
|
394
|
-
declare function squarify(data: NativeModule[], rect: Rect, config: Required<GraphicLayout>, scale?: number): LayoutModule[];
|
|
395
|
-
|
|
396
|
-
declare const STATE_TRANSITION: {
|
|
397
|
-
readonly IDLE: "IDLE";
|
|
398
|
-
readonly PRESSED: "PRESSED";
|
|
399
|
-
readonly DRAGGING: "DRAGGING";
|
|
400
|
-
readonly CLICK_POTENTIAL: "CLICK_POTENTIAL";
|
|
401
|
-
readonly ZOOMING: "ZOOMING";
|
|
402
|
-
readonly MOVE: "MOVE";
|
|
403
|
-
readonly SCALING: "SCALING";
|
|
404
|
-
};
|
|
405
|
-
|
|
406
|
-
declare class StateManager {
|
|
407
|
-
current: StateTransition;
|
|
408
|
-
constructor();
|
|
409
|
-
canTransition(to: StateTransition): boolean;
|
|
410
|
-
transition(to: StateTransition): boolean;
|
|
411
|
-
reset(): void;
|
|
412
|
-
isInState(state: StateTransition): boolean;
|
|
413
|
-
}
|
|
414
|
-
|
|
415
|
-
declare type StateTransition = typeof STATE_TRANSITION[keyof typeof STATE_TRANSITION];
|
|
416
|
-
|
|
417
|
-
declare interface TreemapOptions {
|
|
418
|
-
data: Module[];
|
|
419
|
-
}
|
|
420
|
-
|
|
421
|
-
declare interface ZoomableMetadata {
|
|
422
|
-
isZooming: boolean;
|
|
423
|
-
previousMatrixState?: {
|
|
424
|
-
e: number;
|
|
425
|
-
f: number;
|
|
426
|
-
a: number;
|
|
427
|
-
d: number;
|
|
428
|
-
};
|
|
429
|
-
}
|
|
430
|
-
|
|
431
|
-
export { }
|
|
35
|
+
interface ScalePluginOptions {
|
|
36
|
+
/**
|
|
37
|
+
* @default Infinity
|
|
38
|
+
* @description The maximum scale factor for the treemap.
|
|
39
|
+
*/
|
|
40
|
+
max?: number;
|
|
41
|
+
/**
|
|
42
|
+
* @default 0.1
|
|
43
|
+
* @description The minimum scale factor for the treemap.
|
|
44
|
+
*/
|
|
45
|
+
min?: number;
|
|
46
|
+
}
|
|
47
|
+
declare function presetScalePlugin(options?: ScalePluginOptions): {
|
|
48
|
+
name: "treemap:preset-scale";
|
|
49
|
+
onDOMEventTriggered<N extends DOMEventType>(this: PluginContext, _: N, event: DOMEventMetadata<N>, module: LayoutModule | null, evt: DOMEvent): void;
|
|
50
|
+
meta: {
|
|
51
|
+
scaleOptions: {
|
|
52
|
+
scale: number;
|
|
53
|
+
minScale: number;
|
|
54
|
+
maxScale: number;
|
|
55
|
+
scaleFactor: number;
|
|
56
|
+
};
|
|
57
|
+
};
|
|
58
|
+
onResize(this: PluginContext, { matrix, stateManager: state }: DOMEvent): void;
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
interface ZoomableMetadata {
|
|
62
|
+
isZooming: boolean;
|
|
63
|
+
previousMatrixState?: {
|
|
64
|
+
e: number;
|
|
65
|
+
f: number;
|
|
66
|
+
a: number;
|
|
67
|
+
d: number;
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
declare const presetZoomablePlugin: {
|
|
71
|
+
name: "treemap:preset-zoomable";
|
|
72
|
+
onLoad(this: PluginContext, treemap: BasicTreemapInstance, { stateManager: state, matrix }: DOMEvent): BasicTreemapInstance & {
|
|
73
|
+
zoom: (id: string) => void;
|
|
74
|
+
} & Record<string, never>;
|
|
75
|
+
meta: ZoomableMetadata;
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
export { presetColorPlugin, presetDragElementPlugin, presetHighlightPlugin, presetScalePlugin, presetZoomablePlugin };
|