Comparing version 3.0.12 to 3.1.0
@@ -51,3 +51,8 @@ [ | ||
"description": "Facets" | ||
}, | ||
{ | ||
"name": "interact", | ||
"code": "require('./interaction/index');", | ||
"description": "Interactions" | ||
} | ||
] |
@@ -0,2 +1,23 @@ | ||
#### 3.1.0 (2018-05-25) | ||
##### New Features | ||
* chore(dev): update dependencies, etc. | ||
* feat(interaction): add basic interaction grammar (beta) | ||
* feat(interaction): add brush interaction | ||
* feat(interaction): add zoom interaction | ||
* feat(interaction): add drag interaction | ||
* feat(axis): highlight zero baseline | ||
##### BugFixes | ||
* fix(tooltip): ignore properties like showMarker of tooltip items | ||
#### 3.0.12 (2018-05-18) | ||
##### Bug Fixes | ||
* fix(geom): undefined container in changeVisible. Closes #629 | ||
* fix(tooltip): bug in removing duplicated items, Closes #637 | ||
#### 3.0.11 (2018-05-11) | ||
@@ -3,0 +24,0 @@ |
@@ -318,2 +318,9 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
} | ||
if (options.hasOwnProperty('xField') && options.xField.hasOwnProperty('grid')) { | ||
if (cfg.position === 'left') { | ||
Util.deepMix(cfg, options.xField); | ||
} | ||
} | ||
return cfg; | ||
@@ -335,2 +342,3 @@ }; | ||
var gridPoints = []; | ||
var tickValues = []; | ||
var verticalTicks = formatTicks(verticalScale.getTicks()); | ||
@@ -341,2 +349,3 @@ // 没有垂直的坐标点时不会只栅格 | ||
Util.each(ticks, function (tick, idx) { | ||
tickValues.push(tick.tickValue); | ||
var subPoints = []; | ||
@@ -375,2 +384,3 @@ var value = tick.value; | ||
cfg.grid.items = gridPoints; | ||
cfg.grid.tickValues = tickValues; | ||
} | ||
@@ -377,0 +387,0 @@ return cfg; |
@@ -16,2 +16,5 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
// TODO FIXME this is HARD CODING | ||
var IGNORE_TOOLTIP_ITEM_PROPERTIES = ['marker', 'showMarker']; | ||
function _indexOfArray(items, item) { | ||
@@ -22,3 +25,3 @@ var rst = -1; | ||
for (var key in item) { | ||
if (item.hasOwnProperty(key)) { | ||
if (item.hasOwnProperty(key) && IGNORE_TOOLTIP_ITEM_PROPERTIES.indexOf(key) === -1) { | ||
if (!Util.isObject(item[key]) && item[key] !== sub[key]) { | ||
@@ -25,0 +28,0 @@ isEqual = false; |
@@ -60,3 +60,13 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
*/ | ||
hideLastLine: false | ||
hideLastLine: false, | ||
/** | ||
* 0基线不在轴线上时,是否强调0基线 | ||
* @type {Boolean} | ||
*/ | ||
hightLightZero: true, | ||
/** | ||
* 0基线样式 | ||
* @type {Object} | ||
*/ | ||
zeroLineStyle: { stroke: '#000', lineDash: [0, 0] } | ||
}; | ||
@@ -94,2 +104,3 @@ }; | ||
var type = this.get('type'); | ||
var gridLine = void 0; | ||
@@ -127,5 +138,12 @@ var path = void 0; | ||
cfg = Util.mix({}, lineStyle, { | ||
path: path | ||
}); | ||
if (self._drawZeroLine(type, idx)) { | ||
cfg = Util.mix({}, self.get('zeroLineStyle'), { | ||
path: path | ||
}); | ||
} else { | ||
cfg = Util.mix({}, lineStyle, { | ||
path: path | ||
}); | ||
} | ||
gridLine = self.addShape('path', { | ||
@@ -174,2 +192,13 @@ attrs: cfg | ||
Grid.prototype._drawZeroLine = function _drawZeroLine(type, idx) { | ||
var self = this; | ||
var tickValues = self.get('tickValues'); | ||
if (type === 'line' && tickValues) { | ||
if (tickValues[idx] === 0 && self.get('hightLightZero')) { | ||
return true; | ||
} | ||
} | ||
return false; | ||
}; | ||
Grid.prototype._drawAlternativeBg = function _drawAlternativeBg(item, preItem, index) { | ||
@@ -176,0 +205,0 @@ var self = this; |
@@ -17,17 +17,6 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
// 绑定事件 | ||
function wrapBehavior(obj, action) { | ||
if (obj['_wrap_' + action]) { | ||
return obj['_wrap_' + action]; | ||
} | ||
var method = function method(e) { | ||
obj[action](e); | ||
}; | ||
obj['_wrap_' + action] = method; | ||
return method; | ||
} | ||
var wrapBehavior = Util.wrapBehavior; | ||
// 获取绑定的事件 | ||
function getWrapBehavior(obj, action) { | ||
return obj['_wrap_' + action]; | ||
} | ||
var getWrapBehavior = Util.getWrapBehavior; | ||
@@ -34,0 +23,0 @@ var Base = function () { |
@@ -18,2 +18,5 @@ var G2 = require('./core'); | ||
// interaction | ||
require('./interaction/index'); | ||
module.exports = G2; |
{ | ||
"name": "@antv/g2", | ||
"version": "3.0.12", | ||
"version": "3.1.0", | ||
"description": "the Grammar of Graphics in Javascript", | ||
"main": "build/g2.js", | ||
"browser": "build/g2.js", | ||
"module": "lib/index.js", | ||
"module": "src/index.js", | ||
"homepage": "https://github.com/antvis/g2", | ||
@@ -27,12 +27,12 @@ "repository": { | ||
"babel-eslint": "~8.0.3", | ||
"babel-loader": "^7.1.4", | ||
"babel-loader": "~7.1.4", | ||
"babel-plugin-transform-remove-strict-mode": "~0.0.2", | ||
"babel-preset-env": "~1.6.1", | ||
"body-parser": "^1.18.2", | ||
"body-parser": "~1.18.2", | ||
"chai": "~4.1.2", | ||
"commander": "~2.12.2", | ||
"connect": "^3.6.6", | ||
"connect": "~3.6.6", | ||
"d3-queue": "~3.0.7", | ||
"debug": "~3.1.0", | ||
"electron": "^1.8.4", | ||
"electron": "~1.8.7", | ||
"eslint": "~3.19.0", | ||
@@ -42,5 +42,7 @@ "eslint-config-airbnb": "~15.0.1", | ||
"eslint-plugin-html": "~3.1.1", | ||
"eslint-plugin-jsx-a11y": "~5.1.1", | ||
"eslint-plugin-react": "~7.1.0", | ||
"event-simulate": "~1.0.0", | ||
"get-port": "~3.2.0", | ||
"jszip": "^3.1.5", | ||
"jszip": "~3.1.5", | ||
"nightmare": "~2.10.0", | ||
@@ -51,6 +53,6 @@ "nunjucks": "~3.0.1", | ||
"pre-commit": "~1.2.2", | ||
"serve-static": "^1.13.2", | ||
"serve-static": "~1.13.2", | ||
"shelljs": "~0.7.8", | ||
"string-replace-loader": "~1.3.0", | ||
"torchjs": "~1.0.4", | ||
"torchjs": "~1.2.3", | ||
"uglify-js": "~3.1.10", | ||
@@ -97,9 +99,9 @@ "webpack": "~3.10.0" | ||
"dependencies": { | ||
"@antv/g": "^2.0.7-beta.3", | ||
"fecha": "^2.3.3", | ||
"gl-matrix": "^2.4.1", | ||
"lodash": "^4.17.5", | ||
"venn.js": "^0.2.20", | ||
"wolfy87-eventemitter": "~5.2.4" | ||
"@antv/g": "~2.0.7-beta.3", | ||
"fecha": "~2.3.3", | ||
"gl-matrix": "~2.6.1", | ||
"lodash": "~4.17.5", | ||
"venn.js": "~0.2.20", | ||
"wolfy87-eventemitter": "~5.1.0" | ||
} | ||
} |
@@ -301,2 +301,9 @@ /** | ||
} | ||
if (options.hasOwnProperty('xField') && options.xField.hasOwnProperty('grid')) { | ||
if (cfg.position === 'left') { | ||
Util.deepMix(cfg, options.xField); | ||
} | ||
} | ||
return cfg; | ||
@@ -312,2 +319,3 @@ } | ||
const gridPoints = []; | ||
const tickValues = []; | ||
const verticalTicks = formatTicks(verticalScale.getTicks()); | ||
@@ -318,2 +326,3 @@ // 没有垂直的坐标点时不会只栅格 | ||
Util.each(ticks, (tick, idx) => { | ||
tickValues.push(tick.tickValue); | ||
const subPoints = []; | ||
@@ -352,2 +361,3 @@ let value = tick.value; | ||
cfg.grid.items = gridPoints; | ||
cfg.grid.tickValues = tickValues; | ||
} | ||
@@ -354,0 +364,0 @@ return cfg; |
@@ -14,2 +14,8 @@ /** | ||
// TODO FIXME this is HARD CODING | ||
const IGNORE_TOOLTIP_ITEM_PROPERTIES = [ | ||
'marker', | ||
'showMarker' | ||
]; | ||
function _indexOfArray(items, item) { | ||
@@ -20,3 +26,3 @@ let rst = -1; | ||
for (const key in item) { | ||
if (item.hasOwnProperty(key)) { | ||
if (item.hasOwnProperty(key) && IGNORE_TOOLTIP_ITEM_PROPERTIES.indexOf(key) === -1) { | ||
if (!Util.isObject(item[key]) && item[key] !== sub[key]) { | ||
@@ -23,0 +29,0 @@ isEqual = false; |
@@ -946,3 +946,2 @@ /** | ||
// } | ||
} | ||
@@ -949,0 +948,0 @@ |
@@ -44,3 +44,13 @@ /** | ||
*/ | ||
hideLastLine: false | ||
hideLastLine: false, | ||
/** | ||
* 0基线不在轴线上时,是否强调0基线 | ||
* @type {Boolean} | ||
*/ | ||
hightLightZero: true, | ||
/** | ||
* 0基线样式 | ||
* @type {Object} | ||
*/ | ||
zeroLineStyle: { stroke: '#000', lineDash: [ 0, 0 ] } | ||
}; | ||
@@ -78,2 +88,3 @@ } | ||
const type = this.get('type'); | ||
let gridLine; | ||
@@ -109,5 +120,12 @@ let path; | ||
cfg = Util.mix({}, lineStyle, { | ||
path | ||
}); | ||
if (self._drawZeroLine(type, idx)) { | ||
cfg = Util.mix({}, self.get('zeroLineStyle'), { | ||
path | ||
}); | ||
} else { | ||
cfg = Util.mix({}, lineStyle, { | ||
path | ||
}); | ||
} | ||
gridLine = self.addShape('path', { | ||
@@ -154,2 +172,13 @@ attrs: cfg | ||
_drawZeroLine(type, idx) { | ||
const self = this; | ||
const tickValues = self.get('tickValues'); | ||
if (type === 'line' && tickValues) { | ||
if (tickValues[idx] === 0 && self.get('hightLightZero')) { | ||
return true; | ||
} | ||
} | ||
return false; | ||
} | ||
_drawAlternativeBg(item, preItem, index) { | ||
@@ -236,2 +265,3 @@ const self = this; | ||
module.exports = Grid; |
@@ -25,3 +25,2 @@ /** | ||
render(coord, group) { | ||
@@ -41,3 +40,2 @@ const self = this; | ||
_drawShapes(view, layer) { | ||
@@ -88,6 +86,4 @@ const self = this; | ||
} | ||
} | ||
module.exports = RegionFilter; |
@@ -15,17 +15,6 @@ /** | ||
// 绑定事件 | ||
function wrapBehavior(obj, action) { | ||
if (obj['_wrap_' + action]) { | ||
return obj['_wrap_' + action]; | ||
} | ||
const method = e => { | ||
obj[action](e); | ||
}; | ||
obj['_wrap_' + action] = method; | ||
return method; | ||
} | ||
const wrapBehavior = Util.wrapBehavior; | ||
// 获取绑定的事件 | ||
function getWrapBehavior(obj, action) { | ||
return obj['_wrap_' + action]; | ||
} | ||
const getWrapBehavior = Util.getWrapBehavior; | ||
@@ -32,0 +21,0 @@ class Base { |
@@ -18,2 +18,5 @@ const G2 = require('./core'); | ||
// interaction | ||
require('./interaction/index'); | ||
module.exports = G2; |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
12752913
294
175353
34
+ Added@antv/g@2.0.7-beta.6(transitive)
+ Addedgl-matrix@2.6.1(transitive)
+ Addedregexp.prototype.flags@1.5.2(transitive)
- Removed@antv/g@2.1.0(transitive)
- Removedgl-matrix@2.8.1(transitive)
- Removedregexp.prototype.flags@1.5.3(transitive)
- Removedwolfy87-eventemitter@5.2.9(transitive)
Updated@antv/g@~2.0.7-beta.3
Updatedfecha@~2.3.3
Updatedgl-matrix@~2.6.1
Updatedlodash@~4.17.5
Updatedvenn.js@~0.2.20
Updatedwolfy87-eventemitter@~5.1.0