Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
fordecyt_2019
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Rodrigo Tapia-McClung
fordecyt_2019
Commits
47f87a56
Commit
47f87a56
authored
Aug 20, 2019
by
anneb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
addjust classCount to max available colors
parent
98f1d353
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
9 deletions
+17
-9
attrinfo.html
public/attrinfo.html
+17
-9
No files found.
public/attrinfo.html
View file @
47f87a56
...
...
@@ -345,18 +345,24 @@
// legendTypes 'div', 'qual', 'seq'
// for diverging, qualitative and sequential legends
function
getColorSchemes
(
numClasses
,
legendType
)
{
return
colorbrewer
.
filter
(
scheme
=>
scheme
.
type
===
legendType
&&
scheme
.
sets
.
length
>
numClasses
-
3
)
.
map
(
scheme
=>
{
const
result
=
scheme
.
sets
[
numClasses
-
3
];
result
.
name
=
scheme
.
name
;
result
.
type
=
scheme
.
type
;
return
result
;
});
for
(;
numClasses
>
2
;
numClasses
--
)
{
let
result
=
colorbrewer
.
filter
(
scheme
=>
scheme
.
type
===
legendType
&&
scheme
.
sets
.
length
>
numClasses
-
3
)
.
map
(
scheme
=>
{
const
result
=
scheme
.
sets
[
numClasses
-
3
];
result
.
name
=
scheme
.
name
;
result
.
type
=
scheme
.
type
;
return
result
;
});
if
(
result
.
length
)
{
return
result
;
}
}
return
[];
}
function
classButton
(
classType
)
{
if
(
prepareLegend
())
{
cons
t
classCount
=
Number
(
document
.
querySelector
(
'#classcount'
).
value
);
le
t
classCount
=
Number
(
document
.
querySelector
(
'#classcount'
).
value
);
if
(
classCount
===
1
)
{
// special case, single classification
}
else
{
...
...
@@ -406,7 +412,9 @@
result
.
push
(
percentile
);
return
result
;
},[]);
const
seqSchemes
=
getColorSchemes
(
classCount
,
'qual'
);
const
legendType
=
(
typeof
percentileBreaks
[
0
].
value
===
"string"
)
?
'qual'
:
'seq'
;
const
seqSchemes
=
getColorSchemes
(
classCount
,
legendType
);
classCount
=
seqSchemes
[
0
].
colors
.
length
;
if
(
classCount
>
percentileBreaks
.
length
)
{
classCount
=
percentileBreaks
.
length
}
else
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment