Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Sascha Herzinger
AdaCharts
Commits
9725b6d4
Commit
9725b6d4
authored
Dec 10, 2018
by
Sascha Herzinger
Browse files
improved demo page
parent
0b4bb953
Changes
1
Hide whitespace changes
Inline
Side-by-side
examples/test-heatmap.html
View file @
9725b6d4
...
...
@@ -32,7 +32,10 @@
return
a
;
}
function
generateRandomMatrix
(
width
,
height
,
minValue
,
maxValue
,
undefinedValues
)
{
function
generateRandomMatrix
(
minValue
,
maxValue
)
{
const
height
=
Math
.
floor
(
Math
.
random
()
*
(
50
-
20
+
1
)
+
20
);
const
width
=
Math
.
floor
(
Math
.
random
()
*
(
50
-
20
+
1
)
+
20
);
values
=
[];
rows
=
[];
cols
=
[];
...
...
@@ -40,7 +43,7 @@
for
(
let
i
=
0
;
i
<
height
;
i
+=
1
)
{
rows
.
push
(
`row -
${
i
}
`
);
for
(
let
j
=
0
;
j
<
width
;
j
+=
1
)
{
if
(
undefinedValues
&&
Math
.
random
()
>
0.9
)
{
if
(
Math
.
random
()
>
0.9
)
{
values
.
push
(
undefined
);
}
else
{
values
.
push
(
Math
.
random
()
*
(
maxValue
-
minValue
+
1
)
+
minValue
);
...
...
@@ -67,9 +70,7 @@
}
function
update
()
{
const
randomHeight
=
Math
.
floor
(
Math
.
random
()
*
(
50
-
20
+
1
)
+
20
);
const
randomWidth
=
Math
.
floor
(
Math
.
random
()
*
(
50
-
20
+
1
)
+
20
);
generateRandomMatrix
(
randomWidth
,
randomHeight
,
-
1
,
1
,
true
);
generateRandomMatrix
(
-
1
,
1
,
true
);
heatmap
.
update
({
values
,
rows
,
cols
,
valueRange
:
[
-
1
,
1
],
sequential
:
true
});
}
...
...
@@ -95,6 +96,5 @@
#heatmap-container
{
width
:
50vw
;
height
:
50vw
;
}
</style>
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