@antv/g-gesture
Advanced tools
Comparing version 0.0.52 to 0.0.53
@@ -0,1 +1,2 @@ | ||
import { Rect } from '../..'; | ||
import type { CSSGradientValue } from '../cssom'; | ||
@@ -7,3 +8,3 @@ import { CSSRGB } from '../cssom'; | ||
export interface Pattern { | ||
image: string | CanvasImageSource; | ||
image: string | CanvasImageSource | Rect; | ||
repetition: 'repeat' | 'repeat-x' | 'repeat-y' | 'no-repeat'; | ||
@@ -10,0 +11,0 @@ transform: string; |
@@ -37,3 +37,2 @@ import type { DisplayObject } from '../../display-objects'; | ||
export declare class CSSPropertyTransform implements Partial<CSSProperty<CSSKeywordValue | ParsedTransform[], ParsedTransform[]>> { | ||
private tmpMat4; | ||
parser: typeof parseTransform; | ||
@@ -40,0 +39,0 @@ calculator(name: string, oldParsed: CSSKeywordValue | ParsedTransform[], parsed: CSSKeywordValue | ParsedTransform[], object: DisplayObject): ParsedTransform[]; |
@@ -7,2 +7,4 @@ import type { CanvasLike } from '..'; | ||
* - g-plugin-device-renderer `ctx.createLinearGradient` and generate texture | ||
* | ||
* @see https://blog.scottlogic.com/2020/03/19/offscreen-canvas.html | ||
*/ | ||
@@ -9,0 +11,0 @@ export declare class OffscreenCanvasCreator { |
@@ -1,2 +0,2 @@ | ||
import { Canvas } from '@antv/g-lite'; | ||
import { Rect } from '@antv/g-lite'; | ||
import type { DotPatternCfg } from './interfaces'; | ||
@@ -15,4 +15,3 @@ export declare const defaultDotPatternCfg: { | ||
}; | ||
export declare function drawDot(context: CanvasRenderingContext2D, cfg: DotPatternCfg, x: number, y: number): void; | ||
export declare function dots(canvas: Canvas, cfg?: DotPatternCfg): HTMLCanvasElement; | ||
export declare function dots(cfg?: DotPatternCfg): Rect; | ||
//# sourceMappingURL=dots.d.ts.map |
@@ -8,2 +8,3 @@ export type PatternCfg = { | ||
backgroundColor?: string; | ||
backgroundOpacity?: number; | ||
/** | ||
@@ -10,0 +11,0 @@ * @title 贴图图案填充色 |
@@ -1,2 +0,2 @@ | ||
import { Canvas } from '@antv/g-lite'; | ||
import { Rect } from '@antv/g-lite'; | ||
import type { LinePatternCfg } from './interfaces'; | ||
@@ -10,2 +10,3 @@ /** | ||
backgroundColor: string; | ||
backgroundOpacity: number; | ||
strokeOpacity: number; | ||
@@ -16,13 +17,5 @@ stroke: string; | ||
/** | ||
* 绘制line | ||
* | ||
* @param context canvasContext | ||
* @param cfg linePattern 的配置 | ||
* @param d 绘制 path 所需的 d | ||
*/ | ||
export declare function drawLine(context: CanvasRenderingContext2D, cfg: LinePatternCfg, d: string): void; | ||
/** | ||
* 创建 linePattern | ||
*/ | ||
export declare function lines(canvas: Canvas, cfg?: LinePatternCfg): HTMLCanvasElement; | ||
export declare function lines(cfg?: LinePatternCfg): Rect; | ||
//# sourceMappingURL=lines.d.ts.map |
@@ -1,2 +0,2 @@ | ||
import { Canvas } from '@antv/g-lite'; | ||
import { Rect } from '@antv/g-lite'; | ||
import type { SquarePatternCfg } from './interfaces'; | ||
@@ -18,13 +18,5 @@ /** | ||
/** | ||
* 绘制square | ||
* | ||
* @param context canvasContext | ||
* @param cfg squarePattern 的配置 | ||
* @param x和y square的中心位置 | ||
*/ | ||
export declare function drawSquare(context: CanvasRenderingContext2D, cfg: SquarePatternCfg, x: number, y: number): void; | ||
/** | ||
* 创建 squarePattern | ||
*/ | ||
export declare function squares(canvas: Canvas, cfg?: SquarePatternCfg): HTMLCanvasElement; | ||
export declare function squares(cfg?: SquarePatternCfg): Rect; | ||
//# sourceMappingURL=squares.d.ts.map |
@@ -1,17 +0,2 @@ | ||
import { Canvas } from '@antv/g-lite'; | ||
import type { PatternCfg } from './interfaces'; | ||
/** | ||
* 初始化 cavnas,设置宽高等 | ||
*/ | ||
export declare function initCanvas(canvas: Canvas, width: number, height?: number): [HTMLCanvasElement, CanvasRenderingContext2D]; | ||
/** | ||
* 绘制背景 | ||
* | ||
* @param context | ||
* @param cfg | ||
* @param width | ||
* @param height | ||
*/ | ||
export declare function drawBackground(context: CanvasRenderingContext2D, cfg: PatternCfg, width: number, height?: number): void; | ||
/** | ||
* 计算贴图单元大小 | ||
@@ -33,8 +18,2 @@ * | ||
export declare function getSymbolsPosition(unitSize: number, isStagger: boolean): number[][]; | ||
/** | ||
* 给整个 pattern贴图 做变换, 目前支持旋转 | ||
* | ||
* @param dpr 设备像素比 | ||
* @param degree 旋转角度 | ||
*/ | ||
//# sourceMappingURL=util.d.ts.map |
@@ -1,2 +0,2 @@ | ||
import type { RenderingPlugin, RenderingPluginContext } from '@antv/g-lite'; | ||
import type { DisplayObject, RenderingPlugin, RenderingPluginContext, CanvasContext } from '@antv/g-lite'; | ||
import type { CanvasRendererPluginOptions } from './interfaces'; | ||
@@ -37,3 +37,3 @@ /** | ||
private clearRect; | ||
private renderDisplayObject; | ||
renderDisplayObject(object: DisplayObject, context: CanvasRenderingContext2D, canvasContext: CanvasContext, restoreStack: DisplayObject[]): void; | ||
private convertAABB2Rect; | ||
@@ -40,0 +40,0 @@ /** |
@@ -1,3 +0,4 @@ | ||
import type { DisplayObject, ParsedBaseStyleProps, RenderingService } from '@antv/g-lite'; | ||
import { CanvasContext, DisplayObject, ParsedBaseStyleProps } from '@antv/g-lite'; | ||
import type { ImagePool } from '@antv/g-plugin-image-loader'; | ||
import { CanvasRendererPlugin } from '../../CanvasRendererPlugin'; | ||
import type { StyleRenderer } from './interfaces'; | ||
@@ -7,3 +8,3 @@ export declare class DefaultRenderer implements StyleRenderer { | ||
constructor(imagePool: ImagePool); | ||
render(context: CanvasRenderingContext2D, parsedStyle: ParsedBaseStyleProps, object: DisplayObject, renderingService: RenderingService): void; | ||
render(context: CanvasRenderingContext2D, parsedStyle: ParsedBaseStyleProps, object: DisplayObject, canvasContext: CanvasContext, plugin: CanvasRendererPlugin): void; | ||
private clearShadowAndFilter; | ||
@@ -10,0 +11,0 @@ private fill; |
@@ -1,5 +0,6 @@ | ||
import type { DisplayObject, ParsedBaseStyleProps, RenderingService } from '@antv/g-lite'; | ||
import type { CanvasContext, DisplayObject, ParsedBaseStyleProps } from '@antv/g-lite'; | ||
import { CanvasRendererPlugin } from '../../CanvasRendererPlugin'; | ||
export interface StyleRenderer { | ||
render: (context: CanvasRenderingContext2D, parsedStyle: ParsedBaseStyleProps, object: DisplayObject, renderingService: RenderingService) => void; | ||
render: (context: CanvasRenderingContext2D, parsedStyle: ParsedBaseStyleProps, object: DisplayObject, canvasContext: CanvasContext, plugin: CanvasRendererPlugin) => void; | ||
} | ||
//# sourceMappingURL=interfaces.d.ts.map |
@@ -1,2 +0,2 @@ | ||
import type { DataURLOptions, RenderingPlugin, RenderingPluginContext, Shape } from '@antv/g-lite'; | ||
import { DataURLOptions, RenderingPlugin, RenderingPluginContext, Shape } from '@antv/g-lite'; | ||
import type { Canvas, InputRect, ManagedSkottieAnimation, Particles } from 'canvaskit-wasm'; | ||
@@ -3,0 +3,0 @@ import type { FontLoader } from './FontLoader'; |
@@ -1,2 +0,2 @@ | ||
import type { LinearGradient, Pattern, RadialGradient, CanvasConfig } from '@antv/g-lite'; | ||
import { LinearGradient, Pattern, RadialGradient, CanvasConfig } from '@antv/g-lite'; | ||
import { GradientType } from '@antv/g-lite'; | ||
@@ -16,3 +16,3 @@ export type GradientParams = (LinearGradient & RadialGradient) & { | ||
getOrCreateImage(src: string): Promise<HTMLImageElement>; | ||
getOrCreatePatternSync(pattern: Pattern, context: CanvasRenderingContext2D, callback: () => void): CanvasPattern; | ||
getOrCreatePatternSync(pattern: Pattern, context: CanvasRenderingContext2D, $offscreenCanvas: HTMLCanvasElement, dpr: number, callback: () => void): CanvasPattern; | ||
getOrCreateGradient(params: GradientParams, context: CanvasRenderingContext2D): CanvasGradient; | ||
@@ -19,0 +19,0 @@ private generateGradientKey; |
@@ -1,2 +0,3 @@ | ||
import type { CanvasContext, CSSGradientValue, CSSRGB, DisplayObject, ParsedBaseStyleProps, Pattern } from '@antv/g-lite'; | ||
import { CanvasContext, CSSGradientValue, CSSRGB, DisplayObject, ParsedBaseStyleProps, Pattern } from '@antv/g-lite'; | ||
import { SVGRendererPlugin } from '../../SVGRendererPlugin'; | ||
export declare class DefElementManager { | ||
@@ -14,3 +15,3 @@ private context; | ||
private clearUnusedDefElement; | ||
createOrUpdateGradientAndPattern(object: DisplayObject, $el: SVGElement, parsedColor: CSSGradientValue[] | CSSRGB | Pattern, name: string): void; | ||
createOrUpdateGradientAndPattern(object: DisplayObject, $el: SVGElement, parsedColor: CSSGradientValue[] | CSSRGB | Pattern, name: string, plugin: SVGRendererPlugin): void; | ||
createOrUpdateShadow(object: DisplayObject, $el: SVGElement, name: string): void; | ||
@@ -17,0 +18,0 @@ createOrUpdateFilter(object: DisplayObject, $el: SVGElement, filters: ParsedBaseStyleProps['filter']): void; |
@@ -1,5 +0,6 @@ | ||
import type { DisplayObject, Pattern } from '@antv/g-lite'; | ||
import { DisplayObject, Pattern } from '@antv/g-lite'; | ||
import { CSSGradientValue, CSSRGB } from '@antv/g-lite'; | ||
import { SVGRendererPlugin } from '../../SVGRendererPlugin'; | ||
export declare const PATTERN_PREFIX = "g-pattern-"; | ||
export declare function createOrUpdateGradientAndPattern(document: Document, $def: SVGDefsElement, object: DisplayObject, $el: SVGElement, parsedColor: CSSGradientValue[] | CSSRGB | Pattern, name: string, createImage: (url: string) => HTMLImageElement): string; | ||
export declare function createOrUpdateGradientAndPattern(document: Document, $def: SVGDefsElement, object: DisplayObject, $el: SVGElement, parsedColor: CSSGradientValue[] | CSSRGB | Pattern, name: string, createImage: (url: string) => HTMLImageElement, plugin: SVGRendererPlugin): string; | ||
//# sourceMappingURL=Pattern.d.ts.map |
@@ -1,2 +0,3 @@ | ||
import type { LinearGradient, RadialGradient, RenderingPlugin, RenderingPluginContext } from '@antv/g-lite'; | ||
import type { DisplayObject, LinearGradient, RadialGradient, RenderingPlugin, RenderingPluginContext } from '@antv/g-lite'; | ||
import { mat4 } from 'gl-matrix'; | ||
import type { DefElementManager } from './shapes/defs'; | ||
@@ -50,6 +51,6 @@ import type { SVGRendererPluginOptions } from './interfaces'; | ||
private reorderChildren; | ||
private applyTransform; | ||
applyTransform($el: SVGElement, rts: mat4): void; | ||
private applyAttributes; | ||
private updateAttribute; | ||
private createSVGDom; | ||
createSVGDom(document: Document, object: DisplayObject, root: SVGElement, noWrapWithGroup?: boolean): void; | ||
private removeSVGDom; | ||
@@ -56,0 +57,0 @@ private createOrUpdateHitArea; |
{ | ||
"name": "@antv/g-gesture", | ||
"version": "0.0.52", | ||
"version": "0.0.53", | ||
"description": "G Gesture", | ||
@@ -37,4 +37,4 @@ "keywords": [ | ||
"devDependencies": { | ||
"@antv/g-mobile-canvas": "^0.8.26", | ||
"@antv/g-mobile-canvas-element": "^0.6.29" | ||
"@antv/g-mobile-canvas": "^0.8.27", | ||
"@antv/g-mobile-canvas-element": "^0.6.30" | ||
}, | ||
@@ -44,3 +44,3 @@ "publishConfig": { | ||
}, | ||
"gitHead": "9c99243a29308d12fc22ab4f3290033771e53fcb" | ||
"gitHead": "28fd2d84bf0525523836447be314ab15b9997e32" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1112389
1311
16361