MCPcopy
hub / github.com/chartjs/Chart.js / _getParentNode

Function _getParentNode

src/helpers/helpers.dom.ts:16–22  ·  view source on GitHub ↗
(domNode: HTMLCanvasElement)

Source from the content-addressed store, hash-verified

14 * @private
15 */
16export function _getParentNode(domNode: HTMLCanvasElement): HTMLCanvasElement {
17 let parent = domNode.parentNode;
18 if (parent && parent.toString() === '[object ShadowRoot]') {
19 parent = (parent as ShadowRoot).host;
20 }
21 return parent as HTMLCanvasElement;
22}
23
24/**
25 * convert max-width/max-height values that may be percentages into a number

Callers 3

getContainerSizeFunction · 0.85
createResizeObserverFunction · 0.85
isAttachedMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected