Skip to content

Commit

Permalink
Minimal radius for highlighted points.
Browse files Browse the repository at this point in the history
  • Loading branch information
alexanderby committed Dec 9, 2016
1 parent 1d774b7 commit ca976dc
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/elements/element.path.base.js
Expand Up @@ -355,19 +355,21 @@ const BasePath = {
const cssClass = 'i-data-anchor';
const screenModel = this.node().screenModel;
const showOnHover = this.node().config.guide.showAnchors === 'hover';
const rmin = 3; // Min highlight radius
const rx = 1.25; // Highlight multiplier
var anchors = this.node()
.config
.options
.container
.selectAll(`.${cssClass}`)
.attr({
r: (showOnHover ?
((d) => filter(d) ? (screenModel.size(d) / 2) : 0) :
((d) => filter(d) ? Math.max(rmin, (screenModel.size(d) / 2)) : 0) :
((d) => {
// NOTE: Highlight point with larger radius.
var r = screenModel.size(d) / 2;
if (filter(d)) {
return Math.ceil(r * 1.25);
r = Math.max(rmin, Math.ceil(r * rx));
}
return r;
})
Expand Down

0 comments on commit ca976dc

Please sign in to comment.