같은 항목이 색과 이름을 유지한 채 이전 위치에서 새 위치로 움직이는 갱신The same items keep their color and name while position and size move from the old state to the new one.
막대 A가 파란색과 라벨을 유지한 채 y 320→210, height 120→230으로 0.75초 동안 움직인다
갱신 때 막대를 지우고 새로 그려 항목 대응이 끊기거나, 색이 바뀌어 다른 항목처럼 보인다
기본값은 클립에 쓴 값Defaults are the values used in the clip
| 항목PARAM | 기본DEFAULT | 범위RANGE | 메모NOTE |
|---|---|---|---|
| 길이 | 0.75s | 0.5~1.0s | 위치와 크기 동시 이동 |
| 대응 키 | ID | ID 고정 | 순서가 아닌 ID로 매칭 |
| 색 | 고정 | 고정 | 전후 동일 |
| 이징 | power2.inOut | power2~power3.inOut | 시작과 끝이 모두 보이게 |
data.forEach(d => {
tl.to('#bar-' + d.id, { attr: { y: yScale(d.next), height: h(d.next) }, duration: 0.75, ease: 'power2.inOut' }, 0.4);
tl.to('#lab-' + d.id, { attr: { y: yScale(d.next) - 8 }, duration: 0.75, ease: 'power2.inOut' }, 0.4);
});그대로 붙여 넣는다Paste as is
GSAP으로 <대상> 막대 차트를 새 데이터로 갱신해줘. 항목을 ID로 대응해 기존 요소를 재사용하고, 색과 라벨은 그대로 두며 y와 height, 라벨 y를 0.4초에 시작해 0.75초 동안 power2.inOut으로 옮겨. 요소를 지우고 다시 만들지 마. paused 타임라인 하나로 만들어.
Update the <target> bar chart to the new data with GSAP. Match items by ID and reuse the existing elements, keep colors and labels unchanged, and tween y, height and the label y starting at 0.4s over 0.75s with power2.inOut. Do not delete and rebuild elements. One paused timeline.
<파일>의 <대상> 차트에 object-constant-update를 적용해. data.forEach로 #bar-id와 #lab-id의 attr(y, height)를 next 값으로 0.75s, power2.inOut, position 0.4에 tween. DOM 노드 수가 전후 동일한지 검사하고 0.3초·0.8초·1.3초를 캡처해 색과 라벨이 유지되는지 확인해.
Apply object-constant-update to the <target> chart in <file>. With data.forEach, tween the attr (y, height) of #bar-id and #lab-id to the next values over 0.75s, power2.inOut, position 0.4. Assert the DOM node count is the same before and after, and capture at 0.3s, 0.8s and 1.3s to check colors and labels persist.
HyperFrames · ReelForge · Scrolline
개념 출처와 라이선스. 구현은 이 레포에서 새로 씀Concept sources and licenses. Implementations are original to this repo