vis2 = Plot.plot({
style: { fontSize: 13, background: "#e0ecf4" },
width: width > 650 ? 690 : 350,
height: 426,
margin: 50,
marginTop: 50,
marginBottom: 100,
marginRight: 100,
y: { label: null },
x: { label: null },
marks: [
Plot.axisX({
tickFormat: (d) => d + "%"
}),
Plot.ruleY([0], { strokeDasharray: "2 2" }),
Plot.ruleX([0], { strokeDasharray: "2 2" }),
Plot.dot(data, {
x: "vac",
y: "sal_change",
tip: true,
title: (d) => `${d.name}`,
fill: "pink",
stroke: "#333",
strokeWidth: 0.5,
r: 4
}),
Plot.dot(
data.filter(
(d) => d.vac > 7 || d.vac < -18 || d.sal_change > 43 || d.sal_change < 0
),
{
x: "vac",
lineWidth: 12,
y: "sal_change",
strokeWidth: 0.5,
stroke: "#000"
}
),
Plot.text(
data.filter(
(d) => d.vac > 7 || d.vac < -18 || d.sal_change > 43 || d.sal_change < 0
),
{
x: "vac",
lineWidth: 12,
y: "sal_change",
dy: -14,
text: (d) => d.name_,
fontWeight: 300,
fill: "#333",
stroke: "#fff"
}
),
Plot.text(["ЗМІНА ЗАРПЛАТИ\nВ 2024 РОЦІ,\nТИС ГРН"], {
frameAnchor: "top-left",
dx: -40,
dy: -40,
font: 16,
fontWeight: 700
}),
Plot.text(["ЗМІНА ШТАТУ\nЗ ПОЧАТКУ 2024 РОКУ"], {
frameAnchor: "bottom-right",
dx: 40,
dy: 50,
font: 16,
fontWeight: 700
})
]
})