基于 SOC 职业分类
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/cxcscmu/SkillLearnBench --skill d3-data-formatting命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
正在显示 SKILL.md
Handles reading, populating, and saving .docx files using the python-docx library. Use this skill for any tasks involving template filling or modifying Word documents.
Perform various data analysis on SEC 13-F and obtain some insights of fund activities such as number of holdings, AUM, and change of holdings between two quarters.
This skill includes search capability in 13F, such as fuzzy search a fund information using possibly inaccurate name, or fuzzy search a stock cusip info using its name.
| name | d3-data-formatting |
| description | Loading CSV data, formatting currency/large numbers, and implementing tooltips in D3. |
Efficient data visualization requires robust parsing and clear numerical presentation.
Use Promise.all with d3.csv to load multiple datasets before initializing the visualization.
Promise.all([
d3.csv("data/stock-descriptions.csv"),
d3.csv("data/indiv-stock/AAPL.csv")
]).then(([descriptions, aaplData]) => {
// Process and merge data
});
For market capitalization, use d3.format or custom logic to convert large numbers into readable strings (e.g., Trillions 'T', Billions 'B').
function formatMarketCap(d) {
if (!d || d === "") return "N/A";
const val = parseFloat(d);
if (val >= 1e12) return (val / 1e12).toFixed(2) + "T";
if (val >= 1e9) return (val / 1e9).toFixed(2) + "B";
if (val >= 1e6) return (val / 1e6).toFixed(2) + "M";
return val.toLocaleString();
}
Create a hidden div and update its position and content on mouse events.
const tooltip = d3.select("body").append("div")
.attr("class", "tooltip")
.style("opacity", 0);
nodes.on("mouseover", (event, d) => {
tooltip.transition().duration(200).style("opacity", .9);
tooltip.html(`Ticker: ${d.ticker}<br/>Sector: ${d.sector}`)
.style("left", (event.pageX + 10) + "px")
.style("top", (event.pageY - 28) + "px");
})
.on("mouseout", () => {
tooltip.transition().duration(500).style("opacity", 0);
});