본문으로 건너뛰기

getGraphStyle()

이 Hook은 현재 버전 내 적용되고 있는 그래프 스타일 데이터를 반환합니다.


Example

import { useRef } from "react";
import { Palito } from "../palito/Palito.jsx";

const ExamplePage = () => {
const palitoRef = useRef(null);
const LICENSE_KEY = "key-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";

const handleGetData = () => {
if (palitoRef.current) {
const graphStyle = palitoRef.current.getGraphStyle();

console.log("--- Palito Library Data ---");
console.log("Graph Style:", graphStyle);
}
};

return (
<div>
<Palito
ref={palitoRef}
licenseKey={LICENSE_KEY}
/>
<div style={{ position: 'absolute', bottom: '40px', right: '20px', zIndex: 1000 }}>
<button onClick={handleGetData} style={{ padding: '10px 20px', fontSize: '16px' }}>
Get Data from Library
</button>
</div>
</div>
);
};

export default ExamplePage;
예제 출력 예시
getGraphStyle의 예시

Props

이 Hook은 props를 받지 않습니다.

이름유형설명기본값
(없음)---

Return

{
"edgeType": string, // customStep: step, default: bezier, straight: straight, smoothstep: smoothstep
"lineStyle": string // dashed, solid
}