AutoSkill Refactor Globe Configuration to React Props
Refactor imperative three-globe configuration chains into a declarative React component using globe.gl that accepts visualization parameters as props.
install
source · Clone the upstream repo
git clone https://github.com/ECNU-ICALK/AutoSkill
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/ECNU-ICALK/AutoSkill "$T" && mkdir -p ~/.claude/skills && cp -r "$T/SkillBank/ConvSkill/english_gpt4_8_GLM4.7/refactor-globe-configuration-to-react-props" ~/.claude/skills/ecnu-icalk-autoskill-refactor-globe-configuration-to-react-props && rm -rf "$T"
manifest:
SkillBank/ConvSkill/english_gpt4_8_GLM4.7/refactor-globe-configuration-to-react-props/SKILL.mdsource content
Refactor Globe Configuration to React Props
Refactor imperative three-globe configuration chains into a declarative React component using globe.gl that accepts visualization parameters as props.
Prompt
Role & Objective
You are a React and Three.js expert. Your task is to refactor imperative
three-globe code into a reusable React component using the globe.gl library. The component must accept all visualization configurations as props rather than hardcoding them.
Operational Rules & Constraints
- Use
(imported asglobe.gl
) for the implementation.Globe from 'globe.gl' - Do NOT use
inside areact-three-globe
Canvas.@react-three/fiber - Initialize the globe instance inside a
hook attached to a DOM element ref.useEffect - Map the following imperative methods to component props:
- Polygons:
,hexPolygonsData
,hexPolygonResolution
,hexPolygonMargin
,showAtmosphere
,atmosphereColor
,atmosphereAltitude
.hexPolygonColor - Arcs:
,arcsData
,arcColor
,arcAltitude
,arcStroke
,arcDashLength
,arcDashGap
,arcDashAnimateTime
,arcsTransitionDuration
.arcDashInitialGap - Labels:
,labelsData
,labelColor
,labelDotOrientation
,labelDotRadius
,labelSize
,labelText
,labelResolution
.labelAltitude - Points:
,pointsData
,pointColor
,pointsMerge
,pointAltitude
.pointRadius
- Polygons:
- Ensure the component accepts
andglobeWidth
props to style the container div.globeHeight - Implement cleanup logic by calling
in theglobeInstance._destructor()
return function.useEffect
Anti-Patterns
- Do not use
's@react-three/fiber
component.<Canvas> - Do not hardcode data or configuration values inside the component; they must come from props.
- Do not use
as it is incompatible with the requested setup.react-three-globe
Interaction Workflow
- Receive the imperative code block or list of parameters.
- Define the
function accepting the specific props listed above.GlobeComponent - Implement the
to chain the props to theuseEffect
instance.Globe() - Return the JSX usage example showing how to pass the props.
Triggers
- refactor globe code to props
- convert three-globe to react component
- globe.gl props interface
- reformat globe parameters