mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-11 20:40:20 +00:00
@@ -0,0 +1,30 @@
|
||||
/// <reference path="webcola.d.ts"/>
|
||||
module WebColaTests {
|
||||
var adaptor = cola.adaptor({
|
||||
trigger: function() {
|
||||
},
|
||||
kick: function() {
|
||||
},
|
||||
on: function() {
|
||||
},
|
||||
drag: function() {
|
||||
}
|
||||
});
|
||||
|
||||
adaptor
|
||||
.size([100, 100])
|
||||
.avoidOverlaps(true)
|
||||
.nodes({})
|
||||
.links({})
|
||||
.handleDisconnected(true)
|
||||
.convergenceThreshold(0.001)
|
||||
.constraints({})
|
||||
.linkDistance(100)
|
||||
.flowLayout('y', 0);
|
||||
|
||||
adaptor.start(1, 2, 3);
|
||||
adaptor.dragstart({});
|
||||
adaptor.dragend({});
|
||||
adaptor.stop();
|
||||
adaptor.resume();
|
||||
}
|
||||
Vendored
+35
@@ -0,0 +1,35 @@
|
||||
// Type definitions for webcola 3.0.1
|
||||
// Project: https://github.com/tgdwyer/WebCola
|
||||
// Definitions by: Qinfeng Chen <https://github.com/qinfchen>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
declare module WebCola{
|
||||
interface Adaptor {
|
||||
avoidOverlaps(avodOverLaps: boolean): Adaptor;
|
||||
constraints(constraints: any): Adaptor;
|
||||
convergenceThreshold(convergenceThreshold: number): Adaptor;
|
||||
dragend(node: { [index: number]: any }): void;
|
||||
dragstart(node: { [index: number]: any }): void;
|
||||
flowLayout(axis: string, minSeparation: number): Adaptor;
|
||||
handleDisconnected(handleDisconnected: boolean): Adaptor;
|
||||
links(links: any): Adaptor;
|
||||
linkDistance(linkLength: number): Adaptor;
|
||||
nodes(nodes: any): Adaptor;
|
||||
resume(): void;
|
||||
size(dimension: number[]): Adaptor;
|
||||
start(
|
||||
initialUnconstrainedIterations: number,
|
||||
initialUserConstraintIterations: number,
|
||||
initialAllConstraintsIterations: number
|
||||
): void;
|
||||
stop(): void;
|
||||
}
|
||||
|
||||
interface Cola {
|
||||
adaptor(options: { [index:number]: any }): Adaptor;
|
||||
start(): void;
|
||||
stop(): void;
|
||||
}
|
||||
}
|
||||
|
||||
declare var cola: WebCola.Cola;
|
||||
|
||||
Reference in New Issue
Block a user