-
Notifications
You must be signed in to change notification settings - Fork 0
/
17ab02e2.js
1 lines (1 loc) · 1.96 KB
/
17ab02e2.js
1
(window.webpackJsonp=window.webpackJsonp||[]).push([[19],{VCGX:function(A,O,e){"use strict";e.r(O),e.d(O,"default",function(){return g});var n=e("nKUr"),K=e.n(n),T=e("y8nQ"),D=e("Vl3Y"),R=e("giR+"),M=e("fyUT"),j=e("c1Ei"),a=e.n(j),d=e("5Tp6"),P=e("XKWP"),p=e("N7Kx"),f=e("kFHX"),C=e("4jIl"),U=e("q1tI"),b=e.n(U),h=e("VphZ"),g=function(I){Object(f.a)(l,I);var W=Object(C.a)(l);function l(o){var t;return Object(P.a)(this,l),t=W.call(this,o),t.svgWidth=500,t.svgHeight=500,t.drawSvg=Object(d.a)(a.a.mark(function u(){var s,_,i,m,r;return a.a.wrap(function(c){for(;;)switch(c.prev=c.next){case 0:s=t.state.count,_=h.select(".interpolate-test"),_.selectAll("svg").remove(),i=_.append("svg").attr("width",500).attr("height",500).style("border","1px solid black"),m=h.interpolate("red","blue"),r=Array(s).fill(0).map(function(E,v){return m(v/s)}),i.selectAll("rect").data(r).enter().append("rect").attr("width",t.svgWidth/s).attr("height",t.svgHeight).attr("x",function(E,v){return t.svgWidth*v/s}).attr("fill",function(E){return E});case 7:case"end":return c.stop()}},u)})),t.state={count:500},t}return Object(p.a)(l,[{key:"componentDidMount",value:function(){var o=Object(d.a)(a.a.mark(function u(){return a.a.wrap(function(_){for(;;)switch(_.prev=_.next){case 0:return _.next=2,this.drawSvg();case 2:case"end":return _.stop()}},u,this)}));function t(){return o.apply(this,arguments)}return t}()},{key:"render",value:function(){var t=this,u=this.state.count;return Object(n.jsxs)(n.Fragment,{children:[Object(n.jsx)(D.a,{children:Object(n.jsx)(D.a.Item,{label:"\u63D2\u503C\u6570\u91CF",children:Object(n.jsx)(M.a,{defaultValue:u,min:1,max:500,onChange:function(){var s=Object(d.a)(a.a.mark(function _(i){return a.a.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",t.setState({count:i},t.drawSvg));case 1:case"end":return r.stop()}},_)}));return function(_){return s.apply(this,arguments)}}()})})}),Object(n.jsx)("div",{className:"interpolate-test"})]})}}]),l}(b.a.Component)}}]);