오늘 할 일

SVG 뷰 방식 공유, 렌더링

stageSimple.svg

//위 svg 이미지에서 섹션들의 point들
const SECTIONS = [
  {
    id: "A",
    points: [
      [447.121, 869.114],
      [447.121 + 1118.19, 869.114],
      [447.121 + 1118.19, 869.114 + 1822.87],
      [447.121, 869.114 + 1822.87],
    ],
  },
  {
    id: "B",
    points: [
      [2662.6, 869.114],
      [2662.6 + 1118.11, 869.114],
      [2662.6 + 1118.11, 869.114 + 1822.9],
      [2662.6, 869.114 + 1822.9],
    ],
  },
];

//section 정보, 5개씩 4줄인 형태입니다
//placeId는 몰라서 string 넘었습니다. ㅠㅠ
//sectionB 는 중간에 한자리씩 빠진 형태입니다
const  sectionA= {
  "id": 1,
  "name": "A구역",
  "colLen": 5,
  "seats":[true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true],
  "placeId": "placeId" 
}

const sectionB={ 
 "id": 2,
  "name": "B구역",
  "colLen": 5,
  "seats":[true,true,false,true,true,true,true,false,true,true,true,true,false,true,true,true,true,false,true,true],
   "placeId": "placeId"
}
//DB  Place Table
{
	"id" : 1,
	"name" : "공연장 이름",
	"overview-points" : "1_points.json",
	"overview-svg-url" : "/static/1_overview.svg", //백그라운드가 들어갈 이미지 URL
	"overview-height" : 1180,
	"overview-width" : 1800,
	"sections" : [1, 2],
}

//DB 1_points.json
//point는 섹션 위치의 도형 꼭지점 좌표로 point를 통해서 도형을 그린다.
{
    id: "A",
    points: [
      [447.121, 869.114],
      [447.121 + 1118.19, 869.114],
      [447.121 + 1118.19, 869.114 + 1822.87],
      [447.121, 869.114 + 1822.87],
    ],
  },
  {
    id: "B",
    points: [
      [2662.6, 869.114],
      [2662.6 + 1118.11, 869.114],
      [2662.6 + 1118.11, 869.114 + 1822.9],
      [2662.6, 869.114 + 1822.9],
    ],
  },

svg 렌더링 방식

3주차 이슈뽑기