vap-visual
Advanced tools
Comparing version 0.2.1 to 0.2.2
@@ -84,7 +84,9 @@ "use strict"; | ||
if (_.has(yAxis, 'labelRotate')) { | ||
if (_.isNumber(yAxis.labelRotate)) { | ||
yAxis.labelRotate = [6, -3, yAxis.labelRotate]; | ||
} | ||
} | ||
else { | ||
yAxis.labelRotate = [6, -3, 330]; | ||
} | ||
else if (_.isNumber(yAxis.labelRotate)) { | ||
yAxis.labelRotate = [6, -3, yAxis.labelRotate]; | ||
} | ||
} | ||
@@ -91,0 +93,0 @@ if (!yAxis.show) { |
@@ -26,3 +26,3 @@ import * as d3 from 'd3'; | ||
protected FormatLabel: (v: any, o?: any) => any; | ||
protected FormatValue: (v: any) => any; | ||
protected FormatValue: (v: any, o?: any) => any; | ||
protected LAYOUT: Layout; | ||
@@ -29,0 +29,0 @@ protected checkedField: string[]; |
@@ -25,2 +25,3 @@ "use strict"; | ||
// alert(1); | ||
var DEFAULT_FORMAT = function (v, o) { return v; }; | ||
var default_1 = /** @class */ (function () { | ||
@@ -64,4 +65,4 @@ function default_1(selector, conf) { | ||
// FORMART LABEL / VALUE | ||
this.FormatLabel = function (v, o) { return v; }; | ||
this.FormatValue = function (v) { return v; }; | ||
this.FormatLabel = DEFAULT_FORMAT; | ||
this.FormatValue = DEFAULT_FORMAT; | ||
// Layout and Cache Data | ||
@@ -216,10 +217,8 @@ this.LAYOUT = { x: 0, y: 0, w: 0, h: 0 }; | ||
this.CONTAINER.classed(this.props.className, true).classed(this.__ClassName, true); | ||
if (_.has(this.props, 'maxCount') && _.isNumber(this.props.maxCount)) | ||
this.MAXCOUNT = this.props.maxCount; | ||
if (_.has(this.props, 'duration') && _.isNumber(this.props.duration)) | ||
this.DURATION = this.props.duration; | ||
if (_.has(this.props, 'valueFormat')) | ||
this.FormatValue = util_1.default.buildFormat(this.props.valueFormat); | ||
if (_.has(this.props, 'labelFormat')) | ||
this.FormatLabel = this.props.labelFormat; | ||
(_.has(this.props, 'maxCount') && _.isNumber(this.props.maxCount)) ? this.MAXCOUNT = this.props.maxCount : this.MAXCOUNT = util_1.default.getDefault().maxcount; | ||
(_.has(this.props, 'duration') && _.isNumber(this.props.duration)) ? this.DURATION = this.props.duration : this.DURATION = util_1.default.getDefault().duration; | ||
_.has(this.props, 'valueFormat') ? this.FormatValue = util_1.default.buildFormat(this.props.valueFormat) : this.FormatValue = DEFAULT_FORMAT; | ||
// console.log(this.props.labelFormat) | ||
(_.has(this.props, 'labelFormat') && _.isFunction(this.props.labelFormat)) ? this.FormatLabel = this.props.labelFormat : this.FormatLabel = DEFAULT_FORMAT; | ||
// console.log(this.FormatLabel) | ||
this.SVG = this.CONTAINER.append('svg'); | ||
@@ -310,3 +309,5 @@ this.DEFS = this.SVG.append('defs'); | ||
if (typeof _this.props[key] == 'function' && typeof conf[key] == 'function') { | ||
return; | ||
if (_this.props[key] == conf[key]) { | ||
return; | ||
} | ||
} | ||
@@ -319,3 +320,2 @@ isDiff = true; | ||
} | ||
this.props = _.merge({}, this.props, conf); | ||
if (this.SVG) { | ||
@@ -322,0 +322,0 @@ this.SVG.remove(); |
{ | ||
"name": "vap-visual", | ||
"version": "0.2.1", | ||
"version": "0.2.2", | ||
"description": "vap-visual - A Visual FrameWork base on d3 & lodash", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -247,3 +247,3 @@ "use strict"; | ||
this.GROUP.attr('class', function (d) { | ||
var __name = d.properties.name; | ||
var __name = _.has(d.properties, 'name') ? d.properties : d.name; | ||
var clazz = [_this.initClassName]; | ||
@@ -250,0 +250,0 @@ var data = _.find(arr, { __name: __name }); |
438189
10737