diff --git a/HISTORY.md b/HISTORY.md index 5cabd697..631c66a3 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -4,6 +4,9 @@ http://visjs.org ## not yet released, version 4.13.1-SNAPSHOT +### Graph3d + +- Fixed #1615: implemented new option `dotSizeRatio`. ## 2016-02-01, version 4.13.0 diff --git a/docs/graph3d/index.html b/docs/graph3d/index.html index 43a5e2c8..c0e604a7 100644 --- a/docs/graph3d/index.html +++ b/docs/graph3d/index.html @@ -379,6 +379,13 @@ var options = { The line width of dots, bars and lines. Applicable for all styles. + + dotSizeRatio + number + 0.02 + Ratio of the size of the dots with respect to the width of the graph. + + gridColor string diff --git a/lib/graph3d/Graph3d.js b/lib/graph3d/Graph3d.js index 20c7b6b1..68390079 100644 --- a/lib/graph3d/Graph3d.js +++ b/lib/graph3d/Graph3d.js @@ -96,6 +96,8 @@ function Graph3d(container, data, options) { strokeWidth: 1 // px }; + this.dotSizeRatio = 0.02; // size of the dots as a fraction of the graph width + // create a frame and canvas this.create(); @@ -844,6 +846,8 @@ Graph3d.prototype.setOptions = function (options) { if (options.yValueLabel !== undefined) this.yValueLabel = options.yValueLabel; if (options.zValueLabel !== undefined) this.zValueLabel = options.zValueLabel; + if (options.dotSizeRatio !== undefined) this.dotSizeRatio = options.dotSizeRatio; + if (options.style !== undefined) { var styleNumber = this._getStyleNumber(options.style); if (styleNumber !== -1) { @@ -976,7 +980,7 @@ Graph3d.prototype._redrawLegend = function() { if (this.style === Graph3d.STYLE.DOTCOLOR || this.style === Graph3d.STYLE.DOTSIZE) { - var dotSize = this.frame.clientWidth * 0.02; + var dotSize = this.frame.clientWidth * this.dotSizeRatio; var widthMin, widthMax; if (this.style === Graph3d.STYLE.DOTSIZE) { @@ -1613,7 +1617,7 @@ Graph3d.prototype._redrawDataDot = function() { this.dataPoints.sort(sortDepth); // draw the datapoints as colored circles - var dotSize = this.frame.clientWidth * 0.02; // px + var dotSize = this.frame.clientWidth * this.dotSizeRatio; // px for (i = 0; i < this.dataPoints.length; i++) { var point = this.dataPoints[i];