basb-cli
Version:
Blog as Second Brain!
2 lines (1 loc) • 3.99 kB
JavaScript
import{_ as t,G as e,u as i,s as a,C as r,R as n,f as s,ak as o,bb as l,bc as p,p as u,o as c,c as h,Y as d,S as m,e as y,b9 as v}from"./index.js";import{install as f}from"./install32.js";import"./sliderMove.js";import"./axisModelCreator.js";import"./axisDefault.js";import"./AxisBuilder.js";import"./labelLayoutHelper.js";import"./brushHelper.js";import"./interactionMutex.js";import"./cursorHelper.js";function g(t,e,i,a){for(var r,n=[],s=0;s<i.length;s++){var o=i[s],l=t.get(t.mapDimension(o),e);r=l,("category"===a.getAxis(o).type?null==r:null==r||isNaN(r))||n.push(a.dataToPoint(l,o))}return n}function S(t,e,i,a,r){var n=g(t,i,a,r),s=new o({shape:{points:n},z2:10});return e.add(s),t.setItemGraphicEl(i,s),s}function _(t){var e=t.get("smooth",!0);return!0===e&&(e=.3),e=l(e),p(e)&&(e=0),{smooth:e}}function I(t,e,i,a){t.useStyle(e.getItemVisual(i,"style")),t.style.fill=null,t.setShape("smooth",a.smooth);var r=e.getItemModel(i),n=r.getModel("emphasis");u(t,r,"lineStyle"),c(t,n.get("focus"),n.get("blurScope"),n.get("disabled"))}var w=function(r){function o(){var t=null!==r&&r.apply(this,arguments)||this;return t.type=o.type,t._dataGroup=new e,t._initialized=!1,t}return t(o,r),o.prototype.init=function(){this.group.add(this._dataGroup)},o.prototype.render=function(t,e,r,o){this._progressiveEls=null;var l=this._dataGroup,p=t.getData(),u=this._data,c=t.coordinateSystem,h=c.dimensions,d=_(t);if(p.diff(u).add((function(t){I(S(p,l,t,h,c),p,t,d)})).update((function(e,r){var n=u.getItemGraphicEl(r),s=g(p,e,h,c);p.setItemGraphicEl(e,n),i(n,{shape:{points:s}},t,e),a(n),I(n,p,e,d)})).remove((function(t){var e=u.getItemGraphicEl(t);l.remove(e)})).execute(),!this._initialized){this._initialized=!0;var m=function(t,e,i){var a=t.model,r=t.getRect(),o=new n({shape:{x:r.x,y:r.y,width:r.width,height:r.height}}),l="horizontal"===a.get("layout")?"width":"height";return o.setShape(l,0),s(o,{shape:{width:r.width,height:r.height}},e,i),o}(c,t,(function(){setTimeout((function(){l.removeClipPath()}))}));l.setClipPath(m)}this._data=p},o.prototype.incrementalPrepareRender=function(t,e,i){this._initialized=!0,this._data=null,this._dataGroup.removeAll()},o.prototype.incrementalRender=function(t,e,i){for(var a=e.getData(),r=e.coordinateSystem,n=r.dimensions,s=_(e),o=this._progressiveEls=[],l=t.start;l<t.end;l++){var p=S(a,this._dataGroup,l,n,r);p.incremental=!0,I(p,a,l,s),o.push(p)}},o.prototype.remove=function(){this._dataGroup&&this._dataGroup.removeAll(),this._data=null},o.type="parallel",o}(r);function x(t){var e=t.ecModel.getComponent("parallel",t.get("parallelIndex"));if(e){var i={};return y(e.dimensions,(function(t){var e=+t.replace("dim","");i[t]=e})),i}}var G=function(e){function i(){var t=null!==e&&e.apply(this,arguments)||this;return t.type=i.type,t.visualStyleAccessPath="lineStyle",t.visualDrawType="stroke",t}return t(i,e),i.prototype.getInitialData=function(t,e){return h(null,this,{useEncodeDefaulter:d(x,null,this)})},i.prototype.getRawIndicesByActiveState=function(t){var e=this.coordinateSystem,i=this.getData(),a=[];return e.eachActiveState(i,(function(e,r){t===e&&a.push(i.getRawIndex(r))})),a},i.type="series.parallel",i.dependencies=["parallel"],i.defaultOption={z:2,coordinateSystem:"parallel",parallelIndex:0,label:{show:!1},inactiveOpacity:.05,activeOpacity:1,lineStyle:{width:1,opacity:.45,type:"solid"},emphasis:{label:{show:!1}},progressive:500,smooth:!1,animationEasing:"linear"},i}(m),b=["lineStyle","opacity"],j={seriesType:"parallel",reset:function(t,e){var i=t.coordinateSystem,a={normal:t.get(["lineStyle","opacity"]),active:t.get("activeOpacity"),inactive:t.get("inactiveOpacity")};return{progress:function(t,e){i.eachActiveState(e,(function(t,i){var r=a[t];if("normal"===t&&e.hasItemOption){var n=e.getItemModel(i).get(b,!0);null!=n&&(r=n)}e.ensureUniqueItemVisual(i,"style").opacity=r}),t.start,t.end)}}}};function A(t){v(f),t.registerChartView(w),t.registerSeriesModel(G),t.registerVisual(t.PRIORITY.VISUAL.BRUSH,j)}export{A as install};