Definitelytyped: [d3] λͺ¨λ“ˆ 'd3-scale'은 이미 'interpolateCool'μ΄λΌλŠ” 멀버λ₯Ό λ‚΄λ³΄λƒˆμŠ΅λ‹ˆλ‹€. λͺ¨ν˜Έμ„±μ„ ν•΄κ²°ν•˜κΈ° μœ„ν•΄ λͺ…μ‹œμ μœΌλ‘œ λ‹€μ‹œ λ‚΄λ³΄λ‚΄λŠ” 것을 κ³ λ €ν•˜μ‹­μ‹œμ˜€.

에 λ§Œλ“  2018λ…„ 03μ›” 27일  Β·  3μ½”λ©˜νŠΈ  Β·  좜처: DefinitelyTyped/DefinitelyTyped

  • @types/d3 νŒ¨ν‚€μ§€λ₯Ό μ‚¬μš©ν•΄ λ³΄μ•˜λŠ”λ° λ¬Έμ œκ°€ μžˆμ—ˆμŠ΅λ‹ˆλ‹€.
  • μ €μž: @tomwanzek @gustavderdrache @borisyankov

λ‹€μŒ 쒅속성을 μ‚¬μš©ν•˜μ—¬ d3 v4.xμ—μ„œ 5.0으둜 μ—…λ°μ΄νŠΈν•˜λ €κ³  ν•©λ‹ˆλ‹€.

"d3": "5.0.0",
"@types/d3": "5.0.0",

앱을 μ»΄νŒŒμΌν•˜λ©΄ λ‹€μŒμ΄ ν‘œμ‹œλ©λ‹ˆλ‹€.

node_modules/@types/d3/index.d.ts(37,1) 였λ₯˜: 였λ₯˜ TS2308: λͺ¨λ“ˆ 'd3-scale'이 이미 'interpolateCool'μ΄λΌλŠ” 멀버λ₯Ό λ‚΄λ³΄λƒˆμŠ΅λ‹ˆλ‹€. λͺ¨ν˜Έμ„±μ„ ν•΄κ²°ν•˜κΈ° μœ„ν•΄ λͺ…μ‹œμ μœΌλ‘œ λ‹€μ‹œ λ‚΄λ³΄λ‚΄λŠ” 것을 κ³ λ €ν•˜μ‹­μ‹œμ˜€.
node_modules/@types/d3/index.d.ts(37,1): 였λ₯˜ TS2308: λͺ¨λ“ˆ 'd3-scale'이 이미 'interpolateCubehelixDefault'λΌλŠ” 멀버λ₯Ό λ‚΄λ³΄λƒˆμŠ΅λ‹ˆλ‹€. λͺ¨ν˜Έμ„±μ„ ν•΄κ²°ν•˜κΈ° μœ„ν•΄ λͺ…μ‹œμ μœΌλ‘œ λ‹€μ‹œ λ‚΄λ³΄λ‚΄λŠ” 것을 κ³ λ €ν•˜μ‹­μ‹œμ˜€.
node_modules/@types/d3/index.d.ts(37,1): error TS2308: λͺ¨λ“ˆ 'd3-scale'이 이미 'interpolateInferno'λΌλŠ” 멀버λ₯Ό λ‚΄λ³΄λƒˆμŠ΅λ‹ˆλ‹€. λͺ¨ν˜Έμ„±μ„ ν•΄κ²°ν•˜κΈ° μœ„ν•΄ λͺ…μ‹œμ μœΌλ‘œ λ‹€μ‹œ λ‚΄λ³΄λ‚΄λŠ” 것을 κ³ λ €ν•˜μ‹­μ‹œμ˜€.
node_modules/@types/d3/index.d.ts(37,1): 였λ₯˜ TS2308: λͺ¨λ“ˆ 'd3-scale'이 이미 'interpolateMagma'λΌλŠ” 멀버λ₯Ό λ‚΄λ³΄λƒˆμŠ΅λ‹ˆλ‹€. λͺ¨ν˜Έμ„±μ„ ν•΄κ²°ν•˜κΈ° μœ„ν•΄ λͺ…μ‹œμ μœΌλ‘œ λ‹€μ‹œ λ‚΄λ³΄λ‚΄λŠ” 것을 κ³ λ €ν•˜μ‹­μ‹œμ˜€.
node_modules/@types/d3/index.d.ts(37,1): 였λ₯˜ TS2308: 'd3-scale' λͺ¨λ“ˆμ΄ 이미 'interpolatePlasma'λΌλŠ” 멀버λ₯Ό λ‚΄λ³΄λƒˆμŠ΅λ‹ˆλ‹€. λͺ¨ν˜Έμ„±μ„ ν•΄κ²°ν•˜κΈ° μœ„ν•΄ λͺ…μ‹œμ μœΌλ‘œ λ‹€μ‹œ λ‚΄λ³΄λ‚΄λŠ” 것을 κ³ λ €ν•˜μ‹­μ‹œμ˜€.
node_modules/@types/d3/index.d.ts(37,1): 였λ₯˜ TS2308: λͺ¨λ“ˆ 'd3-scale'이 이미 'interpolateRainbow'λΌλŠ” 멀버λ₯Ό λ‚΄λ³΄λƒˆμŠ΅λ‹ˆλ‹€. λͺ¨ν˜Έμ„±μ„ ν•΄κ²°ν•˜κΈ° μœ„ν•΄ λͺ…μ‹œμ μœΌλ‘œ λ‹€μ‹œ λ‚΄λ³΄λ‚΄λŠ” 것을 κ³ λ €ν•˜μ‹­μ‹œμ˜€.
node_modules/@types/d3/index.d.ts(37,1): error TS2308: λͺ¨λ“ˆ 'd3-scale'이 이미 'interpolateViridis'λΌλŠ” 멀버λ₯Ό λ‚΄λ³΄λƒˆμŠ΅λ‹ˆλ‹€. λͺ¨ν˜Έμ„±μ„ ν•΄κ²°ν•˜κΈ° μœ„ν•΄ λͺ…μ‹œμ μœΌλ‘œ λ‹€μ‹œ λ‚΄λ³΄λ‚΄λŠ” 것을 κ³ λ €ν•˜μ‹­μ‹œμ˜€.
node_modules/@types/d3/index.d.ts(37,1): 였λ₯˜ TS2308: 'd3-scale' λͺ¨λ“ˆμ΄ 이미 'interpolateWarm'μ΄λΌλŠ” 멀버λ₯Ό λ‚΄λ³΄λƒˆμŠ΅λ‹ˆλ‹€. λͺ¨ν˜Έμ„±μ„ ν•΄κ²°ν•˜κΈ° μœ„ν•΄ λͺ…μ‹œμ μœΌλ‘œ λ‹€μ‹œ λ‚΄λ³΄λ‚΄λŠ” 것을 κ³ λ €ν•˜μ‹­μ‹œμ˜€.
node_modules/@types/d3/index.d.ts(37,1): 였λ₯˜ TS2308: 'd3-scale' λͺ¨λ“ˆμ΄ 이미 'schemeCategory10'μ΄λΌλŠ” 멀버λ₯Ό λ‚΄λ³΄λƒˆμŠ΅λ‹ˆλ‹€. λͺ¨ν˜Έμ„±μ„ ν•΄κ²°ν•˜κΈ° μœ„ν•΄ λͺ…μ‹œμ μœΌλ‘œ λ‹€μ‹œ λ‚΄λ³΄λ‚΄λŠ” 것을 κ³ λ €ν•˜μ‹­μ‹œμ˜€.

차이가 μžˆλ‹€λ©΄ λ‚΄ 앱은 angular-cli(webpack)λ₯Ό μ‚¬μš©ν•˜μ—¬ 컴파일되고 tsconfig.app.json의 types λ°°μ—΄μ—μ„œ d3 λ₯Ό μ°Έμ‘°ν•©λ‹ˆλ‹€.

이것이 μ–΄λ–€ μ‹μœΌλ‘œλ“  λ‚΄ μ„€μ •μ—λ§Œ ν•΄λ‹Ήν•˜λŠ”μ§€, μ•„λ‹ˆλ©΄ 버그인지 잘 λͺ¨λ₯΄κ² μŠ΅λ‹ˆλ‹€. 이에 λŒ€ν•΄ μžμ„Ένžˆ μ•„μ‹œλŠ” λΆ„μ˜ 도움을 λΆ€νƒλ“œλ¦½λ‹ˆλ‹€.

κ°€μž₯ μœ μš©ν•œ λŒ“κΈ€

@tomwanzek 감사

μ›λž˜ package.json 의 버전 번호λ₯Ό μ—…λ°μ΄νŠΈν•˜κ³  yarn install λ₯Ό μ‹€ν–‰ν–ˆλŠ”λ° μ–΄λ–€ μ΄μœ λ‘œλ“  μœ„μ˜ 였λ₯˜κ°€ λ°œμƒν–ˆμŠ΅λ‹ˆλ‹€.

κ·ΈλŸ¬λ‚˜ λ¨Όμ € d3 및 μœ ν˜• μ •μ˜λ₯Ό μ œκ±°ν•œ λ‹€μŒ μ΅œμ‹  λ²„μ „μ—μ„œ νŒ¨ν‚€μ§€λ₯Ό λ‹€μ‹œ μΆ”κ°€ν•˜λ©΄ ν•΄κ²°λ˜λŠ” 것 κ°™μŠ΅λ‹ˆλ‹€. λ‹€μŒμ€ νŠΈλ¦­μ„ μˆ˜ν–‰ν–ˆμŠ΅λ‹ˆλ‹€.

yarn remove <strong i="11">@d3</strong>
yarn remove @types/d3
yarn add <strong i="12">@d3</strong>
yarn add @types/d3 --dev

λͺ¨λ“  3 λŒ“κΈ€

@ λ‚˜λŠ” ν™•μ‹€νžˆ 당신은 μ™œ μΆ”κ°€ ν•  수 μ•„λ‹ˆμ—μš” 맀트 - μ„ΌμŠ€ 아이 d3 λ°›λŠ” types 에 λ°°μ—΄ tsconfig.app.json , κ·Έλ ‡κ²Œ ν•  ν•„μš”κ°€ μ—†μ–΄μ•Όν•©λ‹ˆλ‹€. ν‘œμ€€ TS λͺ¨λ“ˆ/μœ ν˜• 확인은 λͺ¨λ“  것을 ν•΄κ²°ν•΄μ•Ό ν•©λ‹ˆλ‹€.

d3 및 @types/d3 λŒ€ν•΄ μ„€μΉ˜λœ 쒅속성을 ν™•μΈν•˜λŠ” package-lock.json λ˜λŠ” yarn @types/d3 μžˆμŠ΅λ‹ˆκΉŒ? d3-scale 와 d3-scale-chromatic 사이에 버전 좩돌이 μžˆλŠ” 것 κ°™μŠ΅λ‹ˆλ‹€. κ·€ν•˜κ°€ λ‚˜μ—΄ν•œ 였λ₯˜λŠ” [email protected] 의 λͺ¨λ“  이전 κΈ°λŠ₯이며 d3-scale@2 ν˜„μž¬ d3-scale-chromatic 둜 λ¦¬νŒ©ν„°λ§λ˜μ—ˆμŠ΅λ‹ˆλ‹€. λ”°λΌμ„œ μ„€μΉ˜μ—λŠ” d3-scale@2 에 λŒ€ν•œ μ•”μ‹œμ  쒅속성이 μžˆμ–΄μ•Ό ν•©λ‹ˆλ‹€.

@tomwanzek 감사

μ›λž˜ package.json 의 버전 번호λ₯Ό μ—…λ°μ΄νŠΈν•˜κ³  yarn install λ₯Ό μ‹€ν–‰ν–ˆλŠ”λ° μ–΄λ–€ μ΄μœ λ‘œλ“  μœ„μ˜ 였λ₯˜κ°€ λ°œμƒν–ˆμŠ΅λ‹ˆλ‹€.

κ·ΈλŸ¬λ‚˜ λ¨Όμ € d3 및 μœ ν˜• μ •μ˜λ₯Ό μ œκ±°ν•œ λ‹€μŒ μ΅œμ‹  λ²„μ „μ—μ„œ νŒ¨ν‚€μ§€λ₯Ό λ‹€μ‹œ μΆ”κ°€ν•˜λ©΄ ν•΄κ²°λ˜λŠ” 것 κ°™μŠ΅λ‹ˆλ‹€. λ‹€μŒμ€ νŠΈλ¦­μ„ μˆ˜ν–‰ν–ˆμŠ΅λ‹ˆλ‹€.

yarn remove <strong i="11">@d3</strong>
yarn remove @types/d3
yarn add <strong i="12">@d3</strong>
yarn add @types/d3 --dev

λ‚˜λŠ” 맀우 λΉ„μŠ·ν•œ 였λ₯˜κ°€ μžˆμ§€λ§Œ

npm remove --save-exact d3
npm remove --save-exact @types/d3
npm install --save-exact d3
npm install --save-exact -D @types/d3

ν•΄κ²°ν•˜μ§€ μ•ŠμŠ΅λ‹ˆλ‹€.

μœ ν˜• 자체둜 이동할 λ•Œ d3-scale 및 d3-scale-chromatic λ•Œλ•Œλ‘œ λ™μΌν•œ κΈ°λŠ₯을 λ‚΄λ³΄λ‚΄λŠ” 것을 λ³Ό 수 μžˆμŠ΅λ‹ˆλ‹€.

Screen Shot 2019-05-06 at 13 25 10

이게 μ •μƒμΈκ°€μš”? d3 μ„€μΉ˜ν•˜μ§€ μ•Šκ³  각각 λ³„λ„μ˜ νŒ¨ν‚€μ§€λ₯Ό λŒ€μ‹  μ„€μΉ˜ν•΄μ•Ό ν•©λ‹ˆκΉŒ?

이 νŽ˜μ΄μ§€κ°€ 도움이 λ˜μ—ˆλ‚˜μš”?
0 / 5 - 0 λ“±κΈ‰