Skip to content

Commit cb2d362

Browse files
author
Lijun Zhang
committed
DM-7508:fixed the conflict with dev
1 parent b903790 commit cb2d362

File tree

4 files changed

+143
-117
lines changed

4 files changed

+143
-117
lines changed

.eslintrc

Lines changed: 31 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,28 @@
11
{
22
"plugins": [
3-
"react"
3+
"react",
4+
"jsdoc"
5+
46
],
7+
"settings": {
8+
"jsdoc": {
9+
"tagNamePreference": {
10+
"param": "param",
11+
"returns": "returns"
12+
}
13+
}
14+
},
15+
"extends": [
16+
"eslint:recommended",
17+
"plugin:react/recommended"
18+
],
519
"env": {
620
"es6": true,
721
"browser": true
822
},
923
"parserOptions": {
10-
"ecmaVersion": 7,
11-
"ecmaFeatures": {
24+
"ecmaVersion": 7,
25+
"ecmaFeatures": {
1226
"arrowFunctions" : true,
1327
"binaryLiterals" : true,
1428
"blockBindings": true,
@@ -64,7 +78,20 @@
6478
"react/wrap-multilines": 1,
6579
"semi": [2, "always"],
6680
"space-infix-ops": 0,
67-
"quotes": [2, "single", "avoid-escape"]
81+
"quotes": [2, "single", "avoid-escape"],
82+
"eqeqeq": 1,
83+
//jsdoc rules
84+
"jsdoc/check-param-names": 1,
85+
"jsdoc/check-tag-names": 1,
86+
"jsdoc/check-types": 1,
87+
"jsdoc/newline-after-description": 1,
88+
"jsdoc/require-description-complete-sentence": 1,
89+
"jsdoc/require-hyphen-before-param-description": 1,
90+
"jsdoc/require-param": 2,
91+
"jsdoc/require-param-description": 1,
92+
"jsdoc/require-param-type": 1,
93+
"jsdoc/require-returns-description": 1,
94+
"jsdoc/require-returns-type": 1
6895

6996
// "react/display-name": 1,
7097
// "react/forbid-prop-types": 1,

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@
8383
"webpack": "^1.13.2",
8484
"eslint-plugin-jsx-a11y": "^0.6.2",
8585
"jsdoc-jsx": "^0.1.0",
86-
"ink-docstrap" :"^1.2.1"
86+
"ink-docstrap" :"^1.2.1",
87+
"eslint-plugin-jsdoc":"^2.3.1"
8788
}
8889
}

src/firefly/js/visualize/CsysConverter.js

Lines changed: 44 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ const MAX_CACHE_ENTRIES = 38000; // set to never allows the cache array over 480
3939
export class CysConverter {
4040

4141
/**
42-
*
4342
* @param {object} plot
4443
*/
4544
constructor(plot) {
@@ -57,8 +56,8 @@ export class CysConverter {
5756

5857
/**
5958
*
60-
* @param wp world point
61-
* @param imp Image Point
59+
* @param {WorldPt} wp world point
60+
* @param {ImagePt} imp Image Point
6261
*/
6362
putInConversionCache(wp, imp) {
6463
if (SimpleMemCache.size(this.plotImageId)<MAX_CACHE_ENTRIES) {
@@ -72,8 +71,8 @@ export class CysConverter {
7271

7372
/**
7473
* Determine if a world point is in data Area of the plot and is not null
75-
* @param iwPt the point to test.
76-
* @return {boolean} true if it is in the data boundaries, false if not.
74+
* @param {WorldPt} iwPt the point to test.
75+
* @returns {boolean} true if it is in the data boundaries, false if not.
7776
*/
7877
imagePointInData(iwPt) {
7978
var retval= false;
@@ -89,8 +88,8 @@ export class CysConverter {
8988

9089
/**
9190
* Determine if a image point is in the plot boundaries and is not null.
92-
* @param pt the point to test.
93-
* @return {boolean} true if it is in the boundaries, false if not.
91+
* @param {Point} pt the point to test.
92+
* @returns {boolean} true if it is in the boundaries, false if not.
9493
*/
9594
pointInData(pt) {
9695
if (!isValidPoint(pt)) return false;
@@ -101,6 +100,7 @@ export class CysConverter {
101100
/**
102101
* This method returns false it the point is definitely not in plot. It returns true if the point might be in the plot.
103102
* Used for tossing out points that we know that are not in plot without having to do all the math. It is much faster.
103+
* @param {WorldPt} wp
104104
* @return {boolean} true in we guess it might be in the bounds, false if we know that it is not in the bounds
105105
*/
106106
pointInPlotRoughGuess(wp) {
@@ -117,8 +117,8 @@ export class CysConverter {
117117

118118
/**
119119
* Determine if a image point is in the plot boundaries and is not null.
120-
* @param ipt the point to test.
121-
* @return boolean true if it is in the boundaries, false if not.
120+
* @param {ImagePt} ipt the point to test.
121+
* @returns boolean true if it is in the boundaries, false if not.
122122
*/
123123
imageWorkSpacePtInPlot(ipt) {
124124
if (!ipt) return false;
@@ -128,7 +128,7 @@ export class CysConverter {
128128

129129
/**
130130
* Determine if a image point is in the plot boundaries and is not null
131-
* @param pt the point to test.
131+
* @param {Point} pt the point to test.
132132
* @return {boolean} true if it is in the boundaries, false if not.
133133
*/
134134
pointInPlot(pt) {
@@ -149,9 +149,9 @@ export class CysConverter {
149149
}
150150

151151
/**
152-
* test to see if the input is in the view port and is not null
153-
* @param vpt
154-
* @return {boolean}
152+
* @desc Test to see if the input is in the view port and is not null.
153+
* @param {Object} vpt
154+
* @returns {boolean}
155155
*/
156156
viewPortPointInViewPort(vpt) {
157157
if (!vpt || !vpt.type || vpt.type!==Point.VP_PT) return false;
@@ -162,9 +162,9 @@ export class CysConverter {
162162

163163

164164
/**
165-
* Determine if a point is in the view port boundaries and is not null.
166-
* @param pt the point to test.
167-
* @return {boolean} true if it is in the boundaries, false if not.
165+
* @desc Determine if a point is in the view port boundaries and is not null.
166+
* @param {Point} pt the point to test.
167+
* @returns {boolean} true if it is in the boundaries, false if not.
168168
*/
169169
pointInViewPort(pt) {
170170
if (!isValidPoint(pt)) return false;
@@ -219,8 +219,8 @@ export class CysConverter {
219219
}
220220

221221
/**
222-
* return a ImageWorkspacePt from the screen point
223-
* @param screenPt
222+
* @desc Return a ImageWorkspacePt from the screen point.
223+
* @param {ScreenPt} screenPt
224224
* @param {number} [altZoomLevel]
225225
*/
226226
makeIWPtFromSPt(screenPt, altZoomLevel) {
@@ -235,7 +235,6 @@ export class CysConverter {
235235

236236

237237
/**
238-
* Return the ImagePt coordinates given Pt
239238
* @param {object} pt the point to translate
240239
* @return ImagePt the image coordinates
241240
*/
@@ -266,7 +265,8 @@ export class CysConverter {
266265

267266
/**
268267
* return a ImagePoint from a ImageWorkspace point
269-
* @param iwPt
268+
* @param {ImageWpt} iwPt
269+
* returns ImagePt
270270
*/
271271
static makeIPtFromIWPt(iwPt) {
272272
if (!iwPt) return null;
@@ -275,9 +275,9 @@ export class CysConverter {
275275

276276

277277
/**
278-
* Return the image coordinates given a WorldPt class
279-
* @param wpt the class containing the point in sky coordinates
280-
* @return ImagePt the translated coordinates
278+
* @desc Return the image coordinates given a WorldPt class.
279+
* @param {WorldPt} wpt the class containing the point in sky coordinates
280+
* @returns ImagePt the translated coordinates
281281
*/
282282
getImageCoordsFromWorldPt(wpt) {
283283
if (!wpt) return null;
@@ -308,11 +308,11 @@ export class CysConverter {
308308

309309

310310
/**
311-
* Return the ViewPortCoords coordinates given for Pt
312-
* @param pt the point to translate
311+
* @desc Return the ViewPortCoords coordinates given for Pt.
312+
* @param {Point} pt the point to translate
313313
* @param {number} [altZoomLevel], only use this parameter it you want to compute the point for a zoom level that
314314
* if different than what the plotted zoom level
315-
* @return WorldPt the world coordinates
315+
* @returns WorldPt the world coordinates
316316
*/
317317
getViewPortCoords(pt, altZoomLevel) {
318318
if (!isValidPoint(pt)) return null;
@@ -341,8 +341,8 @@ export class CysConverter {
341341

342342

343343
/**
344-
* return a ViewPort Point from a ScreenPt
345-
* @param pt
344+
* @desc Return a ViewPort Point from a ScreenPt.
345+
* @param {PointPt} pt
346346
*/
347347
makeVPtFromSPt(pt) {
348348
if (!pt) return null;
@@ -353,8 +353,8 @@ export class CysConverter {
353353

354354
/**
355355
* An optimized conversion of WorldPt to viewport point.
356-
* @param {object} wpt a world pt
357-
* @param {object} retPt mutable returned ViewPort Point, this object will be written to
356+
* @param {Object} wpt a world pt
357+
* @param {Object} retPt mutable returned ViewPort Point, this object will be written to
358358
* @return {boolean} success or failure
359359
*/
360360
getViewPortCoordsOptimize(wpt, retPt) {
@@ -425,7 +425,7 @@ export class CysConverter {
425425

426426
/**
427427
* Return the screen coordinates given Pt
428-
* @param pt the point to translate
428+
* @param {PointPt} pt the point to translate
429429
* @param {number} [altZoomLevel], only use this parameter it you want to compute the point for a zoom level that
430430
* if different than what the plotted zoom level
431431
* @return ScreenPt the screen coordinates
@@ -466,7 +466,7 @@ export class CysConverter {
466466

467467
/**
468468
*
469-
* @param {object} iwpt ImageWorkspacePt
469+
* @param {Object} iwpt ImageWorkspacePt
470470
* @param {number} [altZoomLevel]
471471
*/
472472
makeSPtFromIWPt(iwpt, altZoomLevel) {
@@ -481,14 +481,12 @@ export class CysConverter {
481481
//----------------------------- Conversion to WorldPt Methods ---------------------------
482482
//========================================================================================
483483

484-
485-
484+
486485
/**
487-
* Return the sky coordinates given a image x (fsamp) and y (fline)
488-
* package in a ImageWorkSpacePt class
489-
* @param pt the point to convert
490-
* @param outputCoordSys (optional) The coordinate system to return, default to coordinate system of image
491-
* @return WorldPt the translated coordinates
486+
* @desc Return the sky coordinates given a image x (fsamp) and y (fline)
487+
* @param {PointPt} pt the point to convert
488+
* @param {CoordinateSys} outputCoordSys (optional) The coordinate system to return, default to coordinate system of image
489+
* @returns WorldPt the translated coordinates
492490
*/
493491
getWorldCoords(pt, outputCoordSys) {
494492
if (!isValidPoint(pt)) return null;
@@ -560,8 +558,8 @@ export class CysConverter {
560558

561559
/**
562560
*
563-
* @param {object} plot - the image
564-
* @return {CysConverter}
561+
* @param {Object} plot - the image
562+
* @returns {CysConverter}
565563
*/
566564
static make(plot) {
567565
return plot ? new CysConverter(plot) : null;
@@ -572,7 +570,7 @@ export class CysConverter {
572570

573571
/**
574572
*
575-
* @param pt
573+
* @param {PointPt} pt
576574
* @return {*}
577575
* @public
578576
*/
@@ -595,7 +593,11 @@ export const CCUtil = {
595593
/**
596594
* Convert to ImageWorkSpace Point
597595
* @param {object} plot - the image
596+
<<<<<<< b903790cf8c8f0aa927fce32f5dbe688666272ee
598597
* @memberof firefly.util.image.CCUtil
598+
=======
599+
* @memberof firefly.util.image.CCUtil
600+
>>>>>>> DM-7508:add eslint jsdoc rules
599601
* @public
600602
*
601603
*/

0 commit comments

Comments
 (0)