{"id":304506,"date":"2020-05-29T15:00:33","date_gmt":"2020-05-29T15:00:33","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=304506"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=304506","title":{"rendered":"\u041a\u0430\u043a \u043c\u044b \u0434\u0435\u043b\u0430\u043b\u0438 \u0433\u0440\u0430\u0444\u0438\u043a \u0441 \u0433\u043e\u0440\u0438\u0437\u043e\u043d\u0442\u0430\u043b\u044c\u043d\u044b\u043c \u0441\u043a\u0440\u043e\u043b\u043b\u043e\u043c \u043d\u0430 d3.js"},"content":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/company\/simbirsoft\/blog\/504248\/\">\n<p>\u0415\u0441\u043b\u0438 \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438 \u043d\u0443\u0436\u043d\u043e \u0432\u044b\u0432\u043e\u0434\u0438\u0442\u044c \u043c\u043d\u043e\u0433\u043e \u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0434\u0430\u043d\u043d\u044b\u0445, \u0434\u0438\u0430\u0433\u0440\u0430\u043c\u043c, \u0438\u043d\u0442\u0435\u0440\u0430\u043a\u0442\u0438\u0432\u043d\u044b\u0445 \u0432\u0438\u0434\u0436\u0435\u0442\u043e\u0432 \u2013 \u0432\u0430\u0436\u043d\u043e \u043f\u043e\u0437\u0430\u0431\u043e\u0442\u0438\u0442\u044c\u0441\u044f \u043e UX, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e \u0431\u044b\u043b\u043e \u0443\u0434\u043e\u0431\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c. \u0421\u043f\u043e\u0441\u043e\u0431 \u0432\u044b\u0432\u043e\u0434\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u0432\u0430\u0436\u0435\u043d, \u0435\u0441\u043b\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u044e\u0442 \u0438 \u043d\u0430 \u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0430\u0445, \u0438 \u043d\u0430 \u0441\u043c\u0430\u0440\u0442\u0444\u043e\u043d\u0430\u0445. \u0414\u0435\u043b\u0438\u043c\u0441\u044f \u043e\u043f\u044b\u0442\u043e\u043c, \u043a\u0430\u043a \u043c\u044b \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043b\u0438 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043d\u0435\u0442\u0440\u0438\u0432\u0438\u0430\u043b\u044c\u043d\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u2013 \u043a\u0430\u0441\u0442\u043e\u043c\u043d\u044b\u0439 \u0441\u043a\u0440\u043e\u043b\u043b \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 d3.js.<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/xh\/vd\/rl\/xhvdrlbo1tgv84a7qdfzdkeovum.png\"><a name=\"habracut\"><\/a><\/p>\n<p>  <\/p>\n<p>\u041f\u0440\u0438\u0432\u0435\u0442, \u0425\u0430\u0431\u0440! \u0421\u0435\u0433\u043e\u0434\u043d\u044f \u0445\u043e\u0442\u0438\u043c \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u0441 \u0432\u0430\u043c\u0438 \u043e\u043f\u044b\u0442\u043e\u043c \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u043e\u0434\u043d\u043e\u0439 \u043d\u0435\u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0438 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 <a href=\"https:\/\/d3js.org\/\">d3.js<\/a>. \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0435\u043c \u043f\u0440\u0435\u0434\u044b\u0441\u0442\u043e\u0440\u0438\u044e.<\/p>\n<p>  <\/p>\n<p>\u041f\u0440\u043e\u0435\u043a\u0442, \u043d\u0430\u0434 \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u043c\u044b \u0440\u0430\u0431\u043e\u0442\u0430\u043b\u0438 \u2013 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0434\u043b\u044f \u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u043d\u0433\u0430 \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u0438 \u0440\u0430\u0431\u043e\u0442\u044b \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440\u043e\u0432. \u0415\u0433\u043e \u043e\u0442\u043b\u0438\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u044c\u044e \u0431\u044b\u043b\u043e \u043d\u0430\u043b\u0438\u0447\u0438\u0435 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0430 \u0438\u043d\u0442\u0435\u0440\u0430\u043a\u0442\u0438\u0432\u043d\u044b\u0445 \u0432\u0438\u0434\u0436\u0435\u0442\u043e\u0432, \u0432 \u0447\u0430\u0441\u0442\u043d\u043e\u0441\u0442\u0438, \u0433\u0440\u0430\u0444\u0438\u043a\u043e\u0432. <\/p>\n<p>  <\/p>\n<p>\u041e\u0434\u0438\u043d \u0438\u0437 \u0442\u0430\u043a\u0438\u0445 \u0433\u0440\u0430\u0444\u0438\u043a\u043e\u0432 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u043b \u0441\u043e\u0431\u043e\u0439 \u0434\u0438\u0430\u0433\u0440\u0430\u043c\u043c\u0443 \u0413\u0430\u043d\u0442\u0430 \u0438 \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u043b \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0442\u044c \u0434\u043b\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0438 \u0434\u0430\u0442\u0443 \u0440\u0430\u0431\u043e\u0447\u0438\u0445 \u0441\u043c\u0435\u043d \u0441\u043e\u0442\u0440\u0443\u0434\u043d\u0438\u043a\u043e\u0432 \u043d\u0430 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u0435 \u0432 \u043f\u043e\u043b\u0433\u043e\u0434\u0430. \u041d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0432\u044b\u0432\u043e\u0434\u0438\u0442\u044c \u0434\u0438\u0430\u0433\u0440\u0430\u043c\u043c\u0443 \u0432 \u043f\u043e\u043b\u043d\u043e\u043c \u0440\u0430\u0437\u043c\u0435\u0440\u0435 \u043a\u0430\u043a \u043d\u0430 \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u044b\u0445 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430\u0445, \u0442\u0430\u043a \u0438 \u043d\u0430 \u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0430\u0445. \u0418\u0437-\u0437\u0430 \u044d\u0442\u043e\u0433\u043e \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f \u043e\u0442 \u0440\u0435\u0448\u0435\u043d\u0438\u044f <code>overflow-x: auto<\/code> \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u043e\u0442\u043a\u0430\u0437\u0430\u0442\u044c\u0441\u044f: \u0442\u044b\u043a\u0430\u0442\u044c \u043c\u044b\u0448\u043a\u043e\u0439 \u043d\u0430 \u0441\u043a\u0440\u043e\u043b\u043b\u0431\u0430\u0440 \u043d\u0430 \u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0435 \u2013 \u0442\u0430\u043a\u043e\u0439 \u0441\u0435\u0431\u0435 UX. \u0420\u0435\u0448\u0438\u043b\u0438 \u0434\u0435\u043b\u0430\u0442\u044c \u043a\u0430\u0441\u0442\u043e\u043c\u043d\u044b\u0439 \u0441\u043a\u0440\u043e\u043b\u043b. \u041d\u043e \u043e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c, \u0447\u0442\u043e \u044d\u0442\u043e \u043d\u0435 \u0442\u0430\u043a-\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0441\u043f\u0435\u0448\u0438\u043c \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u0441 \u0432\u0430\u043c\u0438 \u0441\u0432\u043e\u0438\u043c \u043e\u043f\u044b\u0442\u043e\u043c.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/lf\/nx\/rp\/lfnxrp7smpm7auib1s8vz_vkqs4.png\">  <\/p>\n<p><em>\u041f\u0440\u0438\u043c\u0435\u0440: \u0447\u0442\u043e \u043d\u0430\u0434\u043e \u0431\u044b\u043b\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c. <\/em><\/p>\n<p>  <\/p>\n<p>\u041c\u044b \u043f\u043e\u043a\u0430\u0436\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u0440 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043d\u0430 React, \u043d\u043e \u0442\u043e \u0436\u0435 \u0441\u0430\u043c\u043e\u0435 \u043c\u043e\u0436\u043d\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u043d\u0430 \u043b\u044e\u0431\u043e\u043c \u0434\u0440\u0443\u0433\u043e\u043c \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0435. \u0414\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0433\u0440\u0430\u0444\u0438\u043a\u043e\u043c \u043c\u044b \u0432\u044b\u0431\u0440\u0430\u043b\u0438 d3.js \u043a\u0430\u043a \u043e\u0447\u0435\u043d\u044c \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u043e\u0435 \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u0435\u043d\u043d\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435. \u0418\u0437 \u044d\u0442\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u043d\u0430\u043c \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u044f\u0442\u0441\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0434\u043b\u044f \u043e\u0441\u0435\u0439 \u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u0434\u043b\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0441\u043a\u0440\u043e\u043b\u043b\u0430. \u041d\u043e \u043e\u0431 \u044d\u0442\u043e\u043c \u0447\u0443\u0442\u044c \u043f\u043e\u0437\u0436\u0435, \u0434\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0443\u0436\u043d\u043e \u0440\u0435\u0448\u0438\u0442\u044c \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443 \u0441 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0435\u0439 d3 \u0432 React. <\/p>\n<p>  <\/p>\n<p>\u0421\u0443\u0442\u044c \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e d3.js \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e \u043c\u0430\u043d\u0438\u043f\u0443\u043b\u0438\u0440\u0443\u0435\u0442 DOM, \u0447\u0442\u043e \u043d\u0435\u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c\u043e \u0432 \u0441\u0432\u044f\u0437\u043a\u0435 \u0441 \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c\u0438 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0430\u043c\u0438, \u0442\u0430\u043a \u043a\u0430\u043a \u043e\u043d\u0438 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0431\u0435\u0440\u0443\u0442 \u043d\u0430 \u0441\u0435\u0431\u044f \u0432\u0441\u0435 \u043c\u0430\u043d\u0438\u043f\u0443\u043b\u044f\u0446\u0438\u0438 \u0441 DOM-\u0434\u0435\u0440\u0435\u0432\u043e\u043c \u0438 \u0432\u043c\u0435\u0448\u0430\u0442\u0435\u043b\u044c\u0441\u0442\u0432\u043e \u0432 \u044d\u0442\u043e\u0442 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0434\u0440\u0443\u0433\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u043f\u0440\u0438\u0432\u0435\u0434\u0451\u0442 \u043a \u0431\u0430\u0433\u0430\u043c \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0443\u0436\u043d\u043e \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u0442\u044c \u0438\u0445 \u0437\u043e\u043d\u044b \u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0441\u0442\u0438. \u041c\u044b \u0441\u0434\u0435\u043b\u0430\u043b\u0438 \u044d\u0442\u043e \u0442\u0430\u043a: React \u043c\u0430\u043d\u0438\u043f\u0443\u043b\u0438\u0440\u0443\u0435\u0442 DOM, \u0430 d3 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0440\u0430\u0441\u0447\u0451\u0442\u044b. \u042d\u0442\u043e\u0442 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0438 \u043d\u0430\u043c \u043e\u043f\u0442\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u043f\u043e\u0434\u043e\u0448\u0451\u043b, \u0442\u0430\u043a \u043a\u0430\u043a \u043e\u043d \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 react \u043f\u043e \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044e DOM \u0438 \u043f\u0440\u0438\u0432\u044b\u0447\u043d\u044b\u0439 JSX \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441 (\u043e \u0434\u0440\u0443\u0433\u0438\u0445 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0445 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0430\u0445 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0447\u0438\u0442\u0430\u0442\u044c <a href=\"https:\/\/habr.com\/ru\/post\/354806\/\">\u0437\u0434\u0435\u0441\u044c<\/a>). \u0414\u0430\u043b\u0435\u0435 \u0432 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u0445 \u043f\u043e\u043a\u0430\u0436\u0435\u043c, \u043a\u0430\u043a \u044d\u0442\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u044b\u0432\u0430\u0435\u0442\u0441\u044f.<\/p>\n<p>  <\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0438\u0441\u0442\u0443\u043f\u0438\u0442\u044c \u043a \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435! <\/p>\n<p>  <\/p>\n<h3 id=\"bazovaya-realizaciya-skrolla\">\u0411\u0430\u0437\u043e\u0432\u0430\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0441\u043a\u0440\u043e\u043b\u043b\u0430<\/h3>\n<p>  <\/p>\n<p>\u041d\u0430\u0447\u043d\u0451\u043c \u0441 \u0432\u0451\u0440\u0441\u0442\u043a\u0438:<\/p>\n<p>  <\/p>\n<pre><code class=\"javascript\">&lt;div ref={ganttContainerRef} className={gantt}&gt;   &lt;svg className={gantt__chart} ref={svgRef}&gt;     &lt;g ref={scrollGroupRef}&gt;       &lt;GanttD3XAxis \/&gt;       &lt;GanttD3Bars data={data} \/&gt;     &lt;\/g&gt;     &lt;GanttD3YAxis data={data} \/&gt;   &lt;\/svg&gt; &lt;\/div&gt;<\/code><\/pre>\n<p>  <\/p>\n<p>\u041d\u0430\u043c \u043d\u0443\u0436\u043d\u044b \u0434\u0432\u0435 \u043e\u0441\u0438. \u041f\u043e Y \u0432\u044b\u0432\u043e\u0434\u0438\u043c \u0438\u043c\u0435\u043d\u0430 \u0441\u043e\u0442\u0440\u0443\u0434\u043d\u0438\u043a\u043e\u0432, \u043f\u043e X \u0434\u0430\u0442\u044b. \u0421\u043a\u0440\u043e\u043b\u043b\u0438\u0442\u044c\u0441\u044f \u0431\u0443\u0434\u0435\u0442 \u0431\u043b\u043e\u043a \u0441 \u043e\u0441\u044c\u044e X \u0438 \u043f\u043e\u043b\u043e\u0441\u043a\u0430\u043c\u0438, \u043e\u043d\u0438 \u043e\u0431\u0451\u0440\u043d\u0443\u0442\u044b \u0432 \u0442\u0435\u0433 group. <\/p>\n<p>  <\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u043c \u043d\u0443\u0436\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0438\u0437 d3:<\/p>\n<p>  <\/p>\n<pre><code class=\"javascript\">import { event, select } from &quot;d3-selection&quot;; import { zoom, zoomIdentity, zoomTransform } from &quot;d3-zoom&quot;; import { scaleTime } from &quot;d3-scale&quot;;<\/code><\/pre>\n<p>  <\/p>\n<p>\u0424\u0443\u043d\u043a\u0446\u0438\u0438 event \u0438 select \u043d\u0443\u0436\u043d\u044b \u0434\u043b\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0441\u043e\u0431\u044b\u0442\u0438\u0439 \u0432 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0435 zoom \u0438 \u0434\u043b\u044f \u0432\u044b\u0431\u043e\u0440\u0430 dom-\u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432. <\/p>\n<p>  <\/p>\n<p>\u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u0438 zoom \u043c\u044b \u0438 \u0431\u0443\u0434\u0435\u043c \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u044b\u0432\u0430\u0442\u044c \u0433\u043e\u0440\u0438\u0437\u043e\u043d\u0442\u0430\u043b\u044c\u043d\u0443\u044e \u043f\u0440\u043e\u043a\u0440\u0443\u0442\u043a\u0443: \u044d\u0442\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043d\u0430\u0432\u0435\u0448\u0438\u0432\u0430\u0435\u0442 \u043d\u0430 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u0441\u043e\u0431\u044b\u0442\u0438\u0439 \u0434\u043b\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0437\u0443\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0438 drag<code>n<\/code>drop. <\/p>\n<p>  <\/p>\n<p>\u0412\u044b\u0437\u043e\u0432 zoomTransform \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c, \u043d\u0430\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0441\u043c\u0435\u0441\u0442\u0438\u043b \u044d\u043b\u0435\u043c\u0435\u043d\u0442: \u043a\u0430\u0436\u0434\u044b\u0439 \u043d\u043e\u0432\u044b\u0439 \u043a\u043b\u0438\u043a \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442\u0441\u044f \u0441 \u0442\u0435\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0437\u0430\u043a\u043e\u043d\u0447\u0438\u043b\u0441\u044f \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0439. \u0427\u0442\u043e\u0431\u044b \u0441\u0431\u0440\u043e\u0441\u0438\u0442\u044c \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u044b \u0432 \u043f\u0430\u043c\u044f\u0442\u0438, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c zoomIdentity. <\/p>\n<p>  <\/p>\n<p>\u041f\u043e\u0441\u043b\u0435\u0434\u043d\u044f\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f scaleTime \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u0443\u0435\u0442 \u0434\u0430\u0442\u044b \u043d\u0430 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u043d\u0443\u044e \u043e\u0441\u044c. \u0421 \u0435\u0451 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043d\u0430\u043f\u0438\u0448\u0435\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043d\u0430 \u043e\u0441\u044c X:<\/p>\n<p>  <\/p>\n<pre><code class=\"javascript\">export const dateScale = date =&gt; {   const { startDate, endDate, chartWidth } = chartConfig;   const scale = scaleTime()     .domain([startDate, endDate])     .range([0, chartWidth]);   return scale(date); };<\/code><\/pre>\n<p>  <\/p>\n<p>\u0412 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0435 \u043c\u0435\u0442\u043e\u0434\u0430 domain \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b: \u0435\u0433\u043e \u043d\u0443\u0436\u043d\u043e \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u0430 \u043e\u0441\u044c, \u0434\u043b\u0438\u043d\u0443 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u043c \u0432 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0435 \u043c\u0435\u0442\u043e\u0434\u0430 range.<\/p>\n<p>  <\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0430\u043f\u0438\u0448\u0435\u043c \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0441\u043e\u0431\u044b\u0442\u0438\u044f zoom. \u0418\u043c\u0435\u043d\u043d\u043e \u0432 \u043d\u0451\u043c \u0438 \u0431\u0443\u0434\u0435\u0442 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u0430 \u043f\u0440\u043e\u043a\u0440\u0443\u0442\u043a\u0430.<\/p>\n<p>  <\/p>\n<pre><code class=\"javascript\">const onZoom = (scrollGroup, ganttContainer) =&gt; {   const ganttContainerWidth =    ganttContainer.getBoundingClientRect().width;   const marginLeft = yAxisWidth + lineWidth;   const transform = zoomTransform(scrollGroup.node());   const maxStartTranslate = chartWidth \/ 2;   const maxEndTranslate = ganttContainerWidth - chartWidth \/ 2 -   marginLeft;    transform.x = Math.max(transform.x, maxEndTranslate);   transform.x = Math.min(transform.x, maxStartTranslate);    const translateX = defaultTranslate + transform.x;   scrollGroup.attr(&quot;transform&quot;, `translate( ${translateX} ,   0)`); };<\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u043e\u043a\u0430 \u0447\u0442\u043e \u043d\u0430\u0441 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0443\u044e\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0435 \u0441\u0442\u0440\u043e\u0447\u043a\u0438, \u0442\u0430\u043a \u043a\u0430\u043a \u0432\u0441\u044f \u00ab\u043c\u0430\u0433\u0438\u044f\u00bb \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u043d\u0438\u0445. <\/p>\n<p>  <\/p>\n<p>\u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u0434\u043e\u0441\u0442\u0430\u0435\u043c \u0442\u0435\u043a\u0443\u0449\u0435\u0435 \u0441\u043c\u0435\u0449\u0435\u043d\u0438\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430:<\/p>\n<p>  <\/p>\n<pre><code class=\"javascript\">const transform = zoomTransform(scrollGroup.node());<\/code><\/pre>\n<p>  <\/p>\n<p>\u0414\u0430\u043b\u0435\u0435 \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u043c \u043d\u043e\u0432\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u043a\u0440\u0443\u0442\u043a\u0438 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u043c \u0435\u0433\u043e \u0432 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e translate: <\/p>\n<p>  <\/p>\n<pre><code class=\"javascript\">const translateX = defaultTranslate + transform.x;   scrollGroup.attr(&quot;transform&quot;, `translate( ${translateX} ,   0)`);<\/code><\/pre>\n<p>  <\/p>\n<p>\u041e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c zoom-\u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0435 \u043a \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0443:<\/p>\n<p>  <\/p>\n<pre><code class=\"javascript\"> useEffect(() =&gt; {     const scrollGroup = select(scrollGroupRef.current);     const ganttContainer = ganttContainerRef.current;      const d3Zoom = zoom()       .scaleExtent([1, 1])       .on(&quot;zoom&quot;, () =&gt; onZoom(scrollGroup, ganttContainer));     select(ganttContainer)       .call(d3Zoom);       select(ganttContainer).call(d3 Zoom.transform,zoomIdentity);      scrollGroup.attr(&quot;transform&quot;, `translate(${defaultTranslate} , 0)`);   });<\/code><\/pre>\n<p>  <\/p>\n<p>\u041d\u0430 \u044d\u0442\u043e\u043c \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0432\u0441\u0451, \u0441\u043a\u0440\u043e\u043b\u043b \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442! \u041e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043e\u0434\u043d\u0443 \u043a\u0440\u0443\u0442\u0443\u044e \u0444\u0438\u0447\u0443 \u0438 \u0443\u0441\u0442\u0440\u0430\u043d\u0438\u0442\u044c \u043e\u0434\u0438\u043d \u043d\u0435\u043f\u0440\u0438\u044f\u0442\u043d\u044b\u0439 \u0431\u0430\u0433. <\/p>\n<p>  <\/p>\n<h3 id=\"ficha-svayp-dvumya-palcami\">\u0424\u0438\u0447\u0430: \u0441\u0432\u0430\u0439\u043f \u0434\u0432\u0443\u043c\u044f \u043f\u0430\u043b\u044c\u0446\u0430\u043c\u0438<\/h3>\n<p>  <\/p>\n<p>\u041d\u0430\u0447\u043d\u0451\u043c \u0441 \u0444\u0438\u0447\u0438. \u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438 macbook \u0438\u043b\u0438 \u0445\u043e\u0440\u043e\u0448\u0438\u0445 Windows-\u043d\u043e\u0443\u0442\u0431\u0443\u043a\u043e\u0432 \u0437\u043d\u0430\u044e\u0442, \u0447\u0442\u043e \u0441\u043a\u0440\u043e\u043b\u043b\u0438\u0442\u044c \u0433\u043e\u0440\u0438\u0437\u043e\u043d\u0442\u0430\u043b\u044c\u043d\u043e \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u0443\u0434\u043e\u0431\u043d\u0435\u0435 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0442\u0430\u0447\u043f\u0430\u0434\u0430. \u0421\u0432\u0430\u0439\u043f\u0430\u0435\u043c \u0434\u0432\u0443\u043c\u044f \u043f\u0430\u043b\u044c\u0446\u0430\u043c\u0438 \u0432\u043b\u0435\u0432\u043e \u0438\u043b\u0438 \u0432\u043f\u0440\u0430\u0432\u043e, \u0438 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u043f\u0440\u043e\u043a\u0440\u0443\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f. \u041d\u0430\u0448 \u0433\u0440\u0430\u0444\u0438\u043a \u043f\u043e\u043a\u0430 \u0442\u0430\u043a \u043d\u0435 \u0443\u043c\u0435\u0435\u0442. \u041d\u0430\u0443\u0447\u0438\u043c \u0435\u0433\u043e!<\/p>\n<p>  <\/p>\n<p>\u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u043d\u0430 \u0441\u043e\u0431\u044b\u0442\u0438\u0435 \u043a\u043e\u043b\u0451\u0441\u0438\u043a\u0430 \u043c\u044b\u0448\u0438 (\u0438\u043c\u0435\u043d\u043d\u043e \u0442\u0430\u043a \u0431\u0440\u0430\u0443\u0437\u0435\u0440 \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0435\u0442 \u044d\u0442\u043e\u0442 \u0436\u0435\u0441\u0442 \u0442\u0430\u0447\u043f\u0430\u0434\u0430):<\/p>\n<p>  <\/p>\n<pre><code class=\"javascript\">select(ganttContainer)   .call(d3Zoom)   .on(&quot;wheel.zoom&quot;, () =&gt; {     onZoom(scrollGroup, ganttContainer);   });  const onZoom = (scrollGroup, ganttContainer) =&gt; {    const ganttContainerWidth = ganttContainer.getBoundingClientRect().width;    const marginLeft = yAxisWidth + lineWidth;    const transform = zoomTransform(scrollGroup.node());    const { type, deltaY, wheelDeltaX } = event;    const maxStartTranslate = chartWidth \/ 2;    const maxEndTranslate = ganttContainerWidth - chartWidth \/ 2 - marginLeft;     if (type === &quot;wheel&quot;) {      if (deltaY !== 0) return null;      transform.x += wheelDeltaX;    }     transform.x = Math.max(transform.x, maxEndTranslate);    transform.x = Math.min(transform.x, maxStartTranslate);     const translateX = defaultTranslate + transform.x;    scrollGroup.attr(&quot;transform&quot;, `translate( ${translateX} , 0)`);  };<\/code><\/pre>\n<p>  <\/p>\n<p>\u041d\u0438\u0447\u0435\u0433\u043e \u0441\u043b\u043e\u0436\u043d\u043e, \u043f\u0440\u043e\u0441\u0442\u043e \u043a \u043f\u0440\u0438\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043f\u0440\u043e\u043a\u0440\u0443\u0442\u043a\u0443 \u043a\u043e\u043b\u0451\u0441\u0438\u043a\u0430 \u043a transform.x. \u0412\u0441\u0451! \u0422\u0435\u043f\u0435\u0440\u044c \u0433\u0440\u0430\u0444\u0438\u043a \u0443\u043c\u0435\u0435\u0442 \u0441\u043a\u0440\u043e\u043b\u043b\u0438\u0442\u044c\u0441\u044f \u043f\u043e \u0436\u0435\u0441\u0442\u0430\u043c \u0442\u0440\u0435\u043a\u043f\u0430\u0434\u0430. <\/p>\n<p>  <\/p>\n<h3 id=\"bag-perehvat-kasaniy\">\u0411\u0430\u0433: \u043f\u0435\u0440\u0435\u0445\u0432\u0430\u0442 \u043a\u0430\u0441\u0430\u043d\u0438\u0439<\/h3>\n<p>  <\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043f\u043e\u043f\u0440\u0430\u0432\u0438\u043c \u0431\u0430\u0433. \u0414\u0435\u043b\u043e \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043d\u0430\u0448 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a zoom \u043f\u0435\u0440\u0435\u0445\u0432\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u043a\u0430\u0441\u0430\u043d\u0438\u044f \u0438 \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0438\u0440\u0443\u0435\u0442 \u0438\u0445 \u043a\u0430\u043a \u0436\u0435\u0441\u0442\u044b \u0434\u043b\u044f \u0437\u0443\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f. \u041f\u043e\u044d\u0442\u043e\u043c\u0443, \u043a\u043e\u0433\u0434\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u043f\u043e\u043f\u0430\u0434\u0430\u0435\u0442 \u043f\u0430\u043b\u044c\u0446\u0435\u043c \u043d\u0430 \u0433\u0440\u0430\u0444\u0438\u043a, \u0442\u043e \u043e\u043d \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u043e\u043a\u0440\u0443\u0447\u0438\u0432\u0430\u0442\u044c \u0441\u0430\u0439\u0442 \u0432\u043d\u0438\u0437.<\/p>\n<p>  <\/p>\n<p>\u0427\u0442\u043e\u0431\u044b \u0440\u0435\u0448\u0438\u0442\u044c \u044d\u0442\u0443 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443, \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0442\u044c \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0441\u0432\u0430\u0439\u043f\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0438 \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u043d\u0435\u0433\u043e \u0432\u043a\u043b\u044e\u0447\u0430\u0442\u044c \u043b\u0438\u0431\u043e \u0433\u043e\u0440\u0438\u0437\u043e\u043d\u0442\u0430\u043b\u044c\u043d\u044b\u0439 \u0441\u043a\u0440\u043e\u043b\u043b \u0433\u0440\u0430\u0444\u0438\u043a\u0430, \u043b\u0438\u0431\u043e \u0432\u0435\u0440\u0442\u0438\u043a\u0430\u043b\u044c\u043d\u0443\u044e \u043f\u0440\u043e\u043a\u0440\u0443\u0442\u043a\u0443 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b.<\/p>\n<p>  <\/p>\n<p>\u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u0441\u043e\u0437\u0434\u0430\u0451\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435:<\/p>\n<p>  <\/p>\n<pre><code class=\"javascript\">const scrollXDisabled = useRef(false);   const startXRef = useRef(0);   const startYRef = useRef(0);   const isXPanRef = useRef(false);   const isYPanRef = useRef(false);<\/code><\/pre>\n<p>  <\/p>\n<p>\u0414\u0430\u043b\u0435\u0435 \u043f\u0438\u0448\u0435\u043c \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0434\u043b\u044f \u0444\u0438\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442 \u0441\u0442\u0430\u0440\u0442\u0430 \u043a\u0430\u0441\u0430\u043d\u0438\u044f:<\/p>\n<p>  <\/p>\n<pre><code class=\"javascript\">const onTouchStart = () =&gt; {     const touch = getTouchObject(event);     startXRef.current = touch.pageX;     startYRef.current = touch.pageY;   };<\/code><\/pre>\n<p>  <\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0443\u0436\u043d\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0441\u0432\u0430\u0439\u043f\u0430 \u0438 \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u043d\u0443\u0436\u043d\u0443\u044e \u043f\u0440\u043e\u043a\u0440\u0443\u0442\u043a\u0443:<\/p>\n<p>  <\/p>\n<pre><code class=\"javascript\">const onTouchMove = () =&gt; {     const touch = getTouchObject(event);     const diffX = startXRef.current - touch.pageX;     const diffY = startYRef.current - touch.pageY;      if (diffX &gt;= 10 || diffX &lt;= -10) {       isXPanRef.current = true;     }      if (diffY &gt;= 3 || diffY &lt;= -3) {       isYPanRef.current = true;     }      if (!isXPanRef.current &amp;&amp; isYPanRef.current &amp;&amp;   !scrollXDisabled.current) {       select(ganttContainerRef.current).on(&quot;.zoom&quot;, null);       scrollXDisabled.current = true;     }     if (scrollXDisabled) window.scrollBy(0, diffY);   };<\/code><\/pre>\n<p>  <\/p>\n<p>\u0414\u043b\u044f diffX \u0438 diffY \u0437\u0430\u0434\u0430\u0451\u043c \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0443\u044e \u043f\u043e\u0433\u0440\u0435\u0448\u043d\u043e\u0441\u0442\u044c, \u0447\u0442\u043e\u0431\u044b \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u043d\u0435 \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043b \u043d\u0430 \u043c\u0430\u043b\u0435\u0439\u0448\u0435\u0435 \u0434\u0440\u043e\u0436\u0430\u043d\u0438\u0435 \u043f\u0430\u043b\u044c\u0446\u0430.<\/p>\n<p>  <\/p>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0443\u0431\u0440\u0430\u043b \u043f\u0430\u043b\u0435\u0446, \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c \u0432\u0441\u0451 \u0432 \u0438\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435:<\/p>\n<p>  <\/p>\n<pre><code class=\"javascript\">const onTouchEnd = zoomBehavior =&gt; {   select(ganttContainerRef.current).call(zoomBehavior);   scrollXDisabled.current = false;   isXPanRef.current = false;   isYPanRef.current = false; }; <\/code><\/pre>\n<p>  <\/p>\n<p>\u041e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u043d\u0430\u0432\u0435\u0441\u0438\u0442\u044c \u043d\u0430\u0448\u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u043d\u0430 zoom-\u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0435:<\/p>\n<p>  <\/p>\n<pre><code class=\"javascript\">select(ganttContainer)       .call(d3Zoom)       .on(&quot;touchstart&quot;, onTouchStart, true)       .on(&quot;touchmove&quot;, onTouchMove, true)       .on(         &quot;touchend&quot;,         () =&gt; {           onTouchEnd(d3Zoom);         },         true  );<\/code><\/pre>\n<p>  <\/p>\n<p>\u0413\u043e\u0442\u043e\u0432\u043e! \u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0430\u0448 \u0433\u0440\u0430\u0444\u0438\u043a \u043f\u043e\u043d\u0438\u043c\u0430\u0435\u0442, \u0447\u0442\u043e \u0445\u043e\u0447\u0435\u0442 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c. \u041f\u043e\u043b\u043d\u044b\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u043a\u043e\u0434\u0430 \u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u044d\u0442\u043e\u0433\u043e \u0433\u0440\u0430\u0444\u0438\u043a\u0430 \u043d\u0430 canvas \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c <a href=\"https:\/\/codesandbox.io\/embed\/horizontal-scroll-q586s?fontsize=14&amp;hidenavigation=1&amp;theme=dark\">\u0437\u0434\u0435\u0441\u044c<\/a>. <\/p>\n<p>  <\/p>\n<p><strong>\u0421\u043f\u0430\u0441\u0438\u0431\u043e \u0437\u0430 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435! \u041d\u0430\u0434\u0435\u0435\u043c\u0441\u044f, \u0447\u0442\u043e \u0441\u0442\u0430\u0442\u044c\u044f \u0431\u044b\u043b\u0430 \u0432\u0430\u043c \u043f\u043e\u043b\u0435\u0437\u043d\u0430. <\/strong><\/p>\n<\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/company\/simbirsoft\/blog\/504248\/\"> https:\/\/habr.com\/ru\/company\/simbirsoft\/blog\/504248\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/company\/simbirsoft\/blog\/504248\/\">\n<p>\u0415\u0441\u043b\u0438 \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438 \u043d\u0443\u0436\u043d\u043e \u0432\u044b\u0432\u043e\u0434\u0438\u0442\u044c \u043c\u043d\u043e\u0433\u043e \u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0434\u0430\u043d\u043d\u044b\u0445, \u0434\u0438\u0430\u0433\u0440\u0430\u043c\u043c, \u0438\u043d\u0442\u0435\u0440\u0430\u043a\u0442\u0438\u0432\u043d\u044b\u0445 \u0432\u0438\u0434\u0436\u0435\u0442\u043e\u0432 \u2013 \u0432\u0430\u0436\u043d\u043e \u043f\u043e\u0437\u0430\u0431\u043e\u0442\u0438\u0442\u044c\u0441\u044f \u043e UX, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e \u0431\u044b\u043b\u043e \u0443\u0434\u043e\u0431\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c. \u0421\u043f\u043e\u0441\u043e\u0431 \u0432\u044b\u0432\u043e\u0434\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u0432\u0430\u0436\u0435\u043d, \u0435\u0441\u043b\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u044e\u0442 \u0438 \u043d\u0430 \u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0430\u0445, \u0438 \u043d\u0430 \u0441\u043c\u0430\u0440\u0442\u0444\u043e\u043d\u0430\u0445. \u0414\u0435\u043b\u0438\u043c\u0441\u044f \u043e\u043f\u044b\u0442\u043e\u043c, \u043a\u0430\u043a \u043c\u044b \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043b\u0438 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043d\u0435\u0442\u0440\u0438\u0432\u0438\u0430\u043b\u044c\u043d\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u2013 \u043a\u0430\u0441\u0442\u043e\u043c\u043d\u044b\u0439 \u0441\u043a\u0440\u043e\u043b\u043b \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 d3.js.<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/xh\/vd\/rl\/xhvdrlbo1tgv84a7qdfzdkeovum.png\"><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-304506","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/304506","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=304506"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/304506\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=304506"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=304506"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=304506"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}