Skip to content

Commit 6153502

Browse files
committed
lint/doc scatterplot.js
1 parent 8da4c03 commit 6153502

File tree

2 files changed

+35
-27
lines changed

2 files changed

+35
-27
lines changed

src/hiv_tx_network.js

+15-16
Original file line numberDiff line numberDiff line change
@@ -827,23 +827,22 @@ class HIVTxNetwork {
827827
828828
validate the list of CoI
829829
830-
@param groups [array] is a list of CoI
831-
832-
name: unique string
833-
description: string,
834-
nodes: {
835-
{
836-
'id' : node id,
837-
'added' : date,
838-
'kind' : enum (one of _cdcPrioritySetNodeKind)
839-
}
840-
},
841-
created: date,
842-
kind: enum (one of kGlobals.CDCCOIKind),
843-
tracking: enum (one of kGlobals.CDCCOITrackingOptions)
844-
createdBy : enum (on of [kGlobals.CDCCOICreatedBySystem,kGlobals.CDCCOICreatedManually])
830+
@param groups {array} is a list of CoI
831+
name: unique string
832+
description: string,
833+
nodes: {
834+
{
835+
'id' : node id,
836+
'added' : date,
837+
'kind' : _cdcPrioritySetNodeKind
838+
}
839+
},
840+
created: date,
841+
kind: kGlobals.CDCCOIKind,
842+
tracking: kGlobals.CDCCOITrackingOptions
843+
createdBy : kGlobals.CDCCOICreatedBySystem,kGlobals.CDCCOICreatedManually
845844
846-
@param auto_extend [bool] : if true, automatically expand existing CoI
845+
@param auto_extend {bool} : if true, automatically expand existing CoI
847846
848847
*/
849848
priority_groups_validate(groups, auto_extend) {

src/scatterplot.js

+20-11
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,37 @@
11
var d3 = require("d3");
22

3+
/**
4+
* Renders a scatter plot using D3.js.
5+
6+
* @param {Object[]} points - An array of data points, each with x and y coordinates (and optionally a title).
7+
* @param {number} w - The width of the plot area.
8+
* @param {number} h - The height of the plot area.
9+
* @param {string} id - The ID of the HTML element where the plot will be rendered.
10+
* @param {Object} labels - An object containing labels for the x and y axes.
11+
* @param {boolean} [dates=false] - A flag indicating whether the x-axis should represent dates.
12+
13+
* @returns {void}
14+
*/
15+
316
function hivtrace_render_scatterplot(points, w, h, id, labels, dates) {
417
var _defaultFloatFormat = d3.format(",.2r");
518
var _defaultDateViewFormatShort = d3.time.format("%B %Y");
619

720
var margin = {
8-
top: 10,
9-
right: 10,
10-
bottom: 100,
11-
left: 100,
12-
},
21+
top: 10,
22+
right: 10,
23+
bottom: 100,
24+
left: 100,
25+
},
1326
width = w - margin.left - margin.right,
1427
height = h - margin.top - margin.bottom;
1528

1629
var x = (dates ? d3.time.scale() : d3.scale.linear())
17-
.domain(
18-
d3.extent(points, (p) => p.x)
19-
)
30+
.domain(d3.extent(points, (p) => p.x))
2031
.range([0, width]);
2132

2233
var y = (dates ? d3.time.scale() : d3.scale.linear())
23-
.domain(
24-
d3.extent(points, (p) => p.y)
25-
)
34+
.domain(d3.extent(points, (p) => p.y))
2635
.range([height, 0]);
2736

2837
var xAxis = d3.svg

0 commit comments

Comments
 (0)