dchart-core
Advanced tools
Comparing version 1.0.18 to 1.0.19
@@ -1,1 +0,1 @@ | ||
var exports=module.exports,_=require("../util"),d3=require("d3"),Com=require("./com"),Opt=require("./config").Options;exports.init=function(t,i){return this._com=new Com,this._data=null,this.options=new Opt,i=i||{},_.deepMerge(this.options,i),t?(this.el=d3.select(t),this._initArgu(),void this._initEvent()):!1},exports._initBeforeLayout=function(t){var i=this.options,e={left:0,top:0,right:0,bottom:0};for(var s in t){var h=t[s];if(_.has(h,"position")&&"center"!==h.position)switch(h.position){case"bottom":case"top":i.height-=-1===h.height.indexOf("%")?parseInt(h.height):parseInt(h.height)*i.height/100,e[h.position]+=i.height;break;case"left":case"right":i.width-=-1===h.width.indexOf("%")?parseInt(h.width):parseInt(h.width)*i.width/100,e[h.position]+=i.width}}t.series={margin:e.top+"px "+e.right+"px "+e.bottom+"px "+e.left+"px"}},exports._initArgu=function(){var t=this.options;t.svgWidth?t.width=parseInt(this.el.style("width")):(t.width||(t.width=parseInt(this.el.style("width"))),this.el.style("width",t.width)),t.svgHeight?t.height=parseInt(this.el.style("height")):(t.height||(t.height=parseInt(this.el.style("height"))),this.el.style("height",t.height)),t.beforeLayout&&this._initBeforeLayout(t.beforeLayout),t.svgWidth=t.width,t.svgHeight=t.height,t.innerWidth=t.svgWidth-t.margin.left-t.margin.right,t.innerHeight=t.svgHeight-t.margin.top-t.margin.bottom},exports.initLayout=function(){var t=this.options;this.renderTheme(t.theme),this.svg=this.el&&this.el.append("svg").attr({"class":"con-svg",width:t.svgWidth,height:t.svgHeight}).append("g").attr({"class":"con-g",transform:"translate("+t.margin.left+","+t.margin.top+")"}),this.series=this.svg.append("g").attr("class","series")}; | ||
var exports=module.exports,_=require("../util"),d3=require("d3"),Com=require("./com"),Opt=require("./config").Options;exports.init=function(t,i){return this._com=new Com,this._data=null,this.options=new Opt,i=i||{},_.deepMerge(this.options,i),t?(this.el=d3.select(t),this._initArgu(),void this._initEvent()):!1},exports._initBeforeLayout=function(t){var i=this.options,e={left:0,top:0,right:0,bottom:0};for(var h in t){var s=t[h];if(_.has(s,"position")&&"center"!==s.position)switch(s.position){case"bottom":case"top":i.height-=-1===s.height.indexOf("%")?parseInt(s.height):parseInt(s.height)*i.height/100,e[s.position]+=i.height;break;case"left":case"right":i.width-=-1===s.width.indexOf("%")?parseInt(s.width):parseInt(s.width)*i.width/100,e[s.position]+=i.width}}t.series={margin:e.top+"px "+e.right+"px "+e.bottom+"px "+e.left+"px"}},exports._initArgu=function(){var t=this.options;t.svgWidth?t.width=parseInt(this.el.style("width")):(t.width||(t.width=parseInt(this.el.style("width"))),this.el.style("width",t.width)),t.svgHeight?t.height=parseInt(this.el.style("height")):(t.height||(t.height=parseInt(this.el.style("height"))),this.el.style("height",t.height)),t.beforeLayout&&this._initBeforeLayout(t.beforeLayout),t.svgWidth=t.width,t.svgHeight=t.height,t.innerWidth=t.svgWidth-t.margin.left-t.margin.right,t.innerHeight=t.svgHeight-t.margin.top-t.margin.bottom},exports.initLayout=function(){var t=this.options;t.theme&&this.renderTheme(t.theme),this.svg=this.el&&this.el.append("svg").attr({"class":"con-svg",width:t.svgWidth,height:t.svgHeight}).append("g").attr({"class":"con-g",transform:"translate("+t.margin.left+","+t.margin.top+")"}),this.series=this.svg.append("g").attr("class","series")}; |
{ | ||
"name": "dchart-core", | ||
"version": "1.0.18", | ||
"version": "1.0.19", | ||
"description": "", | ||
@@ -8,3 +8,3 @@ "scripts": { | ||
}, | ||
"main": "src/datav.js", | ||
"main": "datav.js", | ||
"author": "elvira.zy", | ||
@@ -11,0 +11,0 @@ "license": "ISC", |
80662