Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Draw on Canvas using Views
Kanva is a canvas framework for Node.js & browser web apps, inspired by structures present in Android ecosystem.
Kanva is broken down into several packages, allowing you to pick what's really needed.
Most important yarn
scripts during development:
start
- runs builds for all packages in watch mode
verify
- runs lint & tests
Package
Description
Core of Kanva
React bindings for Kanva core.
Chart views in Kanva
@kanva/charts-react
React bindings for chart views in Kanva
@kanva/example
Storybook showcase of Kanva's possibilities
Ƭ CanvasCreator: function
▸ (options
: CanvasCreatorOptions): Canvas
Parameters:
Ƭ DeepReadonly: T extends Primitive ? T : DeepReadonlyObject‹T›
Ƭ DeepReadonlyObject: object
Ƭ DimensionInput: string | number | undefined | null
Ƭ FontStyle: "normal" | "italic" | "oblique"
Ƭ FontVariant: "normal" | "small-caps"
Ƭ FontWeight: "normal" | "bold" | "bolder" | "lighter" | 100 | "100" | 200 | "200" | 300 | "300" | 400 | "400" | 500 | "500" | 600 | "600" | 700 | "700" | 800 | "800" | 900 | "900"
Ƭ Id: number | string
Ƭ ImageClass: object
Ƭ OnAreaSelectListener: function
▸ (areaSelectEvent
: AreaSelectEvent): boolean
Parameters:
Ƭ OnDragListener: function
▸ (dragEvent
: DragEvent): boolean
Parameters:
Ƭ OnScaleListener: function
▸ (scaleEvent
: ScaleEvent): boolean
Parameters:
Ƭ Primitive: string | number | boolean | undefined | null
Ƭ RadiusInput: number | Partial‹Radius› | null | undefined
Ƭ RectInput: RectObjectInput | number
Ƭ SupportedDomPointerEvent: MouseEvent | WheelEvent | TouchEvent
Const
DEBUG_POINTER_EVENTS• DEBUG_POINTER_EVENTS: false = false
Const
DEFAULT_POINTER_COUNT• DEFAULT_POINTER_COUNT: 1 = 1
Const
MATCH_PARENT• MATCH_PARENT: -1 = -1
Const
PARENT_ID• PARENT_ID: -1 = -1
Const
WHEEL_SCROLL_SPAN• WHEEL_SCROLL_SPAN: 100 = 100
Const
WRAP_CONTENT• WRAP_CONTENT: -2 = -2
Const
colorRegex• colorRegex: RegExp‹› = /^(?:#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2}))|(?:#([0-9a-f])([0-9a-f])([0-9a-f]))|(?:rgb((\d+),\s*(\d+),\s*(\d+)))|(?:rgba((\d+),\s*(\d+),\s*(\d+),\s*(\d*.?\d+)))$/i
Const
defaultImageClass• defaultImageClass: undefined | object = (() => { try { // Browsers default return Image; } catch { return undefined; } })()
Const
defaultLayoutProps• defaultLayoutProps: LayoutProps = new LayoutParams().asProps()
Const
isBrowser• isBrowser: false | requestAnimationFrame & requestAnimationFrame = typeof window !== 'undefined' && window.requestAnimationFrame
Const
supportedDomPointerEvents• supportedDomPointerEvents: ("touchmove" | "mousemove" | "mousedown" | "touchstart" | "mouseover" | "mouseenter" | "touchcancel" | "mouseout" | "mouseup" | "touchend" | "wheel")[] = [ 'touchmove', 'mousemove', 'mousedown', 'touchstart', 'mouseover', 'mouseenter', 'touchcancel', 'mouseout', 'mouseup', 'touchend', 'wheel', ]
Const
calcDimension▸ calcDimension(dimension
: Dimension, parentDimension
: number): undefined | number
Parameters:
Returns: undefined | number
Const
createEventDispatcher▸ createEventDispatcher(view
: View): EventListener
Parameters:
Returns: EventListener
▸ createLayoutMap‹K›(t
: Record‹K, LayoutProps›): object
Type parameters:
▪ K: string
Parameters:
Returns: object
Const
deepFreeze▸ deepFreeze‹T›(object
: T): DeepReadonly‹T›
Type parameters:
▪ T
Parameters:
Returns: DeepReadonly‹T›
Const
defaultCanvasCreator▸ defaultCanvasCreator(__namedParameters
: object): HTMLCanvasElement
Parameters:
▪ __namedParameters: object
Returns: HTMLCanvasElement
Const
domEventToPointerAction▸ domEventToPointerAction(event
: Event): PointerAction | undefined
Parameters:
Returns: PointerAction | undefined
Const
existingNonParentDependency▸ existingNonParentDependency(id
: undefined | Id): id is number
Parameters:
Returns: id is number
Const
fillPointerEventData▸ fillPointerEventData(pointerEvent
: CanvasPointerEvent, view
: View, event
: Event): void
Parameters:
Returns: void
Const
getBox▸ getBox(width
: number, height
: number, scale
: number): object
Parameters:
Returns: object
str: string = +
style: string = font-size: 1px; padding: ${isSafari() ? height * scale / 2 : 0}px ${Math.floor(width * scale / 2)}px; color: transparent; line-height: ${height * scale}px;
Const
getElementOffset▸ getElementOffset(element
: HTMLElement, offset
: Offset): Offset
Parameters:
Returns: Offset
Const
horizontalLayoutDependencies▸ horizontalLayoutDependencies(lp
: LayoutParams): number[]
Parameters:
Returns: number[]
Const
isBright▸ isBright(color
: Color): boolean
Parameters:
Returns: boolean
Const
isChrome▸ isChrome(): boolean
Returns: boolean
Const
isMouseEvent▸ isMouseEvent(event
: Event): event is MouseEvent
Parameters:
Returns: event is MouseEvent
Const
isSafari▸ isSafari(): boolean
Returns: boolean
Const
isTouchEvent▸ isTouchEvent(event
: Event): event is TouchEvent
Parameters:
Returns: event is TouchEvent
Const
isWheelEvent▸ isWheelEvent(event
: Event): event is WheelEvent
Parameters:
Returns: event is WheelEvent
Const
logPointerEvent▸ logPointerEvent(pointerEvent
: CanvasPointerEvent): void
Parameters:
Returns: void
Const
logScreenshot▸ logScreenshot(view
: View, scale
: number): void
Parameters:
Returns: void
Const
luminance▸ luminance(c
: Color): number
Parameters:
Returns: number
Const
mouseToPointer▸ mouseToPointer(event
: MouseEvent, offset
: Offset, canvasPointer
: CanvasPointer): void
Parameters:
Returns: void
Const
noContextError▸ noContextError(): Error
Returns: Error
Const
normalizeRadius▸ normalizeRadius(radius
: RadiusInput): Radius
Parameters:
Returns: Radius
Const
parseColor▸ parseColor(colorString
: string | undefined): typeof colorString extends undefined ? undefined : Color | undefined
Parameters:
Returns: typeof colorString extends undefined ? undefined : Color | undefined
Const
parseDimension▸ parseDimension(value
: DimensionInput): Dimension
Parameters:
Returns: Dimension
Const
parseFont▸ parseFont(__namedParameters
: object): string
Parameters:
▪ __namedParameters: object
Returns: string
Const
registerEventDispatcher▸ registerEventDispatcher(element
: Element, dispatcher
: EventListener): (Anonymous function)
Parameters:
Returns: (Anonymous function)
Const
removeDefaultProps▸ removeDefaultProps(props
: LayoutProps): any
Parameters:
Returns: any
Const
removeEqualProps▸ removeEqualProps(object
: any, defaultObject
: any): any
Parameters:
Returns: any
Const
removeUndefinedProps▸ removeUndefinedProps(object
: any): any
Parameters:
Returns: any
Const
resolveDimensionDependencies▸ resolveDimensionDependencies‹T›(children
: T[], dependencySelector
: function, context
: Context): T[]
Type parameters:
▪ T: ViewLike
Parameters:
▪ children: T[]
▪ dependencySelector: function
▸ (lp
: LayoutParams): number[]
Parameters:
▪ context: Context
Returns: T[]
Const
resolveLayoutParamsIds▸ resolveLayoutParamsIds(layoutParams
: LayoutParams, context
: Context): void
Parameters:
Returns: void
Const
rgba▸ rgba(color
: string, alpha
: number): string
Parameters:
Returns: string
Const
roundCoordinate▸ roundCoordinate(coordinate
: number): number
Parameters:
Returns: number
Const
scaleImage▸ scaleImage(scaleType
: ImageScaleType, imageWidth
: number, imageHeight
: number, innerWidth
: number, innerHeight
: number, rect
: Rect): Rect
Parameters:
Returns: Rect
Const
touchToPointer▸ touchToPointer(touch
: Touch | null, offset
: Offset, canvasPointer
: CanvasPointer): void
Parameters:
Returns: void
Const
verticalLayoutDependencies▸ verticalLayoutDependencies(lp
: LayoutParams): number[]
Parameters:
Returns: number[]
Const
xor▸ xor(a
: boolean, b
: boolean): boolean
Parameters:
Returns: boolean
Const
DefaultProps• ABOVE: undefined = undefined
• ALIGN_BOTTOM: undefined = undefined
• ALIGN_END: undefined = undefined
• ALIGN_START: undefined = undefined
• ALIGN_TOP: undefined = undefined
• BELOW: undefined = undefined
• CENTER_HORIZONTAL: boolean = false
• CENTER_VERTICAL: boolean = false
• HEIGHT: number = WRAP_CONTENT
• IS_ABSOLUTE: boolean = false
• IS_ANIMATED: boolean = false
• MARGIN: Rect‹› = new Rect(0)
• MAX_HEIGHT: number = Number.MAX_SAFE_INTEGER
• MAX_WIDTH: number = Number.MAX_SAFE_INTEGER
• MIN_HEIGHT: number = 0
• MIN_WIDTH: number = 0
• PADDING: Rect‹› = new Rect(0)
• TO_END_OF: undefined = undefined
• TO_START_OF: undefined = undefined
• WIDTH: number = WRAP_CONTENT
• X: number = 0
• Y: number = 0
Const
defaultFont• fontFamily: string = "Arial"
• fontSize: number = 12
Const
defaultPaintOptions• font: string = parseFont(defaultFont)
• lineDash: never[] = []
• lineRounding: boolean = false
• lineWidth: number = 0
• textAlign: TextAlign = 'left' as TextAlign
• textBaseline: TextBaseline = 'bottom' as TextBaseline
• textDirection: CanvasDirection = 'ltr' as CanvasDirection
Const
zeroRadius• bl: number = 0
• br: number = 0
• tl: number = 0
• tr: number = 0
↳ AreaSelectGestureDetector
+ new AreaSelectGestureDetector(options
: AreaSelectGestureDetectorOptions): AreaSelectGestureDetector
Parameters:
Returns: AreaSelectGestureDetector
▸ onGestureEvent(event
: CanvasPointerEvent): boolean
Overrides GestureDetector.onGestureEvent
Parameters:
Returns: boolean
▸ onPointerEvent(event
: CanvasPointerEvent): boolean
Inherited from GestureDetector.onPointerEvent
Parameters:
Returns: boolean
A layout and view system that draws stuff on canvas, has no external dependencies besides TypeScript typings (for now :wink: ). The idea is similar to what we can do with RelativeLayout (or ConstraintLayout) and Views on Android. Base classes are:
It's like component in React. It has it's own lifecycle and is able to accept properties. To access properties from React wrapper, properties need to have Java-style setters and getters (i.e. for property myProperty
, you have setMyProperty()
and getMyProperty()
). Usually we want to see the change after setting a value, this is why view needs to call require()
method inside property setters.
The lifecycle looks like this:
This is what lets us position the view inside another view. One can set the LayoutParams' values by chaining available methods. The dimensions of View can be set as a number (in pixels), MATCH_PARENT
or WRAP_CONTENT
. The calculated size is then wrapped to minWidth
/maxWidth
and minHeight
/maxHeight
.
MATCH_PARENT
- the view is as big as it's parent
WRAP_CONTENT
- view takes the smallest amount of space possible
Views can be positioned absolutely or relatively. Absolute positioning is the simplest one: just set the desired x
and y
coordinates and view will appear there. Relative positioning is a bit more complex concept, illustrated below.
This section is unfortunately still work in progress...
CanvasPointerEvent
• pointerCount: number = 0
• scrollX: number = 0
• scrollY: number = 0
• scrollZ: number = 0
Parameters:
▸ offsetPointers(offsetX
: number, offsetY
: number): void
Parameters:
Returns: void
Context
Parameters:
Readonly
canvasCreator• debugEnabled: boolean = false
Readonly
imageClass▸ deregisterView(id
: number): void
Parameters:
Returns: void
▸ getId(id
: string | number | undefined): undefined | string | number
Parameters:
Returns: undefined | string | number
▸ registerView(idName
: string): number
Parameters:
Returns: number
▸ resolve(id
: string | number | undefined): number | undefined
Parameters:
Returns: number | undefined
All notable changes to this project will be documented in this file. See for commit guidelines.
Note: Version bump only for package kanva
Note: Version bump only for package kanva
Note: Version bump only for package kanva
Note: Version bump only for package kanva
npm: move tslib from dev dependencies to dependencies ()
Note: Version bump only for package kanva
Note: Version bump only for package kanva
Note: Version bump only for package kanva
kanva: first public release
Draw on Canvas using Views
Kanva is a canvas framework for Node.js & browser web apps, inspired by structures present in Android ecosystem.
Kanva is broken down into several packages, allowing you to pick what's really needed.
Package | Description |
---|
Most important yarn
scripts during development:
start
- runs builds for all packages in watch mode
verify
- runs lint & tests
Name | Type |
---|---|
Name | Type |
---|---|
Name | Type |
---|---|
Name | Type |
---|---|
Name | Type |
---|---|
Name | Type |
---|---|
Name | Type |
---|---|
Name | Type |
---|---|
Name | Type |
---|---|
Name | Type |
---|---|
Name | Type |
---|---|
Name | Type |
---|---|
Name | Type |
---|---|
Name | Type |
---|---|
Name | Type |
---|---|
Name | Type |
---|---|
Name | Type |
---|---|
Name | Type |
---|---|
Name | Type |
---|---|
Name | Type |
---|---|
Name | Type | Default |
---|---|---|
Name | Type |
---|---|
Name | Type |
---|---|
Name | Type |
---|---|
Name | Type |
---|---|
Name | Type |
---|---|
Name | Type |
---|---|
Name | Type |
---|---|
Name | Type |
---|---|
Name | Type |
---|---|
Name | Type |
---|---|
Name | Type |
---|---|
Name | Type |
---|---|
Name | Type |
---|---|
Name | Type |
---|---|
Name | Type |
---|---|
Name | Type |
---|---|
Name | Type |
---|---|
Name | Type |
---|---|
▸ onPointerEvent(event
: ): boolean
Returns:
▸ onGestureEvent(event
: ): boolean
Overrides .
▸ onPointerEvent(event
: ): boolean
Inherited from .
+ new CanvasPointerEvent():
Returns:
• action:
• offset:
• pointers: [] = new Array(10).fill(null).map(() => ({}) as any)
• target:
• get primaryPointer():
Returns:
▸ clone():
Returns:
▸ cloneTo(event
: ):
Returns:
+ new Context(options
: ):
Name | Type | Default |
---|
Returns:
• canvasCreator:
• imageClass:
Name | Type |
---|
Implementation of
Name | Type |
---|
Implementation of
Name | Type |
---|
Implementation of
Name | Type |
---|
react: properly pass 'style' prop to Kanva root element ()
example: fix handleScale operating on wrong argument in various storybook stories ()
charts: add new area band type chart, data container can now process tuple of numbers in internal series ()
example: add new area band type chart example in storybook ()
bar-chart.view: bar chart rendering ()
Core/View: pointer event offset now includes view LP padding ()
data-container: #getYValuesMatch occasional crash potential fix ()
data-container: #getYValuesMatch, #getScales crash prevention ()
DataContainer: Missing this.scales issue ()
ImageView: Refresh onLoad image changed to MEASURE. Storybook for Image added. ()
line-chart.view: add XY point normalizing function ()
pointer-events: filter-out UP pointer events for tooltip action ()
select area zoom: min selected area applied for both x and y min values ()
tooltip extension: primary match set to the closest match to the given x point. Matches returned only for the series that are in expected range ()
transform extension options: copy scaleOptions instead of rewriting received object ()
data-container: tooltip extension barebones ()
data-container: tooltip-extension bar chart support ()
Pointer Events: AreaChart & BarChart pointer events snap ()
Pointer Events: dispatching fabricated pointer events ()
pointer-events: tooltip positioning, onMount callback ()
tooltip-extension: Area Chart stationary tooltip ()
zoom: enable setting zoom option after extension initialization ()
zoom: enable updating instead of rewriting of transformExtension options ()
zooming: select area zoom extension custom styling ()
zooming: zooming by selecting area extension ()
options
areaSelectEvent
dragEvent
scaleEvent
dimension
parentDimension
number
view
t
Record‹K, LayoutProps›
object
T
height
number
width
number
event
Event
id
undefined | Id
pointerEvent
view
event
Event
width
number
height
number
scale
number
element
HTMLElement
offset
lp
color
event
Event
event
Event
event
Event
pointerEvent
view
-
scale
number
1
c
event
MouseEvent
offset
canvasPointer
radius
colorString
string | undefined
value
fontFamily
string
fontSize
number
fontStyle
undefined | "normal" | "italic" | "oblique"
fontVariant
undefined | "normal" | "small-caps"
fontWeight
undefined | "normal" | "bold" | "bolder" | "lighter" | 100 | "100" | 200 | "200" | 300 | "300" | 400 | "400" | 500 | "500" | 600 | "600" | 700 | "700" | 800 | "800" | 900 | "900"
element
Element
dispatcher
EventListener
props
object
any
defaultObject
any
object
any
lp
layoutParams
context
color
string
alpha
number
coordinate
number
scaleType
imageWidth
number
imageHeight
number
innerWidth
number
innerHeight
number
rect
touch
Touch | null
offset
canvasPointer
lp
a
boolean
b
boolean
Name
Type
options
AreaSelectGestureDetectorOptions
Name
Type
event
Name
Type
event
Name | Type |
| number |
| number |
| number |
| string | number | undefined |
| string |
| string | number | undefined |
This section is unfortunately still work in progress...
This section is unfortunately still work in progress...
Name | Type |
|
|
Name | Type |
|
Name | Type |
|
Name | Type |
|
Name | Type |
|
Name | Type |
|
| {} |
↳ ImageView
+ new ImageView(context
: Context): ImageView
Overrides View.constructor
Parameters:
Returns: ImageView
Protected
Optional
backgroundColor• backgroundColor? : undefined | string
Inherited from RootCanvasView.backgroundColor
Protected
Optional
borderColor• borderColor? : undefined | string
Inherited from RootCanvasView.borderColor
Protected
Optional
borderRect• borderRect? : Rect
Inherited from RootCanvasView.borderRect
Readonly
context• context: Context
Inherited from RootCanvasView.context
Protected
height• height: number = 0
Inherited from RootCanvasView.height
Optional
id• id? : undefined | number
Inherited from RootCanvasView.id
Protected
innerRect• innerRect: Rect = new Rect(0)
Inherited from RootCanvasView.innerRect
This are the bounds of view including padding.
Protected
lp• lp: LayoutParams = new LayoutParams()
Inherited from RootCanvasView.lp
Readonly
name• name: string
Inherited from RootCanvasView.name
• offsetRect: Rect = new Rect(0)
Inherited from RootCanvasView.offsetRect
This are the bounds of view absolute offset.
Protected
Optional
onMount• onMount? : undefined | function
Inherited from RootCanvasView.onMount
Protected
rect• rect: Rect = new Rect(0)
Inherited from RootCanvasView.rect
This are bounds of a view including margin and padding
Protected
visibility• visibility: Visibility = Visibility.VISIBLE
Inherited from RootCanvasView.visibility
Protected
width• width: number = 0
Inherited from RootCanvasView.width
• get innerHeight(): number
Inherited from RootCanvasView.innerHeight
Returns: number
• get innerWidth(): number
Inherited from RootCanvasView.innerWidth
Returns: number
▸ addChild(child
: View, position
: number): void
Inherited from RootCanvasView.addChild
Parameters:
Returns: void
▸ destroy(): void
Inherited from RootCanvasView.destroy
Returns: void
▸ dispatchPointerEvent(event
: CanvasPointerEvent): boolean
Inherited from RootCanvasView.dispatchPointerEvent
Parameters:
Returns: boolean
▸ draw(canvas
: ViewCanvas, force
: boolean): void
Parameters:
Returns: void
▸ getBackgroundColor(): undefined | string
Inherited from RootCanvasView.getBackgroundColor
Returns: undefined | string
▸ getBorder(): undefined | string
Inherited from RootCanvasView.getBorder
Returns: undefined | string
▸ getBorderColor(): undefined | string
Inherited from RootCanvasView.getBorderColor
Returns: undefined | string
▸ getId(): undefined | string | number
Inherited from RootCanvasView.getId
Returns: undefined | string | number
▸ getInternalWrappedHeight(): number
Overrides RootCanvasView.getInternalWrappedHeight
Returns: number
▸ getInternalWrappedWidth(): number
Overrides RootCanvasView.getInternalWrappedWidth
Returns: number
▸ getLayoutParams(): LayoutParams‹›
Inherited from RootCanvasView.getLayoutParams
Returns: LayoutParams‹›
▸ getMatchParentHeight(): number
Inherited from RootCanvasView.getMatchParentHeight
Returns: number
▸ getMatchParentWidth(): number
Inherited from RootCanvasView.getMatchParentWidth
Returns: number
▸ getOnMount(): undefined | function
Inherited from RootCanvasView.getOnMount
Returns: undefined | function
▸ getParent(): null | View‹ViewProps›
Inherited from RootCanvasView.getParent
Returns: null | View‹ViewProps›
▸ getRootView(): View‹ViewProps›
Inherited from RootCanvasView.getRootView
▸ getScaleType(): ImageScaleType
Returns: ImageScaleType
▸ getSource(): undefined | string
Returns: undefined | string
▸ getVisibility(): Visibility
Inherited from RootCanvasView.getVisibility
Returns: Visibility
▸ hasParent(): boolean
Inherited from RootCanvasView.hasParent
Returns: boolean
▸ layout(force?
: undefined | false | true): void
Inherited from RootCanvasView.layout
Prepares the layout for all children
Parameters:
Returns: void
▸ measure(canvas
: ViewCanvas, force?
: undefined | false | true): void
Inherited from RootCanvasView.measure
Measures the component and adjusts it's dimensions to min/max width and height values.
Parameters:
Returns: void
true if width or height changed, false otherwise
▸ mount(): void
Inherited from RootCanvasView.mount
Returns: void
▸ onDestroy(): void
Inherited from TextView.onDestroy
Returns: void
▸ onDraw(canvas
: ViewCanvas): void
Overrides RootCanvasView.onDraw
Parameters:
Returns: void
▸ onLayout(): void
Inherited from RootCanvasView.onLayout
Returns: void
▸ onMeasure(width
: number, height
: number): object
Inherited from RootCanvasView.onMeasure
Parameters:
Returns: object
height: number
width: number
▸ onPointerEvent(_event
: CanvasPointerEvent): boolean
Inherited from RootCanvasView.onPointerEvent
Parameters:
Returns: boolean
▸ onSizeChanged(_width
: number, _height
: number, _oldWidth
: number, _oldHeight
: number): void
Inherited from TextView.onSizeChanged
Parameters:
Returns: void
▸ onSnapshot(): object
Overrides View.onSnapshot
Returns: object
source: undefined | string = this.source
▸ removeChild(child
: View | number): void
Inherited from RootCanvasView.removeChild
Parameters:
Returns: void
▸ removeChildAt(startIndex
: number, endIndex
: number): void
Inherited from RootCanvasView.removeChildAt
Parameters:
Returns: void
▸ require(requiredChanges
: RequiredViewChanges): void
Inherited from TextView.require
Parameters:
Returns: void
▸ requireGuard(requiredChanges
: RequiredViewChanges): boolean
Inherited from RootCanvasView.requireGuard
Parameters:
Returns: boolean
▸ requireGuardAndTake(requiredChanges
: RequiredViewChanges, force?
: undefined | false | true): boolean
Inherited from RootCanvasView.requireGuardAndTake
Parameters:
Returns: boolean
▸ resolvePositionDependencies(): void
Inherited from RootCanvasView.resolvePositionDependencies
Prepare arrays of children ordered horizontally and vertically, so that they could be measured in a single pass, without waiting for their dependencies to be resolved.
This has to be called before measure whenever child's layoutParams change or views are added/removed.
throws
an error in case of unresolvable dependency (circular or lack of required view)
Returns: void
▸ screenshot(): string | undefined
Inherited from RootCanvasView.screenshot
Returns: string | undefined
▸ setBackgroundColor(backgroundColor
: string | undefined): void
Inherited from RootCanvasView.setBackgroundColor
Parameters:
Returns: void
▸ setBorder(borderRect
: RectLike | undefined): void
Inherited from RootCanvasView.setBorder
Parameters:
Returns: void
▸ setBorderColor(borderColor
: string | undefined): void
Inherited from RootCanvasView.setBorderColor
Parameters:
Returns: void
▸ setChildAt(child
: View, position
: number): void
Inherited from RootCanvasView.setChildAt
Parameters:
Returns: void
▸ setId(id?
: undefined | string): void
Inherited from RootCanvasView.setId
Parameters:
Returns: void
▸ setLayoutParams(lp
: LayoutParams): void
Inherited from RootCanvasView.setLayoutParams
Parameters:
Returns: void
▸ setOnMount(callback
: function): void
Inherited from RootCanvasView.setOnMount
Parameters:
▪ callback: function
▸ (view
: View‹any›): void
Parameters:
Returns: void
▸ setScaleType(scaleType
: ImageScaleType): void
Parameters:
Returns: void
▸ setSource(source
: string): void
Parameters:
Returns: void
▸ setVisibility(visibility
: Visibility): void
Inherited from RootCanvasView.setVisibility
Parameters:
Returns: void
▸ snapshot(): object
Inherited from RootCanvasView.snapshot
Returns: object
Line
+ new Line(): Line
Returns: Line
+ new Line(startX
: number, startY
: number, endX
: number, endY
: number): Line
Parameters:
Returns: Line
• endX: number
• endY: number
• startX: number
• startY: number
▸ add(line
: Line | Point): this
Parameters:
Returns: this
▸ add(x
: number, y
: number): this
Parameters:
Returns: this
▸ clone(): Line‹›
Returns a copy of Line that can be mutated separately.
Returns: Line‹›
Copies all of this Line's properties to a Line specified in an argument. Returns the line passed as argument.
Parameters:
Returns: Line‹›
▸ extend(distance
: number): this
Extends this line by a specified distance. Starting point remains the same, ending point changes it's place by the distance. If current line has the length of 0, it's extended horizontally. Resulting Line is the same, mutated Line.
Parameters:
Returns: this
▸ length(): number
Returns: number
▸ move(distance
: number): this
Moves this line by a specified distance on the same angle. Acting similarly to {@link Line#extend}, but modifies both starting and ending points by a specified distance. If current line has the length of 0, it's moved horizontally. Resulting Line is the same, mutated Line.
Parameters:
Returns: this
▸ offset(line
: Line | Point): this
Parameters:
Returns: this
▸ offset(x
: number, y
: number): this
Parameters:
Returns: this
▸ pointAt(position
: number, result
: Point): Point
Returns a point on this line, at specified position (ranged from 0 to 1). I.e. to get the center of line, pass 0.5. Creates a new Point, but in order to reuse the existing one, you can pass it as a second argument.
Parameters:
Returns: Point
▸ toString(): string
Returns: string
NoContext
ContextLike
▸ deregisterView(_id
: number): void
Parameters:
Returns: void
▸ getId(_id
: string | number): string | number
Parameters:
Returns: string | number
▸ registerView(_idName
: string): number
Implementation of ContextLike
Parameters:
Returns: number
▸ resolve(_id
: string | number | undefined): number | undefined
Implementation of ContextLike
Parameters:
Returns: number | undefined
Rect
+ new Rect(value
: RectInput): Rect
Parameters:
Returns: Rect
• b: number
• l: number
• r: number
• t: number
• get height(): number
Returns: number
• get width(): number
Returns: number
▸ clone(): Rect‹›
Returns a copy of Rect that can be mutated separately.
Returns: Rect‹›
Copies all of this Rect's properties to a Rect specified in an argument. Returns the line passed as argument.
Parameters:
Returns: Rect‹›
▸ contains(x
: number, y
: number): boolean
Parameters:
Returns: boolean
▸ expand(expansion
: Rect | number): this
Expands this Rect by other Rect's dimensions (i.e. to reduce padding) or by a constant numeric value from each side. Resulting Rect is the same, mutated Rect.
Parameters:
Returns: this
▸ inset(shrink
: Rect | number): this
Shrinks this Rect by other Rect's dimensions (i.e. to apply padding) or by a constant numeric value from each side. Resulting Rect is the same, mutated Rect.
Parameters:
Returns: this
▸ intersects(rect
: Rect): boolean
Parameters:
Returns: boolean
▸ offset(offset
: Rect | Point): this
Moves this Rect by left top position of passed rect or by XY coordinates of a Point. Resulting Rect is the same, mutated Rect.
Parameters:
Returns: this
▸ offset(x
: number, y
: number): this
Moves this Rect by passed x and y coordinates. Resulting Rect is the same, mutated Rect.
Parameters:
Returns: this
▸ toString(): string
Returns: string
Static
from▸ from(rectLike
: RectLike): Rect
Parameters:
Returns: Rect
Paint
Optional
fillStyle• fillStyle? : undefined | string
Implementation of PaintOverrides.fillStyle
• font: Font = defaultFont
• fontString: string = defaultPaintOptions.font
• lineDash: number[] = defaultPaintOptions.lineDash
• lineRounding: boolean = defaultPaintOptions.lineRounding
Implementation of PaintOverrides.lineRounding
• lineWidth: number = defaultPaintOptions.lineWidth
Optional
strokeStyle• strokeStyle? : undefined | string
• textAlign: TextAlign = defaultPaintOptions.textAlign
Implementation of PaintOverrides.textAlign
• textBaseline: TextBaseline = defaultPaintOptions.textBaseline
Implementation of PaintOverrides.textBaseline
• textDirection: CanvasDirection = defaultPaintOptions.textDirection
Implementation of PaintOverrides.textDirection
Static
Readonly
DEFAULT▪ DEFAULT: DeepReadonly‹Paint› = new Paint()
▸ canDrawFill(): boolean
Returns: boolean
▸ canDrawStroke(): boolean
Returns: boolean
▸ canDrawText(): boolean
Returns: boolean
▸ clone(): Paint‹›
Returns: Paint‹›
▸ getLineHeight(): number
Returns: number
▸ isBright(): boolean
Returns: boolean
▸ setFillStyle(fill
: string): this
Parameters:
Returns: this
▸ setFont(font
: Font): this
Parameters:
Returns: this
▸ setLineDash(lineDash
: number[]): this
Parameters:
Returns: this
▸ setLineRounding(lineRounding
: boolean): this
Parameters:
Returns: this
▸ setLineWidth(lineWidth
: number): this
Parameters:
Returns: this
▸ setStrokeStyle(stroke
: string): this
Parameters:
Returns: this
▸ setTextAlign(textAlign
: TextAlign): this
Parameters:
Returns: this
▸ setTextBaseline(textBaseline
: TextBaseline): this
Parameters:
Returns: this
▸ setTextDirection(textDirection
: CanvasDirection): this
Parameters:
Returns: this
▸ snapshot(): object
Returns: object
Point
+ new Point(x
: number, y
: number): Point
Parameters:
Returns: Point
• x: number
• y: number
▸ clone(): Point‹›
Returns a copy of Point that can be mutated separately.
Returns: Point‹›
▸ cloneTo(point
: Point): Point‹›
Copies all of this Point's properties to a Point specified in an argument. Returns the point passed as argument.
Parameters:
Returns: Point‹›
▸ toString(): string
Returns: string
↳ ScaleGestureDetector
+ new ScaleGestureDetector(options
: ScaleGestureDetectorOptions): ScaleGestureDetector
Parameters:
Returns: ScaleGestureDetector
▸ onGestureEvent(event
: CanvasPointerEvent): boolean
Overrides GestureDetector.onGestureEvent
Parameters:
Returns: boolean
▸ onPointerEvent(event
: CanvasPointerEvent): boolean
Inherited from GestureDetector.onPointerEvent
Parameters:
Returns: boolean
↳ RootCanvasView
+ new RootCanvasView(context
: Context, canvas
: Canvas): RootCanvasView
Overrides View.constructor
Parameters:
Returns: RootCanvasView
Protected
Optional
backgroundColor• backgroundColor? : undefined | string
Inherited from RootCanvasView.backgroundColor
Protected
Optional
borderColor• borderColor? : undefined | string
Inherited from RootCanvasView.borderColor
Protected
Optional
borderRect• borderRect? : Rect
Inherited from RootCanvasView.borderRect
Readonly
context• context: Context
Inherited from RootCanvasView.context
Protected
height• height: number = 0
Inherited from RootCanvasView.height
Optional
id• id? : undefined | number
Inherited from RootCanvasView.id
Protected
innerRect• innerRect: Rect = new Rect(0)
Inherited from RootCanvasView.innerRect
This are the bounds of view including padding.
Protected
lp• lp: LayoutParams = new LayoutParams()
Inherited from RootCanvasView.lp
Readonly
name• name: string
Inherited from RootCanvasView.name
• offsetRect: Rect = new Rect(0)
Inherited from RootCanvasView.offsetRect
This are the bounds of view absolute offset.
Protected
Optional
onMount• onMount? : undefined | function
Inherited from RootCanvasView.onMount
Protected
rect• rect: Rect = new Rect(0)
Inherited from RootCanvasView.rect
This are bounds of a view including margin and padding
Protected
visibility• visibility: Visibility = Visibility.VISIBLE
Inherited from RootCanvasView.visibility
Protected
width• width: number = 0
Inherited from RootCanvasView.width
• get innerHeight(): number
Inherited from RootCanvasView.innerHeight
Returns: number
• get innerWidth(): number
Inherited from RootCanvasView.innerWidth
Returns: number
▸ addChild(child
: View, position
: number): void
Inherited from RootCanvasView.addChild
Parameters:
Returns: void
▸ destroy(): void
Inherited from RootCanvasView.destroy
Returns: void
▸ dispatchPointerEvent(event
: CanvasPointerEvent): boolean
Inherited from RootCanvasView.dispatchPointerEvent
Parameters:
Returns: boolean
▸ draw(canvas
: ViewCanvas): void
Parameters:
Returns: void
▸ getBackgroundColor(): undefined | string
Inherited from RootCanvasView.getBackgroundColor
Returns: undefined | string
▸ getBorder(): undefined | string
Inherited from RootCanvasView.getBorder
Returns: undefined | string
▸ getBorderColor(): undefined | string
Inherited from RootCanvasView.getBorderColor
Returns: undefined | string
▸ getCanvas(): HTMLCanvasElement
Returns: HTMLCanvasElement
▸ getId(): undefined | string | number
Inherited from RootCanvasView.getId
Returns: undefined | string | number
▸ getInternalWrappedHeight(_canvas
: ViewCanvas): number | undefined
Inherited from RootCanvasView.getInternalWrappedHeight
Parameters:
Returns: number | undefined
▸ getInternalWrappedWidth(_canvas
: ViewCanvas): number | undefined
Inherited from RootCanvasView.getInternalWrappedWidth
Parameters:
Returns: number | undefined
▸ getLayoutParams(): LayoutParams‹›
Inherited from RootCanvasView.getLayoutParams
Returns: LayoutParams‹›
▸ getMatchParentHeight(): number
Inherited from RootCanvasView.getMatchParentHeight
Returns: number
▸ getMatchParentWidth(): number
Inherited from RootCanvasView.getMatchParentWidth
Returns: number
▸ getOnMount(): undefined | function
Inherited from RootCanvasView.getOnMount
Returns: undefined | function
▸ getParent(): null | View‹ViewProps›
Inherited from RootCanvasView.getParent
Returns: null | View‹ViewProps›
▸ getRootView(): View‹ViewProps›
Inherited from RootCanvasView.getRootView
▸ getScale(): number
Returns: number
▸ getVisibility(): Visibility
Inherited from RootCanvasView.getVisibility
Returns: Visibility
▸ hasParent(): boolean
Inherited from RootCanvasView.hasParent
Returns: boolean
▸ layout(force?
: undefined | false | true): void
Inherited from RootCanvasView.layout
Prepares the layout for all children
Parameters:
Returns: void
▸ measure(canvas
: ViewCanvas, force?
: undefined | false | true): void
Inherited from RootCanvasView.measure
Measures the component and adjusts it's dimensions to min/max width and height values.
Parameters:
Returns: void
true if width or height changed, false otherwise
▸ mount(): void
Inherited from RootCanvasView.mount
Returns: void
▸ onDestroy(): void
Returns: void
▸ onDraw(_canvas
: ViewCanvas): void
Inherited from RootCanvasView.onDraw
Parameters:
Returns: void
▸ onLayout(): void
Inherited from RootCanvasView.onLayout
Returns: void
▸ onMeasure(width
: number, height
: number): object
Inherited from RootCanvasView.onMeasure
Parameters:
Returns: object
height: number
width: number
▸ onPointerEvent(_event
: CanvasPointerEvent): boolean
Inherited from RootCanvasView.onPointerEvent
Parameters:
Returns: boolean
▸ onSizeChanged(): void
Overrides TextView.onSizeChanged
Returns: void
▸ onSnapshot(): object
Overrides View.onSnapshot
Returns: object
dpr: number = this.dpr
▸ removeChild(child
: View | number): void
Inherited from RootCanvasView.removeChild
Parameters:
Returns: void
▸ removeChildAt(startIndex
: number, endIndex
: number): void
Inherited from RootCanvasView.removeChildAt
Parameters:
Returns: void
▸ require(requiredChanges
: RequiredViewChanges): void
Parameters:
Returns: void
▸ requireGuard(requiredChanges
: RequiredViewChanges): boolean
Inherited from RootCanvasView.requireGuard
Parameters:
Returns: boolean
▸ requireGuardAndTake(requiredChanges
: RequiredViewChanges, force?
: undefined | false | true): boolean
Inherited from RootCanvasView.requireGuardAndTake
Parameters:
Returns: boolean
▸ resolvePositionDependencies(): void
Inherited from RootCanvasView.resolvePositionDependencies
Prepare arrays of children ordered horizontally and vertically, so that they could be measured in a single pass, without waiting for their dependencies to be resolved.
This has to be called before measure whenever child's layoutParams change or views are added/removed.
throws
an error in case of unresolvable dependency (circular or lack of required view)
Returns: void
▸ run(): void
Returns: void
▸ screenshot(): string | undefined
Inherited from RootCanvasView.screenshot
Returns: string | undefined
▸ setBackgroundColor(backgroundColor
: string | undefined): void
Inherited from RootCanvasView.setBackgroundColor
Parameters:
Returns: void
▸ setBorder(borderRect
: RectLike | undefined): void
Inherited from RootCanvasView.setBorder
Parameters:
Returns: void
▸ setBorderColor(borderColor
: string | undefined): void
Inherited from RootCanvasView.setBorderColor
Parameters:
Returns: void
▸ setChildAt(child
: View, position
: number): void
Inherited from RootCanvasView.setChildAt
Parameters:
Returns: void
▸ setDebugEnabled(enabled
: boolean): void
Parameters:
Returns: void
▸ setId(id?
: undefined | string): void
Inherited from RootCanvasView.setId
Parameters:
Returns: void
▸ setLayoutParams(lp
: LayoutParams): void
Inherited from RootCanvasView.setLayoutParams
Parameters:
Returns: void
▸ setOnMount(callback
: function): void
Inherited from RootCanvasView.setOnMount
Parameters:
▪ callback: function
▸ (view
: View‹any›): void
Parameters:
Returns: void
▸ setVisibility(visibility
: Visibility): void
Inherited from RootCanvasView.setVisibility
Parameters:
Returns: void
▸ setupPointerEvents(): void
Returns: void
▸ snapshot(): object
Inherited from RootCanvasView.snapshot
Returns: object
LayoutParams
Optional
aboveId• aboveId? : Id = DefaultProps.ABOVE
Optional
belowId• belowId? : Id = DefaultProps.BELOW
Optional
bottomId• bottomId? : Id = DefaultProps.ALIGN_BOTTOM
• centerH: boolean = DefaultProps.CENTER_HORIZONTAL
• centerV: boolean = DefaultProps.CENTER_VERTICAL
• dependenciesModified: boolean = false
Optional
endId• endId? : Id = DefaultProps.ALIGN_END
• h: DimensionInput = DefaultProps.HEIGHT
• hDimension: Dimension = parseDimension(DefaultProps.HEIGHT)
• isAbsolute: boolean = DefaultProps.IS_ABSOLUTE
• isAnimated: boolean = DefaultProps.IS_ANIMATED
• marginRect: Rect‹› = DefaultProps.MARGIN
• maxH: number = DefaultProps.MAX_HEIGHT
• maxW: number = DefaultProps.MAX_WIDTH
• minH: number = DefaultProps.MIN_HEIGHT
• minW: number = DefaultProps.MIN_WIDTH
• paddingRect: Rect‹› = DefaultProps.PADDING
Optional
startId• startId? : Id = DefaultProps.ALIGN_START
Optional
toEndOfId• toEndOfId? : Id = DefaultProps.TO_END_OF
Optional
toStartOfId• toStartOfId? : Id = DefaultProps.TO_START_OF
Optional
topId• topId? : Id = DefaultProps.ALIGN_TOP
• w: DimensionInput = DefaultProps.WIDTH
• wDimension: Dimension = parseDimension(DefaultProps.WIDTH)
• x: DimensionInput = DefaultProps.X
• xDimension: Dimension = parseDimension(DefaultProps.X)
• y: DimensionInput = DefaultProps.Y
• yDimension: Dimension = parseDimension(DefaultProps.Y)
▸ above(id?
: Id): this
Parameters:
Returns: this
▸ absolute(absolute?
: undefined | false | true): this
Parameters:
Returns: this
▸ alignBottom(id?
: Id): this
Parameters:
Returns: this
▸ alignEnd(id?
: Id): this
Parameters:
Returns: this
▸ alignParentBottom(): this
Returns: this
▸ alignParentEnd(): this
Returns: this
▸ alignParentStart(): this
Returns: this
▸ alignParentTop(): this
Returns: this
▸ alignStart(id?
: Id): this
Parameters:
Returns: this
▸ alignTop(id?
: Id): this
Parameters:
Returns: this
▸ animate(animate?
: undefined | false | true): this
Parameters:
Returns: this
▸ asProps(): LayoutProps
Returns: LayoutProps
▸ below(id?
: Id): this
Parameters:
Returns: this
▸ center(center?
: undefined | false | true): this
Parameters:
Returns: this
▸ centerHorizontal(center?
: undefined | false | true): this
Parameters:
Returns: this
▸ centerVertical(center?
: undefined | false | true): this
Parameters:
Returns: this
▸ height(height
: DimensionInput): this
Parameters:
Returns: this
▸ margin(margin?
: RectLike): this
Parameters:
Returns: this
▸ maxHeight(maxHeight
: number): this
Parameters:
Returns: this
▸ maxWidth(maxWidth
: number): this
Parameters:
Returns: this
▸ minHeight(minHeight
: number): this
Parameters:
Returns: this
▸ minWidth(minWidth
: number): this
Parameters:
Returns: this
▸ padding(padding?
: RectLike): this
Parameters:
Returns: this
▸ posX(x
: DimensionInput): this
Parameters:
Returns: this
▸ posY(y
: DimensionInput): this
Parameters:
Returns: this
▸ toEndOf(id?
: Id): this
Parameters:
Returns: this
▸ toLeftOf(id?
: Id): this
Parameters:
Returns: this
▸ toRightOf(id?
: Id): this
Parameters:
Returns: this
▸ toStartOf(id?
: Id): this
Parameters:
Returns: this
▸ updateWithProps(__namedParameters
: object): boolean
Parameters:
▪Default value
__namedParameters: object= {}
Returns: boolean
▸ width(width
: DimensionInput): this
Parameters:
Returns: this
Core of Kanva |
React bindings for Kanva core. |
Chart views in Kanva |
React bindings for chart views in Kanva |
Storybook showcase of Kanva's possibilities |
‹›
↳ TextView
Parameters:
Protected
Optional
backgroundColor• backgroundColor? : undefined | string
Protected
Optional
borderColor• borderColor? : undefined | string
Protected
Optional
borderRectReadonly
contextProtected
height• height: number = 0
Optional
id• id? : undefined | number
Protected
innerRectThis are the bounds of view including padding.
Protected
lpReadonly
name• name: string
This are the bounds of view absolute offset.
Protected
Optional
onMount• onMount? : undefined | function
Protected
rectThis are bounds of a view including margin and padding
Protected
visibilityProtected
width• width: number = 0
• get innerHeight(): number
Returns: number
• get innerWidth(): number
Returns: number
Parameters:
Returns: void
▸ destroy(): void
Returns: void
Parameters:
Returns: boolean
Parameters:
Returns: void
▸ getBackgroundColor(): undefined | string
Returns: undefined | string
▸ getBorder(): undefined | string
Returns: undefined | string
▸ getBorderColor(): undefined | string
Returns: undefined | string
▸ getId(): undefined | string | number
Returns: undefined | string | number
▸ getInternalWrappedHeight(): number
Returns: number
Parameters:
Returns: undefined | number
▸ getMatchParentHeight(): number
Returns: number
▸ getMatchParentWidth(): number
Returns: number
▸ getOnMount(): undefined | function
Returns: undefined | function
▸ getText(): string
Returns: string
Parameters:
Returns: number
▸ hasParent(): boolean
Returns: boolean
▸ layout(force?
: undefined | false | true): void
Prepares the layout for all children
Parameters:
Returns: void
Measures the component and adjusts it's dimensions to min/max width and height values.
Parameters:
Returns: void
true if width or height changed, false otherwise
▸ mount(): void
Returns: void
▸ onDestroy(): void
Returns: void
Parameters:
Returns: void
▸ onLayout(): void
Returns: void
▸ onMeasure(width
: number, height
: number): object
Parameters:
Returns: object
height: number
width: number
Parameters:
Returns: boolean
▸ onSizeChanged(_width
: number, _height
: number, _oldWidth
: number, _oldHeight
: number): void
Parameters:
Returns: void
▸ onSnapshot(): object
Returns: object
text: string = this.textString
textPaint: object = this.textPaint.snapshot()
Parameters:
Returns: void
▸ removeChildAt(startIndex
: number, endIndex
: number): void
Parameters:
Returns: void
Parameters:
Returns: void
Parameters:
Returns: boolean
Parameters:
Returns: boolean
▸ resolvePositionDependencies(): void
Prepare arrays of children ordered horizontally and vertically, so that they could be measured in a single pass, without waiting for their dependencies to be resolved.
This has to be called before measure whenever child's layoutParams change or views are added/removed.
throws
an error in case of unresolvable dependency (circular or lack of required view)
Returns: void
▸ screenshot(): string | undefined
Returns: string | undefined
▸ setBackgroundColor(backgroundColor
: string | undefined): void
Parameters:
Returns: void
Parameters:
Returns: void
▸ setBorderColor(borderColor
: string | undefined): void
Parameters:
Returns: void
Parameters:
Returns: void
▸ setId(id?
: undefined | string): void
Parameters:
Returns: void
Parameters:
Returns: void
▸ setOnMount(callback
: function): void
Parameters:
▪ callback: function
Parameters:
Returns: void
▸ setText(text
: string): void
Parameters:
Returns: void
Parameters:
Returns: void
Parameters:
Returns: void
▸ snapshot(): object
Returns: object
Const
ImageView• ImageView: ReactViewComponent = createReactView(KanvaImageView)
Const
KanvaContextConst
TextView• TextView: ReactViewComponent = createReactView(KanvaTextView)
Const
View• View: ReactViewComponent = createReactView(KanvaView)
Const
createReactView▸ createReactView‹Props›(viewClass
: object): ReactViewComponent
Type parameters:
▪ Props: object
Parameters:
Returns: ReactViewComponent
Const
getAllGettersAndSetters▸ getAllGettersAndSetters(obj
: object): object[]
Parameters:
Returns: object[]
ViewCanvas
Parameters:
Protected
Readonly
canvasReadonly
context• context: CanvasRenderingContext2D
Parameters:
Returns: void
Parameters:
Returns: void
Parameters:
Returns: void
Parameters:
Returns: void
Parameters:
Returns: TextMetrics
Parameters:
Returns: void
Parameters:
Returns: void
Const
AreaChartView• AreaChartView: object = createReactView(KanvaAreaChartView)
new __type(props
: Partial‹ViewProps & Props›): object
context: React.ContextType‹typeof KanvaContext›
internalProps: InternalProps
isDebugEnabled: boolean
layoutParams? : LayoutProps | undefined
propHandlers: Record‹string, object›
propNames: string[]
props: Readonly‹Partial‹ViewProps & Props›› & Readonly‹object›
refs(): object
state: Readonly‹object›
view? : View‹ViewProps› | undefined
UNSAFE_componentWillMount(): void
UNSAFE_componentWillReceiveProps(nextProps
: Readonly‹Partial‹ViewProps & Props››, nextContext
: any): void
UNSAFE_componentWillUpdate(nextProps
: Readonly‹Partial‹ViewProps & Props››, nextState
: Readonly‹object›, nextContext
: any): void
componentDidCatch(error
: Error, errorInfo
: ErrorInfo): void
componentDidMount(): void
componentDidUpdate(): void
componentWillMount(): void
componentWillReceiveProps(nextProps
: Readonly‹Partial‹ViewProps & Props››, nextContext
: any): void
componentWillUnmount(): void
componentWillUpdate(nextProps
: Readonly‹Partial‹ViewProps & Props››, nextState
: Readonly‹object›, nextContext
: any): void
createAndAttachView(): void
forceUpdate(callback?
: function | undefined): void
getSnapshotBeforeUpdate(prevProps
: Readonly‹Partial‹ViewProps & Props››, prevState
: Readonly‹object›): any
refreshProps(): void
render(): Element
setState‹K›(state
: object | function | Pick‹object, K› | null, callback?
: function | undefined): void
shouldComponentUpdate(nextProps
: Readonly‹Partial‹ViewProps & Props››, nextState
: Readonly‹object›, nextContext
: any): boolean
contextType: Context‹ContextObject›
displayName: string
Const
AxisView• AxisView: object = createReactView(KanvaAxisView)
new __type(props
: Partial‹ViewProps & Props›): object
context: React.ContextType‹typeof KanvaContext›
internalProps: InternalProps
isDebugEnabled: boolean
layoutParams? : LayoutProps | undefined
propHandlers: Record‹string, object›
propNames: string[]
props: Readonly‹Partial‹ViewProps & Props›› & Readonly‹object›
refs(): object
state: Readonly‹object›
view? : View‹ViewProps› | undefined
UNSAFE_componentWillMount(): void
UNSAFE_componentWillReceiveProps(nextProps
: Readonly‹Partial‹ViewProps & Props››, nextContext
: any): void
UNSAFE_componentWillUpdate(nextProps
: Readonly‹Partial‹ViewProps & Props››, nextState
: Readonly‹object›, nextContext
: any): void
componentDidCatch(error
: Error, errorInfo
: ErrorInfo): void
componentDidMount(): void
componentDidUpdate(): void
componentWillMount(): void
componentWillReceiveProps(nextProps
: Readonly‹Partial‹ViewProps & Props››, nextContext
: any): void
componentWillUnmount(): void
componentWillUpdate(nextProps
: Readonly‹Partial‹ViewProps & Props››, nextState
: Readonly‹object›, nextContext
: any): void
createAndAttachView(): void
forceUpdate(callback?
: function | undefined): void
getSnapshotBeforeUpdate(prevProps
: Readonly‹Partial‹ViewProps & Props››, prevState
: Readonly‹object›): any
refreshProps(): void
render(): Element
setState‹K›(state
: object | function | Pick‹object, K› | null, callback?
: function | undefined): void
shouldComponentUpdate(nextProps
: Readonly‹Partial‹ViewProps & Props››, nextState
: Readonly‹object›, nextContext
: any): boolean
contextType: Context‹ContextObject›
displayName: string
Const
BarChartView• BarChartView: object = createReactView(KanvaBarChartView)
new __type(props
: Partial‹ViewProps & Props›): object
context: React.ContextType‹typeof KanvaContext›
internalProps: InternalProps
isDebugEnabled: boolean
layoutParams? : LayoutProps | undefined
propHandlers: Record‹string, object›
propNames: string[]
props: Readonly‹Partial‹ViewProps & Props›› & Readonly‹object›
refs(): object
state: Readonly‹object›
view? : View‹ViewProps› | undefined
UNSAFE_componentWillMount(): void
UNSAFE_componentWillReceiveProps(nextProps
: Readonly‹Partial‹ViewProps & Props››, nextContext
: any): void
UNSAFE_componentWillUpdate(nextProps
: Readonly‹Partial‹ViewProps & Props››, nextState
: Readonly‹object›, nextContext
: any): void
componentDidCatch(error
: Error, errorInfo
: ErrorInfo): void
componentDidMount(): void
componentDidUpdate(): void
componentWillMount(): void
componentWillReceiveProps(nextProps
: Readonly‹Partial‹ViewProps & Props››, nextContext
: any): void
componentWillUnmount(): void
componentWillUpdate(nextProps
: Readonly‹Partial‹ViewProps & Props››, nextState
: Readonly‹object›, nextContext
: any): void
createAndAttachView(): void
forceUpdate(callback?
: function | undefined): void
getSnapshotBeforeUpdate(prevProps
: Readonly‹Partial‹ViewProps & Props››, prevState
: Readonly‹object›): any
refreshProps(): void
render(): Element
setState‹K›(state
: object | function | Pick‹object, K› | null, callback?
: function | undefined): void
shouldComponentUpdate(nextProps
: Readonly‹Partial‹ViewProps & Props››, nextState
: Readonly‹object›, nextContext
: any): boolean
contextType: Context‹ContextObject›
displayName: string
Const
ChartGridView• ChartGridView: object = createReactView(KanvaChartGridView)
new __type(props
: Partial‹ViewProps & Props›): object
context: React.ContextType‹typeof KanvaContext›
internalProps: InternalProps
isDebugEnabled: boolean
layoutParams? : LayoutProps | undefined
propHandlers: Record‹string, object›
propNames: string[]
props: Readonly‹Partial‹ViewProps & Props›› & Readonly‹object›
refs(): object
state: Readonly‹object›
view? : View‹ViewProps› | undefined
UNSAFE_componentWillMount(): void
UNSAFE_componentWillReceiveProps(nextProps
: Readonly‹Partial‹ViewProps & Props››, nextContext
: any): void
UNSAFE_componentWillUpdate(nextProps
: Readonly‹Partial‹ViewProps & Props››, nextState
: Readonly‹object›, nextContext
: any): void
componentDidCatch(error
: Error, errorInfo
: ErrorInfo): void
componentDidMount(): void
componentDidUpdate(): void
componentWillMount(): void
componentWillReceiveProps(nextProps
: Readonly‹Partial‹ViewProps & Props››, nextContext
: any): void
componentWillUnmount(): void
componentWillUpdate(nextProps
: Readonly‹Partial‹ViewProps & Props››, nextState
: Readonly‹object›, nextContext
: any): void
createAndAttachView(): void
forceUpdate(callback?
: function | undefined): void
getSnapshotBeforeUpdate(prevProps
: Readonly‹Partial‹ViewProps & Props››, prevState
: Readonly‹object›): any
refreshProps(): void
render(): Element
setState‹K›(state
: object | function | Pick‹object, K› | null, callback?
: function | undefined): void
shouldComponentUpdate(nextProps
: Readonly‹Partial‹ViewProps & Props››, nextState
: Readonly‹object›, nextContext
: any): boolean
contextType: Context‹ContextObject›
displayName: string
Const
ChartZoomView• ChartZoomView: object = createReactView(KanvaChartZoomView)
new __type(props
: Partial‹ViewProps & Props›): object
context: React.ContextType‹typeof KanvaContext›
internalProps: InternalProps
isDebugEnabled: boolean
layoutParams? : LayoutProps | undefined
propHandlers: Record‹string, object›
propNames: string[]
props: Readonly‹Partial‹ViewProps & Props›› & Readonly‹object›
refs(): object
state: Readonly‹object›
view? : View‹ViewProps› | undefined
UNSAFE_componentWillMount(): void
UNSAFE_componentWillReceiveProps(nextProps
: Readonly‹Partial‹ViewProps & Props››, nextContext
: any): void
UNSAFE_componentWillUpdate(nextProps
: Readonly‹Partial‹ViewProps & Props››, nextState
: Readonly‹object›, nextContext
: any): void
componentDidCatch(error
: Error, errorInfo
: ErrorInfo): void
componentDidMount(): void
componentDidUpdate(): void
componentWillMount(): void
componentWillReceiveProps(nextProps
: Readonly‹Partial‹ViewProps & Props››, nextContext
: any): void
componentWillUnmount(): void
componentWillUpdate(nextProps
: Readonly‹Partial‹ViewProps & Props››, nextState
: Readonly‹object›, nextContext
: any): void
createAndAttachView(): void
forceUpdate(callback?
: function | undefined): void
getSnapshotBeforeUpdate(prevProps
: Readonly‹Partial‹ViewProps & Props››, prevState
: Readonly‹object›): any
refreshProps(): void
render(): Element
setState‹K›(state
: object | function | Pick‹object, K› | null, callback?
: function | undefined): void
shouldComponentUpdate(nextProps
: Readonly‹Partial‹ViewProps & Props››, nextState
: Readonly‹object›, nextContext
: any): boolean
contextType: Context‹ContextObject›
displayName: string
Const
LegendView• LegendView: object = createReactView(KanvaLegendView)
new __type(props
: Partial‹ViewProps & Props›): object
context: React.ContextType‹typeof KanvaContext›
internalProps: InternalProps
isDebugEnabled: boolean
layoutParams? : LayoutProps | undefined
propHandlers: Record‹string, object›
propNames: string[]
props: Readonly‹Partial‹ViewProps & Props›› & Readonly‹object›
refs(): object
state: Readonly‹object›
view? : View‹ViewProps› | undefined
UNSAFE_componentWillMount(): void
UNSAFE_componentWillReceiveProps(nextProps
: Readonly‹Partial‹ViewProps & Props››, nextContext
: any): void
UNSAFE_componentWillUpdate(nextProps
: Readonly‹Partial‹ViewProps & Props››, nextState
: Readonly‹object›, nextContext
: any): void
componentDidCatch(error
: Error, errorInfo
: ErrorInfo): void
componentDidMount(): void
componentDidUpdate(): void
componentWillMount(): void
componentWillReceiveProps(nextProps
: Readonly‹Partial‹ViewProps & Props››, nextContext
: any): void
componentWillUnmount(): void
componentWillUpdate(nextProps
: Readonly‹Partial‹ViewProps & Props››, nextState
: Readonly‹object›, nextContext
: any): void
createAndAttachView(): void
forceUpdate(callback?
: function | undefined): void
getSnapshotBeforeUpdate(prevProps
: Readonly‹Partial‹ViewProps & Props››, prevState
: Readonly‹object›): any
refreshProps(): void
render(): Element
setState‹K›(state
: object | function | Pick‹object, K› | null, callback?
: function | undefined): void
shouldComponentUpdate(nextProps
: Readonly‹Partial‹ViewProps & Props››, nextState
: Readonly‹object›, nextContext
: any): boolean
contextType: Context‹ContextObject›
displayName: string
Const
LineChartView• LineChartView: object = createReactView(KanvaLineChartView)
new __type(props
: Partial‹ViewProps & Props›): object
context: React.ContextType‹typeof KanvaContext›
internalProps: InternalProps
isDebugEnabled: boolean
layoutParams? : LayoutProps | undefined
propHandlers: Record‹string, object›
propNames: string[]
props: Readonly‹Partial‹ViewProps & Props›› & Readonly‹object›
refs(): object
state: Readonly‹object›
view? : View‹ViewProps› | undefined
UNSAFE_componentWillMount(): void
UNSAFE_componentWillReceiveProps(nextProps
: Readonly‹Partial‹ViewProps & Props››, nextContext
: any): void
UNSAFE_componentWillUpdate(nextProps
: Readonly‹Partial‹ViewProps & Props››, nextState
: Readonly‹object›, nextContext
: any): void
componentDidCatch(error
: Error, errorInfo
: ErrorInfo): void
componentDidMount(): void
componentDidUpdate(): void
componentWillMount(): void
componentWillReceiveProps(nextProps
: Readonly‹Partial‹ViewProps & Props››, nextContext
: any): void
componentWillUnmount(): void
componentWillUpdate(nextProps
: Readonly‹Partial‹ViewProps & Props››, nextState
: Readonly‹object›, nextContext
: any): void
createAndAttachView(): void
forceUpdate(callback?
: function | undefined): void
getSnapshotBeforeUpdate(prevProps
: Readonly‹Partial‹ViewProps & Props››, prevState
: Readonly‹object›): any
refreshProps(): void
render(): Element
setState‹K›(state
: object | function | Pick‹object, K› | null, callback?
: function | undefined): void
shouldComponentUpdate(nextProps
: Readonly‹Partial‹ViewProps & Props››, nextState
: Readonly‹object›, nextContext
: any): boolean
contextType: Context‹ContextObject›
displayName: string
Const
PieChartView• PieChartView: object = createReactView(KanvaPieChartView)
new __type(props
: Partial‹ViewProps & Props›): object
context: React.ContextType‹typeof KanvaContext›
internalProps: InternalProps
isDebugEnabled: boolean
layoutParams? : LayoutProps | undefined
propHandlers: Record‹string, object›
propNames: string[]
props: Readonly‹Partial‹ViewProps & Props›› & Readonly‹object›
refs(): object
state: Readonly‹object›
view? : View‹ViewProps› | undefined
UNSAFE_componentWillMount(): void
UNSAFE_componentWillReceiveProps(nextProps
: Readonly‹Partial‹ViewProps & Props››, nextContext
: any): void
UNSAFE_componentWillUpdate(nextProps
: Readonly‹Partial‹ViewProps & Props››, nextState
: Readonly‹object›, nextContext
: any): void
componentDidCatch(error
: Error, errorInfo
: ErrorInfo): void
componentDidMount(): void
componentDidUpdate(): void
componentWillMount(): void
componentWillReceiveProps(nextProps
: Readonly‹Partial‹ViewProps & Props››, nextContext
: any): void
componentWillUnmount(): void
componentWillUpdate(nextProps
: Readonly‹Partial‹ViewProps & Props››, nextState
: Readonly‹object›, nextContext
: any): void
createAndAttachView(): void
forceUpdate(callback?
: function | undefined): void
getSnapshotBeforeUpdate(prevProps
: Readonly‹Partial‹ViewProps & Props››, prevState
: Readonly‹object›): any
refreshProps(): void
render(): Element
setState‹K›(state
: object | function | Pick‹object, K› | null, callback?
: function | undefined): void
shouldComponentUpdate(nextProps
: Readonly‹Partial‹ViewProps & Props››, nextState
: Readonly‹object›, nextContext
: any): boolean
contextType: Context‹ContextObject›
displayName: string
▪ _Props: Record‹string, any›
View
↳
↳
↳
Parameters:
Protected
Optional
backgroundColor• backgroundColor? : undefined | string
Protected
Optional
borderColor• borderColor? : undefined | string
Protected
Optional
borderRectReadonly
contextProtected
height• height: number = 0
Optional
id• id? : undefined | number
Protected
innerRectThis are the bounds of view including padding.
Protected
lpReadonly
name• name: string
This are the bounds of view absolute offset.
Protected
Optional
onMount• onMount? : undefined | function
Protected
rectThis are bounds of a view including margin and padding
Protected
visibilityProtected
width• width: number = 0
• get innerHeight(): number
Returns: number
• get innerWidth(): number
Returns: number
Parameters:
Returns: void
▸ destroy(): void
Returns: void
Parameters:
Returns: boolean
Parameters:
Returns: void
▸ getBackgroundColor(): undefined | string
Returns: undefined | string
▸ getBorder(): undefined | string
Returns: undefined | string
▸ getBorderColor(): undefined | string
Returns: undefined | string
▸ getId(): undefined | string | number
Returns: undefined | string | number
Parameters:
Returns: number | undefined
Parameters:
Returns: number | undefined
▸ getMatchParentHeight(): number
Returns: number
▸ getMatchParentWidth(): number
Returns: number
▸ getOnMount(): undefined | function
Returns: undefined | function
▸ hasParent(): boolean
Returns: boolean
▸ layout(force?
: undefined | false | true): void
Prepares the layout for all children
Parameters:
Returns: void
Measures the component and adjusts it's dimensions to min/max width and height values.
Parameters:
Returns: void
true if width or height changed, false otherwise
▸ mount(): void
Returns: void
▸ onDestroy(): void
Returns: void
Parameters:
Returns: void
▸ onLayout(): void
Returns: void
▸ onMeasure(width
: number, height
: number): object
Parameters:
Returns: object
height: number
width: number
Parameters:
Returns: boolean
▸ onSizeChanged(_width
: number, _height
: number, _oldWidth
: number, _oldHeight
: number): void
Parameters:
Returns: void
▸ onSnapshot(): object
Returns: object
Parameters:
Returns: void
▸ removeChildAt(startIndex
: number, endIndex
: number): void
Parameters:
Returns: void
Parameters:
Returns: void
Parameters:
Returns: boolean
Parameters:
Returns: boolean
▸ resolvePositionDependencies(): void
Prepare arrays of children ordered horizontally and vertically, so that they could be measured in a single pass, without waiting for their dependencies to be resolved.
This has to be called before measure whenever child's layoutParams change or views are added/removed.
throws
an error in case of unresolvable dependency (circular or lack of required view)
Returns: void
▸ screenshot(): string | undefined
Returns: string | undefined
▸ setBackgroundColor(backgroundColor
: string | undefined): void
Parameters:
Returns: void
Parameters:
Returns: void
▸ setBorderColor(borderColor
: string | undefined): void
Parameters:
Returns: void
Parameters:
Returns: void
▸ setId(id?
: undefined | string): void
Parameters:
Returns: void
Parameters:
Returns: void
▸ setOnMount(callback
: function): void
Parameters:
▪ callback: function
Parameters:
Returns: void
Parameters:
Returns: void
▸ snapshot(): object
Returns: object
Ƭ AxisLabelAccessor: function
▸ (value
: number, index
: number): string
Parameters:
Ƭ DataContainerEventListener: function
Parameters:
Ƭ DataNormalizer: function
Parameters:
Ƭ DeepPartial: object
Ƭ PointAccessor: function
Parameters:
Ƭ SimpleOnScaleListener: function
Parameters:
Ƭ TooltipEventHandler: function
Parameters:
Const
TOOLTIP_EXTENSION• TOOLTIP_EXTENSION: "DataContainerTooltipExtension" = "DataContainerTooltipExtension"
Const
TRANSFORM_EXTENSION• TRANSFORM_EXTENSION: "DataContainerTransformExtension" = "DataContainerTransformExtension"
Const
VIEW_TAG• VIEW_TAG: "LineChartView" = "LineChartView"
Const
X_SCALE_BAR_OFFSET• X_SCALE_BAR_OFFSET: 0.5 = 0.5
Const
performanceResultsConst
calculateMinLineLengthParameters:
Returns: number
Const
defaultNormalizeData▸ defaultNormalizeData(__namedParameters
: object): object | object
Parameters:
▪ __namedParameters: object
Returns: object | object
Const
findBestMatchInSortedArray▸ findBestMatchInSortedArray‹T›(array
: T[], matcher
: function): T | undefined
Type parameters:
▪ T
Parameters:
▪ array: T[]
▪ matcher: function
▸ (element
: T): number
Parameters:
Returns: T | undefined
Const
floorToNearest▸ floorToNearest(value
: number, nearest
: number): number
Parameters:
Returns: number
Const
getContinuousNumericScaleParameters:
Returns: ScaleContinuousNumeric‹number, number›
Const
getPaint▸ getPaint‹P›(paint
: P, contrastPaint
: P | undefined, backgroundIsBright
: boolean): P
Type parameters:
▪ P: Paint | undefined
Parameters:
Returns: P
Const
isTupleOfNumbers▸ isTupleOfNumbers(value
: unknown): value is [number, number]
Parameters:
Returns: value is [number, number]
Const
isXYArray▸ isXYArray(data
: any): data is XYPoint‹any›[]
Parameters:
Returns: data is XYPoint‹any›[]
Const
mergeXYParameters:
Const
performanceCounter▸ performanceCounter(name
: string): end
Parameters:
Returns: end
Const
precision▸ precision(a
: number): number
Parameters:
Returns: number
Const
prepareAxisPointsParameters:
Const
prepareAxisValuesParameters:
Const
roundToNearest▸ roundToNearest(value
: number, nearest
: number): number
Parameters:
Returns: number
Const
segmentizePointsType parameters:
▪ In
▪ Filter
▪ Out
Parameters:
Const
DEFAULT_OPTIONS▪ pan: object
pointers: number = 1
▪ scale: object
drag: true = true
listenerThreshold: number = 1
multitouch: true = true
scroll: true = true
selectArea: false = false
limit: object
x: [number, number] = [1, 1]
y: [number, number] = [1, 1]
minSelectedAreaThreshold: object
x: number = 50
y: number = 0
Const
defaultStyle• backgroundPaint: Paint‹› = new Paint() .setLineWidth(1.5)
• barRadius: number = 0
• barWidth: number = 0.5
• borders: Rect‹› = new Rect({left: 1, right: 1, top: 1, bottom: 1 })
• innerRadius: number = 0
• isBackgroundBright: boolean = true
• labelPadding: number = 4
• labelPaint: Paint‹› = new Paint()
• padding: number = 0
• paint: Paint‹› = new Paint().setFillStyle(rgba('#FFF', 0.5)).setStrokeStyle('#FFF')
• paints: object
• wrapLabelsOnEdge: boolean = true
▪ background: object
paint: Paint‹› = new Paint() .setFillStyle(rgba('#FFF', .1))
radius: number = 0
width: number = 8
▪ foreground: object
paint: Paint‹› = new Paint() .setFillStyle(rgba('#FFF', .5))
radius: number = 0
width: number = 8
▪ minChunkLength: object
domain: number = 0
Const
labelPaintOverrides• textAlign: CENTER = TextAlign.CENTER
• textBaseline: BOTTOM = TextBaseline.BOTTOM
Name | Type |
---|---|
Name | Type | Default |
---|---|---|
Name | Type |
---|---|
Name | Type | Default |
---|---|---|
Name | Type |
---|---|
Name | Type |
---|---|
Name | Type |
---|---|
Name | Type |
---|---|
Name | Type |
---|---|
Name | Type |
---|---|
Name | Type |
---|---|
Name | Type | Default |
---|---|---|
Name | Type |
---|---|
Name | Type |
---|---|
Name | Type |
---|---|
Name | Type |
---|---|
Name | Type |
---|---|
Name | Type |
---|---|
Name | Type |
---|---|
Name | Type |
---|---|
Name | Type |
---|---|
Name | Type |
---|---|
Name | Type |
---|---|
Name | Type |
---|---|
Name | Type | Default |
---|---|---|
Name | Type |
---|---|
Name | Type |
---|---|
Name | Type |
---|---|
Name | Type |
---|---|
Name | Type |
---|---|
Name | Type |
---|---|
Name | Type |
---|---|
Name | Type |
---|---|
Name | Type |
---|---|
Name | Type |
---|---|
Name | Type | Default |
---|---|---|
Name | Type |
---|---|
Name | Type |
---|---|
Name | Type |
---|---|
Name | Type |
---|---|
Name | Type |
---|---|
Name | Type |
---|---|
Name | Type |
---|---|
Name | Type |
---|---|
Name | Type |
---|---|
Name | Type |
---|---|
Name | Type | Default |
---|---|---|
Name | Type |
---|---|
Name | Type |
---|---|
Name | Type |
---|---|
Name | Type |
---|---|
Name | Type |
---|---|
Name | Type |
---|---|
Name | Type |
---|---|
Name | Type |
---|---|
Name | Type |
---|---|
Name | Type |
---|---|
Name | Type |
---|---|
Name | Type | Default |
---|---|---|
Name | Type |
---|---|
Name | Type |
---|---|
Name | Type |
---|---|
Name | Type |
---|---|
Name | Type |
---|---|
Name | Type |
---|---|
Name | Type |
---|---|
Name | Type |
---|---|
Name | Type |
---|---|
Name | Type |
---|---|
Name | Type |
---|---|
Name | Type |
---|---|
Name | Type |
---|---|
Name | Type |
---|---|
Name | Type |
---|---|
Name | Type |
---|---|
Name | Type |
---|---|
Name | Type |
---|---|
Name | Type |
---|---|
Name | Type |
---|---|
Name | Type |
---|---|
Name | Type |
---|---|
Name | Type |
---|---|
Name | Type |
---|---|
Name | Type | Default |
---|---|---|
Name | Type |
---|---|
+ new TextView(context
: ):
Overrides .
Name | Type |
---|
Returns:
Inherited from .
Inherited from .
• borderRect? :
Inherited from .
• context:
Inherited from .
Inherited from .
Inherited from .
• innerRect: = new Rect(0)
Inherited from .
• lp: = new LayoutParams()
Inherited from .
Inherited from .
• offsetRect: = new Rect(0)
Inherited from .
Inherited from .
• rect: = new Rect(0)
Inherited from .
• visibility: = Visibility.VISIBLE
Inherited from .
Inherited from .
Inherited from .
Inherited from .
▸ addChild(child
: , position
: number): void
Inherited from .
Name | Type | Default |
---|
Inherited from .
▸ dispatchPointerEvent(event
: ): boolean
Inherited from .
Name | Type |
---|
▸ draw(canvas
: , force
: boolean): void
Inherited from .
Name | Type | Default |
---|
Inherited from .
Inherited from .
Inherited from .
Inherited from .
Overrides .
▸ getInternalWrappedWidth(canvas
: ): undefined | number
Overrides .
Name | Type |
---|
▸ getLayoutParams(): ‹›
Inherited from .
Returns: ‹›
Inherited from .
Inherited from .
Inherited from .
▸ getParent(): null | ‹›
Inherited from .
Returns: null | ‹›
▸ getRootView(): ‹›
Inherited from .
Returns: ‹›
▸ getTextPaint():
Returns:
▸ getVisibility():
Inherited from .
Returns:
▸ getY(textBaseline
: ): number
Name | Type |
---|
Inherited from .
Inherited from .
Name | Type |
---|
▸ measure(canvas
: , force?
: undefined | false | true): void
Inherited from .
Name | Type |
---|
Inherited from .
Inherited from .
▸ onDraw(canvas
: ): void
Overrides .
Name | Type |
---|
Inherited from .
Inherited from .
Name | Type |
---|
▸ onPointerEvent(_event
: ): boolean
Inherited from .
Name | Type |
---|
Inherited from .
Name | Type |
---|
Overrides .
▸ removeChild(child
: | number): void
Inherited from .
Name | Type |
---|
Inherited from .
Name | Type | Default |
---|
▸ require(requiredChanges
: ): void
Inherited from .
Name | Type |
---|
▸ requireGuard(requiredChanges
: ): boolean
Inherited from .
Name | Type |
---|
▸ requireGuardAndTake(requiredChanges
: , force?
: undefined | false | true): boolean
Inherited from .
Name | Type |
---|
Inherited from .
Inherited from .
Inherited from .
Name | Type |
---|
▸ setBorder(borderRect
: | undefined): void
Inherited from .
Name | Type |
---|
Inherited from .
Name | Type |
---|
▸ setChildAt(child
: , position
: number): void
Inherited from .
Name | Type |
---|
Inherited from .
Name | Type |
---|
▸ setLayoutParams(lp
: ): void
Inherited from .
Name | Type |
---|
Inherited from .
▸ (view
: ‹any›): void
Name | Type |
---|
Name | Type |
---|
▸ setTextPaint(paint
: ): void
Name | Type |
---|
▸ setVisibility(visibility
: ): void
Inherited from .
Name | Type | Default |
---|
Inherited from .
• KanvaContext: Context‹› = React.createContext({ ctx: new NoContext(), parent: undefined as any, })
Name | Type |
---|
Name | Type |
---|
+ new ViewCanvas(canvas
: ):
Name | Type |
---|
Returns:
• canvas:
▸ drawPath(paint
: ): void
Name | Type |
---|
▸ drawRect(rect
: , paint
: , borders?
: ): void
Name | Type |
---|
▸ drawText(x
: number, y
: number, text
: string, paint
: , paintOverrides?
: , maxWidth
: number): void
Name | Type | Default |
---|
▸ line(line
: ): void
Name | Type |
---|
▸ measureText(text
: string, paint
: ): TextMetrics
Name | Type |
---|
▸ roundRect(x
: number, y
: number, w
: number, h
: number, r
: ): void
Name | Type |
---|
▸ setPaint(paint
: , paintOverrides?
: ): void
Name | Type |
---|
+ new View(context
: , name
: string):
Name | Type | Default |
---|
Returns:
• borderRect? :
• context:
• innerRect: = new Rect(0)
• lp: = new LayoutParams()
• offsetRect: = new Rect(0)
• rect: = new Rect(0)
• visibility: = Visibility.VISIBLE
▸ addChild(child
: , position
: number): void
Name | Type | Default |
---|
▸ dispatchPointerEvent(event
: ): boolean
Name | Type |
---|
▸ draw(canvas
: , force
: boolean): void
Name | Type | Default |
---|
▸ getInternalWrappedHeight(_canvas
: ): number | undefined
Name | Type |
---|
▸ getInternalWrappedWidth(_canvas
: ): number | undefined
Name | Type |
---|
▸ getLayoutParams(): ‹›
Returns: ‹›
▸ getParent(): null | ‹›
Returns: null | ‹›
▸ getRootView(): ‹›
Returns: ‹›
▸ getVisibility():
Returns:
Name | Type |
---|
▸ measure(canvas
: , force?
: undefined | false | true): void
Name | Type |
---|
▸ onDraw(_canvas
: ): void
Name | Type |
---|
Name | Type |
---|
▸ onPointerEvent(_event
: ): boolean
Name | Type |
---|
Name | Type |
---|
▸ removeChild(child
: | number): void
Name | Type |
---|
Name | Type | Default |
---|
▸ require(requiredChanges
: ): void
Name | Type |
---|
▸ requireGuard(requiredChanges
: ): boolean
Name | Type |
---|
▸ requireGuardAndTake(requiredChanges
: , force?
: undefined | false | true): boolean
Name | Type |
---|
Name | Type |
---|
▸ setBorder(borderRect
: | undefined): void
Name | Type |
---|
Name | Type |
---|
▸ setChildAt(child
: , position
: number): void
Name | Type |
---|
Name | Type |
---|
▸ setLayoutParams(lp
: ): void
Name | Type |
---|
▸ (view
: ‹any›): void
Name | Type |
---|
▸ setVisibility(visibility
: ): void
Name | Type | Default |
---|
Ƭ AreaSelectEvent: ‹, Rect | undefined›
Name | Type |
---|
Ƭ DataChangeEvent: ‹›
▸ (action
: ‹T, P›): P
Name | Type |
---|
Ƭ DataContainerEvents: | |
▸ (point
: ):
Name | Type |
---|
Ƭ GetScalesEvent: ‹, ›
▸ (point
: DataPoint, index
: number, series
: DataPoint[]):
Name | Type |
---|
▸ (args
: ): void
Name | Type |
---|
▸ (event
: ): void
Name | Type |
---|
• performanceResults: Record‹string, ›
▸ calculateMinLineLength(start
: number, end
: number, scale
: , customMinLength?
: ): number
Name | Type |
---|
Name | Type |
---|
Name | Type |
---|
Name | Type |
---|
▸ getContinuousNumericScale(scaleType
: ): ScaleContinuousNumeric‹number, number›
Name | Type |
---|
Name | Type |
---|
Name | Type |
---|
Name | Type |
---|
▸ mergeXY(x
: number[], y
: number[]): []
Name | Type |
---|
Returns: []
Name | Type |
---|
Name | Type |
---|
▸ prepareAxisPoints(axisValues
: [], scale
: ): []
Name | Type |
---|
Returns: []
▸ prepareAxisValues(scale
: , params
: , seriesLength
: number): []
Name | Type | Default |
---|
Returns: []
Name | Type |
---|
▸ segmentizePoints‹In, Filter, Out›(data
: ‹In›[], filterBy
: Filter): ‹Out›[][]
Name | Type |
---|
Returns: ‹Out›[][]
• alignment: = LegendAlignment.ROW
• type: = DataDisplayType.LINE
context
child
-
position
number
-1
event
canvas
-
force
boolean
false
force?
undefined | false | true
canvas
force?
undefined | false | true
canvas
width
number
height
number
_event
_width
number
_height
number
_oldWidth
number
_oldHeight
number
child
View | number
startIndex
number
-
endIndex
number
startIndex + 1
requiredChanges
requiredChanges
requiredChanges
force?
undefined | false | true
backgroundColor
string | undefined
borderRect
RectLike | undefined
borderColor
string | undefined
child
position
number
id?
undefined | string
lp
view
View‹any›
scaleType
source
string
visibility
Visibility.VISIBLE
Name
Type
startX
number
startY
number
endX
number
endY
number
Name
Type
line
Name
Type
x
number
y
number
Name
Type
line
Name
Type
distance
number
Name
Type
distance
number
Name
Type
line
Name
Type
x
number
y
number
Name
Type
Default
position
number
-
result
new Point()
Name
Type
_id
number
Name
Type
_id
string | number
Name
Type
_idName
string
Name
Type
_id
string | number | undefined
Name
Type
value
Name
Type
rect
Name
Type
x
number
y
number
Name
Type
expansion
Rect | number
Name
Type
shrink
Rect | number
Name
Type
rect
Name
Type
offset
Name
Type
x
number
y
number
Name
Type
rectLike
fill
string
font
lineDash
number[]
lineRounding
boolean
lineWidth
number
stroke
string
textAlign
textBaseline
textDirection
CanvasDirection
Name
Type
Default
x
number
0
y
number
0
Name
Type
point
Name
Type
options
ScaleGestureDetectorOptions
Name
Type
event
Name
Type
event
context
canvas
child
-
position
number
-1
event
canvas
_canvas
_canvas
force?
undefined | false | true
canvas
force?
undefined | false | true
_canvas
width
number
height
number
_event
child
View | number
startIndex
number
-
endIndex
number
startIndex + 1
requiredChanges
requiredChanges
requiredChanges
force?
undefined | false | true
backgroundColor
string | undefined
borderRect
RectLike | undefined
borderColor
string | undefined
child
position
number
enabled
boolean
id?
undefined | string
lp
view
View‹any›
visibility
Visibility.VISIBLE
id?
absolute?
undefined | false | true
id?
id?
id?
id?
animate?
undefined | false | true
id?
center?
undefined | false | true
center?
undefined | false | true
center?
undefined | false | true
height
margin?
maxHeight
number
maxWidth
number
minHeight
number
minWidth
number
padding?
x
y
id?
id?
id?
id?
above
undefined | string | number
DefaultProps.ABOVE
alignBottom
undefined | string | number
DefaultProps.ALIGN_BOTTOM
alignEnd
undefined | string | number
DefaultProps.ALIGN_END
alignStart
undefined | string | number
DefaultProps.ALIGN_START
alignTop
undefined | string | number
DefaultProps.ALIGN_TOP
below
undefined | string | number
DefaultProps.BELOW
centerHorizontal
boolean
DefaultProps.CENTER_HORIZONTAL
centerVertical
boolean
DefaultProps.CENTER_VERTICAL
height
null | string | number
DefaultProps.HEIGHT
isAbsolute
boolean
DefaultProps.IS_ABSOLUTE
isAnimated
boolean
DefaultProps.IS_ANIMATED
margin
DefaultProps.MARGIN
maxHeight
number
DefaultProps.MAX_HEIGHT
maxWidth
number
DefaultProps.MAX_WIDTH
minHeight
number
DefaultProps.MIN_HEIGHT
minWidth
number
DefaultProps.MIN_WIDTH
padding
DefaultProps.PADDING
posX
null | string | number
DefaultProps.X
posY
null | string | number
DefaultProps.Y
toEndOf
undefined | string | number
DefaultProps.TO_END_OF
toStartOf
undefined | string | number
DefaultProps.TO_START_OF
width
null | string | number
DefaultProps.WIDTH
width
| undefined | false | true |
| number |
| number |
| number |
| number |
| number |
| number |
| number | - |
| number | startIndex + 1 |
| string | undefined |
| string | undefined |
| undefined | string |
| string |
| object |
| object |
| undefined | false | true |
| number |
| number |
| number |
| number |
| number |
| number |
| number | - |
| number | startIndex + 1 |
| string | undefined |
| string | undefined |
| undefined | string |
| number |
| number |
| DataPoint |
| number |
| DataPoint[] |
| number |
| number |
| T |
| number |
| number |
| P |
| P | undefined |
| boolean |
| unknown |
| any |
| number[] |
| number[] |
| string |
| number |
| number |
| number |
This section is unfortunately still work in progress...
|
| - |
| number | -1 |
|
| - |
| boolean | false |
|
|
|
| undefined | false | true |
|
|
|
|
|
|
| undefined | false | true |
|
|
| number |
|
|
|
| Visibility.VISIBLE |
|
|
|
|
|
| number | - |
| number | - |
| string | - |
| - |
| - |
| number | 0 |
|
| string |
|
| number |
| number |
| number |
| number |
|
|
|
| - |
| string | "View" |
| - |
| number | -1 |
|
| - |
| boolean | false |
|
|
|
| undefined | false | true |
|
|
|
|
|
|
| undefined | false | true |
|
|
| number |
|
|
| Visibility.VISIBLE |
|
|
|
|
| number |
| number |
|
|
|
|
|
| - |
| - |
| number | 10 |
|
| Filter |
| number
| undefined
‹any›
| number
| undefined
‹any›
‹T, P›
[]
‹In›[]