[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6KJ8259SMZZJG4B6H7MT7QE":3,"skill-same:01M6KJ8259SMZZJG4B6H7MT7QE":59},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":32,"linkOnly":33,"markdownContent":34,"markdownBody":35,"frontMatter":36,"refName":37,"commitSha":38,"skillDirectory":39,"forksCount":40,"repositoryHtmlUrl":41,"repositoryHomepageUrl":42,"ownerHtmlUrl":43,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":44,"install":45,"resources":58},"01M6KJ8259SMZZJG4B6H7MT7QE","d3-interactivity-and-tooltips",null,"HTML\u002FCSS\u002FJS patterns for creating tooltips, conditional interactions based on data attributes, and cross-highlighting elements across different views (like a chart and a table).","cxcscmu\u002FSkillLearnBench","cxcscmu","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F142838272?v=4","01M6KCQDFQWPDSN0MKZY96MSQP","01M6KCQDM7G70TKJ28NTSQC0RZ",93,"MIT","https:\u002F\u002Fgithub.com\u002Fcxcscmu\u002FSkillLearnBench\u002Fblob\u002Fmain\u002Fskills\u002Fb3-teacher-feedback-gemini-3.1-pro-preview\u002Fstock-data-visualization\u002Frun3_d3-interactivity-and-tooltips\u002FSKILL.md",[],[18,19,20,21,22,23,24,25,26,27,28,29,30,31],"d3","d3 interactivity and tooltips","css","data","js","table","html","patterns","across","elements","chart","attributes","for","conditional","2026-11-10 10:12:30",false,"---\nname: d3-interactivity-and-tooltips\ndescription: HTML\u002FCSS\u002FJS patterns for creating tooltips, conditional interactions based on data attributes, and cross-highlighting elements across different views (like a chart and a table).\n---\n\n### 1. Tooltip HTML\u002FCSS\u002FJS Pattern\n\nTo create a dynamic tooltip, use a hidden HTML `div` that is styled with CSS and positioned dynamically using JavaScript mouse events.\n\n**HTML Pattern:**\n```html\n\u003C!-- Place this somewhere in your HTML body, outside the SVG -->\n\u003Cdiv id=\"tooltip\" class=\"tooltip\">\u003C\u002Fdiv>\n```\n\n**CSS Pattern:**\n```css\n.tooltip {\n  position: absolute;\n  opacity: 0; \u002F* Hidden by default *\u002F\n  pointer-events: none; \u002F* Prevents the tooltip from interfering with mouse events *\u002F\n  background-color: rgba(0, 0, 0, 0.8);\n  color: white;\n  padding: 8px 12px;\n  border-radius: 4px;\n  font-family: sans-serif;\n  font-size: 12px;\n  \u002F* Add transition for smooth appearance *\u002F\n  transition: opacity 0.2s;\n}\n```\n\n**JavaScript Pattern:**\nBind `mouseover`, `mousemove`, and `mouseout` events to your D3 selection. Position the tooltip using `event.pageX` and `event.pageY`.\n\n```javascript\nconst tooltip = d3.select(\"#tooltip\");\n\nnodes.on(\"mouseover\", function(event, d) {\n    tooltip.style(\"opacity\", 1); \u002F\u002F Make visible\n    tooltip.html(`\u003Cstrong>${d.name}\u003C\u002Fstrong>\u003Cbr>Value: ${d.value}`);\n})\n.on(\"mousemove\", function(event, d) {\n    \u002F\u002F Offset by a few pixels so the cursor doesn't cover the tooltip\n    tooltip.style(\"left\", (event.pageX + 10) + \"px\")\n           .style(\"top\", (event.pageY + 10) + \"px\");\n})\n.on(\"mouseout\", function(event, d) {\n    tooltip.style(\"opacity\", 0); \u002F\u002F Hide\n});\n```\n\n### 2. Conditional Interactions Pattern\n\nSometimes interactions (like tooltips) should only trigger for specific data points (e.g., skip entries missing certain fields). Wrap the logic inside your event listeners with a condition.\n\n```javascript\nnodes.on(\"mouseover\", function(event, d) {\n    \u002F\u002F Conditional Interaction: Only show tooltip if the node is NOT an ETF\n    if (d.type !== \"ETF\") {\n        tooltip.style(\"opacity\", 1);\n        tooltip.html(`Ticker: ${d.ticker}\u003Cbr>Market Cap: ${d.marketCap}`);\n    }\n})\n.on(\"mousemove\", function(event, d) {\n    if (d.type !== \"ETF\") {\n        tooltip.style(\"left\", (event.pageX + 10) + \"px\")\n               .style(\"top\", (event.pageY + 10) + \"px\");\n    }\n})\n.on(\"mouseout\", function(event, d) {\n    tooltip.style(\"opacity\", 0);\n});\n```\n\n### 3. Cross-Highlighting Pattern\n\nTo connect two different views (like a bubble chart and a table), assign common identifiers to both elements and toggle a specific CSS class (e.g., `.selected`) on click.\n\n**CSS Pattern:**\n```css\n\u002F* Styling for highlighted bubble *\u002F\n.bubble.selected {\n  stroke: #000;\n  stroke-width: 3px;\n}\n\n\u002F* Styling for highlighted table row *\u002F\n.table-row.selected {\n  background-color: #ffff99;\n  font-weight: bold;\n}\n```\n\n**JavaScript Pattern:**\nAttach a click handler that removes the `.selected` class from all elements, then adds it back only to the elements matching the clicked data.\n\n```javascript\n\u002F\u002F Give bubbles a class of 'bubble' and rows a class of 'table-row'\nfunction handleSelection(event, d) {\n    \u002F\u002F 1. Remove the 'selected' class from ALL bubbles and rows\n    d3.selectAll(\".bubble\").classed(\"selected\", false);\n    d3.selectAll(\".table-row\").classed(\"selected\", false);\n    \n    \u002F\u002F 2. Add the 'selected' class to the specific bubble and row matching the clicked data\n    \u002F\u002F Assuming both data objects share a unique 'ticker' property\n    d3.selectAll(\".bubble\")\n      .filter(nodeData => nodeData.ticker === d.ticker)\n      .classed(\"selected\", true);\n      \n    d3.selectAll(\".table-row\")\n      .filter(rowData => rowData.ticker === d.ticker)\n      .classed(\"selected\", true);\n}\n\n\u002F\u002F Bind the event listener to both the chart nodes and the table rows\nd3.selectAll(\".bubble\").on(\"click\", handleSelection);\nd3.selectAll(\".table-row\").on(\"click\", handleSelection);\n```","### 1. Tooltip HTML\u002FCSS\u002FJS Pattern\n\nTo create a dynamic tooltip, use a hidden HTML `div` that is styled with CSS and positioned dynamically using JavaScript mouse events.\n\n**HTML Pattern:**\n```html\n\u003C!-- Place this somewhere in your HTML body, outside the SVG -->\n\u003Cdiv id=\"tooltip\" class=\"tooltip\">\u003C\u002Fdiv>\n```\n\n**CSS Pattern:**\n```css\n.tooltip {\n  position: absolute;\n  opacity: 0; \u002F* Hidden by default *\u002F\n  pointer-events: none; \u002F* Prevents the tooltip from interfering with mouse events *\u002F\n  background-color: rgba(0, 0, 0, 0.8);\n  color: white;\n  padding: 8px 12px;\n  border-radius: 4px;\n  font-family: sans-serif;\n  font-size: 12px;\n  \u002F* Add transition for smooth appearance *\u002F\n  transition: opacity 0.2s;\n}\n```\n\n**JavaScript Pattern:**\nBind `mouseover`, `mousemove`, and `mouseout` events to your D3 selection. Position the tooltip using `event.pageX` and `event.pageY`.\n\n```javascript\nconst tooltip = d3.select(\"#tooltip\");\n\nnodes.on(\"mouseover\", function(event, d) {\n    tooltip.style(\"opacity\", 1); \u002F\u002F Make visible\n    tooltip.html(`\u003Cstrong>${d.name}\u003C\u002Fstrong>\u003Cbr>Value: ${d.value}`);\n})\n.on(\"mousemove\", function(event, d) {\n    \u002F\u002F Offset by a few pixels so the cursor doesn't cover the tooltip\n    tooltip.style(\"left\", (event.pageX + 10) + \"px\")\n           .style(\"top\", (event.pageY + 10) + \"px\");\n})\n.on(\"mouseout\", function(event, d) {\n    tooltip.style(\"opacity\", 0); \u002F\u002F Hide\n});\n```\n\n### 2. Conditional Interactions Pattern\n\nSometimes interactions (like tooltips) should only trigger for specific data points (e.g., skip entries missing certain fields). Wrap the logic inside your event listeners with a condition.\n\n```javascript\nnodes.on(\"mouseover\", function(event, d) {\n    \u002F\u002F Conditional Interaction: Only show tooltip if the node is NOT an ETF\n    if (d.type !== \"ETF\") {\n        tooltip.style(\"opacity\", 1);\n        tooltip.html(`Ticker: ${d.ticker}\u003Cbr>Market Cap: ${d.marketCap}`);\n    }\n})\n.on(\"mousemove\", function(event, d) {\n    if (d.type !== \"ETF\") {\n        tooltip.style(\"left\", (event.pageX + 10) + \"px\")\n               .style(\"top\", (event.pageY + 10) + \"px\");\n    }\n})\n.on(\"mouseout\", function(event, d) {\n    tooltip.style(\"opacity\", 0);\n});\n```\n\n### 3. Cross-Highlighting Pattern\n\nTo connect two different views (like a bubble chart and a table), assign common identifiers to both elements and toggle a specific CSS class (e.g., `.selected`) on click.\n\n**CSS Pattern:**\n```css\n\u002F* Styling for highlighted bubble *\u002F\n.bubble.selected {\n  stroke: #000;\n  stroke-width: 3px;\n}\n\n\u002F* Styling for highlighted table row *\u002F\n.table-row.selected {\n  background-color: #ffff99;\n  font-weight: bold;\n}\n```\n\n**JavaScript Pattern:**\nAttach a click handler that removes the `.selected` class from all elements, then adds it back only to the elements matching the clicked data.\n\n```javascript\n\u002F\u002F Give bubbles a class of 'bubble' and rows a class of 'table-row'\nfunction handleSelection(event, d) {\n    \u002F\u002F 1. Remove the 'selected' class from ALL bubbles and rows\n    d3.selectAll(\".bubble\").classed(\"selected\", false);\n    d3.selectAll(\".table-row\").classed(\"selected\", false);\n    \n    \u002F\u002F 2. Add the 'selected' class to the specific bubble and row matching the clicked data\n    \u002F\u002F Assuming both data objects share a unique 'ticker' property\n    d3.selectAll(\".bubble\")\n      .filter(nodeData => nodeData.ticker === d.ticker)\n      .classed(\"selected\", true);\n      \n    d3.selectAll(\".table-row\")\n      .filter(rowData => rowData.ticker === d.ticker)\n      .classed(\"selected\", true);\n}\n\n\u002F\u002F Bind the event listener to both the chart nodes and the table rows\nd3.selectAll(\".bubble\").on(\"click\", handleSelection);\nd3.selectAll(\".table-row\").on(\"click\", handleSelection);\n```",{"name":5,"description":7},"main","726e1f79b96b0cb3d729d0e55a1c847e0b5353ae","skills\u002Fb3-teacher-feedback-gemini-3.1-pro-preview\u002Fstock-data-visualization\u002Frun3_d3-interactivity-and-tooltips",8,"https:\u002F\u002Fgithub.com\u002Fcxcscmu\u002FSkillLearnBench","https:\u002F\u002Fcxcscmu.github.io\u002FSkillLearnBench","https:\u002F\u002Fgithub.com\u002Fcxcscmu","2026-10-02 22:55:36",{"source":8,"skillName":5,"commands":46,"prompt":56,"zipAvailable":57},[47,50,53],{"tool":48,"command":49},"npx","npx skills add cxcscmu\u002FSkillLearnBench --skill d3-interactivity-and-tooltips",{"tool":51,"command":52},"bunx","bunx skills add cxcscmu\u002FSkillLearnBench --skill d3-interactivity-and-tooltips",{"tool":54,"command":55},"pnpm","pnpm dlx skills add cxcscmu\u002FSkillLearnBench --skill d3-interactivity-and-tooltips","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fcxcscmu\u002FSkillLearnBench\u002Fblob\u002Fmain\u002Fskills\u002Fb3-teacher-feedback-gemini-3.1-pro-preview\u002Fstock-data-visualization\u002Frun3_d3-interactivity-and-tooltips\u002FSKILL.md",true,[],[60,73,94,112,132,143],{"skillNo":61,"name":62,"nameZh":6,"description":63,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":64,"categories":65,"keywords":66,"publishedAt":32},"01M6KM5KH175P5ABP5JMX2SBDQ","object_counter","Count occurrences of an object in the image using computer vision algorithm.","https:\u002F\u002Fgithub.com\u002Fcxcscmu\u002FSkillLearnBench\u002Fblob\u002Fmain\u002Fskills\u002Fhuman_authored\u002Fvideo-object-counting\u002Fobject_counter\u002FSKILL.md",[],[67,68,69,70,71,72],"object counter","object","vision","computer","Computer Vision","image",{"skillNo":74,"name":75,"nameZh":6,"description":76,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":77,"categories":78,"keywords":79,"publishedAt":32},"01M6KM51TMVXG79MMPCS6Y8G86","travel-planning-workflow","Invoke this skill when performing travel planning. It defines a structured workflow for generating itineraries. Following this workflow is essential to ensure the final plan satisfies user requirements.","https:\u002F\u002Fgithub.com\u002Fcxcscmu\u002FSkillLearnBench\u002Fblob\u002Fmain\u002Fskills\u002Fhuman_authored\u002Ftravel-planning\u002Ftravel-planning-workflow\u002FSKILL.md",[],[80,81,82,83,84,85,86,87,88,30,89,90,91,92,93],"workflow","planning","planning workflow","travel","travel planning","travel planning workflow","structured","performing","plan","user","it","requirements","essential","itineraries",{"skillNo":95,"name":96,"nameZh":6,"description":97,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":98,"categories":99,"keywords":100,"publishedAt":32},"01M6KM4DY820XHS9YTSK5QP5HD","bundled-dataset-search-tool","invoke this skill when you need to perform database search for travel planning. This skill provides some useful pre-packaged tools to look up accommodations, attractions, cities, driving distance, flights, and restaurants from the bundled dataset.","https:\u002F\u002Fgithub.com\u002Fcxcscmu\u002FSkillLearnBench\u002Fblob\u002Fmain\u002Fskills\u002Fhuman_authored\u002Ftravel-planning\u002Fbundled-dataset-search-tool\u002FSKILL.md",[],[101,102,103,104,105,106,107,83,108,109,84,110,30,111,81],"search","tool","dataset","bundled dataset search tool","restaurants","Tools","up","look","flights","you","database",{"skillNo":113,"name":114,"nameZh":6,"description":115,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":116,"categories":117,"keywords":118,"publishedAt":32},"01M6KM465BB9PQ0B548HQSVAWZ","glm-output","Output-processing guidance for GLM tasks. Especially useful after glm-basics and glm-calibration when you need verifier-matching metrics from output.nc and a final \u002Froot\u002Fmetrics.json.","https:\u002F\u002Fgithub.com\u002Fcxcscmu\u002FSkillLearnBench\u002Fblob\u002Fmain\u002Fskills\u002Fhuman_authored\u002Ftemperature-simulation\u002Fglm-output\u002FSKILL.md",[],[119,120,121,30,122,123,124,125,126,127,128,129,110,130,131],"glm output","output","glm","tasks","metrics","json","basics","guidance","matching","verifier","processing","root","calibration",{"skillNo":133,"name":134,"nameZh":6,"description":135,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":136,"categories":137,"keywords":138,"publishedAt":32},"01M6KM40KY3QWDW5W97S39R2BC","glm-calibration","Calibration guidance for GLM tasks. Often most effective after glm-basics has clarified the setup; glm-output is the companion skill for exact final metric computation.","https:\u002F\u002Fgithub.com\u002Fcxcscmu\u002FSkillLearnBench\u002Fblob\u002Fmain\u002Fskills\u002Fhuman_authored\u002Ftemperature-simulation\u002Fglm-calibration\u002FSKILL.md",[],[139,131,121,120,126,125,122,140,141,30,142],"glm calibration","setup","companion","metric",{"skillNo":144,"name":145,"nameZh":6,"description":146,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":147,"categories":148,"keywords":149,"publishedAt":32},"01M6KM3VHHVSGMGHJQB3PPT6YG","glm-basics","A good starting point for GLM calibration tasks. Use to inspect glm3.nml, confirm how GLM runs, and identify the relevant files before moving on to calibration and output evaluation.","https:\u002F\u002Fgithub.com\u002Fcxcscmu\u002FSkillLearnBench\u002Fblob\u002Fmain\u002Fskills\u002Fhuman_authored\u002Ftemperature-simulation\u002Fglm-basics\u002FSKILL.md",[],[150,121,125,151,139,131,30,120,152,153,154,155,156,157,122],"glm basics","inspect","relevant","files","good","use","how","Evaluation"]