Function
| Static Public Summary | ||
| public |
measure distance between two points |
|
| public |
distancePointElement(x: number, y: number, element: HTMLElement): * find shortest distance from point to HTMLElement's bounding box from: https://gamedev.stackexchange.com/questions/44483/how-do-i-calculate-distance-between-a-point-and-an-axis-aligned-rectangle |
|
| public |
getChildIndex(parent: *, child: *): * |
|
| public |
html(options: *): * |
|
| public |
inside(dragging: HTMLElement, element: HTMLElement): * determine whether the mouse is inside an element |
|
| public |
combines options and default options |
|
| public |
percentage(xa1: number, ya1: number, xa2: number, xa2: number, xb1: number, yb1: number, xb2: number, yb2: number): number calculate percentage of overlap between two boxes from https://stackoverflow.com/a/21220004/1955997 |
|
| public |
removeChildren(element: *) |
|
| public |
set a style on an element |
|
| public |
styles(object: *, styles: *) |
|
| public |
determines global location of a div from https://stackoverflow.com/a/26230989/1955997 |
|
Static Public
public distance(x1: number, y1: number, x2: number, y2: number): * source
import {distance} from 'yy-tree/src/utils.js'measure distance between two points
Return:
| * |
public distancePointElement(x: number, y: number, element: HTMLElement): * source
import {distancePointElement} from 'yy-tree/src/utils.js'find shortest distance from point to HTMLElement's bounding box from: https://gamedev.stackexchange.com/questions/44483/how-do-i-calculate-distance-between-a-point-and-an-axis-aligned-rectangle
Return:
| * |
public getChildIndex(parent: *, child: *): * source
import {getChildIndex} from 'yy-tree/src/utils.js'Params:
| Name | Type | Attribute | Description |
| parent | * | ||
| child | * |
Return:
| * |
public html(options: *): * source
import {html} from 'yy-tree/src/utils.js'Params:
| Name | Type | Attribute | Description |
| options | * |
Return:
| * |
public inside(dragging: HTMLElement, element: HTMLElement): * source
import {inside} from 'yy-tree/src/utils.js'determine whether the mouse is inside an element
Params:
| Name | Type | Attribute | Description |
| dragging | HTMLElement | ||
| element | HTMLElement |
Return:
| * |
public options(options: object, defaults: object): object source
import {options} from 'yy-tree/src/utils.js'combines options and default options
public percentage(xa1: number, ya1: number, xa2: number, xa2: number, xb1: number, yb1: number, xb2: number, yb2: number): number source
import {percentage} from 'yy-tree/src/utils.js'calculate percentage of overlap between two boxes from https://stackoverflow.com/a/21220004/1955997
public removeChildren(element: *) source
import {removeChildren} from 'yy-tree/src/utils.js'Params:
| Name | Type | Attribute | Description |
| element | * |
public style(element: HTMLElement, style: string, value: string | string[]) source
import {style} from 'yy-tree/src/utils.js'set a style on an element
public styles(object: *, styles: *) source
import {styles} from 'yy-tree/src/utils.js'Params:
| Name | Type | Attribute | Description |
| object | * | ||
| styles | * |
public toGlobal(e: HTMLElement): PointLike source
import {toGlobal} from 'yy-tree/src/utils.js'determines global location of a div from https://stackoverflow.com/a/26230989/1955997
Params:
| Name | Type | Attribute | Description |
| e | HTMLElement |