UNPKG

react-pixi-plot

Version:

A React component rendering a zoomable and draggable PIXI.js scene. Intended to render 2d plots

63 lines (62 loc) 1.78 kB
import * as PIXI from 'pixi.js'; export default class SVGGraphics extends PIXI.Container { svgElement: HTMLElement; _lineWidthScale: number; _tint: number; constructor(svgElement: HTMLElement, lineWidthScale?: number); lineWidthScale: number; tint: number; containsPoint: (p: PIXI.Point) => boolean; drawNode: (node: SVGElement) => void; /** * Draws the given root SVG node (and handles it as a group) * @param {SVGSVGElement} node */ drawSvgNode: (node: any) => void; /** * Draws the given group svg node * @param {SVGGroupElement} node */ drawGNode: (node: any) => void; /** * Draws the given line svg node * @param {SVGLineElement} node */ drawLineNode: (node: any) => void; /** * Draws the given polyline svg node * @param {SVGPolylineElement} node */ drawPolylineNode: (node: any) => void; /** * Draws the given circle node * @param {SVGCircleElement} node */ drawCircleNode: (node: any) => void; /** * Draws the given ellipse node * @param {SVGCircleElement} node */ drawEllipseNode: (node: any) => void; /** * Draws the given rect node * @param {SVGRectElement} node */ drawRectNode: (node: any) => void; /** * Draws the given polygon node * @param {SVGPolygonElement} node */ drawPolygonNode: (node: any) => void; addHitAreaAroundLine(g: PIXI.Graphics): void; /** * Draws the given path svg node * @param {SVGPathElement} node */ drawPathNode: (node: any) => void; /** * Applies the given node's attributes to our PIXI.Graphics object * @param {SVGElement} node */ applySvgAttributes: (graphics: any, node: SVGElement) => void; }