FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
AlgorithmVisualizer/js/create/array1d.js at master · zzhgithub/AlgorithmVisualizer · GitHub
zzhgithub
/
AlgorithmVisualizer
Public
forked from
algorithm-visualizer/algorithm-visualizer
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Wiki
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
AlgorithmVisualizer
/
js
/
create
/
array1d.js
Copy path
More file actions
More file actions
Latest commit
History
History
History
45 lines (37 loc) · 1.36 KB
Breadcrumbs
AlgorithmVisualizer
/
js
/
create
/
array1d.js
Copy path
File metadata and controls
45 lines (37 loc) · 1.36 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
'use strict'
;
const
array2D
=
require
(
'./array2d'
)
;
const
modules
=
require
(
'../module'
)
;
const
util
=
require
(
'./util'
)
;
const
getTracerName
=
(
)
=>
{
return
document
.
getElementById
(
"tracerName-1D"
)
.
value
;
}
const
getNumColumns
=
(
)
=>
{
var
column_field
=
document
.
getElementById
(
'numColumns-1D'
)
;
return
column_field
.
value
;
}
;
const
setup
=
(
)
=>
{
var
button_1DMatrix
=
document
.
getElementById
(
"button-1DMatrix"
)
;
var
logger
;
var
arr1DTracer
;
button_1DMatrix
.
addEventListener
(
'click'
,
function
(
)
{
util
.
clearModules
(
)
;
arr1DTracer
=
new
modules
.
Array1DTracer
(
)
;
var
arrElem
=
document
.
querySelector
(
'.module_wrapper'
)
;
arrElem
.
addEventListener
(
"mousewheel"
,
array2D
.
mousescroll
,
false
)
;
arrElem
.
addEventListener
(
"DOMMouseScroll"
,
array2D
.
mousescroll
,
false
)
;
logger
=
new
modules
.
LogTracer
(
'Generated Javascript'
)
;
var
numColumns
=
getNumColumns
(
)
;
var
data
=
array2D
.
fauxData
(
1
,
numColumns
)
[
0
]
;
arr1DTracer
.
setData
(
data
)
;
array2D
.
tableToInputFields
(
1
,
numColumns
)
;
util
.
positionModules
(
)
;
arr1DTracer
.
refresh
(
)
;
}
,
false
)
;
var
button_JS
=
document
.
getElementById
(
'button-generateJS-1D'
)
;
button_JS
.
addEventListener
(
'click'
,
function
(
)
{
array2D
.
generateJS
(
logger
,
'Array1DTracer'
,
getTracerName
(
)
)
;
}
,
false
)
;
}
;
module
.
exports
=
{
setup
}
;
Back
|
FazBrowse Home
|
New Git URL