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
74f703ee
Commit
74f703ee
authored
Aug 20, 2019
by
Anne Blankert
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
support 2 classes, fix reclass, textual changes
parent
47f87a56
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
10 deletions
+16
-10
attrinfo.html
public/attrinfo.html
+14
-8
info.html
public/info.html
+1
-1
tableinfo.html
public/tableinfo.html
+1
-1
No files found.
public/attrinfo.html
View file @
74f703ee
...
...
@@ -357,6 +357,15 @@
return
result
;
}
}
if
(
numClasses
===
2
)
{
return
colorbrewer
.
filter
(
scheme
=>
scheme
.
type
===
legendType
)
.
map
(
scheme
=>
{
const
result
=
{
colors
:
[
scheme
.
sets
[
0
].
colors
[
0
],
scheme
.
sets
[
0
].
colors
[
2
]]}
result
.
name
=
scheme
.
name
;
result
.
type
=
scheme
.
type
;
return
result
;
})
}
return
[];
}
...
...
@@ -400,7 +409,7 @@
let
percentileBreaks
=
globalStats
.
percentiles
.
reduce
((
result
,
percentile
)
=>
{
percentile
.
pcount
=
1
;
if
(
result
.
length
===
0
)
{
result
.
push
(
percentile
);
result
.
push
(
Object
.
assign
({},
percentile
));
// spread operator not supported by current Edge
return
result
;
}
if
(
result
[
result
.
length
-
1
].
to
===
percentile
.
from
)
{
...
...
@@ -409,10 +418,10 @@
result
[
result
.
length
-
1
].
pcount
++
;
return
result
;
}
result
.
push
(
percentile
);
result
.
push
(
Object
.
assign
({},
percentile
));
return
result
;
},[]);
const
legendType
=
(
typeof
percentileBreaks
[
0
].
value
===
"string"
)
?
'qual'
:
'seq'
;
const
legendType
=
(
typeof
percentileBreaks
[
0
].
from
===
"string"
)
?
'qual'
:
'seq'
;
const
seqSchemes
=
getColorSchemes
(
classCount
,
legendType
);
classCount
=
seqSchemes
[
0
].
colors
.
length
;
if
(
classCount
>
percentileBreaks
.
length
)
{
...
...
@@ -424,7 +433,7 @@
let
sumClassCount
=
0
percentileBreaks
=
percentileBreaks
.
reduce
((
result
,
percentile
)
=>
{
sumPCount
+=
percentile
.
pcount
;
if
(
sumPCount
>
sumClassCount
*
pCountPerClass
)
{
if
(
sumPCount
>
=
sumClassCount
*
pCountPerClass
&&
result
.
length
<
classCount
)
{
// new class
result
.
push
(
percentile
);
sumClassCount
++
;
...
...
@@ -436,10 +445,7 @@
return
result
;
},[])
}
mapboxPaint
=
[
"case"
]
mapboxPaint
=
[
"case"
]
percentileBreaks
.
forEach
((
brk
,
index
,
arr
)
=>
{
addLegendLine
(
seqSchemes
[
0
].
colors
[
index
],
`
${
brk
.
from
}
-
${
brk
.
to
}
`
,
layerType
);
mapboxPaint
.
push
([
"<"
,[
"get"
,
globalStats
.
column
],
brk
.
to
],
seqSchemes
[
0
].
colors
[
index
])
...
...
public/info.html
View file @
74f703ee
...
...
@@ -126,7 +126,7 @@
</head>
<body
onload=
"init()"
>
<h1>
Layers in database
</h1>
<input
id=
"filter"
type=
"text"
placeholder=
"
Filter
.."
size=
"20"
oninput=
"filterLayerInfo()"
><br>
<input
id=
"filter"
type=
"text"
placeholder=
"
Search.
.."
size=
"20"
oninput=
"filterLayerInfo()"
><br>
<table
id=
"layerinfo"
></table>
</body>
</html>
\ No newline at end of file
public/tableinfo.html
View file @
74f703ee
...
...
@@ -87,6 +87,6 @@
<h2
id=
"tablename"
></h2>
<div
id=
"bbox"
>
waiting for table stats...
</div>
<ul
id=
"columns"
></ul>
<a
href=
"info.html"
>
Back to layer overview
e
</a>
<a
href=
"info.html"
>
Back to layer overview
</a>
</body>
</html>
\ No newline at end of file
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