How to use fancy-canvas - 1 common examples

To help you get started, we’ve selected a few fancy-canvas examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github tradingview / lightweight-charts / src / gui / canvas-utils.ts View on Github external
export function createBoundCanvas(parentElement: HTMLElement, size: Size): CanvasCoordinateSpaceBinding {
	const doc = ensureNotNull(parentElement.ownerDocument);
	const canvas = createCanvas(doc);
	parentElement.appendChild(canvas);

	const binding = bindToDevicePixelRatio(canvas);
	binding.resizeCanvas({
		width: size.w,
		height: size.h,
	});
	return binding;
}

fancy-canvas

Functionality on top of HTML canvas element, including support for HiDPI and pixel-perfect rendering

MIT
Latest version published 1 year ago

Package Health Score

52 / 100
Full package analysis