MCPcopy
hub / github.com/jasondavies/d3-cloud / getContext

Function getContext

index.js:97–108  ·  view source on GitHub ↗
(canvas)

Source from the content-addressed store, hash-verified

95 };
96
97 function getContext(canvas) {
98 const context = canvas.getContext("2d", {willReadFrequently: true});
99
100 canvas.width = canvas.height = 1;
101 const ratio = Math.sqrt(context.getImageData(0, 0, 1, 1).data.length >> 2);
102 canvas.width = (cw << 5) / ratio;
103 canvas.height = ch / ratio;
104
105 context.fillStyle = context.strokeStyle = "red";
106
107 return {context, ratio};
108 }
109
110 function place(board, tag, bounds) {
111 var perimeter = [{x: 0, y: 0}, {x: size[0], y: size[1]}],

Callers 1

index.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…