-
Notifications
You must be signed in to change notification settings - Fork 953
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement @turf/clusters-dbscan
module
#812
Changes from 1 commit
d0d8970
24cf66d
8669d30
e5fb827
17ca549
ed0e48a
88d3953
cf53d66
4636f3a
0893af2
359815a
a14fa69
0a60b90
144ef79
ef76c37
7bee88f
3eb3d66
07dea46
62e4e91
63275fc
82485d8
8a45889
c2be7be
01e92de
01bc50b
d3a3166
28436e7
d926702
7fe4acf
67e9071
e7fb4a8
9bdd634
af57608
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -78,17 +78,12 @@ function colorize(clustered) { | |
|
||
featureEach(clustered, function (point) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd change this to: switch (point.properties.dbscan) {
case 'core':
case 'edge': {
const coreColor = colours[point.properties.cluster];
const edgeColor = chromatism.brightness(-20, colours[point.properties.cluster]).hex;
point.properties['marker-color'] = (point.properties.dbscan === 'core') ? coreColor : edgeColor;
point.properties['marker-size'] = 'small';
points.push(point);
break;
}
case 'noise': {
point.properties['marker-color'] = '#AEAEAE';
point.properties['marker-symbol'] = 'circle-stroked';
point.properties['marker-size'] = 'medium';
points.push(point);
}
} as There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. lol Yep! Looks good. I really like this Switch statement, makes it really easy to control those clustered points. |
||
switch (point.properties.dbscan) { | ||
case 'core': { | ||
const color = colours[point.properties.cluster]; | ||
point.properties['marker-color'] = color; | ||
point.properties['marker-size'] = 'small'; | ||
points.push(point); | ||
break; | ||
} | ||
case 'core': | ||
case 'edge': { | ||
const color = chromatism.brightness(-15, colours[point.properties.cluster]).hex; | ||
point.properties['marker-color'] = color; | ||
point.properties['marker-symbol'] = 'cross'; | ||
const coreColor = colours[point.properties.cluster]; | ||
const edgeColor = chromatism.brightness(-20, colours[point.properties.cluster]).hex; | ||
point.properties['marker-color'] = (point.properties.dbscan === 'core') ? coreColor : edgeColor; | ||
point.properties['marker-size'] = 'small'; | ||
points.push(point); | ||
break; | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍