Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
gargantext
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
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
humanities
gargantext
Commits
e275556c
Commit
e275556c
authored
Nov 16, 2015
by
PkSM3
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[UPDATE] show map-list OK
parent
7fbf1e18
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
47 additions
and
10 deletions
+47
-10
NGrams_dyna_chart_and_table.js
static/js/NGrams_dyna_chart_and_table.js
+47
-10
No files found.
static/js/NGrams_dyna_chart_and_table.js
View file @
e275556c
...
...
@@ -601,8 +601,18 @@ function CRUD( parent_id , action , nodes , args , http_method , callback) {
}
else
callback
(
false
);
}
function
Main_test
(
data
,
initial
)
{
function
Main_test
(
data
,
initial
,
search_filter
)
{
console
.
log
(
""
)
console
.
log
(
" = = = = MAIN_TEST: = = = = "
)
console
.
log
(
"data:"
)
console
.
log
(
data
)
console
.
log
(
"initial:"
)
console
.
log
(
initial
)
console
.
log
(
"search_filter:"
)
console
.
log
(
search_filter
)
console
.
log
(
" = = = = / MAIN_TEST: = = = = "
)
console
.
log
(
""
)
var
DistributionDict
=
{}
for
(
var
i
in
DistributionDict
)
...
...
@@ -610,8 +620,6 @@ function Main_test( data , initial) {
delete
DistributionDict
;
DistributionDict
=
{}
AjaxRecords
=
[]
var
FirstScore
=
initial
;
var
arrayd3
=
[]
...
...
@@ -640,6 +648,7 @@ function Main_test( data , initial) {
div_stats
+=
"</p>"
$
(
"#stats"
).
html
(
div_stats
)
AjaxRecords
=
[]
for
(
var
i
in
data
.
ngrams
)
{
var
le_ngram
=
data
.
ngrams
[
i
]
...
...
@@ -647,7 +656,6 @@ function Main_test( data , initial) {
var
orig_id
=
le_ngram
.
id
var
arr_id
=
parseInt
(
i
)
RecDict
[
orig_id
]
=
arr_id
;
var
node_info
=
{
"id"
:
le_ngram
.
id
,
"name"
:
le_ngram
.
name
,
...
...
@@ -663,6 +671,8 @@ function Main_test( data , initial) {
DistributionDict
[
node_info
.
score
]
++
;
}
console
.
log
(
FirstScore
)
// console.log("The Distribution!:")
// console.log(Distribution)
var
DistributionList
=
[]
...
...
@@ -829,7 +839,7 @@ function Main_test( data , initial) {
$
(
"#filter_search"
).
html
(
$
(
"#filter_search"
).
html
().
replace
(
'selected="selected"'
)
);
$
(
"#
filter_all"
).
attr
(
"selected"
,
"selected"
)
$
(
"#
"
+
search_filter
).
attr
(
"selected"
,
"selected"
)
var
the_content
=
$
(
"#filter_search"
).
html
();
$
(
""
+
the_content
).
insertAfter
(
"#dynatable-query-search-my-ajax-table"
)
return
"OK"
...
...
@@ -841,16 +851,41 @@ function SearchFilters( elem ) {
var
MODE
=
elem
.
value
;
if
(
MODE
==
"filter_all"
)
{
var
result
=
Main_test
(
AjaxRecords
,
MODE
)
console
.
clear
()
var
result
=
Main_test
(
ngrams_data
.
ngrams
,
ngrams_data
.
scores
.
initial
,
MODE
)
console
.
log
(
result
)
MyTable
.
data
(
'dynatable'
).
sorts
.
clear
();
MyTable
.
data
(
'dynatable'
).
sorts
.
add
(
'score'
,
0
)
// 1=ASCENDING,
MyTable
.
data
(
'dynatable'
).
process
();
}
if
(
MODE
==
"filter_map-list"
)
{
console
.
clear
()
console
.
log
(
"ngrams_map:"
)
console
.
log
(
ngrams_map
)
var
sub_ngrams_data
=
{
"ngrams"
:[],
"scores"
:
$
.
extend
({},
ngrams_data
.
scores
)
}
for
(
var
r
in
ngrams_data
.
ngrams
)
{
if
(
ngrams_map
[
ngrams_data
.
ngrams
[
r
].
id
]
)
{
sub_ngrams_data
[
"ngrams"
].
push
(
ngrams_data
.
ngrams
[
r
]
)
}
}
var
result
=
Main_test
(
sub_ngrams_data
,
ngrams_data
.
scores
.
initial
,
MODE
)
console
.
log
(
result
)
// MyTable.data('dynatable').sorts.clear();
// MyTable.data('dynatable').sorts.add('score', 0) // 1=ASCENDING,
// MyTable.data('dynatable').process();
}
if
(
MODE
==
"filter_stop-list"
)
{
console
.
clear
()
console
.
log
(
"ngrams_stop:"
)
console
.
log
(
{}
)
}
}
...
...
@@ -946,7 +981,8 @@ $.when(
}
}
// Initializing the Charts and Table
var
result
=
Main_test
(
ngrams_data
,
FirstScore
)
console
.
log
(
ngrams_data
)
var
result
=
Main_test
(
ngrams_data
,
FirstScore
,
"filter_all"
)
console
.
log
(
result
)
// Listener for onchange Score-Selector
...
...
@@ -954,8 +990,9 @@ $.when(
$
(
"#ScoresBox"
).
html
(
scores_div
)
$
(
"#scores_selector"
).
on
(
'change'
,
function
()
{
console
.
log
(
this
.
value
)
var
result
=
Main_test
(
ngrams_data
,
this
.
value
)
var
result
=
Main_test
(
ngrams_data
,
this
.
value
,
"filter_all"
)
console
.
log
(
result
)
});
...
...
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