xiaohongshu
xiaohongshu
Create D3 questions with drag-and-drop matching interactions. Students drag items (tables, graphs, equations) to categories.
Full skill instructions
Use this skill when creating questions where students:
Perfect for:
Not suitable for:
Copy these from .claude/skills/question-types/snippets/:
drag-match.js → Full createDragMatcher() system (sophisticated!)cards/standard-card.js → createStandardCard()cards/explanation-card.js → createExplanationCard() - For student explanationscards/video-accordion.js → createVideoAccordion() - For help videostables.js → If rendering tables inside draggable itemscat courses/IM-8th-Grade/modules/Unit-3/assignments/510-Proportion-Equations/questions/06/attachments/chart.js
const ITEMS = [
{ id: "item1", /* your item data */ },
{ id: "item2", /* your item data */ },
{ id: "item3", /* your item data */ },
];
const CATEGORIES = [
{ id: "cat1", text: "Category 1 description" },
{ id: "cat2", text: "Category 2 description" },
];
function createDefaultState() {
return {
cat1Matches: [], // Array of matched item IDs
cat2Matches: [],
explanation: ""
};
}
dragMatcher = createDragMatcher(d3, content, {
items: ITEMS.map(item => ({
id: item.id,
content: (container) => renderItem(container, item), // Custom render function
})),
categories: CATEGORIES.map(cat => ({
id: cat.id,
label: cat.text,
})),
state: {
cat1: chartState.cat1Matches,
cat2: chartState.cat2Matches,
},
onStateChange: (newState) => {
chartState.cat1Matches = newState.cat1 || [];
chartState.cat2Matches = newState.cat2 || [];
sendChartState();
},
locked: interactivityLocked,
});
In codebase:
In this skill:
For text-only items (not tables/graphs):
items: ITEMS.map(item => ({
id: item.id,
content: item.text, // String instead of render function
}))
function createDefaultState() {
return {
cat1Matches: [],
cat2Matches: [],
cat3Matches: [],
explanation: ""
};
}
dragMatcher = createDragMatcher(d3, content, {
// ...
state: {
cat1: chartState.cat1Matches,
cat2: chartState.cat2Matches,
cat3: chartState.cat3Matches,
},
});
function renderTableItem(container, tableData) {
// Use D3 to render a table
const table = container.append("table")
.style("width", "100%")
.style("border-collapse", "collapse");
// Add headers, rows, etc.
// See working example for full implementation
}
items: ITEMS.map(item => ({
id: item.id,
content: (container) => renderTableItem(container, item.data),
}))
createDefaultState() with one array per categorycreateDragMatcher() with onStateChange callbacksetInteractivity() to call dragMatcher.setLocked()applyInitialState() to restore matchesThe createDragMatcher component is a complete drag-and-drop system. Key features:
.setLocked(true)Important methods:
dragMatcher.setLocked(boolean) - Enable/disable draggingdragMatcher.getState() - Get current match statedragMatcher.setState(newState) - Update matches programmaticallyxiaohongshu
technical spec
product ux expert
database patterns
Conduct multi-agent task orchestration and workflow coordination.
Initialize project with Conductor artifacts (product definition,
Expert in web animations, transitions, and motion design using Framer Motion and CSS
Creates Mermaid and ASCII diagrams for flowcharts, architecture, ERDs, state machines, mindmaps, and more. Use when user mentions diagram, flowchart, mermaid, ASCII diagram, text diagram, terminal diagram, visualize, C4, mindmap, architecture diagram, sequence diagram, ERD, or needs visual docume...
PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.
Context-Driven Development skill for projects using Conductor. Use this skill when you detect a `conductor/` directory in the project, when working on tasks defined in a `plan.md` file, or when the user asks about tracks, specs, or plans. Automatically applies TDD workflow, tracks task completion...
Display project status, active tracks, and next actions
Official Stakpak application containerization standard operating procedure, a step-by-step guidline to properly dockerize applications. This is a rule book curated by the Stakpak Team.
Generate, edit, and beat-sync AI video with leading models in one workspace.
The world's fastest calendar for remote work
Transform Your Design with AI Designer by ImgCreator.ai
Revolutionizing Video Production with AI-Powered Creativity
Extend an image past the frame and let AI fill the new aspect ratio.
Discover your celebrity doppelgänger with StarByFace!
ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.
Opus.ai: Revolutionize Your Web Experience