๊ฐ€์ด๋“œ
Shape Annotation

Shape Annotation

shape ์†์„ฑ์œผ๋กœ ์ง€์ •ํ•œ ๋„ํ˜•์„ ์ฐจํŠธ๋‚˜ body(์‹œ๋ฆฌ์ฆˆ๊ฐ€ ํ‘œ์‹œ๋˜๋Š” plotting ์˜์—ญ)์˜ ์ง€์ •ํ•œ ์œ„์น˜์— ํ‘œ์‹œํ•œ๋‹ค.

shape ์†์„ฑ์œผ๋กœ ํ‘œ์‹œํ•  ๋„ํ˜•์„. 'circle', 'diamond', 'square', 'triangle', 'star', 'rectangle' ๋“ฑ์œผ๋กœ ์„ค์ •ํ•  ์ˆ˜ ์žˆ๋‹ค.
์œ„ ์ชฝ ํฐ ๋ณ„์€ noClip์ด true๋กœ ์„ค์ •๋ผ์„œ body ์˜์—ญ ๋ฐ”๊นฅ๊นŒ์ง€ ํ‘œ์‹œ๋˜๊ณ  ์žˆ๋‹ค.
์•„๋ž˜์ชฝ ์ชฝ ํฐ ๋ณ„์€ noClip์ด ์„ค์ •๋˜์ง€ ์•Š์•„ body ์˜์—ญ์— ํด๋ฆฝ๋˜๊ณ  ์žˆ๋‹ค.
์ค‘๊ฐ„์˜ ๊ธด ์ง์‚ฌ๊ฐํ˜•์€ front๊ฐ€ true๋กœ ์„ค์ •๋ผ์„œ ์‹œ๋ฆฌ์ฆˆ ์œ„์— ํ‘œ์‹œ๋˜๊ณ  ์žˆ๋‹ค. 'fill'์„ 'white'๋กœ ์ง€์ •ํ•ด์„œ ์•„๋ž˜์ชฝ ์‹œ๋ฆฌ์ฆˆ ๋ถ€๋ถ„์ด ํ‘œ์‹œ๋˜์ง€ ์•Š๋Š”๋‹ค.
๋˜, ์ด ์ง์‚ฌ๊ฐํ˜•๊ณผ ์˜ค๋ฅธ์ชฝ ์ ์„  ์‚ฌ๊ฐํ˜•์€ x1, x2, y1, y2๋กœ ์œ„์น˜์™€ ํฌ๊ธฐ๊ฐ€ ์„ค์ •๋ผ์„œ ์ฐจํŠธ inverted๋ฅผ true๋กœ ์ง€์ •ํ•ด๋„ ์•„๋ž˜ ๊ทธ๋ฆผ์ฒ˜๋Ÿผ ์œ„์น˜๊ฐ€ ์œ ์ง€๋œ๋‹ค.

์„ค์ •

'type'์„ 'image'๋กœ ์ง€์ •ํ•œ๋‹ค.

    anntations: [{
        type: 'image',
        shape: 'rectangle',
        rotation: -20,
        style: {
            stroke: 'red',
            strokeWidth: '3px'
        }
    }]

'type'์„ ์ง€์ •ํ•˜์ง€ ์•Š๊ณ , shape์„ ์ง€์ •ํ•˜๋ฉด 'image'๋กœ ์ง€์ •ํ•œ ๊ฒƒ๊ณผ ๋™์ผํ•˜๋‹ค.

    anntations: [{
        imageUrl: '/images/chart.png',
    }]

See Also