MCPcopy Index your code
hub / github.com/tensorflow/playground / renderThumbnail

Function renderThumbnail

src/playground.ts:994–1006  ·  view source on GitHub ↗
(canvas, dataGenerator)

Source from the content-addressed store, hash-verified

992
993function drawDatasetThumbnails() {
994 function renderThumbnail(canvas, dataGenerator) {
995 let w = 100;
996 let h = 100;
997 canvas.setAttribute("width", w);
998 canvas.setAttribute("height", h);
999 let context = canvas.getContext("2d");
1000 let data = dataGenerator(200, 0);
1001 data.forEach(function(d) {
1002 context.fillStyle = colorScale(d.label);
1003 context.fillRect(w * (d.x + 6) / 12, h * (d.y + 6) / 12, 4, 4);
1004 });
1005 d3.select(canvas.parentNode).style("display", null);
1006 }
1007 d3.selectAll(".dataset").style("display", "none");
1008
1009 if (state.problem === Problem.CLASSIFICATION) {

Callers 1

drawDatasetThumbnailsFunction · 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…