Slackbot
03/21/2023, 12:17 AMaaronkyle
03/21/2023, 12:19 AMYuri Vishnevsky
03/21/2023, 2:44 AMMark McClure
03/21/2023, 3:15 AMFil
03/21/2023, 6:50 AMPlot.plot({
width: 800,
height: 500,
marks: [
Plot.dot(olympians, {
x: "weight",
y: "height",
fill: "sex",
opacity: 0.5
}),
Plot.ruleX([30]),
Plot.ruleY([1.2]),
() => svg`<g transform="translate(400,270)">${
Plot.rectY(
olympians,
Plot.binX({ y: "count" }, { x: "weight", fill: "sex" })
).plot({ axis: null, x: { domain: [180, 20] }, height: 200, width: 400 })}`
]
})
Gary McClelland
03/21/2023, 2:40 PMFil
03/21/2023, 4:56 PMGary McClelland
03/22/2023, 9:40 PMFil
03/22/2023, 10:03 PMGary McClelland
03/22/2023, 10:54 PMFil
03/23/2023, 7:41 AMGary McClelland
03/23/2023, 1:32 PMdata:image/svg+xml;utf8,${smallPlot(d.dist).outerHTML}
and .attr("xmlns", d3.namespaces.svg). But it works and I can tweak the design. Thanks!Fil
03/23/2023, 1:35 PM…${a}
returns a string with the value of a
• the final string is a data-url that we can use as the URL of an image in the new Plot
• the 'attr' method sets the 'xmlns' attribute to the SVG namespace, so the browser knows how to interpret it